Options for Garage Door Opener?

For a fairly simple, hard-wired solution I used this:

I power the driver module off the +5V on rPi and whilst the 4way driver is designed for Arduino, the logic on rPi is switching it no problem.


  • first I activate the correct gpio for the switch and sensor:

    switch pi:
    - platform: rpi_gpio
    invert_logic: False
    24: “Garage Door”

    binary_sensor pi:
    - platform: rpi_gpio
    invert_logic: False
    18: “Garage Door State”

And then I make some customisations to the switch. Namely, making it a momentary switch, so it makes brief (300ms) connection.As far as the sensor goes, I prefer reading “open” and “closed” as a status, rather than “on/off” which can be misleading.

  - platform: template
        value_template: "{{ False }}"
        friendly_name: "Garage Door"
          - service: switch.turn_on
            entity_id: switch.garage_door
          - delay:
              seconds: 0.3
          - service: switch.turn_off
            entity_id: switch.garage_door
          service: switch.turn_off
          entity_id: switch.garage_door

  - platform: template
        value_template: >-
          {%if states.binary_sensor.garage_door_state.state == 'off' %}
          {%elif states.binary_sensor.garage_door_state.state == 'on' %}
          {% else %}
          {% endif %}
        friendly_name: 'Garage Door State'

You’ll notice that I have used 4way relay driver, giving you the option to plug up to four garage doors/etc. Due to limitations of CAT5 (8 wires) I have only ended up using 3 of 4 relays. And here is the finished product, just a simple enclosure and voila.

The whole build cost me NZ$68.30 ~ US$50 (devide by 3 = $16 per channel ), with 4 relays (+ US$6) /4 = $14. Ignoring the cost of CAT5 that I had lying around.


I just ordered an Open Garage for $50.

I’m surprised no one has used this yet. It should be pretty easy to configure with a Rest Switch and Rest Sensor in Home Assistant.

I’ll post my config when it arrives.

It looks interesting, but @ $50 for one door it’s probably one of the more expensive options out there.

Really? I saw recommendations for Garadget which is almost double the cost. I haven’t seen any off the shelf products that are much less than this.
The solution you propose would likely end up costing more than $50. You have to factor in the price of a Rasp Pi, all those components, the wire, the breadboards, not to mention the time to get it configured in the software. Your opening sentence “For a fairly simple, hard-wired solution”, made me laugh after I saw the long explanation after it. We have different opinions on what simple means. :slight_smile:

There are a lots of options in this area. Different solutions for different people.


@swbradshaw there is no point to go thermonuclear on this. All I said it’s “One of the more expensive options”… perhaps “middle of the road would be better”.

My explanation is detailed, so anybody new to the subject can just copy & paste the code.

Rasp Pi is a sunk cost to me, as if you want to run my garage controller off homeassistant, I need it regardless. Everything else is calculated off the shop bill, to the last penny and it works out at about US$20 (factoring in the CAT5). This could have been even less, if I’d ordered the parts online, as my local jaycar electronics shop nearly doubles the price on most components used. Yes a bit of time is needed to configure hass, but if you desire to have “Open Garage” working with hass, you’ll need to do the same.

Of course there are horses for courses and each to their own. I actually started with Belkin Wemo Maker, which is (nearly) plug & play solution… all you need is a reed sensor for sensing the door closed/open, at the total sum of approx. US$64. That was my first stab at hass and home automation. A fortnight later I realised that there are much more cost effective solutions, hence I’ve gone with my solution above.

Now I’ve just started toying with the idea of using Wemos D1 Mini w/ relay shield for a wifi based garage controller (or any other project that needs a relay and a sensor). The costing is likely going to be sub US$10… of course not an off-the shelf product…

Look at the Sonoff SV https://www.itead.cc/smart-home/sonoff-sv.html
Flash the Tasmoto firmware by arendst GitHub - arendst/Tasmota: Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at

Just need a magnetic reed switch and could probably do that for $10 USD.


I wanted to follow up on the Open Garage. As the name suggests, its open source (hardware and software). I bought the first one from them, but for my other garage I ended up building my own with their source (flashing to ESP8266 chip). That cost was under $10. If you are still looking at D1 mini, its a firmware to checkout. At some point I’ll commit my OpenGarage cover component to HASS so it will be supported.


Thanks for that. I’ve now got a bunch of ESP8266 devices myself and it will be interesting to see what your software does and can be used for.

So finally after months of getting distracted with other jobs, I’m getting to our sub-ten-bucks garage opener. I’ve used Wemos D1 mini, relay shield and a little custom board, for the sensor connections, plus a reed switch. As @HickHackerz suggested I used the arendst/Tasmota firmware to power the device. A little mind boggling to workout how to connect the sensor, though it might have been due to me trying to work it out at 2am.

