Let me first try to illustrate this with some paint magic:
What I’m trying to express here is a motion activated light with an automated countdown after motion is detected. Right now you can do all this on a technical level with a single automation but you can’t visualize it.
There are a couple features needed for this that i’m not aware of existing in Home Assistant.
Visualize a state conditionally. A whole tile can be conditionally visualized but a single state value within the same tile cannot.
The countdown after a motion activated light seems to be something internal in automatons that you cannot access. I know the countdown itself works on a technical level because the light goes off when it expires. I just want to visualize that.
I hope this could be considered as a new feature. Just making it possible on a technical level would already help tremendously!
The layout of this stuff can be done with customization. Like adding the motion detection icon and appending the countdown and perhaps some wrapper text. What’s needed for that however is a state value to exists to trigger that value on.
An idea about the naming.
Probably just call it a MOTION_COUNTDOWN state where the value would be the amount of seconds till the on/off state flips into whatever the current is.
As an aside, and perhaps to make it more generic, i’d really like a generic per entity option (where it makes sense that is) to be able to start a countdown and trigger an action on it elapsing. Most of my lights are not motion controlled yet i do want to let some lights go off/on with a countdown where i manually start that countdown. An automation in these scenarios is not ideal.
What you can do currently, if your wish is not granted: If you use a timer instead of a for, you’ll have an entity represent the countdown. Using multi entity row you might be able to combine the light and timer in one row. Last but not least, with confitional cards you could show the single entity when the time is not running, nd the multi entity row when it is. But I agree it is a lot of hassle.
Mushroom cards have templated cards too, so these might make combining an optional timer in the same card much simpler. But you’ll probbly still need the timer.
It might not solve the issue with a timer.
The issue is that the frontend is not updated on changes from the backend, but on a schedule, so if you are displaying seconds, then you will see sometimes see it jump a few seconds a head.
Just replying in general without mentioning anyone specifically.
Thank you folks for the tips! GUI wise, those are some really nice options!
I do like to emphasize that the GUI part isn’t the problem here. Getting the timer value at all in the first place is the problem and is the feature request. Heck, you can’t even set a timer on a specific light at a specific time (if that is possible then i don’t know how), you can only set a timer through an automation.
It would already be a stellar improvement if you could set arbitrary timers on entities and tie an action to that. And get the elapsed time from that timer in the GUI. Having that would allow you to implement everything.
I should perhaps make a new feature request to make this more clear. the timer point i make above is a core requirement that, once there, can be used to implement the feature i’m asking in this topic.