I am trying to create a Rule that will do the following:
A physical contact opens when the garage door is opened. At this point, the following should occur.
-
After 15 minutes, a virtual contact is set to open.
-
The opening of the Virtual contact triggers an Alexa Routine that broadcasts that the door has been left open.
-
A 10 second pause is initiated to allow for the Alexa routine to execute.
-
The above mentioned virtual contact is then set to closed.
-
After 15 minutes if the physical contact is still open, the virtual contact is flipped again and the process repeats every 15 minutes until the door and the physical contact is closed.
I just started setting this Hubitat up, so I am a certified NOOB. I have tried to duplicate other solutions I have found here, but I have been unable to find some of the commands and options listed.
Please help me figure this out, as I am stumped. I get it to work once, but it does not repeat.
Here is a copy of my Rule, and the associated log file afterwards.
The main thing that stands out to me is that your repeat is not structured correctly. See the docs for several examples:
The actions between the "Repeat..." and "END REP" lines are what will be repeated, which in your case is nothing -- except for an "ELSE" that isn't really nested with a matching "IF THEN" and won't really do anything here, either. Replacing that with another "open()" on the contact sensor might work (and a close, basically the same as what you're doing above--aside from another note below).
Another problem is that the "--> delayed 0:00:10" option you've enabled on your "open()" action delays that action by the specified time, while immediately moving on to the next. Thus, you are closing before you are opening. I generally think things are clearer if you just use the plain "Delay" action instead of this option, then rule execution effectively pauses at that point and resumes with the next action after that time. This difference is also explained in the docs.
3 Likes
Probably not the prettiest implementation, there might be some belt & suspenders thrown in here out of ignorance....so I can't wait for this to get picked apart for my own learning.
But so far this is doing what I need and might serve you in concept. ...The use of Repeat has been a challenge for me to "get right" as well.
Repeat every 0:05:00 (stopable)
Delay 0:04:00 (cancelable)
IF (NOT Door - Garage - closed(F) [FALSE]) THEN
Notify Phone, Phone: 'Attention Garage door is still open!'
ELSE
Stop Repeating Actions
Exit Rule
END-IF
END-REP
I would simplify this with a Repeat While:
Trigger:
Garage Door Sensor contact open and stays that way for 0:15:00
Actions:
On: Garage Light
Open() on Alexa Garage Door Open
Repeat every 0:15:00 while Garage Door Sensor Contact open (stoppable)
Close() on Alexa Garage Door Open
Open() on AlexaGarage Door Open
END-REP
Close() on Alexa Garage Door Open
Off: Garage Light
1 Like