Lights refresh states while still transitioning
See original GitHub issueThe problem
When doing a light transition, HA immediately sets the light’s state to its supposed destination state. During transition, the light’s -current- state gets polled (externally?), causing an intermediate state update. This is especially problematic for automations: turn off a light with transition - HA sets it to ‘off’ which triggers relevant automations. In reality, the light is still transitioning, and something polls the light’s current state, which flows back to HA. HA picks this up as a “light turned on” state change, triggering the relevant automations.
Ie: Set a light scene on “light turn on” and start a timer. On timer finish, turn_off light with transition 10. Light starts to turn off, but triggers the set scene and restarts the timer while turning off - it will loop indefinitely.
I am using Hue bulbs, which I suppose it is related, but not limited to. I suspect this is related to the need of polling the Hue bulbs for their current status, causing a chain of (state) updates that flow through to HA.
I’m seeing this exact same behavior with different integrations: native Hue hub, deconz, as well as ZHA.
The only issue/info I could find regarding this, and I’m pretty sure it’s the same underlying problem but described differently: #32894
Environment
- Home Assistant Core release with the issue: at least from 0.114.4 > 0.115.1
- Last working Home Assistant Core release (if known): No known
- Operating environment (OS/Container/Supervised/Core): Hass.io
- Integration causing this issue: hue, deconz, zha (probably others)
- Link to integration documentation on our website:
Problem-relevant configuration.yaml
Traceback/Error logs
Additional information
An idea for an approach could be to introduce a new light state “transitioning”, with some internal logic to block external updates (but, still allow internal updates) to the light for the duration of the transition, and refresh state after transition is complete? I guess that would also fix the other mentioned issue #32894, as well as be used in automations. Suppose this could come in handy for other light integrations (that properly handle the transition) as well.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:16 (9 by maintainers)
Top GitHub Comments
This is still present in 2021.1.5.
Still present in 2021.12.10 and likely also in 2022.02.0