1
0
ansible-home-assistant/roles/automations/files/hallway.yaml

72 lines
1.9 KiB
YAML
Raw Permalink Normal View History

- id: hallway_button
2021-11-12 01:35:44 +00:00
alias: '[Hallway] Button single press'
mode: single
trigger:
- device_id: cc4f08a2e2f0e5aebc43b87164378795
domain: zha
platform: device
type: remote_button_short_press
subtype: remote_button_short_press
action:
- service: script.hallway_lights_toggle
- id: hallway_button_double
2021-11-12 01:35:44 +00:00
alias: '[Hallway] Button double press'
mode: single
trigger:
- device_id: cc4f08a2e2f0e5aebc43b87164378795
domain: zha
platform: device
type: remote_button_double_press
subtype: remote_button_double_press
action:
- service: script.leave_home
- id: hallway_motion_on
2021-11-12 01:35:44 +00:00
alias: '[Hallway] Motion On'
mode: restart
trigger:
- platform: state
entity_id:
- binary_sensor.hallway_motion_sensor
- binary_sensor.hallway_person_occupancy
2023-04-24 23:44:05 +00:00
- binary_sensor.presence_sensor_fp2_hallaway
to: "on"
condition:
- condition: numeric_state
entity_id: sensor.office_illuminance
below: '400'
2021-11-12 01:35:44 +00:00
action:
- service: script.hallway_lights_on
- id: hallway_motion_off
2021-11-12 01:35:44 +00:00
alias: '[Hallway] Motion Off'
mode: restart
trigger:
- platform: state
entity_id:
- binary_sensor.hallway_motion_sensor
- binary_sensor.hallway_person_occupancy
2023-04-24 23:44:05 +00:00
- binary_sensor.presence_sensor_fp2_hallaway
2021-11-12 01:35:44 +00:00
from: 'on'
to: 'off'
for:
seconds: 5
condition:
- condition: state
entity_id: binary_sensor.hallway_motion_sensor
state: "off"
- condition: or
conditions:
- condition: state
entity_id: binary_sensor.hallway_person_occupancy
state: "off"
- condition: state
entity_id: binary_sensor.hallway_person_occupancy
2024-02-11 12:08:40 +00:00
state: "unavailable"
- condition: state
2023-04-24 23:44:05 +00:00
entity_id: binary_sensor.presence_sensor_fp2_hallaway
state: "off"
2021-11-12 01:35:44 +00:00
action:
- service: script.hallway_lights_off