Files
sarah/config/packages/modules/lighting/areas/hallway.yaml
T
2021-11-21 11:05:04 +02:00

65 lines
1.8 KiB
YAML

automation:
- alias: Lighting · Hallway · Motion On
trigger:
platform: state
entity_id: group.hallway_motion
to: "on"
condition:
condition: state
entity_id: binary_sensor.someone_home
state: "on"
action:
- choose:
# Turn on in Day Mode
- conditions:
- condition: state
entity_id: binary_sensor.someone_sleeping
state: "off"
sequence:
- service: light.turn_on
entity_id:
- light.hallway
- light.browser_hallway
data:
brightness_pct: 100
# Turn off in Night Mode
default:
- service: light.turn_on
entity_id:
- light.hue_white_1
- light.hue_1
- light.browser_hallway
data:
brightness_pct: 1
- alias: Lighting · Hallway · Motion Off
trigger:
platform: state
entity_id: group.hallway_motion
to: "off"
action:
- choose:
# Turn off in Day Mode
- conditions:
- condition: state
entity_id: binary_sensor.someone_sleeping
state: 'off'
sequence:
- service: light.turn_off
entity_id: light.hallway
- service: light.turn_on
entity_id: light.browser_hallway
data:
brightness_pct: 1
# Turn off in Night Mode
default:
- service: light.turn_off
entity_id:
- light.hue_white_1
- light.hue_1
- light.hallway
- service: light.turn_on
entity_id: light.browser_hallway
data:
brightness_pct: 1