However this causes a non boot of the WebUI as {{ states.input_number.washvar.state }} = none upon boot.
I have tried setting up a automation to set the value upon boot but still same issue.
I have tried “cheating” and changing the value to {{ 0 + (states.input_number.washvar.state) }} in the hopes that is would set as 0 but no joy.
Basically I’m trying to have a visual timer based on the selection of an inpu boolean. These are timers for my main wash loads on my washing machine.
I have an input boolean called 30_wash and 40_wash and automations that set input_number.washvar to the relative times. However as {{ states.input_number.washvar.state }} is not valid upon boot the timer and counter aren’t valid.
Unfortunately, you can’t use a template that way in a configuration file. You can only use a template in places where Home Assistant is expecting to get a template.
There is a timer service that MIGHT take a data_template as a parameter.
It’s worth a shot.
Odd thing is I can change the value of input_number.washvar with a automation from whatever to whatever it’s just as it has no value when counter and timer are started on boot it’s not valid.
Note that I don’t set a duration in the component declaration, it’s set dynamically via automation when the slider is moved. Timer is then cancelled if the slider is dragged to zero.
This bit of info will help me move more of my automations to scripts.
The one thing I don’t like about automations is that once they’ve been triggered, there’s no stopping them !!
It’s definitely a very powerful part of homeassistant.
Basically treat the action part of the automation as a script and then if you want to fire different things you could action separate scripts from the automation, and then put a condition at the top of each script so only the correct ones are actioned.
Combine it all with templates and you can get some really intelligent routines. Happy coding