Newbie - Garage door notification/control

Hi me newbie,
I have not done anything in the way of home automation until now but I started reading about these new open source solutions and want to try it out. My problem that I need to solve is I’m an electrical contractor working out of my garage and in the morning I load my truck in a rush, pull out of the garage and “always” remember to close the garage door behind me because I’ve got a lot of expensive stuff in there. Then somewhere down the road I try to remember if I closed the thing.

So it would be nice if I could look at my phone (android) and see if the door status is “closed”. And maybe even have the option to close it remotely.

So I was looking at the “GoControl/Linear GD00Z-4 Z-Wave Garage Door Opener Remote Controller”

I am trying to find out if this device along with a Raspberry Pi running Openhab, a z-wave USB dongle and some android app will solve this problem.

I can’t seem to figure out if the Gocontrol can give me random readings on the state of the door. It has a tilt sensor but am I to understand correctly that because of battery issues the sensor does low polling and is only in communication when the state changes or something?

I could set an alarm type magnetic reed switch on the door and hook it to what?

I know electrical, alarm system installation and programing, some hobby electronic/arduino and have taken some Linux scripting classes.


That is very likely the case. But the last reading from the sensor will still be around so unless something went wrong (e.g. battery died), whatever the last reported value was will be its current state. You don’t need random readings. OH will retain the last reported value.

Here is what I did. It was my first DIY home automation project and it solves exactly this problem. The following is just the bare skeleton of a tutorial but hopefully it is enough to get you started.


  • Raspberry Pi 3 (a Raspberry Pi 0W would probably work just fine)
  • Raspberry Pi Camera
  • 2x Cheap reed sensors (I’ve two garage door openers)
  • Dual Relay
  • Lots of wire, I used speaker wire for the long runs
  • Some resistors (I used 10K Ohm), though I’m not certain I used these in my setup


