Turn a switch on for 15 minutes every hour

I'm attempting to automate a pump and need a rule that will turn a socket on for 15 minutes every hour between sunrise and sunset then on for 10 minutes every hour between sunset and sunrise.

Can anyone suggest a way to do this using rule machine?

Thanks!

Matt

One rule for sunrise to sunset:

Create a second rule, following this layout, but adjust the required expression to "Time between Sunset and Sunrise" and adjust the OFF delay to 10 min.

You'll probably want to adjust the "starting at" to be the first hour after a typical sunrise.

3 Likes

That looks good. I was thinking about using the REPEAT function but your way looks cleaner. Thanks.

Another similar example: Are indefinitely cycling switches possible?

3 Likes

Thanks both. This is what I ended up with. I created a virtual switch that I can turn off when the pump is not needed since we only use the system to grow strawberries in the spring and summer months.

2 Likes

I would recommend you turn off “Cancel pending actions…” in your Required Expression to ensure it doesn’t cancel the “Off”. It isn’t showing as cancellable, so should be okay, but just to be sure…

Otherwise, the pump could remain on after sunset when it occurs within 15 minutes after the hour.

2 Likes

Done @Sebastien. Thanks for the input.

1 Like