question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Lights refresh states while still transitioning

See original GitHub issue

The 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:open
  • Created 3 years ago
  • Reactions:1
  • Comments:16 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
TheJulianJEScommented, Jan 25, 2021

This is still present in 2021.1.5.

1reaction
TheJulianJEScommented, Jan 25, 2022

Still present in 2021.12.10 and likely also in 2022.02.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Room Lighting and transitions - Hubitat Community
I set up a simple RL transition to do some testing. Screen grabs below of how it's set up. It changes "Reading Lamp"...
Read more >
Can I use ReactTransitionGroup for creating transitions on ...
Yes you can add transition on state change. You need to provide a key to the child element which will change on state...
Read more >
Delayed events and transitions | XState Docs
Transitions can be taken automatically after a delay. This is represented in a state definition in the after property, which maps millisecond delays...
Read more >
Apply rules to workflow states (Inheritance process)
Apply rules to workflow states to restrict transitions.
Read more >
Introduction to Qt / QML (Part 27) - States and Transitions
In this video we'll introduce states and transitions in QML. States are a very convenient way to centralize the property values of a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found