Hi guys, I’ve set up a simple automation which starts a timer, that reads an input_number as its duration, once I enable a device.
I’d like to change this timer duration dynamically, how could I achieve this? For example looking at the screenshot below, I’d like to move the slider and at the same time changing the timer’s duration without the need to stop the device and start it again.
The only service call able to set a timer’s duration is the one that starts a timer: timer.start
In other words, changing the duration of an active timer will restart it with the new duration (i.e. the timer.restart event will be produced).
If that’s acceptable, then all you need is an automation with a State Trigger to monitor the Input Number that represents the timer’s desired duration (in seconds). When triggered, it executes timer.start and sets the timer entity’s duration to the Input Number’s value.
Hi @123 , this automation worked for me for couple of months until I updated my HA to 2023.10.1-5, and something happened to not work anymore. Even I change the input_number value, it seems the timer start the "timer.example to its default time . If I set the “input_number.timer_duration” to 20s the automation will trigger to start from 20s, but at the next start of the automation it start from it`s default value, 60s.; something hapening to not retain the last value. Have you facing the same issue? Have you find an solution? Please help
I have not used the timer.change service call yet but you may wish to experiment with it (in combination with timer.start) and see if it can provide the desired behavior.