Otherwise, Tasmota is grand firmware, especially on the Wemos. It comes with a webserver built in, so you can customise a lot of the parameters in your browser, it supports a MQTT messaging and OTA updates. The Wemos D1 mini sports a pull-up resistor on GPIO0 (and GPIO2, though that is used by the relay shield) and a pull down on GPIO15 (more about wemos d1 mini pin outs).

UPDATE: Don’t use the GPIO0/2 for the reed sensor, as it crashes the wemos on reboot. Instead use a 10k pull up resistor and say GPIO16/pin D0.

So now back to costs:

  • reed switch - ~ $1
  • Wemos d1 mini - $4
  • Relay shield - $2.10
  • Custom board- ~$1.50 (much less from China, but I bought the terminal point at a local shop)
  • 5VDC microUSB source - $3 (from IT recyclers)
  • Cable… probably the most expensive item @ $0.56/m.
  • Case - let your imagination go wild… a plastic box from screws.

Total cost $11.60 plus cable, depending on distance from your reed switch. Provided that you bargain down your local thrift store,etc and get your microUSB charger cheaper and source the custom board bits from the Far East, sub-$10 garage opener is ( in Mythbusters’ words) PLAUSIBLE!

UPDATED: The custom board in the above image has been rewired and equipped with a 10k resistor, as in the image below. Apologies for the horrible wiring…


I’ve used a Xiaomi WiFi plug ($10), a $12V DC adapater ($3), and a 12V NO automotive relay ($6).

Under $20 solution provided you have a couple of lengths of wire and some crimp connectors already. If not add another couple of $. Extremely simple to setup. The hardest part was getting the wifi plug integrated into HA. But after that we were away.

This won’t give you open/close detection however I already had a Xiaomi gateway, so added a Xiaomi door sensor for a few more $

Those who want to avoid soldering and long wires, please consider open-source controller Garadget starting at $69. Latest firmware supports direct MQTT integration with Home Assistant.

Question? AMA.

1 Like

Would you be so kind to link the electrical components that you mentioned? And maybe explain a bit further how its all connected?

I also have Xiaomi gateway and their switch laying around. Garage motor is Hormann. I know the motor has a connector for external switch but I’m not clear on how it would work with 220v xiaomi wireless switch.

Hi. What is the custom board connected to on the terminals? I recon that the D1 Mini gets 5V from usb-mini, and that the relay controls the garage-door-opener (either NO or NC).

I used a Olimex esp8266-evb and control it directly from HA using rest. I originally use mqtt to control it, but switching to rest made it much more responsive. This was my first project using the ESP8266 and having a board complete with the relay and power jack made it super simple.

The custom board is there for the reed switch/sensor to detect open/close state of the door.

1 Like

Shameless plug for GarHAge: https://github.com/marthoc/garhage. Version 2.0.0 will be out this week with full support for MQTT discovery in Home Assistant, meaning you build it, put in your wifi info, connect to your garage door opener, power it, and entities will pop up in HA automatically.

1 Like


I followed the instructions in this video:

Except, obviously I used the Xiaomi smart switch instead of the WeMo:

This is the relay I used - although anything rated for 12V should be fine.

I had a 12V adapter spare, just like the one in the video.

This is my automation.yaml:

- action:
    - service: switch.turn_on
      entity_id: switch.garage_door_smartplug
    - delay: 00:00:01
    - service: switch.turn_off
      entity_id: switch.garage_door_smartplug
    - service: input_boolean.turn_off
      entity_id: input_boolean.garage_door
  alias: Toggle command switch to control GD
  id: '246864543689754'
    platform: state
    entity_id: input_boolean.garage_door
    to: 'on'

And this is my configuration.yaml:

# Smart Plug controlling garage door opener circuit
switch garage_relay:
  - platform: xiaomi_miio
    name: Garage Door SmartPlug
    token: <token goes here>

# Front end switch for garage door
    name: Garage Door Opener
    initial: off
    icon: mdi:flash-circle

Hope that helps

1 Like

Thanks a lot mate!

I really appreciate the effort :slight_smile:


Hi. Just want to say that I installed my @garadget last night and it’s great so far (short time, I know).
I had been planning to build something much cheaper myself, but after 2 years of “planning”, I realised I should just hurry up and buy something… Sweet.

I would have appreciated a more “all in one place” guide to setting it up in HA. I had to read too many posts to get it to work. I copied the sensor config, then found I could just set up the cover properly and it works as a sensor - and means I can ask Siri if the door is open and it knows (so I removed the sensor).

1 Like

Happy to hear you were able to configure Garadget to your satisfaction.
Please share your final setup so it can serve as all-in-one guide or a starting point for something custom.