I have the same automation. You can use ‘for’ in your trigger so that it triggers when something has been in the current state ‘for’ an amount of time, in my case 10 minutes:
- alias: "Buitenlamp uit na 10 minuten"
trigger:
platform: state
entity_id: light.voordeur
from: 'off'
to: 'on'
for:
hours: 0
minutes: 10
seconds: 0
condition:
condition: state
entity_id: binary_sensor.fibaro_multisensor_hal_sensor
state: 'off'
action:
service: light.turn_off
data:
entity_id: light.voordeur
transition: 30
I had to do it this way because the light is also controlled by another automation and I needed the condition.