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

61 lines
1.6 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'
- platform: state
entity_id: binary_sensor.presence_sensor_fp2_kitchen
to: 'on'
action:
- choose:
- conditions:
- condition: numeric_state
entity_id: sensor.office_illuminance
below: '350'
sequence:
- service: script.kitchen_lights_on
- id: kitchen_lights_off
alias: '[Kitchen] Lights Off'
mode: restart
trigger:
- platform: state
entity_id: binary_sensor.presence_sensor_fp2_kitchen
to: 'off'
for:
seconds: 5
# - platform: state
# entity_id: binary_sensor.kitchen_motion_sensor
# for: '0:02:00'
# from: 'on'
# to: 'off'
# - platform: state
# entity_id: binary_sensor.kitchen_sink_motion_sensor
# 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.kitchen_sink_motion_sensor
# state: 'off'
# for: '0:02:00'
# - condition: state
# entity_id: binary_sensor.kitchen_tabletop_motion_detection
# state: 'off'
# for: '0:02:00'
action:
- service: script.kitchen_lights_off