#Using time as a variable

1 messages · Page 1 of 1 (latest)

little needle
#

Hey!
So very simply, I want an automation that triggers action A IF time is xx:x9, and action B otherwise.
Relatively simple to set up, but I was curious about how I can use the current time as a variable in an if. I have experience from programming, but am not that familiar with HA, so curious how I would get this variable.
Thanks!

rustic warren
#

You can use now() in a template.

#

A minute that ends in 9 would be:

{{ now().minute % 10 == 9 }}
little needle
#

Not used to the automation syntax, but something like this?