From d8cea6916a6f4e88bc12d7a14048685fc8766052 Mon Sep 17 00:00:00 2001 From: "J.P. Krauss" Date: Sat, 25 Feb 2023 12:31:47 -0800 Subject: [PATCH] Update Security Package --- packages/security/security.yaml | 42 ++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/packages/security/security.yaml b/packages/security/security.yaml index 5d3660b..ee0c4d3 100644 --- a/packages/security/security.yaml +++ b/packages/security/security.yaml @@ -90,6 +90,14 @@ binary_sensor: - binary_sensor.bedroom_side_window - binary_sensor.bedroom_back_window + - platform: group + name: All Motion Sensors + entities: + - binary_sensor.entry_sensor_motion + - binary_sensor.guest_room_sensor_motion + - binary_sensor.hallway_sensor_motion + - binary_sensor.office_sensor_motion + template: sensor: - name: Open Windows/Doors @@ -102,6 +110,15 @@ template: | list | join(', ') }} + - name: Motion Detected + state: > + {{ + expand(state_attr('binary_sensor.all_motion_sensors', 'entity_id')) + | selectattr('state', 'in', ['on']) + | map(attribute='attributes.friendly_name') + | list | join(', ') + }} + binary_sensor: - name: Garage Door Open state: "{{ states('binary_sensor.garage_door') }}" @@ -228,6 +245,7 @@ automation: entity_id: alarm_control_panel.ha_alarm state: - 'armed_away' + - 'armed_home' - 'armed_vacation' action: - service: input_text.set_value @@ -240,6 +258,28 @@ automation: target: entity_id: alarm_control_panel.ha_alarm + - alias: Trigger Alarm on Motion + trigger: + - platform: state + entity_id: binary_sensor.all_motion_sensors + to: 'on' + condition: + condition: state + entity_id: alarm_control_panel.ha_alarm + state: + - 'armed_away' + - 'armed_vacation' + action: + - service: input_text.set_value + target: + entity_id: input_text.ha_alarm_trigger + data: + value: "{{ states('sensor.motion_detected') }}" + + - service: alarm_control_panel.alarm_trigger + target: + entity_id: alarm_control_panel.ha_alarm + - alias: Trigger Alarm on Garage Door Open trigger: - platform: state @@ -283,7 +323,7 @@ automation: data: topic: frigate/doorbell/detect/set payload: 'OFF' - - delay: 60 + - delay: 300 - service: mqtt.publish data: topic: frigate/doorbell/detect/set