This is a basic configuration and the configuration I have at home for my garage opener with notifications if still open after 10 minutes. I also have an automation to turn on the garage light after the garage is open I am also in the process of adding a motion detector to turn the garage light on if some does in the garage.
ESP Home Garage door yaml file
esphome: name: garagedoor platform: ESP8266 board: esp01_1m wifi: ssid: "SSID NAME" password: "Wireless Password" captive_portal: # Enable logging logger: # Enable Home Assistant API api: ota: binary_sensor: - platform: gpio pin: number: GPIO14 mode: INPUT_PULLUP inverted: True name: "Garage Door" device_class: garage_door switch: - platform: gpio pin: GPIO12 id: relay - platform: template icon: "mdi:arrow-up-down-bold-outline" name: "Garage Control" turn_on_action: - switch.turn_on: relay - delay: 500ms - switch.turn_off: relay sensor: - platform: wifi_signal name: "Garage Door WIFI Strength" update_interval: 60s
Garage door notification
- id: '1579945774774' alias: Garage door description: '' trigger: - entity_id: binary_sensor.garage_door for: 0:05:00 from: 'off' platform: state to: 'on' condition:  action: - data: data: attachment: entity_id: push: category: Sensor message: Garage door still open!! title: Garage door service: notify.mobile_app_pixel_3
Light on/off after 10 minutes
automation: - alias: Turn on garage light when opened trigger: platform: state entity_id: binary_sensor.garage_door to: 'on' action: service: light.turn_on entity_id: light.garage_light - alias: Turn off garage light 10 minutes trigger: platform: state entity_id: binary_sensor.garage_door to: 'off' for: minutes: 10 action: service: light.turn_off entity_id: light.garage_light