ESP ZeroCode AI · Community

Wiring diagram for Garage Door 2

Garage Door 2

opens and closes my garage door from my phone. it should also tell me if the door was left open, because I keep forgetting to close it when I drive off

ESP32-C6 matter
Download the firmware

What it does

Manual

Device Type
Garage door controller retrofit — opens/closes an existing garage door opener from the phone and reports whether the door is actually open or closed. Mounts near the opener, wired in parallel with its wall button, powered by USB.

Hardware
chip: esp32c6 — board: ESP32-C6-DevKitM-1 — gpios: GPIO0: relay coil drive (active-high pulse ~1s per toggle) — GPIO1: reed switch input (internal pull-up; closed circuit = door closed) — GPIO2: status LED (active-high) — peripherals: part: Relay module (1-channel, coil 3.3V/5V) — role: pulses the opener's wall-button terminals; contacts wired in parallel with the existing wall button · part: Magnetic reed switch + magnet — role: door position; magnet on the door panel, switch on the track · part: Status LED — role: commissioning / connection state

Inputs
kind: door position — label: Reed switch — hardware: Magnetic reed switch on GPIO1 (pull-up, active-low closed) — behavior: Circuit closed when magnet is near (door shut), open when the door moves away (door open). State reported live to the Matter contact-sensor endpoint; changes reflected in Apple Home / Google Home. · kind: remote command — label: Matter on/off command — hardware: Matter Switch endpoint over Wi-Fi — behavior: Each 'on' or 'off' command pulses the relay ~1s, toggling the opener exactly like the wall button. The switch's on/off state is cosmetic (every command is a toggle pulse).

Outputs
kind: relay pulse — label: Opener trigger — hardware: Relay, contacts across the opener's button terminals — behavior: 1s closure per command. Wall button keeps working in parallel; the opener's own safety beam / auto-reverse logic remains fully in charge. · kind: status LED — label: LED — hardware: GPIO2, active-high — behavior: Breathing/fast-blink while uncommissioned or commissioning; solid or slow blink once connected; brief flash per relay pulse. (Exact pattern finalized at build.)

Connectivity
stack: matter — transport: wifi — purpose: Control + state reporting to Apple Home / Google Home (commissioned via Matter QR code / manual pairing code)

Commissioning
method: Matter QR code + manual pairing code (standard ESP-Matter commissioning) — payload: QR code shown/printed on the device label; commissioning via Apple Home or Google Home app — instructions: Plug in device over USB; open Apple Home or Google Home; scan the Matter QR code (or enter the manual code); add to home. Two accessories appear: the switch (door control) and the contact sensor (door state).

Business Logic
powerOnBehavior: On power-up: initialize Wi-Fi/Matter, read reed switch and report current door state, light the status LED. No door motion on boot. — automationRules: rule: Left-open warning — trigger: Contact sensor reports open and stays open for 10 minutes — action: User-set automation in Apple Home / Google Home sends a push notification ('garage door left open'); user closes it from the phone. No auto-close. — note: Matter has no device-initiated push channel, so the 10-minute alert is a one-time ecosystem automation based on the contact-sensor state. — dayToDayOperation: Open/close the door from the phone anytime (single tap); check door state in the home app; get a notification if left open. The wall button still works as always. Garage door is just one of two Matter accessories in the home app.

Factory Reset
trigger: 5× rapid power cycles within ~10s (or Matter 'remove device' via the home app) — effect: Clears Matter fabric/commissioning data and returns to uncommissioned state (status LED blinks to invite re-pairing).

Failure Modes
scenario: Wi-Fi down / internet outage — behavior: Door control unavailable remotely; local Matter operation may still work if the home hub is on the same LAN. Device keeps monitoring the reed switch. · scenario: Cloud unreachable — behavior: No notifications; home-app status may show offline. Device continues to report state when connection returns. · scenario: Power blip — behavior: Device reboots, reconnects, re-reads door state and reports it. No unintended door motion (relay only pulses on an explicit command). · scenario: Reed switch fails / magnet misaligned — behavior: Door state reads wrong or stuck; the switch may need realignment. User can still operate the door via the switch endpoint. · scenario: User commands while door already open/closed — behavior: The pulse still fires and simply toggles the opener — same as pressing the wall button twice.

Power Management
batteryPowered: false — powerSource: 5V USB wall adapter (USB-A to micro-USB/USB-C on the devkit)

Custom Behavior
None beyond the switch+contact-sensor dual-endpoint presentation required because Matter 1.4 lacks a native garage-door device type.

Published 18 Aug 2026
Built with ESP ZeroCode AI — describe a device, get production firmware.
Terms of Service · Privacy Policy