Home Assistant is the main method I use for opening my garage (other than the integrated remote in my car). I’ve had this setup for the better part of a year and thought I would share it in case it helps anyone else control their garage door. This hardware has been running with Tasmota firmware for the bulk of that time and recently I’ve discovered ESPHome and have converted this guy. And while there are plenty of DIY tutorials for garage door control, I think this is the simplest to get up and running. The parts list is very basic:
- Wemos D1 Mini – The Wemos D1 Mini is an ESP8266 based microcontroller that will handle the heavy lifting of WiFi and communicating to your Home Assistant instance [AliExpress | Amazon]
- Wemos Relay Shield – The Relay Shield will perform the physical function of closing the circuit on the garage opener to activate it [AliExpress | Amazon ]
- Wemos DHT shield – I added the DHT to get temperature and humidity data [AliExpress | Amazon ]
- Wired Reed Switch – A magnetic reed switch that will provide state of the door [AliExpress | Amazon ]
- LM2596S DC-DC power regulator – It converts garage door’s 12V DC to 5V DC for the Wemos or use a microUSB cable. [AliExpress | Amazon ]
I buy my stuff from AliExpress because it’s so cheap that it’s basically free as long as you can put up with month-long shipping. I think all of these combined were about 10 bucks. When you finally get these parts from China, you will need to solder the Wemos headers together so you can stack them. My relay shield was on GPIO5, the DHT shield was on GPIO2, and I connected the reed switch on GPIO13. My garage door opener has an option for a backup battery, and the connection for this battery provides a 12v DC output when the garage door opener is powered up. So while I could have powered the Wemos thought a micro USB and a wall wart, I just got the DC-DC power regular. I connected it to the garage door and used a multimeter to adjust it’s potentiometer to a 5v output and then connected the ground and 5v to the Wemos.
Installation is pretty straight forward, you connect the garage door opener’s control contact (same ones where your local button is wired) to the common and normally open contacts of the relay. I’ll eventually post some pictures, but I don’t have any right now.
I’m not going to go through the details of setting up ESPHome. You can watch either Rob’s or digiblur’s videos to get a good explanation on it. Once you have it up and running, you will need to create a new device by populating the name and WiFi details. Here is my config:
- platform: gpio
name: "Garage Door Sensor"
- delayed_on: 20ms
- platform: dht
name: "Garage Temperature"
- lambda: return x * (9.0/5.0) + 32.0;
name: "Garage Humidity"
- platform: gpio
- platform: template
name: "Garage Door Switch"
- switch.turn_on: relay
- delay: 1s
- switch.turn_off: relay
- platform: restart
name: 'Garage Door REBOOT'
The components above include
- A binary sensor component for the reed switch input
- A sensor component for the DHT temp and humidity
- A switch gpio component for the relay
- A switch template for the pulsed output imitating a momentary button press
- A switch restart component to reboot the Wemos
- A status LED component for indicating networking/error status.
Now can compile the firmware and flash it to your Wemos D1. Again, if you’re not familiar with how to do this, reference the videos linked above. Once it’s flashed, power cycle the device. Now you should be able to open the web gui for the device by either going to it’s IP or going to esphome_garage_door.local in your browser. When the page loads up, you should test out the Garage Door Switch by hitting the button next to it. If when you open the Garage Door Sensor changes state, then everything is working as it should.
Now to integrate it into Home Assistant, you will need to go to configuration > integratios. Assuming you have discovery enabled, you will have a new ESPHome device, click configure and add it to your system. In theory, if you don’t have any existing conflicting entities, your entity names should match the ones I have (If not, post in the comments and I’ll try to help). I’m using lovelace with the following config:
- type: horizontal-stack
# I have other doors here
- type: entity-button
This provides you with a simple button who’s icon shows you the state of the door.
Because I’ve forgotten to close the door a few times, I’ve also set up an alert on the door to notify my phone when the door is open for more than 10 minutes:
name: Garage is open
done_message: Garage is closed
A word about security. This setup means that anyone with access to your WiFi network could open your garage door. This would also assume the intruder is on your WiFi, knows the name or the IP of the device, the fact that it’s running a web server, and could connect to it to open your garage door. Personally, I tightly control the people that have access to my network so it’s not a big concern for me. The likely hood of that happening seems lower than someone breaking a window on my house.