Make Your Own Smart Garage Door Opener for $15

You can buy a smart garage door opener for your home, but it will cost you more than making one. With just a little bit of effort and a few bucks, you can make your own using a Shelly 1 Wifi relay. If you have a more advanced garage door opener, you may need to use this technique instead.)

The Shelly 1 installed as a smart garage door opener control
Shelly 1 Smart Garage Door Opener

Why would you DIY your smart garage door opener?

You can go out and buy a device that makes your garage door smart, but it might cost you. Some of the more popular commercial options include:

These commercial units run on the expensive side. Although the price is certainly an issue, the bigger problem is that these garage door openers require Internet access to work, and send your open and close information to the cloud. I’d rather keep that information locally, or at least have the option to do so.

This led me to look at more do-it-yourself solutions. In fact, I implemented a DIY solution using a Z-wave relay and a Z-wave tilt sensor a few years back. Although that solution has been reliable, I wanted to try something new, and maybe even save some money. Some other DIY/non-cloud options include:

These all seem okay. In the end, I decided to go a little more DIY and use my trusty Shelly 1 device that I used to make my light switch smart. A 2 pack of them can be had for less than $25, which is much less than any of these options.

What you’ll need to make it

It’s possible to get this project done really cheap, depending on what materials and tools you already have. Here’s what you’ll need:

  • Shelly 1 Smart Relay – See my review of it and how I used it for a light switch for more details. This will be the brains of the smart garage door opener. Note, you can also do this project with the newer Shelly 1 Plus.
  • Doorbell wire or equivalent – You may have some wire you can use already. This will be used to connect the Shelly 1 to the garage door opener.
  • 12V DC adapter – In my case I had one lying around from an old Netgear router. You can also use the one I’ve linked without even cutting the wire. This will be used to power the Shelly 1.
  • Good 2.4Ghz WiFi signal where you will put it – The Shelly 1 is controlled over WiFi.
  • Advanced: A connected (e.g. Z-wave or Zigbee) tilt or door sensor and home automation software (like Home Assistant). This will allow you to know whether the garage door is open or closed along with being able to open and close it. More on this later in the article.
12V DC Adapter from old router
12V DC adapter from old router
Shelly 1 Wifi Smart Relay
Shelly 1 Wifi Smart Relay

Making your smart garage door opener

Let’s start with a diagram of what you are going to build:

Wiring diagram for Shelly 1 smart garage door opener
Wiring diagram for Shelly

Editor’s Note: Here are instructions for wiring the newer Shelly Plus 1 smart relay.

Step 1: Prepare the 12V DC Adapter

First, shift the source voltage jumpers on the Shelly 1 into the position for 12V DC. By default, the Shelly 1 is set to take in mains AC voltage or 24-60V DC. For this project, we are using a safer low voltage of 12V DC.

See also  Zyxel NWA50AX: A Wi-Fi 6 Access Point For Less

Cut and strip the adapter. Then plug into relay pins L (-) and N (+).

Step 2: Prepare the doorbell wire

Cut a sufficiently long piece of the doorbell wire. It needs to be long enough to connect the Shelly 1 and the garage door opener relay terminals from the spot where you will power and mount the Shelly 1. Then, strip the wires and plug them into I and O inputs.

When you’re done, it should look similar to this:

Shelly 1 Relay connected to doorbell wire and 12V DC adapter. The beginnings of your smart garage door opener
Shelly 1 Relay connected to doorbell wire and 12V DC adapter

Step 3: Power your Shelly 1 and configure

Now it’s time to configure the relay. Plug in 12V DC Adapter. When the Shelly 1 first boots up it starts up in WiFi AP mode. This allows you to connect directly to the device via its WiFi network.

With your tablet, phone, or laptop connect to the Shelly 1’s local wifi. It should look something like shelly1-12AB34 (the last six characters will be different). After connecting, open a browser and connect to 192.168.33.1. This should bring up the relay’s configuration page.

Second, configure the Shelly 1’s WiFi connection (Internet & Security->Settings) to connect to your home network. BTW, I highly recommend isolating your IoT devices from the rest of your network. I also recommend either setting a static IP on the Shelly device or setting up a static lease from your DHCP server (usually your router).

