Delay (or Wait) is Not working

I am trying to notify my phone if the Garage Door opens in the middle of the night. If I don't close it within 50 seconds, it will send another reminder "if" the Garage Door "still opens". And...the rule only notified once, but not the second one after 50 seconds.

Can anyone look at the rule photo and please point to me which part of the rule is not correct? Thanks.

The way it is written now, if the door is already open at 8 PM, you wouldn't get a notification. Second, your second notification attempt is checking two contact sensors instead of just the one. Do you have two contact sensors on the garage door or is that second one the garage door to enter/exit the house? If the latter, you may not want it in the rule.

Here's a proposed rewrite.

Required Expression: 
Time between 8 PM and 5:45 am

Trigger:
Time is 8 PM
Garage Door open

ACTION:
While (Garage Door Opener contact open(F) [FALSE]) Repeat 2 times every 0:00:50
Notify XXX: "Garage door is open"

Hmm...how can I make the rule also check if the door is "already open"?

Yes, I have two garage door sensors, just in case one fails or runs out of battery, that way I put "OR".

At any rate, I still don't get the 2nd notice. Is there any reason why? Is it because the way I used "Delay"?

You probably want to add the second sensor to the triggers list then.

It looks like the second IF statement wasn't added correctly. Notice how it says

IF( (F) (

That means the if statement thinks there's a condition there that's evaluating to false. That would keep the IF statement as a whole from evaluating as false.

Ahh...good catch! I didn't even notice. Thank you.

How about the trigger "already opened"? How can I make this rule works if the door is "already open" or just opens between those times?

Just add the start time as a trigger, it will force the rule to run and should cause your actions to run if the conditions are met.

Don't forget to end the repeat with END-REP

Sorry. I am a newbie for Rule Machine, did you mean "END-IF"?

No, but it's similar in concept to an END-IF. When you create a Repeat it'll give you an option to add an END-REP. This defines the end of the actions to include in the Repeat. Actions after an END-REP will run after the Repeat has finished. In the example given it may not make a difference since there is only one action after the Repeat and it's the last action of the rule but it's still good programming practice to include it.

While (Garage Door Opener contact open(F) [FALSE]) Repeat 2 times every 0:00:50
    Notify XXX: "Garage door is open"
END-REP
1 Like

Download the Hubitat app