Update Security Package
This commit is contained in:
@@ -68,6 +68,18 @@ binary_sensor:
|
|||||||
- binary_sensor.bedroom_side_window
|
- binary_sensor.bedroom_side_window
|
||||||
- binary_sensor.bedroom_back_window
|
- binary_sensor.bedroom_back_window
|
||||||
|
|
||||||
|
sensor:
|
||||||
|
- platform: template
|
||||||
|
name: Open Windows/Doors
|
||||||
|
unique_id: open_windows_doors
|
||||||
|
state: >
|
||||||
|
{{
|
||||||
|
expand(state_attr('binary_sensor.all_doors', 'entity_id') + state_attr('binary_sensor.all_windows', 'entity_id'))
|
||||||
|
| selectattr('state', 'in', ['on'])
|
||||||
|
| map(attribute='attributes.friendly_name')
|
||||||
|
| list | join(', ')
|
||||||
|
}}
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
# Security Automations
|
# Security Automations
|
||||||
automation:
|
automation:
|
||||||
@@ -127,3 +139,24 @@ automation:
|
|||||||
}} by {{
|
}} by {{
|
||||||
person.attributes.friendly_name
|
person.attributes.friendly_name
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
- alias: Trigger Alarm on Window or Door Open
|
||||||
|
trigger:
|
||||||
|
- platform: state
|
||||||
|
entity_id: binary_sensor.all_doors
|
||||||
|
to: 'on'
|
||||||
|
- platform: state
|
||||||
|
entity_id: binary_sensor.all_windows
|
||||||
|
to: 'on'
|
||||||
|
condition:
|
||||||
|
- or:
|
||||||
|
- condition: state
|
||||||
|
entity_id: alarm_control_panel.ha_alarm
|
||||||
|
state: armed_away
|
||||||
|
- condition: state
|
||||||
|
entity_id: alarm_control_panel.ha_alarm
|
||||||
|
state: armed_vacation
|
||||||
|
action:
|
||||||
|
- service: notify.security
|
||||||
|
data:
|
||||||
|
message: Alarm triggered by {{ state('sensor.open_windows_doors') }}
|
||||||
|
|||||||
Reference in New Issue
Block a user