Native Home Assistant Garage Door Controller using Shelly 1 & MQTT Auto-Discovery
I wanted a reliable, cost-effective way to make my garage door smart without replacing the existing opener or relying on custom cloud integrations. I built a lightweight script using the Shelly Gen2+ Scripting API that turns a Shelly 1 into a native-feeling Home Assistant garage door cover entity over MQTT.
How It Works
- Relay Output (Dry Contact): Connected to the opener’s wall-button terminals to send a 500ms pulse for triggering open/close actions.
- Limit Switch Input: Mounted at the bottom of the door and connected to the Shelly SW input to detect the closed state.
- State Machine & Timeout Safety: Manages transitions like opening and closing. Includes a 30-second safety timeout—if the limit switch isn’t triggered within 30 seconds of closing, it reverts the Home Assistant cover state to open instead of showing a stale status.
- Zero YAML Setup: Automatically registers itself as a native cover entity in Home Assistant via MQTT Auto-Discovery as soon as it connects to your broker.