Illustration: Open your garage door from your phone with ESP32, ESPHome and Home Assistant

AI-generated illustration

Updated 24 October 2026 By Emmanuel SAUVAGE

Open your garage door from your phone with ESP32, ESPHome and Home Assistant

Safe dry-contact wiring on the opener’s push-button input, reed sensor for open/closed, Home Assistant cover entity—with security warnings.

Also available in French.

Control the garage from your phone and know if it stayed open: a relay in parallel with the wall button sends the same short pulse as a physical press; a reed switch reports closed when the door is down. Home Assistant shows a garage cover in the mobile app.

Safety — read first

  • Confirm in the opener manual a dry-contact / momentary push-button input (low voltage). If the manual does not describe it, stop.
  • Never work on mains inside the opener unless you are qualified—power off before opening the housing; wire only the low-voltage button terminals.
  • Keep photo eyes, force limits and obstacle detection—never bypass them.
  • Remote access: use Home Assistant Cloud, Tailscale or VPN—not a naked port forward. Enable 2FA on accounts.
  • Add confirmation in the dashboard before toggling—pocket taps are real.
  • Only operate remotely when you are sure no one is under the door.

Goal

  • Toggle from Home Assistant with confirmation.
  • True open/closed state from reed.
  • Alert if open too long.

Time, level, parts

TimeLevelParts
2–3 hIntermediateESP32, 3.3 V-compatible relay module, wired reed, USB 5 V supply
  • ESP32 DevKit — UK · US
  • 1-channel relay that triggers on 3.3 V logic (many “5 V” boards fail on ESP32 GPIO)—UK search · US
  • Wired door reed — UK · US

A Shelly in dry-contact mode can substitute for the relay if you follow that device’s manual the same way.

Wiring

PartPinTo
Relay VCCESP32 3V3 (or 5 V per module spec)
Relay GNDGND
Relay INGPIO26
Relay COM / NOdry contactOpener button terminals (parallel with wall button)
ReedGPIO27 + GND (internal pull-up)

Reed closed when door fully down (magnet aligned).

ESPHome

Install ESPHome add-on. Use secrets for Wi-Fi and API keys. Download the full example: /code/esphome/porte-garage.yaml.

Core behaviour:

  • Pulse relay ~700 ms (adjust 0.5–1 s per opener manual)—never latched (restore_mode: ALWAYS_OFF).
  • Template cover: open_action only if reed says closed; close_action only if open—so “open” on an open door does not start closing by mistake.
  • Script mode: single debounces double taps.

Flash USB first: esphome run porte-garage.yaml; then OTA.

Home Assistant UI

Dashboard button with confirmation:

type: button
entity: cover.garage_door
name: Garage door
show_state: true
tap_action:
  action: toggle
  confirmation:
    text: "Operate the garage door?"

Alert if open 15 minutes—adapt entity ids to yours.

After power loss

Firmware runs on the ESP32; relay defaults off at boot—power glitch should not pulse the door.

Common mistakes

  • Relay on power terminals instead of button input.
  • Relay that needs 5 V on IN while ESP32 outputs 3.3 V.
  • Pulse too long.
  • Exposed HA on the internet without VPN/TLS.

Verification note

YAML was validated with esphome config / compile (ESPHome 2026.9); we did not install on a live door—your opener manual is authoritative.

Docs: ESPHome template cover · HA remote access.

Also: ESPHome temperature · door reed on Pi · ESP32 projects.

All smart-home guides

Have a question about this guide or need advice? Ask us here

Torn between two models or stuck on a build? Drop us a line and we will get back to you by email.