[Release] Garage Opener app (beta)

Garage Opener app for Hubitat

Make your garage door switch smart.

Features:

  • Works with a switch that starts or stops your garage door
  • Optionally detects when garage door is fully open with a contact sensor
  • Optionally detects when garage door is fully closed with a contact sensor
  • Detects if garage door is stuck half way though (when using contact sensors)
  • Can still use the switch to manually control the garage door, keeping the device state in sync

Requires a switch that starts and stops your garage door, and every time it starts it goes in the opposite direction.

If you have a simple contact button that controls the garage door, you can connect a smart relay in parallel to the button. Alternatively, install a smart switch, connect an AC relay (e.g. LY2NJ) instead of a light to short the garage door opener contacts. Consult with your electrician before dealing with mains voltage!

Basic Installation

  1. Install driver and app code.
  2. Add a virtual device using the installed Virtual Simple Garage Door Controller driver.
  3. Add the Garage Opener app.
  4. Configure the app with the virtual garage door controller and the smart switch that controls your garage door.

Configuration

  • Garage Door Control - virtual device which uses Virtual Simple Garage Door Controller driver
  • Garage Switch - the switch that controls your garage door
  • Garage opening time (in seconds) - the time it takes for the garage door to open
    • If using contact sensors, this value will be used to detect if the door is stuck, so use a slightly large value, e.g. increase the actual time by 1 second
    • If not using contact sensors, this value will be used to time the garage door movement to sync up the virual door state with the physical door state
  • Switch off delay (in milliseconds) - the delay to automatically turn the Garage Switch off so it acts as a momentary switch
  • Reversal delay (in milliseconds) - the delay between stopping the door and starting it again in the opposite direction (used when changing from closing to opening of vice versa)

Step-by-step instructions

Virtual Simple Garage Door Controller

  1. On the Hubitat hub, go to the Drivers Code page and click + New Driver
  2. Copy and paste the contents of virtual-simple-garage-door-controller.groovy and Save
  3. Go to the Devices page, click Add Virtual Device, specify Device Name, Device Label, select Virtual Manual Garage Door Controller for Type and click Done

This device will represent the state of your physical garage door and will enable controlling the door through it.

This driver is needed to avoid automatic change of state of the built-in Virtual Garage Door Controller driver.

Contact Sensors

The app can detect when your garage door is fully closed or fully open.

  • Attach a contact sensor to the garage door when it's fully closed (the contact should be closed in that position)
  • Attach a contact sensor to the garage door when it's fully open (the contact should be closed in that position)

If you only have a single contact sensor it's recommended to use it for detecting fully closed door.

App Installation

  1. On the Hubitat hub, go to the Apps Code page and click + New App
  2. Copy and paste the contents of garage-opener.groovy and Save
  3. Go to the Apps page, click Add User App, select Garage Opener and click Done

Your feedback is welcome.

7 Likes

Thanks for this @muxa. This seems like it's exactly what I want to do with my 2 garage doors. My only worry is that I'm not a programmer and I'm still pretty new to HE. I may be biting off more than I can chew by trying to implement this on my own as my first home automation setup. Any advise from former noobs?

Would this work with the Zooz Zen16 multirelay controlling both doors?

Thanks,
Graham

It will work as long as each relay is exposed as a switch device in Hubitat. Even if it doesn't, it should be possible to create some rules to sync relays to virtual switches.

However the app only supports a single garage door currently. It should be relatively straight forward to change this app to support multiple garage door. Not sure when I'll be able to get to doing it though.

In the meantime to control your garage doors you can create rules in a Rule Machine like this:


Screenshot 2020-04-11 12.06.41
Screenshot 2020-04-11 12.06.55

These don't handle timeouts or contact sensors, but they did work my setup. With addition of contact sensors and timeouts the logic will become much more complicated, that's why I created the app.

I hope this helps.

Great app/driver. I am using it with a Hubduino and didn't like how the Hubduino driver didn't allow for reversal of the door mid open/close like your app does very well. Thank you for sharing this!

One thing I would suggest is adding the ability to rename the app or incorporating multiple doors into the one app. I have two garage doors so install two instances of the app but they are both called the same thing.

Thanks for your suggestion. I'll update the app at some point to support multiple garage doors. The updated app won't be backwards compatible though and will need to be setup again (because of the way how multi-instance app configuration state is stored)

