Question about automation/trigger processing and delays

Im creating an automation that uses several motion sensors as triggers. Was wondering how HA processes the triggers. How would HA process this automation?
Does the 10 minute delay begin counting when HA reaches that step in the automation-- so this automation would take a minimum of 30 minutes to process (if no motion was detected) Or does HA look at the sensors history and if no motion detected previous ten minutes it continues to the next step? (potentially there could be no delay if no motion had been detected in previous 10 minutes of all sensors)

Thank you much

alias: Lights OUT Living Room automated
description: ‘’
trigger:

  • type: no_motion
    platform: device
    device_id: c8e368cd2ef35be95e8cd5c5a0f4b686
    entity_id: binary_sensor.motion_sensor_3_livingroom
    domain: binary_sensor
    id: livingroom_lights_out
    for:
    hours: 0
    minutes: 10
    seconds: 0
    milliseconds: 0
  • type: no_motion
    platform: device
    device_id: bc74f80b42057d933d11a2684176e19f
    entity_id: binary_sensor.motion_sensor_2_kitchen
    domain: binary_sensor
    for:
    hours: 0
    minutes: 10
    seconds: 0
    milliseconds: 0
  • type: no_motion
    platform: device
    device_id: 5f7064436332ffbade82e5d0ff1e7431
    entity_id: binary_sensor.motion_sensor_1_stairs
    domain: binary_sensor
    for:
    hours: 0
    minutes: 10
    seconds: 0
    milliseconds: 0
    condition: []
    action:
  • scene: scene.living_room_lights_out
    mode: single

Multiple triggers are logically ORed. Whichever one satisfies its requirements first will be the first to trigger the automation.

In your example, whichever one is off (no_motion) for 10 minutes is the one that triggers the automation. Whichever next one that is off for 10 minutes will also trigger the automation. Each one of the three triggers operates independently of the other.

It doesn’t use the sensor’s history; it’s not based on the sensor’s previous behavior.

In your example, the moment the sensor’s state changes from on to off, an internal 10 minute timer is started for that sensor. If the timer counts down from 10 to 0 minutes and the sensor’s state remained off the entire time, the trigger occurs. If the state changes during the countdown, the internal timer is reset.

1 Like

Thank you for the explanation!
So much easier then keeping kids in bedrooms for 30 minutes (or even ten mins) to test.