Auto Close Garage Doors

Hey everyone, I've already read through the other "Auto Close" garage RM threads, but most are too complicated for my setting.

I'm a very forgetful person and sometimes I forget to close my garage, but I want to make sure it is closed every time.

So I wanted to create a rule where it can check if the garage sensor reads "open". If it does, wait 5m and check again. If it is still "open" then toggle the "garage door" switch and send me a message that the rule was executed. If it is closed at any point during those 5m, then stop the rule (until it is open again).
The reason for this is because the garage door sensor provides live updates so the rule is activated everytime I open the Garage Door, and sometimes I remember to close the garage door on my way out, as 4m from the rule have passed.

I hope I wasn't too confusing, but if anyone could just double-check this rule, I'd be very grateful. :slight_smile:

Looking forward to your feedback!

My first thought is a question: your first action is "Poll: Garage Door," which I'm assuming you are doing to refresh the state of the device. Most devices should send updated states to Hubitat automatically (notable exceptions, and the reason for the polling "feature" in the first place, include many old Z-Wave switches). So:

  • Have you verified that your device actually needs to be polled?

  • Even if so, does doing this as the first action in your rule actually do anything? Your Rule triggers on the door opening, so this action won't run unless Hubitat received such an event in the first place; I see it is also (possibly) getting polled again a few seconds later. If yours reports "Open" often when it's really closed, then I suppose this might be a workaround, but it's still important to note that the rule won't trigger if it opens and still reports "closed." It should be noted that "Exit Rule" just stops running additional actions, as if that were the last Rule action, but it doesn't cancel anything already set in motion (schedules, event subscriptions, etc.).

Also, it should be noted that the %value% and %time% variables you are using refer to the trigger event values, not necessarily the device at that point in time. (You can use %now% for the current time if you want that instead; if you want the current device value, you will need to feed it into a variable and then use that in your text, but if you do want the last triggering event value, this would work as-is...not sure it makes sense to me either way, though, as it seems like you want the opposite.)

Ignoring that, this rule is really just checking if the door is open 5 minutes after any time it opens. It's not really checking to see if it stays open for 5 minutes (i.e., closing and re-opening will not "reset" or erase your delays). There is a way to cancel delayed actions (which your Rule doesn't actually do, though it is marked as eligible), but I think it would be easier to use different Rule features instead. This simple Rule would do just that:

Trigger: Garage door open

Actions to run:

Wait for condition: Garage door open --> duration 0:05:00
Toggle: Garage Door
Notify: "Garage door toggled"

However, if you need the "polls," you'll need to insert those at an appropriate time in your Rule actions (before and after the wait, maybe? I'm not sure what issue these are addressing, but that seems similar to your first Rule).


i would change the trigger to Garage door changed


something like this (just used random devices, but the NCKL-Panic would be your garage door.) the reason i'm doing it this way is let's say you leave and close the garage, but within that 5 minutes someone comes home and opens it. the original timer should still be running and could cause it to close earlier than the 5 minutes. by putting the delay as cancelable, and canceling it on the close, it will go into the nested if statement, see it's false, then end the rule

1 Like

@SmoothMarx I would practice this rule with a light bulb or a virtual device before trying it for real. I think the below is a concern.

I do similar things with similar rules, although not the garage door. However I put Cancel delayed actions first in the rule, and then go into the IF-Thens.

So it would be something like this:

Cancel Delayed Actions
If door sensor open Then
Delay 5 minutes cancelable
Close Door
Notify Phone
End IF

To me, this is cleaner than the other way.

But I like bertabcd1234's way of the wait for condition too.

With everything like this, safety has to be the primary concern. My wife once forgot to close the back hatch on the SUV parked in the garage. The garage door closed, hitting the SUV door. The safety sensor in the garage door opener sensed the obstruction and reversed the door, but not before several scratches were left in the car. If the garage door had been on an auto-close routine, this sequence could have been repeated multiple times.

If you ever go out through the garage door to do yardwork, for example, do you always want the door to be closed five minutes later? When we are working in the yard, we normally leave the door open.

Anyway, think this through very carefully to make sure you have accounted for all possibilities that might occur. I don't think I would ever want an auto-close routing on my garage, but it might be different for you.


That visual actually made me giggle a bit. Imagine the door hitting your car all night or something. :boom: :boom: :boom: You come out in the morning, the hatch is bent to a :pretzel: and the garage door is :fire: .

That gets annoying. I had my garage set to auto-close (setting on the opener) and every dang time it would close on me and I would have to either walk around and open it, or punch in the code with dirty hands or something. That setting got turned off after the novelty wore off.


This is worth considering. For all of my locks and doors, I have notifications set up if I leave them open--including an annoucement triggered by my bedtime routine if any are still open then--but I've never automatically closed/locked anything. I've never even tried it to see how annoying it would be; I just never did it because I assumed it might be.

Just my preference. :smiley: My post above, of course, was just focused on answering the question at hand.


I get a very large amount of package deliveries and want them put in the garage. One company tends to come early morning and late evening. So far, security & theft has not been a problem over the years we've lived here. I auto-open at breakfast and auto-close at dark. A separate RM checks later to be sure it is closed and starts periodic notifications if it is found open.

1 Like

I've been doing this for a long time. Recently updated the rule for 5.1.

I have a virtual switch called garage door pause that also stops this action when turned on. Nice for when working the garage/etc. Also you will see I turn on another virtual switch called "garagedoorclosing" This triggers another rule that flashes a light and plays a chime on an aeotec siren that's in my garage. I HIGHLY suggest something similar if you actually park in your garage.... there is a reason I added this! That "perfect" timing of backing out of the garage and the door starting to go down....ugh.

First, I'd like to thank each and every one of you for taking the time to reply and thank you again for all the insights and information, there's a lot to consider.

In the end, I think I will heed the "safe" advice and program only notifications, since I can remotely close the garage. At least until I get a motion sensor in there, and/or a physical switch.

But trying to adress some of you personally,

@bertabcd1234 I wasn't entirely sure how the "Trigger" was going to work, so I merely assumed as soon as the door was open, this task would be triggered.

Then, the second polling (maybe it can be refresh or something else, idk) is just to confirm the status hasn't changed, because in the past, I've opened the garage to get in, the rule starts counting down, I get out and close the garage and once it finishes the countdown, it will just toggle, opening the garage again.

But now I understand "Exit Rule" just means it will finish this sequence and listen for the trigger event again (which is what I was looking for).

As for the variables in the notification, I guess I will just change the text to something easier. :slightly_smiling_face:

Also, addressing @neonturbo and @dadarkgtprince, I can't really tell the difference between "Wait" and "Delay" and its different variations. What is the difference between "wait for condition" or "delay (canceleable)"? Don't they work the same?

@rwclements228 makes very good points. I have considered those situations and I would be ok with just pausing the rule when I use the garage as my workbench. Other than that, I am the sole user of the garage, really and (I haven't yet, but!) I plan to paint some markings on the floor to indicate where the car should be stopped and oriented. But the fear you have instilled on me (plus @neonturbo's night description) makes me want to just put notifications.

Why are you painting markings on the floor?

(In case you're interested, the markings are because my garage is very narrow and has a mezzanine for storage that covers the back of the car, so not only does it have to go in at the right angle to not clip the corners, but that also means every time I want to open the trunk I have to inch the car forward a bit, at which point it is over the garage limits. So basically, one blue line for "TRUNK OPEN" and one red line for "PARKING", and can adjust according to the rear view camera.)

and @jrfarrar, you also make a good point, something that happened to me (although I wasn't driving out), and that is why I wanted to include the motion sensor to reset the timer.

@rcjordan, that is not feasible for me, living in a condo. Although it's a nice place around here, there are unknown people moving in and out all day from all apartments, and I have a ton of loose stuff in the garage, (car cleaning products, baby items, old family stuff, electronics, etc.). I can't leave the garage open all day, even though I have in the past (and that is why I want to create this rule :smiley: )

the thing with the wait condition is it will toggle it regardless, so if you open it, it waits for the door to open. this means i you close it or the door opens again, then it will proceed. then it toggles the door (so if open, it'll close and if closed it'll open it)

1 Like

wait for condition says it will wait for that condition to happen before going onto the next step. it can timeout after a certain time and just proceed as normal. this is usually helpful if you have multiple components working together (e.g. you open a door. you then want to wait for motion before turning on the light. you can have a wait for motion condition, then turn on the light). it is best to follow the wait for condition command with a conditional as it can act like a pause until the condition is met before proceeding to the next lines

delay is just a flat out pause, no conditions on it

if you did:
wait for door open -> timeout 5 minutes
delay 5 minutes

if the door never opens, then they will operate the same. if the door opens after 2 minutes though, you've saved 3 minutes overall (which depending on the rule can be good/bad)

1 Like

No, if you close the door, the "Wait for condition: open --> duration X " will be cancelled. Per the cancelation, no further actions will be reached. It sounds like you are confusing duration with timeout. The former is a relatively new feature, though there is a more verbose way to do this using timeout too which many people previously used.

"Opening again" is, then, also not a concern--if it happens, the Rule starts over, per the trigger event. Assuming then door reports correctly, the Rule I wrote should work as-is.