2 Likes

Hi There! I have used your code to get this up and running, however I have a tilt sensor instead of a contact switch. Do I need to create a virtual device that refers to the tilt sensor? Can you advise? Thank you!

This might be a dumb question, but after I create this virtual switch and put it on a dashboard, what do I choose as the template so it works as a switch and displays the sensor? Or am I wrong about what this even does? lol...

Hi all, I'm new to Hubitat (used HA and Indigo in the past). This seems like exactly what I need to get my DIY MQTT based garage door opener working. I am using Node-red to interface Hubitat with MQTT. I cant seem to get the virtual garage door device to update its status to reflect the state of the contact sensor. The contact sensor is updating fine in hubitat, but it has no affect on the state of the virtual garage door device. Any ideas?

Yes, you'll need to create a virtual device with a Generic Component Contact Sensor driver, setup some rules to set the contact sensor state based on the state of the tilt sensor, and then use the virtual contact sensor in the app.

Can you post a screenshot of the app configuration? Also, app logs would help to understand what might be going wrong in the app

Hi I'm seeing an issue with this, the app works in HE, Alexa and HomeKit I can open and close the door in each. but when I press the hardwired button in the garage or the garage door openers associated wireless remote control the app does not update the Garage Door device.

The contact sensors associated open and close as expected but these do not update the garage door state the the state is not fed back to alexa, HE or HomeKit....any ideas?

Thanks.

@jon.d.tyler There was a bug that prevented the garage controller state from being updated when using a "non-smart" remote for the garage door.

It was fixed in v1.0.1 (which I've just pushed to github)

Update v1.0.1: fixed garage controller state not updating when contact sensor changed without engaging a switch (e.g. using a button on the garage motor)

I thought I posted a question here 2 days ago but now I don't see it so I hope this is not a duplicate.
This Virtual Simple Garage Door you have created looks like a fantastic solution. Thanks.
However I am attempting to use the Garage Door Opener App and am having difficulty.
I am not very smart with this Hubitat stuff, so it is probably an issue with my understanding, but hopefully you are willing to help me out.
I liked the idea of your Garge door control as my garage is a distance from the house and if I can see the state of the door on a Hubitat dashboard it would be great.
And with the contact switches for fully open and fully closed it would show if anything has gone wrong with the door opener.
I have had a situation with ice build up at the bottom of the door and the safety senses it as an obstruction and kicks the door back open.
This could alert me of the situation as today it is not obvious when it happens.
To get started I have installed the Virtual Simple Garage Door Controller Driver and the Garage Door Opener App with devices on the bench to understand how this works before I do it in the Garage.
So I first simply had only the Virtual Garage Door Controller and a Sonoff flashed with Tasmota as the Garage Switch.
I have a dashboard with the Virtual Simple Garage Door Controller Tile set using the Garage Control Template.
Testing it works as I would expect.
Testing by clicking on the Virtual Simple Garage Door Controller Tile in Dashboard it goes from Red, to Closing, to Green, to Opening, and back to Red completely as expected.
Manually activating the switch or clicking the tile both give same good results.
But I want to make use of the Garage Fully Open Contact, and Garage Fully Closed Contact, as I presume I will then see on the dashboard if something has failed.
So I add a Generic Component Contact/Switch for Fully Open and one for Fully Closed.
I removed and added again the Garage Opener app just to be sure I was starting fresh.
I run the Garage Opener App and set the Garage Fully Closed Contact to one Generic Component Contact/Switch and set the Fully Open Contact/Switch to the second.
If I open the devices I can verify their current state changes from OFF to ON with the switch.
Now in the Dashboard I click on the Tile for the Virtual Simple Garage Door Controller. The state changes to Closing, and after the time allowed for closing it changes state to Green Closed.
It does not use the Garage Fully Closed Contact to check it just changes state.
If I do activate the contact before the closing time allowed it does nothing to indicate it is now closed sooner.
And if once it is closed I close and open the contact it does not create any error indicating the door has changed to some unknown state.
Testing the Fully Open contact it also does nothing.
I presume I must have missed some step in my set up. Please Help.
Also I see mention of possibly adding capability for multiple doors which would be great as I have 3 doors.
Or can I simply add the driver and app three times with the appropriate switches etc and arrange the tiles so I know which door is what?

Download the Hubitat app