Garage Door ESPHome

From Tyrel's Wiki

Bill of Materials

Schematic

Garage door schematic.png

(Note Pin names, not locations. Not accurate to NodeMCU)

Home Assistant Parts

ESPHome

Relay For Switch

My garage door opener is from the 80s, so I tossed a relay on a nodemcu on pin D1. I close the switch for 500ms, open for 500, then repeat. This sends two pulses to the opener to tell it to open.

 switch:
  - platform: gpio
    pin: D1
    id: relay
  - platform: template
    name: "Garage Remote"
    icon: "mdi:gate"
    turn_on_action:
    - switch.turn_on: relay
    - delay: 500ms
    - switch.turn_off: relay
    - delay: 500ms
    - switch.turn_on: relay
    - delay: 500ms
    - switch.turn_off: relay

Sensor for if door closed

On the same board, I have a magnetic switch on the top of my garage door that when the door is down the magnet is closed. With this I can conditionally tell my HomeAssistant that my door is closed.

 binary_sensor:
  - platform: gpio
    pin: 
      number: D7
      inverted: true
      mode: INPUT_PULLUP
    name: "Garage Door Closed"

Lovelace

When the door is closed, I have this conditional card, which shows a picture of my garage door, and says "Closed", and then for the closed state I negate the "on" and change the url.

type: conditional
conditions:
  - entity: binary_sensor.garage_door_closed
    state: 'on'
card:
  type: picture-glance
  title: Garage (Closed)
  image: 'https://tyrel.dev/house/garage_door.jpeg'
  entities:
    - entity: switch.garage_remote
  hold_action:
    action: none

Lovelace Card - garage door closed.png


External Links =

IG Post of Garage Door Wiring