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.

Supplies

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!

esphome:
  name: garage_door_opener
  platform: ESP8266
  board: d1_mini

wifi:
  ssid: "SSID_HERE"
  password: "PASS_HERE"

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

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: "PASSWORD_HERE"

ota:
  password: "PASSWORD_HERE"

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

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

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

- platform: restart
  name: 'Garage Door REBOOT'

status_led:
  pin:
    number: GPIO2

Leave a Reply

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