I want to turn off lights when only one person is at home and opens the front door.
So when the last person leaves they see the lights turn off as they exit.
How do I integrate the house count into this code so that happens?
`
alias: Enter - leave home
description: ""
triggers:
- type: opened
device_id: 838ee5f0b7fbbf904d8f4668319b5341
entity_id: 5e04ae5fa22a5bd1e7280e2633ba99cb
domain: binary_sensor
trigger: device
for:
hours: 0
minutes: 0
seconds: 1
conditions: []
actions: - action: light.turn_off
metadata: {}
data: {}
target:
entity_id: light.living_lights - wait_for_trigger:
- type: opened
device_id: 838ee5f0b7fbbf904d8f4668319b5341
entity_id: 5e04ae5fa22a5bd1e7280e2633ba99cb
domain: binary_sensor
trigger: device
for:
hours: 0
minutes: 0
seconds: 2
timeout:
hours: 12
minutes: 0
seconds: 0
milliseconds: 0
- type: opened
- action: adaptive_lighting.apply
data:
lights:
- light.living_lights
transition: "90"
adapt_brightness: true
adapt_color: true
turn_on_lights: true - action: light.turn_on
metadata: {}
data:
brightness_pct: 15
target:
entity_id: light.pendant_lights - delay:
hours: 0
minutes: 3
seconds: 0 - action: light.turn_off
metadata: {}
data: {}
target:
entity_id: light.pendant_lights
mode: single
`