Shely 1 Relay Wifi Configuration for smart garage door opener
Shely 1 Relay Wifi Configuration

Next, I recommend you update the firmware (Settings->Update Firmware). Then, configure the Shelly to turn off after turning on (Timer->Auto Off). If you leave it on, the button to open your Garage door will not function. I set mine to .5 seconds.

Configre Auto-Off for the relay
Configure Auto-Off for the relay

I also recommend setting the relay to be off by default. (Settings->Power On Default Mode). If you lose power then your garage door will start in a state where you can use the buttons.

Now would be a good time to test the relay. There is a power button at the top right of the web interface. If you have configured it correctly when you press the button it should turn blue and you should hear a click. Shortly thereafter the relay should turn off and the power button should go back to normal.

Editor’s Note: Depending on your setup, you may experience reduced range for your garage door opener. Here is how you might be able to improve your garage door opener range.

Load WordPress Sites in as fast as 37ms!

Step 4: Connect to the garage door opener

Let’s connect the Shelly 1 to the garage door opener. Before plugging in the 12V DC adapter, connect the doorbell wires in parallel (into the same openings) to the wires coming from the button that controls your garage door opener. You may need to look at the garage door opener manual if you aren’t sure where to plug in.

Now, plug in the adapter and wait a few seconds for the Shelly to boot up. Connect to the web interface, and click the power button. Your garage should open (or close if it was already open). The power button should behave just as if you pressed the garage door opener button.

Smart Garage Door Opener connected up, before mounting
Smart Garage Door Opener connected up, before mounting

Congratulations! You’ve made a smart garage door opener! The Shelly is pretty easy to mount because it is so small. Put it someplace safe and secure.

Step 5 (optional): Configure cloud access and app

You may be content to control the garage door using the web interface. However, you’ll have to be on your network to open and close the garage door. However, the Shelly 1 relay has cloud capability and an app.

Go into the web app and enable cloud control (Internet & Security->Cloud). Then download the Shelly Cloud app, register, and follow the instructions. Now you can open and close your garage door from anywhere.

See also  Neo Siren Alarm Review (Z-Wave)

Advanced: Connect to Home Assistant using MQTT with Tilt Sensor

If you use Home Assistant like me you’ll want to integrate control of the smart garage door opener with the rest of your smart home. Here’s how to use MQTT, a tilt sensor, and Home Assistant to make your DIY garage door opener even smarter. If you need to know more about setting up MQTT and integrating it with Home Assistant, I’ve got you covered.

Step 1: Enable MQTT on Shelly 1

First, enable and configure MQTT via the Shelly 1 web interface (note, this will disable cloud access). Go to the “Internet & Security->Advanced – Developer Settings” and:

  • Click the check mark to “Enable action execution via MQTT” (note this will disable cloud access. It’s one or the other)
  • If you secured your MQTT broker enter its username and password
  • Under “Server:” enter the IP address of your MQTT broker along with its port (usually 1883). Separate the IP address and port with a colon.
  • Save these settings
Shelly 1 MQTT Configuration Page

Take note of the “Will Topic.” This is the MQTT topic that communicates whether or not the Shelly is up and running. Note the 6-character string following “shelly-” in the will topic. You’ll need this to create the Home Assistant config.

Step 2: Configure Home Assistant cover

I have a Z-wave tilt sensor installed on the garage door that tells me when the door is open and when it is closed. This Home Assistant configuration would work similarly with a door sensor.

Home Assistant Configuration Part 1: Create the Cover

First, you need to add code to your configuration.yaml similar to what’s below for your MQTT cover.

cover:
  - platform: mqtt
    name: "Garage Door"
    state_topic: "home-assistant/garage/state"
    command_topic: "shellies/shelly1-xxxxxx/relay/0/command"
    availability_topic: "shellies/shelly1-xxxxxx/online"
    retain: false
    payload_open: "on"
    payload_close: "on"
    payload_stop: "on"
    state_open: "open"
    state_closed: "closed"
    payload_available: "true"
    payload_not_available: "false"

Replace the xxxxxx in the topics with the ID of the Shelly you noted in the web interface will topic. Let’s dissect the important pieces of this code:

  • The entity id of your garage door cover will be what you put in the name field (spaces replaced by underscores).
  • The “state_topic” is the MQTT topic that tells Home Assistant if the garage door is open or closed. You’ll need an automation that updates this topic based on the tilt sensor status in the next section.
  • The “state_open” and “state_closed” define the values Home Assistant is looking for in the “state_topic” to determine whether or not the garage door is open or closed.
  • The “command_topic” controls the Shelly 1 Relay. Sending payload_open (“on”), payload_close (“on”), and payload_stop (“on”) to this topic open, close, and stop the garage door. They are all the same message (“on”) because the garage door only responds to the relay opening and closing.
  • The “availability_topic” tells Home Assistant whether or not the Shelly relay is working. It should be the same as the “Will Topic” in the Shelly web interface referenced earlier. You can learn more about MQTT will topics (last will and testament) here.
  • The “payload_available” and “payload_not_available define the value Home Assistant is looking for in the “availability_topic” to determine whether or not the Shelly 1 relay is online.
  • The retain: false setting tells Home Assistant not to have the MQTT broker retain messages. I don’t think any commands need to be retained.

Home Assistant Configuration Part 2: Update the Garage Status

We also need to add an automation for the tilt sensor to update the “state_topic” when the garage door opens and closes. Place the following (with updates for your specific sensors and topics) in your automation.yaml file:

- id: mqtt_garage_door_status
  alias: 'MQTT Garage Door Status'
  trigger:
    platform: state
    entity_id: binary_sensor.garage
  action:
  - service: mqtt.publish
    data_template:
      topic: 'home-assistant/garage/state'
      payload_template: "{{ 'open' if states.binary_sensor.garage.state =='on' else 'closed' }}"
      retain: true

This automation triggers when the state of the tilt sensor changes. If the sensor switches the “on” state it sends “open” to the topic indicating the garage door is open. Otherwise, it sends “close.”

Home Assistant Configuration Part 3: Make sure the smart garage door opener is available at startup

It seems the Shelly relays don’t always send or retain the message that indicates to Home Assistant that they are available. Thus, when Home Assistant restarts, it doesn’t always mark the cover (garage door control) as available. To fix this we force the Shelly relays to announce themselves using the automation below:

- id: mqtt_shelly_announce
  alias: Shelly Sync at HA Start
  trigger:
  - platform: homeassistant
    event: start
  action:
  - delay: 00:00:20
  - service: mqtt.publish
    data:
      topic: shellies/command
      payload: announce

Home Assistant Configuration Part 4: Make it look good in the UI

Home Assistant has a special device class for covers to make them appear as garage doors in the UI. You just have to add the following to your customize.yaml:

cover.garage_door:
  device_class: garage

And then you’ll get icons that look like this when the garage door is open and closed:

Home Assistant Smart Garage Door Opener User Interface
Home Assistant Garage Door User Interface

Final Thoughts

You can use the Shelly 1 to make a garage door opener smart in addition to a smart light switch or a smart gas fireplace switch. You could buy a commercial smart garage door opener, but using the Shelly 1 relay is easy and affordable. Whether or not your information goes to the cloud is under your control. It works even when your Internet connection is down. This also makes for a good DIY project that will take less than 30 minutes. Adding it to a home automation controller like Home Assistant is the icing on the cake.

See also  Meross MS400 Smart Leak Sensor Review

Also, if you want to add secure control of your garage door from the outside, take a look at this project of using a fingerprint scanner to open and close your garage door.

Note, if this technique doesn’t work for you because you have a Security+ 2.0 or similar garage door opener, then this article I wrote about handling this situation is for you.

Editor’s note: Here’s how you can power your entire smart home using Shelly products.

Interested in supporting HomeTechHacker?

Have you found the content on this site useful? If so, are you interested in supporting me and this site? There’s no obligation of course, but I would really appreciate any support you can give. Below are a few ways you can show support:


Thank you! I really appreciate it!

This page contains affiliate links. If you purchase an item using an affiliate link I will receive a small commission at no cost to you. Affiliates do not influence my recommendations. Read my disclosures for more information.

Share this:

Make Your Own Smart Garage Door Opener for $15

by HomeTechHacker time to read: 9 min