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

Assembly Process

  1. Starting state before making any modifications StartingState
  2. Solder header pins to the ESP8266 board - I soldered the male-to-female header pins to the D1 Mini board to provide connection points. BoardOriginal BoardAfterSolder
  3. Connect the Dupont jumper wires - Plugged the Dupont jumper wires into the female header sockets on the board at G (Ground) and D1 (GPIO5)
  4. 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 BoardMountedToGDoor BoardMountedToGDoor2
  5. Connect to plastic wire connectors - Joined the extension wires and the magnetic reed switch sensor together via plastic wire connectors SensorMountedToGDoor
  6. 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) SensorCloseup

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:

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:

That’s everything, and it’s working great!