Web Gate Opener v2
ESPHome gate control through Home Assistant — web UI that presses the same Lovelace buttons.
HA-Native Gate Control
v1 talked to a Raspberry Pi / HTTP sensor API. The live hardware is now an ESP32-C3 flashed with ESPHome and joined to Home Assistant — so the web panel had to grow up with it.
v2 is the default. It presses the same entities Lovelace uses: button.gate_gate_opener_open and button.gate_gate_opener_close. Newer versions always supersede older ones as the default control surface.
What Changed
Control plane
The Next.js app calls Home Assistant’s REST API (POST /api/services/button/press) with a long-lived token. No more open↔close swap hacks, no dependency on dead ESP HTTP routes.
Hardware path
ESPHome YAML on egypt defines GPIO pulse relays for open/close (500ms) plus wall buttons. HA sees them as template buttons; the web UI is just another client on that bus.
Versioning
“/” is always the newest app. Legacy sensor HTTP UI remains at /v1 for rollback. Portfolio project pages follow the same rule: highest version wins unless ?version= is explicit.
Architecture
Browser → Gate Opener Web (v2) → Home Assistant (host network :8123) → ESPHome API → ESP32-C3 relays → gate motor contacts.
Status polling reads HA entity states so the panel shows Ready vs Needs setup. Discord notifications still fire after successful open/close.
Outcomes
One control plane for wall buttons, Lovelace, and the web/mobile UI. Firmware and automation stay in ESPHome/HA; the web app stays a thin, versioned client.