Auto turn off lights after 15 min of no motion

How can I turn off lights when 2 motion detectors have both stopped receiving motion for at least 15 min. This was easy with one detector, but not sure how that logic would work with 2.


alias: Upstairs Light Off
description: Turn off when X min of no motion on 2 dectectors.
triggers:
  - type: no_motion
    device_id: e2f6ae07f5e50fb787ec74adcb32477d
    entity_id: 6000d1ccfac0fe68f91277adb7bfc8fc
    domain: binary_sensor
    trigger: device
    for:
      hours: 0
      minutes: 15
      seconds: 0
  - type: no_motion
    device_id: 0a71e589243bc21cbd1d3f389d29675d
    entity_id: 374a690e4610db33e746277262920143
    domain: binary_sensor
    trigger: device
    for:
      hours: 0
      minutes: 15
      seconds: 0
conditions:
  - type: is_no_motion
    condition: device
    device_id: e2f6ae07f5e50fb787ec74adcb32477d
    entity_id: 6000d1ccfac0fe68f91277adb7bfc8fc
    domain: binary_sensor
  - type: is_no_motion
    condition: device
    device_id: 0a71e589243bc21cbd1d3f389d29675d
    entity_id: 374a690e4610db33e746277262920143
    domain: binary_sensor
actions:
  - type: turn_off
    device_id: 55881deae33aaab449f7ad5683ceb4e2
    entity_id: 10f510fb43e40d0b9549c8a978ddc1f6
    domain: light
mode: single

create a group from the two detectors. They will act together as one.

1 Like

Pefect! I used something similar for my water detectors and completely forgot about that. Groups was exactly what I needed.

1 Like