- alias: Turn off kitchen light 10 minutes after last movement
trigger:
platform: state
entity_id: sensor.motion_sensor
to: 'off'
for:
minutes: 10
action:
service: homeassistant.turn_off
entity_id: light.kitchen_light
But IMHO, (and confirmed by a few short tests), the for: 10 minutes means that the sensor.motion_sensor should be fixed in the off position for a period of 10 minutes.
I tested this with entity_id: binary_sensor (so, not 100% the same case, I admit) and only when I pressed the switch for 1 minute continuously, the trigger fired.
This page inclines that after the last change of state of the sensor.motion_sensor, the system waits for 10 minutes (or 1 minute in my case) and then proceeds to the action.
This is not the behavior that I saw
IMHO, the example can only work in case the sensor.motion_sensor remains state after the last âmovementâ, for more than 10 minutes.
Either somebody has edited that page in the 21 minutes since you posted this thread, or you misread that page.
The page is accurate.
After the sensor has stopped detecting movement it goes to off, then 10 minutes later the automation turns the light off, which is exactly what the text says it will do.
ouch⌠what was I smoking?
Re-reading the article, it does make sense indeed
After the last movement, the sensor changes state to âoffâ and if it remains there for 10 mins, the action starts
All good
my apologies
chris
âon my first one, I crashed and burnedâ