Where does one post potential errors in the Docs? (please ignore,... was user error)

Hi,
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 sensor.motion_sensor

- 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.

thoughts ?

chrisV

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.

1 Like

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’

my under standing is

  trigger:
    platform: state
    entity_id: sensor.motion_sensor
    to: 'off'
    for:
      minutes: 10

I read it as
if the trigger state of the entity_id is OFF FOR 10 Minutes then do the action

doesn’t the ‘to:’ mean that it has to transition to ‘off’?
(and then remain there for at least 10 minutes)

At least you’re thinking of the community when you thought you’d found something wrong :slight_smile:

You’re very kind Marc
thank you for your replies

1 Like

Yes you are right

but as it has the for: in it the to: then come the how long for

hopethis make cents