1
0
ansible-home-assistant/configuration/automations/bedroom-motion.yaml
pgrondek 1e554cc0df Fix light automations
change light.toggle to light.turn_on
2021-05-25 16:56:30 +02:00

55 lines
1.4 KiB
YAML

- id: bedroom-motion-dark
alias: '[Bedroom] Motion day dark'
mode: single
trigger:
- platform: state
entity_id: binary_sensor.bedroom_motion_occupancy
from: 'off'
to: 'on'
condition:
- condition: numeric_state
entity_id: sensor.bedroom_motion_illuminance
below: '25'
- condition: state
entity_id: input_select.home_mode
state: Day
action:
- choose:
- conditions:
- condition: state
entity_id: input_boolean.sleep_mode
state: 'on'
sequence:
- service: light.turn_on
entity_id: light.bedroom_lights
data:
brightness_pct: 60
kelvin: 2000
- conditions:
- condition: state
entity_id: input_boolean.sleep_mode
state: 'off'
sequence:
- service: light.turn_on
entity_id: light.bedroom_lights
data:
brightness_pct: 60
kelvin: 3200
- id: bedroom-motion-off
alias: '[Bedroom] Motion Off'
mode: restart
trigger:
- platform: state
entity_id: binary_sensor.bedroom_motion_occupancy
for: '0:02:00'
from: 'on'
to: 'off'
condition:
- condition: state
entity_id: alarm_control_panel.ha_alarm
state: disarmed
action:
- service: light.turn_off
entity_id: light.bedroom_lights