See for the tutorial I used to wire it all up. There are probably a lot of newer tutorials out there. At a high level:

  • 5V Pin, Ground Pin, and GPIO Pins to the relay to control the relay
  • two wires from the output side of the relay connected to the wall button the same place where the wires from the opener itself connect to the button (alternatively you can run a wire up to the opener itself and wire them to where the button wires attach to the opener
  • 3.5V Pin and GPIO Pins wired to the reed sensors on the doors, using the resistors between the RPi and the sensor
  • Attach the camera per included instructions


Remote open/close and open/close sensor reporting:

I posted my Python script here.

  • Trigger the Garage: OH sends an MQTT message which causes the script to set the pin that controls the relay to high, wait half a second, then sets it to low which simulates a person pressing the wall button to trigger the opener.

  • Report state of the Garage: This script periodically polls (several times a second) the GPIO pins attached to the reed switches and reports OPEN or CLOSED based on the state of the sensor.

In addition, I installed and configured uv4l to turn the attached RPi Camera into an IP stream.



Switch aGarageOpener1 "Garage Door Opener 1"

Contact vGarageOpener1 "Garage Door Opener 1 is [MAP(]"
  <garagedoor> (gDoorSensors,gDoorCounts)
  { mqtt="<[mosquitto:entry_sensors/main/garage/door1:state:default]" }

Switch aGarageOpener2 "Garage Door Opener 2"

Contact vGarageOpener2 "Garage Door Opener 2 is [MAP(]"
  <garagedoor> (gDoorSensors, gDoorCounts)
  { mqtt="<[mosquitto:entry_sensors/main/garage/door2:state:default]" }

String GarageOpener2_Cmd
  { mqtt=">[mosquitto:entry_sensors/main/garage/door2/cmd:state:*:default]" }


rule "A Garage Opener was triggered"
  Item aGarageOpener1 received command or
  Item aGarageOpener2 received command
  var topic = + "_Cmd"
  sendCommand(topic, "ON")

  logInfo(logName, "Garage opener " + + " was triggered.")
  if(vNetwork_Cerberos.state == OFF) { // this is a network binding Item that goes OFF when the RPi goes offline
    aAlert.sendCommand("Attempting to trigger a garage opener but the controller is offline!")

Just the relevant snippets.

                Switch item=aGarageOpener1 icon="garagedoorclosed" mappings=[ON=Open]  visibility=[vGarageOpener1 == CLOSED]
                Switch item=aGarageOpener1 icon="garagedooropen"   mappings=[ON=Close] visibility=[vGarageOpener1 == OPEN]
                Switch item=aGarageOpener2 icon="garagedoorclosed" mappings=[ON=Open]  visibility=[vGarageOpener2 == CLOSED]
                Switch item=aGarageOpener2 icon="garagedooropen"   mappings=[ON=Close] visibility=[vGarageOpener2 == OPEN]

                Video icon="camera" url="" encoding="mjpeg"

The visibility and custom icon is so the icon on the sitemap and the button are appropriate based on whether the garage door is open or closed.

So with minimal investment in cost and time (I spent an afternoon wiring it together) I can control my openers remotely and have two ways to verify they are closed remotely. And should I set up a security camera system I’ll already have one in the garage.

If I were to do it over again I would get a wide-angle camera (I still might) and would use a RPi 0W instead of a full RPi 3. If you don’t want to do the camera, you can probably implement this using an ESP8266 or Arduino.

If you want something off the shelf Garagio is worth a look.

If you are looking to get into more home automation, the Zwave controller would be worth a look as it will position you to gradualy add more zwave devices as you go.

Here is my garage door hardware: raspberry pi, relay, garage door remote controller and z-wave door sensor and some python code. 99% wireless :slight_smile:

Door sensor installed on garage door reports Open/Close status. Relay attached to Pi connected to garage wireless remote. No need to wire anything in the garage. I also have security camera installed in the garage, in case if I need to see live picture.

Thanks Rich and Ra,
My coding skills are very lacking and I have very little tinkering time right now so to get the garage secure quickly I’m thinking of going with the z-wave GoControl. But I really like the Idea of setting up a single R-Pi in the garage to handle door control, monitoring, a live web cam and the hub also, if I got your setup right. The only thing I would really want the camera to take motion activated photos and email or FTP them to me.

So what do I need to do this? A Raspberry Pi to run Openhab, a Aeotec Z-Stick Z-Wave USB dongle and the GoControl Garage door thing.

What app are people using for a UI that works off site?

How do I access Openhab? SSH (putty) from my PC? This would be for setup and programing right? Do I need some kind of UI device like a tablet that is tied into the Raspberry Pi or something for daily use? I was thinking of setting up a light or something and might expand more when I have time.

So I take it that the z-wave dongle uses RF to communicate to the z-wave devices. Then I guess I would use an app on my phone to control the garage door. So this app has to be tied into Openhab, right? Then once I’m out of the neighborhood how does the app on my phone still communicate with my Raspberry Pi when I’m outside of my local network? Do I have to sign up (or pay) for a DDNS service. I do currently use a free DDNS for my network cams, but does z-wave/Openhab need this also?

Is it common for people to control their smart home devices from off site? I don’t seem to see this discussed.

Thanks again

Well, the code is already out there but not wanting to tinker is fair.

You will need something outside of OH for that. Motion is the program most people use on the RPi. If you will have more than one you will want something like EyeSpy, Zoneminder, or Shinobi.

That should do it.

Http:// and the native UIs.

I recommend using openHABian to install and configure the pi, Then you can access it over ssh or the relevant configure folders are shared as network drives you can mount on the windows machine.

No. Almost everyone runs headless. But to control the light you will need to write some rules or have ui of some sort. But the built in UIs are web based and there are apps for both flavors of smart phones and tablets. There also is integration with Alexa and Google Home.

You would use the openHAB app. The app talks to the OH server. The OH server talks to the USB controller and the controller talks to the device.

See above.

No. See above.

I can’t think of anyone who doesn’t control their OH from off site. The most common approach is to use Next most common is to use a dyndns and port forward to a reverse proxy which adds username and password authentication. After that you have some people who use VPN or host their own instance of the software that drives on Amazon or some other cloud host.

Here’s another example of automating the garage door along with sensors to report status.

It was easy and took me less than 2 hours.