I’m trying to build some automations which I want to trigger at an adjustable time. I will have the time hours, minutes, and seconds stored (or calculated) in sensors and input_number types.
Is there a good way to do this without having a bunch of separate template-sensors for hour, minute, and second to compare individually?
I’d like to do something like (psudocode):
- alias: 'Do A Thing'
trigger:
- platform: time
at: '{{input_number.selected_hour}}:{{sensor.computed_minute}}:{{sensor.computed_second}}'
The only thing I can think of right now would be a really convoluted template-sensor that does something like this:
{%
now().strftime('%H') == input_number.selected_hour and
now().strftime('%M') == sensor.computed_minute and
now().strftime('%S') == sensor.computed_second
%}
But this seems needlessly complex to me, surely there is a better way?