Hi,
I have a button. Pressing it initiates the opening of the gate. I don’t have any sensors, pressing the only thing it does is open (while closing, it interrupts closing and opens again).
What I have now only shows closed. What should I write in value_template to show something different depending on the elapsed time?
If you want to do it without a sensor, you’d have to build the logic. If you just want an assumed state (without opening/closing for 15 seconds) remove the value_template.
@tom_l this is the entrance gate to the estate, it is outside the range of my network. @petro If I remove value_template, the gate will always be open after opening. Even when it closes after some time, it still shows as open.
Can I add some kind of countdown in value_template so that it shows closed again after some time after opening?
No, you have to build the logic yourself if you want any complex timing for state changes. You’d build it by using a helper entity that stores what you currently want, and your open_cover / close_cover action sections would need to handle all the state changes on the helper entity. Lastly, your value_template would pull the state of the helper entity. There is no way around this.