Skip to content

fix(climate): stop syncing start/stopProgram params into settings on AC turn_on/off - #3

Merged
Dekkee merged 1 commit into
mainfrom
fix/ac-turn-on-off-sync
Jun 12, 2026
Merged

fix(climate): stop syncing start/stopProgram params into settings on AC turn_on/off#3
Dekkee merged 1 commit into
mainfrom
fix/ac-turn-on-off-sync

Conversation

@Dekkee

@Dekkee Dekkee commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Problem

climate.turn_on / climate.turn_off on AC units fail with:

Failed to perform the action climate/turn_on. Allowed values: ['2', '4', '5', '6', '7', '8'] But was: 0

The AC actually toggles (the API command is sent before the failure), but HA surfaces the error on every on/off press.

Root cause

HonACClimateEntity.async_turn_on/off call sync_command("startProgram"/"stopProgram", "settings"), which copies every command parameter into the settings command. Parameters lacking a defaultValue read as "0" in pyhon, which is not a valid enum value for their settings counterpart (e.g. windDirectionVertical) → ValueError from HonParameterEnum.

Upstream commit 4c44f6d fixed the same issue in async_set_hvac_mode by replacing the sync with a direct settings.onOffStatus assignment — but async_turn_on/async_turn_off kept the broken sync_command calls.

Fix

Apply the same pattern: send the program command, then only sync settings.onOffStatus ("1"/"0") and schedule a state update.

🤖 Generated with Claude Code

…AC turn_on/off

climate.turn_on / turn_off failed with
  ValueError: Allowed values: ['2', '4', '5', '6', '7', '8'] But was: 0
because sync_command copies every startProgram/stopProgram parameter into
the settings command; params without a defaultValue read as "0" in pyhon,
which is not a valid enum value for the settings counterpart
(windDirectionVertical and friends). The API command itself was already
sent, so the AC toggled but HA surfaced the error.

Apply the same approach upstream used for async_set_hvac_mode
(mmalolepszy/hon-revived 4c44f6d): only sync settings.onOffStatus.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Dekkee
Dekkee merged commit 4b0e894 into main Jun 12, 2026
0 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant