# Routine for closing garage door

**URL:** <https://community.smartthings.com/t/routine-for-closing-garage-door/250434>\
**Category:** SmartApps & Automations\
**Created:** [October 23, 2022, 4:31pm UTC](https://community.smartthings.com/t/routine-for-closing-garage-door/250434 "2022-10-23T16:31:27Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![gst](https://avatars.discourse-cdn.com/v4/letter/g/d07c76/32.png) [@gst](https://community.smartthings.com/u/gst)\
**Post date:** [October 23, 2022, 4:31pm UTC](https://community.smartthings.com/t/routine-for-closing-garage-door/250434/1 "2022-10-23T16:31:27Z")

</div>

I have contact sensors on the garage doors and momentary buttons which open/close the respective doors.

It was working great in webCoRE but with my routine it closes and then opens it again.

Here’s the logic:  
Using my phone location. If I am away for 1 minute and the garage door sensor is open, press the momentary button.

Of course there’s no delay after the button press so the door is in motion and has not yet closed and it appear to repeat causing the door to open again. If there were a delay after the button press that would solve the issue but I don’t see that option in routines.

Yes I could implement a virtual garage door (maybe that’s the only solution) but that’s going to require multiple routines for each door.

Is there another method I am not seeing?

The open when I return, after being away for 10 minutes works OK. It only triggers once.

---

<div class="post-metadata">

**Author:** ![KenW48360](https://avatars.discourse-cdn.com/v4/letter/k/d26b3c/32.png) [@KenW48360](https://community.smartthings.com/u/KenW48360)\
**Post date:** [October 23, 2022, 5:00pm UTC](https://community.smartthings.com/t/routine-for-closing-garage-door/250434/2 "2022-10-23T17:00:13Z")

</div>

You might want to add two preconditions. The garage door is not “Closing” and the Garage door is not “Closed.” Of course, you may need to add a virtual garage door to do this.

---

<div class="post-metadata">

**Author:** ![gst](https://avatars.discourse-cdn.com/v4/letter/g/d07c76/32.png) [@gst](https://community.smartthings.com/u/gst)\
**Post date:** [October 23, 2022, 5:22pm UTC](https://community.smartthings.com/t/routine-for-closing-garage-door/250434/3 "2022-10-23T17:22:29Z")

</div>

Yes, that would require virtual garage doors, and the associated routines.

I have it working using a virtual garage door now as that seems like the only solution for now but the routines need to have a pause (after event) command and really the presence should have options for arrived home or left and only trigger once.

---

<div class="post-metadata">

**Author:** ![jkp](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/jkp/32/117130_2.png) [@jkp](https://community.smartthings.com/u/jkp)\
**Post date:** [October 23, 2022, 5:30pm UTC](https://community.smartthings.com/t/routine-for-closing-garage-door/250434/4 "2022-10-23T17:30:35Z")

</div>

can you post a screenshot of the routine please?

for myself… I just use

if  
presence sensor: not present  
for 1 minute  
then  
garage door  
door closed

I do not use the if garage door open part

---

<div class="post-metadata">

**Author:** ![gst](https://avatars.discourse-cdn.com/v4/letter/g/d07c76/32.png) [@gst](https://community.smartthings.com/u/gst)\
**Post date:** [October 23, 2022, 5:35pm UTC](https://community.smartthings.com/t/routine-for-closing-garage-door/250434/5 "2022-10-23T17:35:39Z")

</div>

![image](https://global.discourse-cdn.com/smartthings/original/3X/e/a/eaaa2148e7bd301e56f6aa52ddd68e991bdc417d.png)

All that matters is that my phone presence is away and the garage door contact is open. It presses the momentary switch to close it.

These are Z-wave tilt contact switches on the doors.

---

<div class="post-metadata">

**Author:** ![rcbjr2](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/rcbjr2/32/111437_2.png) [@rcbjr2](https://community.smartthings.com/u/rcbjr2)\
**Post date:** [October 23, 2022, 5:47pm UTC](https://community.smartthings.com/t/routine-for-closing-garage-door/250434/6 "2022-10-23T17:47:25Z")

</div>

I may be wrong, but you set it up so that the door closes if any of the conditions are met, even if the mode changes. Shouldn’t it be structured so that all conditions must be met?

---

<div class="post-metadata">

**Author:** ![gst](https://avatars.discourse-cdn.com/v4/letter/g/d07c76/32.png) [@gst](https://community.smartthings.com/u/gst)\
**Post date:** [October 23, 2022, 6:00pm UTC](https://community.smartthings.com/t/routine-for-closing-garage-door/250434/7 "2022-10-23T18:00:27Z")

</div>

I assumed the “away for 1 minute” would trigger once, so then if the door is open it would initiate the button press to close it. The location mode could be removed as could the other condition.

---

<div class="post-metadata">

**Author:** ![blueyetisoftware](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/blueyetisoftware/32/143828_2.png) [@blueyetisoftware](https://community.smartthings.com/u/blueyetisoftware)\
**Post date:** [October 23, 2022, 9:32pm UTC](https://community.smartthings.com/t/routine-for-closing-garage-door/250434/8 "2022-10-23T21:32:37Z")

</div>

@gst I would also take a look at the virtual garage door in this driver. It helps manage the distinction between open/opening and closed/closing. It also presents as a door so you can open and close it logically via the dashboard or the smart locks app. You can follow the door tutorial so connect your contact sensor.

> [@\[ST Edge\] Virtual Hub Kit \[BETA\]](https://community.smartthings.com/t/st-edge-virtual-hub-kit-beta/248327):
>
> This will be an open beta, as the driver is not expected to need many updates. Any updates will happen automatically if they are released. Those updates will be announced in this thread, so please watch for notifications. There are some other quality virtual device drivers. The intent of this driver is to enable users to create their own smart apps / devices to enable automations that are not possible with their physical devices. For example, associating a relay/contact sensor to make a door. Follow the invite link below to install the driver. This will create a Virtual Hub in a “No Room Assigned” room within the ST app. You can use this virtual hub to create further devices. Here is a Garage Door Example connecting a relay and contact sensor to automate the door. You should consider t…

---

<div class="post-metadata">

**Author:** ![gst](https://avatars.discourse-cdn.com/v4/letter/g/d07c76/32.png) [@gst](https://community.smartthings.com/u/gst)\
**Post date:** [October 23, 2022, 10:46pm UTC](https://community.smartthings.com/t/routine-for-closing-garage-door/250434/9 "2022-10-23T22:46:00Z")

</div>

Thank you, actually I already installed it and yes that does solve the issue but requires 12 routines not including those that trigger from presence. I hope ST add such simple automation tasks as a pause.

---

<div class="post-metadata">

**Author:** ![blueyetisoftware](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/blueyetisoftware/32/143828_2.png) [@blueyetisoftware](https://community.smartthings.com/u/blueyetisoftware)\
**Post date:** [October 23, 2022, 11:06pm UTC](https://community.smartthings.com/t/routine-for-closing-garage-door/250434/10 "2022-10-23T23:06:02Z")

</div>

If you want to share the 12 automations in DM, I can take a look and see if there is any way to reduce those.

---

<div class="post-metadata">

**Author:** ![gst](https://avatars.discourse-cdn.com/v4/letter/g/d07c76/32.png) [@gst](https://community.smartthings.com/u/gst)\
**Post date:** [October 23, 2022, 11:47pm UTC](https://community.smartthings.com/t/routine-for-closing-garage-door/250434/11 "2022-10-23T23:47:59Z")

</div>

Thanks for the offer. There’s nothing too complicated it’s 2 for the sensor states (open/closed) and 2 for the switch (opening/closing) but multiplied by 3 garage doors. It is working fine so I will just leave it for now and more on to other devices.

---

<div class="post-metadata">

**Author:** ![milandjurovic71](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/milandjurovic71/32/208047_2.png) [@milandjurovic71](https://community.smartthings.com/u/milandjurovic71)\
**Post date:** [October 24, 2022, 12:12am UTC](https://community.smartthings.com/t/routine-for-closing-garage-door/250434/12 "2022-10-24T00:12:46Z")

</div>

Add virtual momentary button from @TAustin to Routines. It has “timer” that reset status after set time, for example 20 seconds  
Place it in Condition to be if Off. It’s going to give 20 second to garage to close, before goes back to off.

---

<div class="post-metadata">

**Author:** ![gst](https://avatars.discourse-cdn.com/v4/letter/g/d07c76/32.png) [@gst](https://community.smartthings.com/u/gst)\
**Post date:** [October 24, 2022, 11:36am UTC](https://community.smartthings.com/t/routine-for-closing-garage-door/250434/13 "2022-10-24T11:36:53Z")

</div>

Great suggestion, thank you.

---

<div class="post-metadata">

**Author:** ![KenW48360](https://avatars.discourse-cdn.com/v4/letter/k/d26b3c/32.png) [@KenW48360](https://community.smartthings.com/u/KenW48360)\
**Post date:** [October 24, 2022, 11:49am UTC](https://community.smartthings.com/t/routine-for-closing-garage-door/250434/14 "2022-10-24T11:49:44Z")

</div>

Running a routine with multiple triggers is fraught with problems. If you set the garage door, location mode, and sensor to Preconditions, it would just trigger on the away. So when you leave, presence triggers, it checks the preconditions and if they are met it runs.

---

<div class="post-metadata">

**Author:** ![gst](https://avatars.discourse-cdn.com/v4/letter/g/d07c76/32.png) [@gst](https://community.smartthings.com/u/gst)\
**Post date:** [October 24, 2022, 4:04pm UTC](https://community.smartthings.com/t/routine-for-closing-garage-door/250434/15 "2022-10-24T16:04:00Z")

</div>

Thanks. I initially only had the phone presence sensor as the trigger and it didn’t work, but that was resolved by using the virtual garage door although I like Milan’s suggestion better so will give that a try.

---

<div class="post-metadata">

**Author:** ![blueyetisoftware](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/blueyetisoftware/32/143828_2.png) [@blueyetisoftware](https://community.smartthings.com/u/blueyetisoftware)\
**Post date:** [October 24, 2022, 4:44pm UTC](https://community.smartthings.com/t/routine-for-closing-garage-door/250434/16 "2022-10-24T16:44:30Z")

</div>

@gst I also have a virtual momentary button in the same driver that has the garage door. A virtual switch would do the same thing using the “auto off” available to all switch in ST.
