Good afternoon, this is my first topic, I looked for the Forum but I did not find the solution.
I have my garage gate connected to the HA.
I’m trying to do an automation so it monitors the sensor open 24 hours a day!
I need if the gate remains open for more than 5 minutes, it automatically closes, and if the gate has not closed, it keeps trying every 5 minutes, ALWAYS until the sensor status shows “CLOSED”
I think you can understand
My Code
- id: '1558329831180'
alias: Garage - Automatico Portao
trigger:
- entity_id: binary_sensor.garage_door_sensor
for: 00:05:00
from: 'off'
platform: state
to: 'on'
condition:
- condition: state
entity_id: binary_sensor.garage_door_sensor
state: 'on'
action:
- data:
entity_id: switch.garage_door_switch
service: switch.turn_on