I've created a Rule with the objective of running if my garage door is open between a range of time. Within the rule it checks to see if the door remains open for x minutes then generates an alert via Pushover. As written, I see the required expression go from False to True but the rule never runs (doesn't get to the first log entry). Would appreciate anyone identifying why its not running.
Does your trigger event (door opens) occur after 10:31? I don't think it will run if the door is open before that time. Only if it changes from closed to open.
No it is already open when the rule conditions are True... the the main reason for having the rule is the wife (at times) leaves the garage door open after going to bed. So I was creating a rule to send me an alert so I would know to close it.
Add a trigger for your start time.
Ok... I thought of doing that but wouldn't this situation cause the rule not to run?
Set trigger for 10pm but at that time the door is closed but at 11pm the door is open and left open. Would the rule still trigger since it is not 10pm?
Keep your existing trigger and add a second one at Certain Time: 10:31 p.m.
Could be 10:32 to be safe, but 10:31 should work.
@dylan.c ... please confirm my understanding of your suggestion... so if the time range is from 9pm to 6am, then add a 2nd trigger for time = +1 the start of the time range (i.e. 9:01pm)?
Yes. Triggers must be events. Something must change state in order for the rule actions to run. Your first trigger will work as long as the door state changes from closed to open between the defined times. However, it will not handle the situation where the door is opened prior to the defined time period because the required expression was false at the time of the event. Adding the certain time trigger "forces" the rule to run.
Got it, thank you! Off to make this change and test.
Adding the 2nd trigger fixed the issue of the rule not running but now I have a new issue. When I close the garage door, the repeating section continues to run and send a door Closed message. I thought the "Exit Rule" would cause the rule to stop running. Based on logs, the repeating section continues to repeat. ???
Closing the garage door has no effect on the rule because it has already progressed past that Exit Rule
action.
I would modify your repeating actions to a while
loop.
While Garage Door is open, Repeat every 1 minute
Edit: you'll also want to move your closed notification outside of the repeating actions, or delete it entirely. Or rethink that part in some way...i don't think it will do what you want how it is right now.
Edit 2: I just noticed your second Exit Rule
action inside the IF statement. Maybe a Stop Repeating Actions
would work there, but that's not something I am familiar with. I still feel the While
loop is a better fit here.
Ok will do... thanks again
It does not. See:
My suggestion for the repeat would be as above, but there are also more examples of repeats in the docs if you care to see other ways this could be done (many of which pre-date this feature, which makes it a bit easier to write IMHO).
(Yes, I'm shamelessly linking to the docs in case anyone finds anything else helpful there...)
I revised the rule to use the While x, repeat every y and the rule is working as desired
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.