DIY Smart Garage Door Opener + Home Assistant Integration

Introduction: DIY Smart Garage Door Opener + Home Assistant Integration

About: I am a techie DIYer who loves tinkering with electronics. Twitter @MrDIYca. For more info and my full contacts, please visit

Turn your normal garage door smart using this DIY project. I will show you how to build it and control it using Home Assistant (over MQTT) and have the ability to remotely open and close your garage door.

I will be using an ESP8266 board called Wemos D1 Mini. New to ESP8266? Watch my Introduction to ESP8266 video first.

The video has step by step instructions that will guide you through the process. Feel free to add your questions in the comment section of the YouTube video if you need any futher assistance.

Step 1: Order the Components
- Wemos d1 mini -
- WeMos Relay Shield -
- Reed Magnetic Switch -
- Electronics Project Box -

- Wemos d1 mini -
- Relay Shield -
- Reed Magnetic Switch -
- Wemos d1 mini -
- WeMos Relay Shield -
- Reed Magnetic Switch -
- Electronics Project Box -

Step 2: Hardware

The relay simulates a garage door opener press and the magnetic switch checks the status of the cover ( open/closed).

The WeMos checks the status of the door and sends an update whenever the status changes. It also listens to an MQTT topic for open/close commands.

I ran into an issue of using port D3 which is mapped to the Programming port - which meant if the system boots and the garage door was closed, it would do into flashing mode. I changed that to port D2 which solved the problem. Lessson learned.

Step 3: Software

Connect the D1 mini to your computer, open the Arduino IDE, paste a copy of the code (attached here), change the configuration variables with your wifi and MQTT info and load the Wemos D1 Mini with the new firmware.

Step 4: Home Assistant

Back in Home Assistant open the configuration file and add a new sensor - the code is attached above.

After saving, restart home assistant for it to take effect. When it came back online, add the new garage sensor to the dashboard.

Step 5: Done

The integration is now complete. Your garage door opener is SMART!

If you found this useful, please consider subscribing to my YouTube channel - It helps me a lot.
If you are interested in supporting my work, you can check my Patreon page.

Much of the information contained is based on personal knowledge and experience. It is the responsibility of the viewer to independently verify all information.

Be the First to Share


    • CNC and 3D Printing Contest

      CNC and 3D Printing Contest
    • Rice & Grains Challenge

      Rice & Grains Challenge
    • Puzzles Challenge

      Puzzles Challenge



    1 year ago

    I am red green colour-blind and this page is really very hard to read because of the poor colour-blind-save colour choice. About 8% of the male population has my condition. There are loads of simple solutions on the web. An updated colour scheme would be much appreciated. I can not rate the project, pity ....


    Question 2 years ago on Step 2

    Very nice setup for HA. I like to modify this routine for a sliding gate. Want to use a gate open or close icon to indicate the Gate Status. Like to know if this is possible and some help. Thanks.