Hello, I am trying to figure out the best way forward for this type of rule:
IF [Door] opens within 5 minutes of HSM disarm, THEN turn on [Kitchen Light].
I've tried to find within the conditional actions in Rule Machine, but I am not having much luck on how/where I should put the conditional actions and/or if the "within 5 minutes" type time condition is available anywhere.
I suppose you could do it in one rule but quickly off the top of my head have 2 rules.
Rule 1.
Trigger
HSM changes to disarm
Action
Set Global variable HSMdisarm (boolean) to true.
Wait 5 minutes
Set Global variable HSMdisarm (boolean) to false.
Rule 2.
Trigger
Contact sensor changes to open.
Action
IF variable HSMdisarm = true THEN Turn on light.
Something like this should work. Create a local string variable (or use a hub variable if you really want to), which I've called localStringVariable but you can call whatever you want.
Trigger:HSM status changes
Actions:
IF (HSM Status is Disarmed) THEN
Wait for event: Door open --> timeout 0:05:00
Set localStringVariable to %device%
IF (localStringVariable is not "timeout") THEN
On: Kitchen Light
END-IF
END-IF
(This is similar to the above suggestion, except it will cancel everything if HSM gets re-armed, and it does a bit more of a complicated check reason the rule proceeded--door opened vs. timeout--that I've seen staff recommend, though in most cases I suspect either would work as well.)
Thanks, I didnt see the "Wait for Events" option.
What I now have is:
Trigger: HSM Reports Disarmed
Action:
Wait for event: Door opens > timeout: 0:5:00
On: Light
It will not. Your light will turn on after either 5 minutes or the door opening, whichever comes first. You'll need to write it one of the ways suggested above in order to get it to come on only if the door opens within that time.