How can I have an automation trigger 5 minutes after a binary sensor changes to a given state?
I have a laser emitter / sensor that I’m planning to install just inside my garage door at bumper height. My plan is to use esphome so HA knows if the door is clear. I also have an LED light that comes on when the bumper is clear of the door so I know when to stop pulling into the garage. Here is my yaml for the binary sensor and for controlling the “stop” light:
binary_sensor:
- platform: gpio
pin: 16
name: "Garage Door Clear"
id: garage_door_clear
device_class: safety
filters:
- invert:
- delayed_on: 200ms
on_state:
then:
if:
condition:
binary_sensor.is_on: garage_door_clear
then:
- output.turn_off: gpio_light
else:
- output.turn_on: gpio_light
output:
- platform: gpio
pin: 12
id: gpio_light
I’d like to turn the “stop” light off after 5 minutes or so. There’s really no reason for it to burn all the time. It seems that within esphome you can only have triggers that work on a state change. I know that I could expose the light to HA and use a HA automation to turn it off, but I’d prefer to keep it within the esphome ecosystem.