01/23/2026
HAOS 16.3
Garage Door Open/Close Sensor with Home Assistant Integration
I built a garage door status sensor and integrated it into Home Assistant. I wanted to get a push notification any time my garage door was opened or closed.
Supplies Used
NOTE: These are not affiliate links and I have no association with any product listed below
- Hosyond 5-Pack D1 Mini NodeMcu ESP8266 Development Boards - ESP8266 WiFi-enabled microcontroller boards
- Gebildet 5-Pack Recessed Wired Magnetic Reed Switches - Normally closed magnetic door/window sensors
- Header Pin Extensions - 22 Gauge Wire 2 Conductor Electrical Wire (referred to as extension wire)
- ESP32 Case Set (2-Pack) - Protective cases with GPIO pin access
- ELEGOO 120pcs Dupont Jumper Wire Kit - Male-to-female, male-to-male, and female-to-female breadboard wires
- USB-C Cable - Had one lying around, 5V rated
- USB Power Adapter - Had one lying around, 5V rated
Assembly Process
- Starting state before making any modifications

- Solder header pins to the ESP8266 board - I soldered the male-to-female header pins to the D1 Mini board to provide connection points.

- Connect the Dupont jumper wires - Plugged the Dupont jumper wires into the female header sockets on the board at G (Ground) and D1 (GPIO5)
- Add extension wires - Connected the extension wire to the female end of the Dupont jumpers; then housed the extension wire in a plastic material mounted on the ceiling of my garage and extended it from the power source to the sensor

- Connect to plastic wire connectors - Joined the extension wires and the magnetic reed switch sensor together via plastic wire connectors

- Mount sensor and magnetic reed switch - Mount the sensor to a static object near the garage door (I used screws that came with the magnetic reed switch). Mount the magnet to the garage door itself (I used 3M double sided tape)

The reed switch is normally closed, meaning when the magnet is near the switch (door closed), the circuit is complete. When the magnet moves away (door opens), the circuit opens, which our code can detect and send us a notification.
Home Assistant Configurations
Home Assistant ESPHome Configuration
Home Assistant ESPHome configuration for the garage door sensor:
esphome:
name: garage-door-status
friendly_name: Garage Door Status
comment: "D1 Mini ESP8266 + recessed NC reed switch between D1 and G (GND)"
esp8266:
board: d1_mini
logger:
api:
encryption:
key: "xxx"
ota:
- platform: esphome
password: "xxx"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
use_address: 192.168.59.5 # Static IP address on IoT VLAN
ap:
ssid: "Garage-Door-Status"
password: "xxx"
captive_portal:
time:
- platform: sntp
id: sntp_time
sensor:
- platform: wifi_signal
name: "WiFi Signal"
update_interval: 60s
- platform: uptime
name: "Uptime"
update_interval: 60s
text_sensor:
- platform: version
name: "ESPHome Version"
- platform: wifi_info
ip_address:
name: "IP Address"
ssid:
name: "Connected SSID"
bssid:
name: "Connected BSSID"
mac_address:
name: "MAC Address"
binary_sensor:
- platform: gpio
id: garage_contact
name: "Garage Door"
device_class: garage_door
pin:
number: D1
mode:
input: true
pullup: true
filters:
- delayed_on: 25ms
- delayed_off: 25ms
- platform: status
name: "Device Status"
button:
- platform: restart
name: "Restart Device"
Home Assistant Push Notification Automations
Home Assistant automation to receive push notifications when the garage door opens or closes:
alias: Garage Door Status - Changed
description: ""
triggers:
- entity_id: binary_sensor.garage_door_status_garage_door
trigger: state
actions:
- data:
title: Garage Door
message: >
Garage door just OPENED
action: notify.mobile_app_jeffs_phone
mode: single
This automation:
- Triggers whenever the garage door sensor changes state (no matter if door was opened or closed)
- Sends a push notification to my phone via the Home Assistant mobile app
To receive a reminder if the garage door has been left open for 10 minutes:
alias: Garage Door Status - Left Open 10 Minutes
description: ""
triggers:
- entity_id: binary_sensor.garage_door_status_garage_door
trigger: state
to: "on"
for: "00:10:00"
actions:
- data:
title: Garage Door
message: Garage door has been OPEN for 10 minutes.
action: notify.mobile_app_jeffs_phone
mode: single
This automation:
- Triggers only when the door has been open for exactly 10 minutes
- Sends a push notification to my phone via the Home Assistant mobile app
That’s everything, and it’s working great!