Closed qrockz closed 2 months ago
I think this might be a core issue, as it seems that when you turn on the entity immediately in response to it going idle, the frontend receives the events out of expected order.
Every 5 seconds, we first receive a state changed event saying that the timer is being set to active, and that is immediately followed by the state changed event saying that the timer went idle. So we think it's always idle. You can see this if you look at the timer entity in the logbook:
You can work around this by inserting a 1ms delay operation before restarting the timer. But maybe this needs a core issue.
I think someone reported a similar issue for another type of entity recently, but I haven't looked it up yet, not sure if it ever went anywhere.
I guess it's this one:
Closing since the core issue is solved.
Checklist
Describe the issue you are experiencing
I've set up an timer with an automation. The timer runs every 5 seconds and as soon it hits Idle status the timer restarts. So on the first time starting the timer the dashboard shows the time running down (5..4..3..2..1) as expected. Then the timer hits Idle status because it's finished and restarts because an automation recognized the Idle status and will restart the timer. But the dashboard does not show the time running down as it should. Instead it shows Idle. But the timer still runs and restarts in the background because the output entity logs it as you can see in the screen recording I've made
https://github.com/home-assistant/frontend/assets/56853194/99fac07f-e44a-45cc-81cf-3fcb560ecd9c
Describe the behavior you expected
The timer runs every 5 seconds and as soon it hits Idle status the timer restarts. The dashboard should always show the time running down (5..4..3..2..1) as soon the timer restarts.
Steps to reproduce the issue
automation wich will restart the timer as soon the timer hits Idle status.
vertikal stack in the dashboard ui which you can see from the screen recording
just an automation which updates the text box which logs the timer status and proves that the timer is running
What version of Home Assistant Core has the issue?
2024.6.4
What was the last working version of Home Assistant Core?
No response
In which browser are you experiencing the issue with?
Firefox on Desktop and Mobile
Which operating system are you using to run this browser?
Ubuntu 23.10 6.5.0-41-generic
State of relevant entities
Problem-relevant frontend configuration
No response
Javascript errors shown in your browser console/inspector
No response
Additional information
No response