WiFi Controlled Garage Door for CHEAP

I originally was looking for a solution for a WiFi controlled garage door over Home Assistant. Looking lately into utilizing D1 Mini’s for things, this seemed to be perfect. I followed the link below for the guidance on what I’d need to complete the task. Once you get the following supplies together, I ended up using the code below to upload to the D1 Mini for interacting with it over the WiFi. Then connected to it with Home Assistant.

Thanks to Khaz.me for the guidance: https://khaz.me/cheap-and-easy-home-assistant-garage-door-control/ Be sure to also check out their link here.


Using a Soldering Iron and some solder, take a look at how I soldered together the D1 Mini and Relay shield with the headers that are included with the D1 Mini. Khaz.me has a good schematic on what to wire up and how. Simplest explanation I found during my research. They ended up using a 12v -> 5v adapter, however I ended up just using the Micro USB power on the D1 for power.​

Main thing to keep in mind is there’s a sensor for whether or not the garage door is open. Then there’s an independent switch configuration in the YAML below for “triggering” the relay. Which simulates pressing the button to open a garage door. Then the other options are mainly for configuring the D1 Mini for WiFi, rebooting the device, and logging, etc..

Below, you’ll find the YAML code to upload to the D1 Mini over the appropriate COM port via Micro USB cable. After that, once it’s on the network, I used the ESP_Home integration on Home Assistant to connect it all up. After all of this you should have a WiFi controlled garage door!

  name: garage_door_opener
  platform: ESP8266
  board: d1_mini

  ssid: "SSID_HERE"
  password: "PASS_HERE"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
    ssid: "Garage Door Opener"
    password: ""


# Enable logging

# Enable Home Assistant API
  password: "PASSWORD_HERE"

  password: "PASSWORD_HERE"

- platform: gpio
    number: GPIO13
    mode: INPUT_PULLUP
    inverted: False
  name: "Garage Door Sensor"
  device_class: garage_door
    - delayed_on: 20ms

- platform: gpio
  id: relay
    number: GPIO5
    inverted: False
  restore_mode: ALWAYS_OFF

- platform: template
  name: "Garage Door Switch"
  icon: "mdi:garage"
  - switch.turn_on: relay
  - delay: 1s
  - switch.turn_off: relay

- platform: restart
  name: 'Garage Door REBOOT'

    number: GPIO2

Leave a Reply

Your email address will not be published. Required fields are marked *