Wi-Fi Garage Door Opener For Home Automation

Powered from the 24v control circuit of a garage door opener. It can control the door and sense if the door is open/closed

Similar projects worth following
Using an inexpensive wi-fi switch (a Sonoff SV in this case) I created a controller that is powered by the 24v control circuit of the garage door opener. It provides the signal to open/close the door (also a 24v signal) and also takes input from a door sensor to tell if the garage door is actually open or closed. This information, along with the wifi signal strength is relayed to Home Assistant and can be used to directly control the door or make automations that will control the door.

So, I got the idea from watching Dr. Zzz's video where he built his garage door controller (version 2) with a Sonoff SV. He was switching line voltage so he needed to remove a couple of resistors from the board to isolate the control/wifi circuit from the line voltage. Luckily, my garage door opener has a 24V control circuit so I can power the device and switch the signal to the door opener button without any additional power supply. Here's his video:
Also, this video was helpful in learning how to decouple the secondary switch input to use as a binary door sensor:

You need to decouple the secondary switch input as normally this would control the relay, and we don't want that. The relay is for opening/closing the door. I wanted to use the secondary switch input as a sensor to see if the door is physically open or closed. I used:

  • Sonoff SV (the low-voltage version of the basic), flashed with Tasmota.
  • Enclosure. The one I got was made for a Sonoff basic, I thought the mounting would be the same as for the SV but it wasn't *facepalm* I glued 4 lego blocks as mounting studs and mounted the board to that.
  • Wired reed-type door sensor.

Watch the videos and pay extra attention to the console commands needed in Tasmota to change the function of the SV. For me, I needed a momentary switch so that when the device is activated it powers the relay for 1 second (this can also be done in the automation if you prefer). You also need the console commands to decouple the secondary switch input switchtopic [name of your switch] and you can also set it to be NO or NC using switchmode2. See the second video or the docs here:

Getting it integrated in HA wasn't easy but a good learning experience. I changed the device type of the entity to a garage door and now the icon looks right and even shows open/closed. More work was needed to get it looking nice in Lovelace and working as a pushbutton. FYI, if you did the Tasmota configuration correctly, HA should discover 3 entities related to the device:

  • The switch itself
  • A wifi signal strength
  • Binary sensor (this is the one I changed the device type to garage to get the icons for open/closed working)


Video showing the door sensor working and the relay firing along with how it integrates with Home Assistant.

MPEG-4 Video - 5.10 MB - 05/25/2020 at 13:03


  • 1 × Sonoff SV Needs to be flashed with Tasmota firmware
  • 1 × Enclosure Big enough to fit the board and has at least one cable gland.
  • 1 × Door Sensor Reed-type magnetic door sensor, wired. Can be NO or NC.

  • 1
    YAML Code for Home Assistant Integration

    YAML code for customize.yaml to change the device class of the secondary switch (gives it the correct icon):

      device_class: garage_door

    YAML code for the display overview. This makes a large clickable button and the large icon will also change depending if the sensor sees that the door is open or closed.

      - entity: binary_sensor.garagedoorsv_switch2
        icon_height: 200px
        name: Press to Open/Close Garage Door
        show_icon: true
        show_name: true
          action: call-service
          service: switch.turn_on
            entity_id: switch.garage_door
        type: button
      - entities:
          - entity: sensor.garage_door_status
          - entity: switch.garage_door
          - entity: binary_sensor.garagedoorsv_switch2
        type: glance
    type: vertical-stack

View all instructions

Enjoy this project?



Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates