1
0
ansible-home-assistant/automations/files/bedroom-motion.yaml

34 lines
824 B
YAML
Raw Normal View History

- 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
2021-01-11 23:54:15 +00:00
below: '50'
- condition: state
entity_id: input_select.home_mode
state: Day
action:
- service: light.turn_on
entity_id: light.bedroom_lights
data:
brightness_pct: 60
kelvin: 5000
- 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'
action:
- service: light.turn_off
entity_id: light.bedroom_lights