A few years ago, I wrote about how I had programmed a device to open my garage using radio frequency waves (RF), similar to how regular garage door opener devices work.
This solution worked fine for test and demonstration purposes, but it was not very viable in the long run as I experienced on several occasions that [A] the signals not always got through and [B] the device occasionally became inoperable through the Linux kernel, forcing me to physically remove and re-insert the tranceiver in the computer to get it working again.
A friend of mine demonstrated to me how he operated his garage door using a Raspberry PI and a relay – and that inspired me to work on this idea.
Introducing Garman 2000
My end goal here was to control the garage door from my cell phone, so I needed an Android application (which I ended up developing myself) called “Garage Manager 2000”, shortened to “Garman2000”.
As I’m a native Norwegian speaker, the prototype was of course made in said language. Here’s a crash course for you English speakers:
- Åpne/Lukke = Open/Close
- Åpen = Open
- Lukket = Closed
The LED icons left to the status descriptors, “åpen/lukket”, shows the current state of the garage. Yellow means “undefined”, grey means “off” and green means “on”.
On the top left screenshot, the garage is neither open nor closed, on the top right, feedback from the sensors in the garage indicates that the garage door is closed.
The app communicates with a REST compliant Garman 2000 server, programmed in Python using the Flask framework.
The server application is run on a Raspberry Pi Model B and communicates with the world through a small WiFi dongle plugged into the USB slot.
Initially, it was developed without any feedback from the garage. The garage door opened whenever two contact points were short circuited, so a relay was perfectly suited for that task! The relay I ended up using required 5V to activate. As the GPIO pins on the Raspberry only carries 3.3V, I used a transistor to send 5V to the relay using a 3.3V output pin to activate it.
Once I got that working, I figured I needed a way to read feedback from the garage door itself. In the end, my desire was to open/close the garage door from the cell phone, and if you are not in physical proximity of the garage door, you do really not know whether it is open or closed (before you have Garman 2000).
As a result, I installed these magnetic contacts that I hooked up to the Raspberry PI using pull up resistors.
Whenever the magnets gets in proximity of each other, a relay inside is activated and I can read the status on the Raspberry Pi.
Home Assistant Integration
Once completed, I integrated the Garman 2000 REST API towards my Home Assistant instance, by creating a custom sensor for viewing and logging the status. I have also integrated a temperature and humidity sensor to this setup and can easily see the overall status (to the right below), and drill down to see the details (left picture).
So now, I can sit on the other side of the world and enjoy a fruity cocktail on a beach, and verify that my garage door is open or closed.