When the outside air temperature drops to a certain value or below, I would like to turn on a switch every 30 minutes, but only leave it on for x number of seconds. Then repeat at every 30 minute interval thereafter until the temperature rises above my threshold.
My use case is that I have an Insteon relay on a water valve that I use to fill my pool. When the outside temperature dips into the teens, the buried water line has a tendency to freeze. I solved this in the ISY application by turning the valve on every 30 minutes or so, and letting it run just for a couple of seconds. This water movement seemed to be enough to prevent freezing.
Currently, the relay is controllable from within HA, and the temp sensor info from a hyper-local weather service API has been pretty accurate, so I think I have what I need to do this.
Everything except the programming know-how, that is. I’ve been looking at triggers and timers, but have only determined that I am going to need some help.
You can use 2 time pattern triggers 30 minutes apart as the triggers and the temperature below whatever value you want as the condition.
Then it’s just a matter of turning the relay on, waiting for a few seconds to pass and then turning it off.
I was just thinking about setting it to run at the same time every hour (e.g. 15 and 45 minutes past the hour) so you know when it runs but what you have does the same thing. I just like knowing when things should run.
What you have should turn it on. What does the automation trace show?
Oh, I see. Yeah, this was more for triggering on a weather event. If the temperature were to drop into the range where I tend to experience issues, I wouldn’t want to wait until the next scheduled time.
I didn’t realize there was an automation trace, but I see it now, so thank you! I haven’t done too much in HA, but need to start using the tools available to help troubleshoot my efforts.
Adam, thanks for getting me off to a good start, and Mike, you provided the last bit that got this working. In hindsight, I feel sort of silly now, seeing how simple it was - I think half the battle is knowing which tools to use.
You can add another trigger for temperature < 25 and it will run the first time the temperature drops so you don’t have to wait for the next scheduled time for it to run.