Hello, I want to have an integration that gets triggered every x minutes between, say 9pm and midnight. The best thing I can figure out so far is to use a cron expression trigger (also known as time_pattern) and check in the conditions whether we are in the required time window. That seems a bit wasteful though. Is there a better way to do that?
#Trigger an automation every n minutes in a certain time window
14 messages · Page 1 of 1 (latest)
Nope. That’s the way you do it.
You could use a template trigger (or binary sensor template helper), but that’s actually worse.
If you really want to cut down on the automation triggers for some reason - add 2 more triggers, one to enable the time pattern trigger at the start of the time period, and another to disable it at the end
Enable/disable the triggers themselves in an automation? How?
Ah no, ignore that, you'd need a second automation to enable/disable the whole first automation.
It's ok, if that's how it's done then that's how it's done. The reason I was asking is, I'm in software development long enough to know that the fact that something is a working solution doesn't necessarily mean it's not a totally cock-eyed solution. Oh the things I have seen...
lol same. I have horror stories.
i feel personally attacked
But yeah, use the time pattern or go crazy with a template.
My code is never meant for release!
And only us pros debug in prod too. lol