iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
An ESP8266 NodeMCU can report whether a garage door is open or closed and publish garage temperature and humidity to a home-automation system. Use a magnetic reed switch for the door and a separate compatible temperature/humidity sensor, such as a DHT22. The NodeMCU itself does not measure humidity. MQTT is one documented way to send readings to Home Assistant; a relay is optional and needed only if you also want to command the opener.
How the garage monitor works
The project combines two independent measurements: a contact switch detects the door’s position, while a separate sensor measures temperature and humidity. The NodeMCU reads those inputs and reports them to a controller such as Home Assistant, commonly using MQTT. A dashboard can then show the door state and climate readings as separate entities.
- Door: A magnetic reed/contact switch changes electrical state when the door reaches the position where the magnet and contact are aligned.
- Temperature and humidity: A compatible sensor, such as a DHT22, supplies the climate readings. Other documented options include AM2320, DHT11/DHT22, and DS18B20; their suitability and wiring differ, and the available documentation does not establish a comparative accuracy winner.
- Reporting: Firmware publishes the readings, for example through MQTT, and Home Assistant presents them as entities.
ESP-MQTT-GarageDoorSensor documents an ESP8266/NodeMCU setup that reports garage-door state and DHT22 temperature and humidity via MQTT. GarHAge documents MQTT status/action topics and Home Assistant configuration. These are implementation examples, not universal pin or firmware requirements: see GarHAge documentation and ESP-MQTT-GarageDoorSensor documentation.
Choose the door sensor and state logic
Magnetic contact switch
Mount the switch and magnet so their relationship reflects the door’s closed position. The firmware must know whether the installed switch is normally open or normally closed; choosing the wrong setting can invert the reported state. GarHAge’s example connects one switch between NodeMCU D5 and GND, and a second door’s switch between D6 and GND. Those assignments belong to that example and should not be copied without checking the board, firmware, and pin configuration you are using.
#1 Best Overall
- Not only it is easy to program for this controller by using the CP2102-USB interface,but also unnecessary to press the flash and reset buttons before each flash operation.
- NodeMcu is an open source Lua based firmware for the ESP8266, ultra low cost wireless modules, development boards for rapid prototyping, integrated with ESP8266 chips.
- The ESP8266 has powerful on-board processing and storage capabilities, and can be integrated with sensors and other application-specific devices through its GPIOs.
- It is compatible with Arduino IDE,works great with the latest Mongoose IoT/Micropython.
- Modern Internet development tools can use the built-in API to instantly put your idea on the fast track.
Contact switch or distance sensing
A contact switch is a direct way to detect a particular door position. OpenGarage’s firmware manual also documents distance sensing and combined switch/distance logic. In its “Distance AND Switch” mode, the door is considered open only when both sensors report open. The manual also describes other logic choices; available modes depend on the device and firmware. See the OpenGarage firmware manual for its documented options.
Whichever approach you choose, the dashboard reports what the configured sensor and logic infer. Misalignment, wiring faults, switch type, and incorrect entity configuration can produce a misleading state.
Rank #2
- The ESP8266 NodeMCU board has all the features of the traditional ESP8266 module,with the same exact size and peripheral ports,offers seamless integration with a 0.96-inch OLED display, eliminating the need for frustrating wires and breadboards.Display features a high-resolution 128x64 with SSD1306 driver and is compatible with I2C,SPI interfaces. Plus,It uses Micro usb cable to connect. Say goodbye to messy setups and hello to hassle-free electronics with the ESP8266 NodeMCU board
- This board uses I2C to connect to an OLED display via the SDA (D6 / GPIO12) and SCL (D5 / GPIO14) pins. With this board,it's easy to display a variety of information and data
- To install the new version driver for CH340,simply search for the keywords "CH340 Driver" on Google.com or Bing.com and follow the installation instructions provided.Recommended for Win10 Operating System
- ESP8266 NodeMCU board is equipped with ESP-12E module,which contains the Tensilica Xtensa 32-bit LX106 RISC microprocessor powering the ESP8266 chip. This microprocessor supports RTOS and operates at a clock frequency that can be adjusted between 80MHz and 160 MHz. It also boasts 128 KB of RAM and 4MB of Flash memory, providing ample storage for data and programs. With its high processing power, built-in Wi-Fi, and Deep Sleep Operating features, It's is an excellent choice for IoT projects
- This board is an outstanding option for various Internet of Things (IoT) projects. It can be used to display network connection status,monitor information, power levels, and other relevant data. Additionally, it's suitable for building Internet Weather Stations, News Stations, Clocks, and Other similar applications
Add a temperature and humidity sensor
Connect a sensor supported by the firmware you select. The DHT22 is one documented choice for an ESP8266 garage project. OpenGarage’s firmware manual lists AM2320, DHT11/DHT22, and DS18B20 as temperature/humidity options; the DS18B20 setup requires a 10K pull-up resistor according to that manual. Check the specific sensor’s wiring and firmware support before assembling the circuit. These documented choices are not a controlled comparison of accuracy.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Publish readings to Home Assistant
Configure the NodeMCU firmware and Home Assistant to use the same MQTT broker and the matching topics or entities. The project documentation for your chosen firmware is the authority for its topic names and payload format; do not assume that one project’s configuration works unchanged with another.
Rank #3
- ESP8266 Breakout Board GPIO 1 into 2 Terminal Screw Board is Fully Compatible with ESP8266 ESP-12E
- GPIO 1 into 2: ESP8266 Breakout Board Can Expand 1 GPIO Pin to 2, Which is Convenient for Users to Reuse Pins for Large-Scale Smart Home Projects
- Double-Layer PCB: ESP8266 Breakout Board is a Double-Layer Board. One Pin is Wired On Both Sides. Therefore, the Circuit is Stable and Highly Reliable
- 2 Type Connections:ESP8266 Breakout Board Designed with Two Connection Methods: Pin Header Connector & Screw Terminal. Just Select Connection According to Your Need
- Convenient to USE: Compared with the Previous Version, Updated Version ESP8266 Breakout Board Has Been Soldered Completely. No Need to Solder Parts,Very Convenient to Use
When representing the door as a Home Assistant binary sensor with device class garage_door, map its state to Home Assistant’s convention: on means open; off means closed. Make sure the contact logic and any inversion setting produce that result. Home Assistant’s developer documentation specifies this mapping at Binary sensor entity documentation.
Home Assistant’s Garage door integration documentation describes open/closed triggers and conditions for automations, and support for binary sensors with device class garage_door and covers with device class garage. The page identifies the integration as introduced in Home Assistant 2026.4, so check the documentation and features for your installed release before relying on that integration. See Home Assistant Garage door integration.
Rank #4
- Built-in Micro-USB, with flash and reset switches, easy to program
- Arduino compatible, works great with the latest Arduino IDE/Mongoose IoT/Micropython
- Data download access to the website: http://www;nodemcu;com
Keep monitoring separate from opener control
A relay is not needed to read door position, temperature, or humidity. Add one only if you intend to send an opener command. In the GarHAge example, a relay briefly closes the same opener terminals used by the wall pushbutton. That is an example for the documented setup, not a compatibility guarantee for every opener. Verify the interface and requirements for your particular opener before connecting anything; this material does not establish a safe way to connect to mains wiring.
Check the reported state before relying on it
- Confirm that the sensor and magnet physically align at the door’s closed position.
- Verify that the firmware setting matches the installed contact’s normally-open or normally-closed behavior.
- Check that the selected board pins match the firmware configuration; example pin assignments are not universal.
- Confirm that the climate sensor is supported and wired as its documentation specifies.
- Verify Wi-Fi, MQTT broker connectivity, topic or payload configuration, and Home Assistant entity state mapping.
- Test the reported open and closed states at the door positions you care about, rather than assuming a dashboard label proves the physical state.
A DIY monitor is an indicator, not a replacement for the garage opener’s built-in safety systems.
Quick Recap
Best Value
- The ESP8266 NodeMCU development board has a built-in 0.96-inch OLED display (128x64, SSD1306) and supports the I2C interface. It can be directly integrated without additional wiring, making it an ideal choice for quickly building ESP8266-based visual display projects
- The development board is equipped with the ESP8266 ESP-12E module, using the Tensilica Xtensa 32-bit LX106 CPU (80-160MHz), equipped with 128KB RAM and 4MB Flash, which can provide stable performance for demanding ESP8266 IoT applications
- The onboard OLED uses the I2C interface through the SDA (D6/GPIO12) and SCL (D5/GPIO14) pins on the ESP8266 NodeMCU, which can easily display real-time network status, sensor data, and other ESP8266 project information
- The ESP NodeMCU development board has built-in Wi-Fi, supports deep sleep, and is compatible with RTOS. It is ideal for low-power IoT solutions such as ESP8266 weather stations, clocks, and smart monitoring systems
- This ESP8266 development board uses a Type-C port for power and data transmission. The CH340 driver can be easily installed by searching online. It is fully compatible with Windows systems and is an ideal choice for ESP8266 beginners and professionals
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

