This shouldn’t matter. Adding device_class: timestamp with a timestamp causes the UI to treat the datetime as a relative time. So it should count up or down without state changes when placed into UI elements that utilize the timestamp deviceclass.
EDIT: This is how ‘last_updated’, ‘last_changed’, and ‘last_triggered’ works in the UI by the way.
EDIT2: The states page will just have the timestamp like you see in your pic.
EDIT3: The only question is, (haven’t tested) Does relative time work for future timestamps? My memory says yes.
timer.my_timer displayed as a badge or in an entities card, displays its countdown.
sensor.my_timer_end displays the full duration in a badge and Invalid date in an entities card but never shows a countdown.
Regardless of whether timer.my_timer is idle or active, the state of sensor.my_timer_end remains fixed at my_timer's duration (5 minutes in this example).
Aaargh! That’s my mistake! I was experimenting with the template and that leading time is a leftover (from the Template Editor) that I copied into the sensor’s configuration.
Even though the timer remains paused, the sensor continues to report the time difference and proceeds to say:
In 4 minutes
In 3 minutes
In 2 minutes
In 1 minute
In 59 seconds
etc
It then proceeds to “wrap around” and tell you how long ago the timer allegedly finished (even though it is actually still paused).
Upon starting the paused timer, the sensor resets itself to the original duration.
Until v113 my timers in buttons updated (showed a countdown) in the frontend but now they have reverted to the ‘old’ behaviour - when the view loses focus it stops updating until the browser is refreshed.
I have no idea if this similar to or related to the old bug…
Thank you very much. It was a step to the right way. The sensor is now updating … but … strange behaviour … the update is every 30 seconds.
For example: If I use a 5 min timer, the display says 5 min left. After 30 seconds the display says 4 min left … and … hold on to your seat … another 30 sec later it jups to … 5 min. It goes so again and again. From 5 to 4 to 5 to 4 … Even when the timer is stopped.
If you are into NR, I’d give this one a go. The only downside vs the stock HA timer is it doesn’t allow to pause by default, a workaround could be done though. For the rest, it’s better than the HA timer in every way.
Valid question, I think the bottom line for me is to save space on the UI.
I use a status line that represents all sorts of statuses, that may include a timer given a switch is on for a pre-determined amount of time. Displayed nicely in a single line on the bottom of a picture elements card.
The alternative would be to display 3 input booleans, 6 input numbers, sun rise, sun set, and the timer.