How to turn a humble Shelly 1 into a smart garage door controller that looks and feels native to Home Assistant.
We’all been there: your garage door opener works perfectly with a remote, but there is no way to control it from Home Assistant. Instead of spending a fortune on a brand-new opener, you can solve the problem with a Shelly 1 and a very small budget.
The following script turns the Shelly 1 smart relay into a full-featured garage door controller that integrates seamlessly into Home Assistant via MQTT. It uses a simple limit switch to detect the door’s closed position and controls the opener through the Shelly’s potential-free relay output. The relay is used to briefly pulse the opener’s trigger input—exactly as if you were pushing the physical wall button. No additional hardware required.
The Hardware Bridge
The setup is elegantly simple. The Shelly 1 acts as the “hands” and “eyes” of the operation:
- The Hands (Relay): Most openers have a terminal for a simple wall button. By connecting the Shelly’s potential-free relay to this input, we can simulate a button press with a brief 500ms pulse.
- The Eyes (Limit Switch): A simple limit switch mounted at the bottom of the door tells the Shelly when the circuit is closed—meaning the door is securely shut.
- The Brains (Script): This is where the magic happens. Using the Shelly Gen2+ scripting API, I wrote a controller that manages a proper state machine.

A Reliable State Machine
A simple “toggle” isn’t enough for a high-quality integration. If you send an “Open” command while the door is already opening, most openers would actually stop or reverse.
My script handles these nuances by tracking states like opening and closing. It even includes a safety timeout: if the door is told to close but the limit switch doesn’t trigger within 30 seconds, it assumes something is wrong and reverts the state to open in Home Assistant, rather than showing a stale, incorrect status.
Native Integration via MQTT
The best part of this setup is that it feels native. Thanks to MQTT Auto-Discovery, as soon as the Shelly connects to your broker, it introduces itself to Home Assistant as a cover entity. No manual YAML configuration, no guesswork—just a functional garage door card ready for your dashboard.
Get the Code
The full script, including detailed configuration options and the state machine logic, is available on GitHub. Whether you’re using a Shelly 1 Gen2, Gen3, or the latest Gen4, this script provides the robust bridge your “dumb” garage door needs to become a first-class citizen in your smart home.
Project Repository: https://github.com/mtasior/ShellyGarageDoor