Need rule to run for 2 mins sleep for 30, struggling

I have a hot water pump that I want to run for 2 minutes when motion is detected. Then don't run again until motion is detected after 30 minutes.

I've got the motion detector, the pump is on a smart plug.

I've tried variables setting water is hot to true, then 30 mins wait, delay etc...

Right now I've got a virtual button that runs the switch for 2 mins then turns off. In my motion detected rule pushes the button, delays for 3 minutes then pauses the virtual button rule, delays for 30 then resumes it.

What I'm getting is 2 mins on, the off for 6 mins then on for 2. Etc...

I'm gonna need some guidance. The turn on off is paused and is still running.

Help! Lol

If you use a Private Boolean as a Required Expression, something like the following should work:

Required Expression
Private Boolean = False

Trigger
Motion

Action
Set Private Boolean to True
Turn on Switch
Wait for Event: Elapsed Time of 2 minutes
Turn off Switch
Wait for Event: Elapsed Time of 30 minutes
Set Private Boolean to False

Basically, the rule runs only when the Private Boolean is False. Motion triggers the rule. The first action is to set the variable to True, which prevents the rule from running again until it is complete. Then the rule turns on and off the switch before waiting for 30 minutes to reset itself.

1 Like

try setting the motion detector driver preferences to not check again for 30 minutes.

Screenshot 2025-03-25 at 10-45-58 HOT WATER PUMP (Not I...

5 Likes