A total newbie here (first post)
This Page: [https://www.home-assistant.io/cookbook/turn_on_light_for_10_minutes_when_motion_detected/] has the following code snippet and mentions that the action happens 10 minutes after the last change of state of the
- 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.