Garage Door SV (ver 2)

One of the first things I actually automated in my Home, was the garage door.  Making your garage door “smart” makes a lot of sense because there are some useful things you can do with it.


To Smarten up your garage doors you’ll need:

  • Sonoff SV
  • Reed Switch
  • USB cord and wall plug or some other power adapter
  • Jumper wires
  • Soap dish
  • There is soldering involved. No way around it on this one


Garage SV setup

  1. Open sonoff.ino
    1. Set a project name and your Wifi and MQTT info in user_config.h
  2. Upload Tasmota
  3. Find the IP address of your new Tasmotized Sonoff (you can look in your router)
  4. Put the Sonoff IP address in your browser, go to Configuration Configure Module and and change the Module Type to Sonoff SV. Save and it’ll restart.
  5. Go back into Configure Module and set GPIO 14 to Switch2 save and it’ll restart again
  6. Click Console and type: switchmode1 0 and then switchmode2 2, restart one more time


Now we’ve got some work to do in Home Assistant

  1. Open configuration.yaml
  2. Make a heading called “cover:” and paste these lines


 – platform: mqtt

   name: “test”

   state_topic: “cmnd/2/POWER2”

   command_topic: “cmnd/sonoffSV04/POWER”

   payload_open: “ON”

   payload_close: “ON”

   payload_stop: “ON”

   state_open: “ON”

   state_closed: “OFF”

   optomistic: false

   retain: false


  1. Under Customize: set the device class and give it a friendly name


     device_class: garage

     friendly_name: Justin Garage


  1. If you want to make a card that says Garage Doors instead of Cover then open your groups.yaml.  If you don’t have one just create and new empty file with that name and past these lines.


     name: Garage Doors

     view: no

     control: hidden

     icon: mdi:garage


       – cover.test


  1. Save both config and groups. In Home Assistant UI check the config and restart.
  2. Now go to the Automation editor, make a new automation. The trigger is the MQTT topic that fires whenever the relay is turned ON. The action is to turn it back off after one second. Save and reload Automations.


Now the hardware setup:

  1. To isolate the power to the ESP chip from what’s being switched by the relay, use a small screwdriver to pop the 2 resistors.
  2. Solder 2 lengths of small wire, one on the Input + and one on the output +, these wires will connect to the switch contacts on your garage door motor.
  3. Connect female end of jumper wires to GPIO 14 and Ground. These are going to the reed switch and will tell you if the garage is open or closed.
  4. Use a USB cable for power. The red wire is + and the uncovered wire and the outer metal sheath are negative.
  5. Connect those to female jumpers and plug them into + and – for the ESP chip.



  1. Lay it out. Connect the reed switch, power up the board, and open Home Assistant.
  2. Move the magnet to test the reed switch
  3. Click the open/close buttons to check the relay.
  4. If it all works it’s time to install



I put mine up near the garage motor. You don’t have to do it this way.

  1. Mount the reed switch. I put mine on the track and the magnet on the top of the door.  Took a few tries to find something that would keep them connected. There’s a lot of motion on that track.
  2. Find the contacts for your open/close button. Connect the wire from the input side of the relay to one contact, and the wire from the output side to the other. It doesn’t matter which.
    1. On my garage door those wires are 12v.
  3. Connect the +/- jumpers from the USB cord, for power to the ESP, and plug it in.
  4. If all went well you’re done!
  5. Automations to check the garage door at a certain time. Refer to other video. Make sure names match.

I’ve tried to do presence detection to open the doors as I pull up to the house. But it hasn’t been very reliable. If anyone has a good solution I’d love to hear about it.


So there it is, from the ashes of a failed battery button comes the SV garage door Phoenix.


Similar Posts