1
0
ansible-home-assistant/configuration/automations/kitchen-motion.yaml

105 lines
3.1 KiB
YAML

- id: kitchen-lights-on
alias: '[Kitchen] Lights On'
mode: single
trigger:
- platform: state
entity_id: binary_sensor.kitchen_motion_sensor
from: 'off'
to: 'on'
- platform: state
entity_id: binary_sensor.kitchen_tabletop_motion_detection
to: 'on'
action:
- choose:
- conditions:
- condition: state
entity_id: input_select.home_mode
state: Day
- condition: numeric_state
entity_id: sensor.xiaomi_lumi_sen_ill_mgl01_cc990100_illuminance
below: '150'
sequence:
- choose:
- conditions:
- condition: state
entity_id: input_boolean.sleep_mode
state: 'on'
sequence:
- service: light.turn_on
entity_id: light.kitchen_lights
data:
brightness_pct: 100
kelvin: 2000
- conditions:
- condition: state
entity_id: input_boolean.sleep_mode
state: 'off'
sequence:
- service: light.turn_on
entity_id: light.kitchen_lights
data:
brightness_pct: 100
kelvin: 3200
- conditions:
- condition: state
entity_id: input_select.home_mode
state: Night
- condition: numeric_state
entity_id: sensor.xiaomi_lumi_sen_ill_mgl01_cc990100_illuminance
below: '100'
sequence:
- service: light.turn_on
entity_id: light.kitchen_lights
data:
brightness_pct: 5
kelvin: 2700
- id: kitchen-lights-off
alias: '[Kitchen] Lights Off'
mode: restart
trigger:
- platform: state
entity_id: binary_sensor.kitchen_motion_sensor
for: '0:02:00'
from: 'on'
to: 'off'
- platform: state
entity_id: binary_sensor.sink_motion_sensor_5473a923_ias_zone
to: 'off'
for: '0:02:00'
- platform: state
entity_id: binary_sensor.kitchen_tabletop_motion_detection
to: 'off'
for: '0:02:00'
condition:
- condition: state
entity_id: binary_sensor.kitchen_motion_sensor
state: 'off'
for: '0:02:00'
- condition: state
entity_id: binary_sensor.sink_motion_sensor_5473a923_ias_zone
state: 'off'
for: '0:02:00'
- condition: state
entity_id: binary_sensor.kitchen_tabletop_motion_detection
state: 'off'
for: '0:02:00'
action:
- service: light.turn_off
entity_id: light.kitchen_lights
- id: kitchen-sink-light-off
alias: '[Kitchen] Sink light off'
mode: single
trigger:
- platform: state
entity_id: binary_sensor.sink_motion_sensor_5473a923_ias_zone
to: 'off'
for: '0:05:00'
condition: [ ]
action:
- service: light.turn_off
data: { }
target:
entity_id: light.kitchen_sink_lighstrip