Hi all,
Newbie to YAML and Jinja here, and to be honest, struggling a little with templating, etc - especially within the automation option under the “configuration” menu item in HA.
I want to define an action that turns on a switch, waits for a delay that is specified from a input_number and then turns off the same switch.
I can get the Action type = Delay to work when I use a static delay by putting {{ ‘00:00:05’ }} in for a delay of 5 seconds, but as soon as I try to replace this static value with a number taken from a input_number, I get problems.
The closest I can get is this,
‘00:00:0{{states.input_number.box2.state | int }}’
where box2 contains the value 7, but this throws there error below in the Hassio log
Error rendering ‘Nightly filtering’ delay template: offset ‘00:00:07’ should be format ‘HH:MM’ or ‘HH:MM:SS’
(“Nightly filtering” is the name of my automation)
Seems like the value ‘00:00:07’ matches the right format, yet I still get the above error.
Can someone lend me a hand? I’m pretty close to solving all of the challenges I need to, but this, which seemed so simple, has taken the longest to solve of anything so far!