How to trigger in RM4 on how long a contact sensor has been open?

Is there any way to create a trigger based upon how long a contact sensor has been open or closed? I can think of other ways to do it, but I'd like to try to do it in RM if at all possible.

Any ideas?

I’d create a global Boolean var and use it.

Trigger:
Contact changed

Action:
If contact open
   Set Boolean var true (delay x min) (cancel)
Else
   Cancel delayed actions
   Set Boolean var false
End if
1 Like

No, there is no way to trigger that way. You have to trigger on the open event, and then start a timer (delay). That delay has to be cancelable, and would be cancelled on the contact closing prior to the timer running out. If the timer runs out, then you proceed to whatever it is you wanted to trigger.

Ok. I'll give it a shot. Thanks Bruce.

@napalmcsr, I am going to take your suggestion as well so that I can trigger other rules based upon the same timer. Thanks for the suggestion!