Yes, that's much better it should work ok. But you have a delay in there, so I assume you are trying to delay the rule for some reason. I can think of a couple scenarios where you need to stop or delay the rule. But where you have that delay in the rule wonât do anything.
A delay stops the rule from running, and Rule machine sets up a scheduled job to start the rule back up again when the delay is over. So in your rule, when it starts back up again it will then exit the rule. However, while the delay is going, any trigger, such as the motion sensor, will start the rule up again from the top, more or less a second copy or the rule. If that happens in your rule and the lock is open, then it will set up another scheduled job for another delay. If the lock is locked when the trigger happens then it will beep. The delay has no affect on stopping anything caused by another trigger.
Many rules have unwanted things happen if they get triggered again too soon, so the general way to prevent that is to use a variable to make rule exit if it gets triggered too soon.
Suppose you unlock the door and go out on the porch. If you stay there, maybe to look at your cellphone, the motion sensor could go inactive and then trigger again when you move. If the lock is still locked, the rule wonât do anything. But if after you lock the door, the motion sensor triggers again, then it will make it beep. So you want to set it up so once it triggers the first time, it wonât beep until after a certain time has passed, such as 2 minutes.
First, you need to create a local boolean variable and set it to true.
In this sample, I called the variable âdobeepâ.
Each time the rule runs when the lock is open, it sets dobeep to false and starts a delay to set it back to true in 2 minutes. And if when the lock is locked, it wonât beep until the delay is over and dobeep is true again. (I'm using the preformatted text option here, it allows you to show indents, but puts in goofy colors.)
IF (Front Door Lock Simulated open(F) [FALSE]) THEN
Cancel delayed actions
set dobeep to false
set dobeep to true â> delayed 0:02:00 (cancelable)
Exit Rule
ELSE-IF (Variable dobeep = false) then
Exit Rule
ELSE-IF (Mode is Night(F) [FALSE]) THEN
Notify Rob's iPhone: 'Someone at the front door Night Mode'
Repeat 3 times every 0:00:01
Beep: Siren
END-REP
ELSE
Notify Rob's iPhone: 'Someone at the front door'
Beep: Siren
END-IF
Using something like this will make sure you can get off the porch after locking the door without making it beep again.