Awesome Open Source
Awesome Open Source

ESP8266 MQTT GarageDoorSensor and Temperture HomeAssistant

This project allows for up to three "dumb" garage door openers to be controlled (open/close) and report garage door status (open/closed/occupied) via MQTT. In addition if you can also monitor the Temperture and Humidity within your garage to over MQTT as well.

The code covered in this repository utilizes Home Assistant's MQTT Cover Component and uses an ESP8266 microcontroller. There is a sample configuration in the repository

Inspiration for this comes from GarHAge and OpenGarage. The Temp and Humidity code for a DHT22 from GarHage, and now it morphed to change to NewPing for the ultrasonic HC-SR04 due to the inconsitant reading using the Ultrasonic library with the HC-SCR04 I aquired from china.

NOTE: I am currrently only using this with one garage door, to enable for 2 or 3, just enable the use to true in the auth.h file you create

Supported Features Include

  • Report status on up to 3 garage doors
  • Report information on Temp and Humidity
  • Ability to Select Celius or Fahrenheit for Temp
  • Web page for status of Garage Doors and Temperature
  • Events and status sent via MQTT
  • MQTT commands to toggle relays to open/close the garage doors
  • Over-the-Air (OTA) Upload from the ArduinoIDE!

OTA Uploading

This code also supports remote uploading to the ESP8266 using Arduino's OTA library. To utilize this, you'll need to first upload the sketch using the traditional USB method. However, if you need to update your code after that, your WIFI-connected ESP chip should show up as an option under Tools -> Port -> 'HostName'at

More information on OTA uploading can be found here.

Parts List

Wiring Diagram

alt text

Web page

alt text

Completed Project

alt text alt text alt text

I have also made a stl bracket to hold it to the rail

alt text

Sample MQTT commands

Listen to MQTT commands

mosquitto_sub -h -t '#'

Open the second garage door

mosquitto_pub -h -t GarDoor/2/action -m "OPEN"

Alternatives To Esp Mqtt Garagedoorsensor
Select To Compare

Alternative Project Comparisons
Related Awesome Lists
Top Programming Languages
Top Projects

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
C Plus Plus (242,160
Esp (8,403
Mqtt (7,937
Relay (4,314
Ota (953
Ultrasonic (717
Garage Door (164