# Rule Machine® Introduction

#104

Thanks for the suggestions. They were very helpful.

#105

I finally wrapped my brain around the WC "stays" capability in RM (using the cancel capability). Now, I'm trying to figure out how to implement a WC piston in RM that uses a "changed in the last n minutes" condition. The logic is:

Something Happens
AND
Motion changed in the last 45 minutes
Then do it

Is there a way to do that in one triggered rule?

I think a rule with the Private Boolean of a trigger would work, e.g.

Rule 1
If motion, set Rule 2 PB TRUE
Delay 45 minutes, set FALSE Rule 2 PB [cancel]

Triggered Rule 2
Something happens
AND
Private Boolean TRUE
Then do it

Is there a simpler way?

#106

I had to do it with PB. My blinds trip my motion sensors. I actually need a rule and an "action". The trigger fires when the the blinds change setting the PB for the motion rule. It also runs an "action" that has within it a delay of a few seconds and setting the PB back to true. That's the only way that I'be been able to figure out how to do it.

#107

I think this would work, but you don't need a condition of PB true in the second rule. If PB is false, the rule will do nothing by default.

You do need to enable the PB restriction in the second rule though.

#108

When doing this I find it easier for my brain to just look at RULE1 in RULE2.

Rule 1
If motion
Delay 45 minutes[cancel]

Triggered Rule 2
Something happens
AND
RULE 1 TRUE
Then do it

#109

That really makes no sense because rule 1 is true if motion is active. Your cancel only applies to the action. The rule is still true immediately. So, you don't accomplish anything by breaking it up. Basically, you would get the same functionality if they were in the same rule.

#110

Because the rule goes false as soon as motion stops right? It's just the actions that are delayed.