Skip to content

Avoid invalid climate state when power sensor turns on#1563

Open
naamah75 wants to merge 1 commit into
smartHomeHub:masterfrom
naamah75:fix-climate-power-sensor-on-state
Open

Avoid invalid climate state when power sensor turns on#1563
naamah75 wants to merge 1 commit into
smartHomeHub:masterfrom
naamah75:fix-climate-power-sensor-on-state

Conversation

@naamah75

@naamah75 naamah75 commented Jun 2, 2026

Copy link
Copy Markdown

When a configured power_sensor changes to on while the climate entity is currently off, SmartIR restores the last HVAC mode when available. If there is no last operation yet, it currently falls back to STATE_ON.

For a Home Assistant climate entity, on is not a supported HVAC mode/state. This can produce warnings/errors in consumers that validate climate states, for example Alexa:

climate.<entity> has unsupported state value 'on'

This changes the fallback to use the first configured non-off HVAC mode when available, otherwise it stays off. That keeps the climate entity state within the supported HVAC modes.

Tested with:

python3 -m py_compile custom_components/smartir/climate.py

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