Waiting for 2 devices

Hey,

I am currently trying to create a rule which sends me a notification on my phone after 2 contact sensors are open for at least 5 minutes.
Example: If the first contact sensor reports open for 8 minutes and the other sensor just reached the 5-minute mark, I'd like to receive a notification.

I managed a similar rule like this in SharpTools, but couldn't find out how to do it in Rule Machine.

Sincerely,
Raylands

I would do it in three rules
Rule 1
Trigger contact 1 changed
Action
If contact 1 open
Set global var1 true delay 5 min cancel
Else
Cancel delay
Global var1 false
End if

Rule 2 do the same for contact 2 with var2

Rule 3
Trigger
Var 1 changed
Var 2 changed
Action
If var1 true and var2 true
Send notification
End if

1 Like

Something like this maybe.......

TRIGGER
Contact sensor A or B changed

ACTIONS
IF contact sensor A open
AND
Contact sensor B open
THEN
Notify phone "Contact sensors have been open for 5 minutes". Delayed 5 minutes (Cancelable).
ELSE
Cancel Delayed actions.
END-IF

2 Likes

These are 2 good solutions, but I still have a question about the second one.
Will the "Cancel Delayed actions" order cancel all delayed actions from every rule or only the rule it's getting called from?

In the solution I have posted above, it will only cancel the delayed actions that are active within this rule.
It will not touch any other rules.

1 Like

@bobbles solution is much better, go with it.