1
0
Fork 0
ansible-home-assistant/configuration/automations/hallway-motion.yaml
Przemek Grondek fe0e59e313 Update hallway/front door automations
switch calling doorbell automation to async script call
 increase lights blinking to 10 seconds
 change doorbell prevention automation from delay to trigger requirement
 wait door close before locking door
 turn on/off hallway light on motion
2021-08-12 00:37:29 +02:00

69 lines
2.1 KiB
YAML

- id: hallway-lightstrip-on
alias: '[Hallway] Motion On'
mode: restart
trigger:
- platform: state
entity_id: binary_sensor.hallway_motion_sensor
from: 'off'
to: 'on'
action:
- choose:
- conditions:
- condition: state
entity_id: input_select.home_mode
state: Day
sequence:
- choose:
- conditions:
- condition: state
entity_id: input_boolean.sleep_mode
state: 'on'
sequence:
- service: light.turn_on
entity_id: light.hallway_light
- service: light.turn_on
entity_id: light.hallway_light
data:
brightness_pct: 50
- conditions:
- condition: state
entity_id: input_boolean.sleep_mode
state: 'off'
- condition: numeric_state
entity_id: sensor.kitchen_motion_luminance
below: '25'
sequence:
- service: light.turn_on
entity_id: light.hallway_light
- service: light.turn_on
entity_id: light.hallway_light
data:
brightness_pct: 90
- conditions:
- condition: state
entity_id: input_select.home_mode
state: Night
sequence:
- service: light.turn_on
entity_id: light.hallway_lightstrip
data:
brightness_pct: 5
rgb_color:
- 255
- 0
- 0
- id: hallway-motion-off
alias: '[Hallway] Motion Off'
mode: restart
trigger:
- platform: state
entity_id: binary_sensor.hallway_motion_sensor
for: '0:02:00'
from: 'on'
to: 'off'
action:
- service: light.turn_off
entity_id: light.hallway_lightstrip
- service: light.turn_off
entity_id: light.hallway_light