Files
fresh-home/automations/rooms/driveway_lights.yaml
T
2025-02-10 15:08:18 -05:00

71 lines
1.7 KiB
YAML

alias: Driveway Lights
id: automation_driveway_lights
mode: queued
trigger:
- platform: state
id: motion_on
entity_id:
- binary_sensor.from_street_vehicle_occupancy
- binary_sensor.driveway_person_occupancy
- binary_sensor.front_yard_person_occupancy
- binary_sensor.front_yard_animal_occupancy
- binary_sensor.garage_door
from: "off"
to: "on"
- platform: state
id: motion_off
entity_id:
- binary_sensor.from_street_vehicle_occupancy
- binary_sensor.driveway_person_occupancy
- binary_sensor.front_yard_person_occupancy
- binary_sensor.front_yard_animal_occupancy
- binary_sensor.garage_door
from: "on"
to: "off"
for: "00:05:00"
- platform: state
id: got_bright
entity_id: binary_sensor.is_dark
to: "on"
- platform: state
id: got_dark
entity_id: binary_sensor.is_dark
to: "off"
action:
- choose:
- conditions:
- condition: trigger
id: "motion_on"
- condition: or
conditions:
- condition: state
alias: "It is dark outside"
entity_id: binary_sensor.is_dark
state: 'on'
- condition: state
alias: "Front porch light is on"
entity_id: light.front_porch_overhead
state: 'on'
- condition: state
entity_id: light.driveway
state: 'off'
sequence:
- service: light.turn_on
target:
entity_id: light.driveway
- conditions:
- condition: trigger
id: "motion_off"
- condition: state
entity_id: light.driveway
state: 'on'
sequence:
- service: light.turn_off
target:
entity_id: light.driveway