sorry for that “maybe stupid question” about time trigger.
I have a automation which starts at 9am.
If something happend like restart of the system later or anything similar, this automation does not get triggered again, because it is maybe allready 9.30am.
What would be the right way to go to get a automation that works like a old fashioned timer-switch and get a “switched-on-time-window” e.g. from 9-12?
Not sure if it will work if this is directly inside an automation, but if it is in a binary sensor then it will for sure work since they will be unavailable at startup
Actually it is a general question, not depending at the usecase.
But in this case I have a automation to switch a heater on at 9am and a secound automation that switches it off at 5pm.
I found the trigger: time_pattern. Maybe I could as well repeat the trigger e.g. every "x"min in a specified timeframe.
something like this:
alias: heater timer on at 9am
description: ""
triggers:
- trigger: time
at: "09:00:00"
- trigger: time_pattern
hours: "9,10,11,12,13,14,15,16"
minutes: "15"
conditions: []
actions:
- type: turn_on
device_id: xxx
entity_id: xxx
domain: switch
mode: single
The 9:00 is superfluous with the time pattern, but it will work. So long as you don’t want to be able to manually turn off am the heater without it turning itself back on.
Or just as I said.
Make the template I posted a template binary sensor and it will turn on at 9.
If you restart at 8:59 and it comes back online 9:15 then it will be unavailable until the template has been evaluated and then turn on.
Should be just a few seconds.
Then use the action switch.turn_on, don’t use device.
sounds good as well.
where do I have to set this trigger then? in the same automation, right?
edit: okay,I see
edit2:
just realised that this would not work like expected.
if I have this additional startup command, the automation would start at any time. also out of the range and I have the exact same time problem like before.