I noticed that one of my automation did not run because I restarted my HA at about 22:00, and that was exactly the time it should trigger:
trigger:
platform: time
at: '22:00:00'
I hoped to define a range say, minutes: ‘0-20’, but it doesn’t work (runtime error).
It says in docs that it is possible to match on interval, but it’s rather different - ‘/5’ will trigger every 5 minutes of a given hour.
It will do, but to me seems a bit over the top because of the whole hour.
Any ideas on how to avoid hardcoding triggering time and making sure the automation will eventually run in a given timeframe?
It depends, but sometimes it takes only one restart to miss that important automation
Well, that automation turns down my central heating temperature for the night, and I don’t want it to leave it as it is all way long, So the answer is yes.
I think my solution is better, but still not quite happy with it:
If you use that technique (i.e., select a range of text then click the “Preformatted text” button, you have to make sure there is a blank line before the selected text. Or you can use the “three back-tick” technique, which I find easier:
```
abc
123
```
I think you’re looking for something like this:
- alias: Turn down heating at night
trigger:
- platform: time
at: '22:00:00'
- platform: homeassistant
event: start
condition:
- condition: time
after: '22:00:00'
before: '05:00:00'
action:
- service: climate.set_away_mode
data:
entity_id: climate.combi_boiler
away_mode: 'on'
Of course, change the before time in the condition as needed. Or you can delete the before option, in which case it will default to before midnight.