Added contextual awareness for security automations
This commit is contained in:
@ -32,6 +32,13 @@ input_boolean:
|
|||||||
security_issue:
|
security_issue:
|
||||||
name: Security Issue
|
name: Security Issue
|
||||||
icon: mdi:alert-circle-outline
|
icon: mdi:alert-circle-outline
|
||||||
|
# These booleans will only provide status/context for automation purposes. They will NOT actually control the security system.
|
||||||
|
security_armed_home:
|
||||||
|
name: Security Armed Home
|
||||||
|
icon: mdi:shield-home
|
||||||
|
security_armed_away:
|
||||||
|
name: Security Armed Away
|
||||||
|
icon: mdi:security
|
||||||
|
|
||||||
input_datetime:
|
input_datetime:
|
||||||
morning_alarm_disarm:
|
morning_alarm_disarm:
|
||||||
@ -290,16 +297,12 @@ automation:
|
|||||||
then:
|
then:
|
||||||
- if:
|
- if:
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: binary_sensor.people_present
|
entity_id: group.adults
|
||||||
state: 'off'
|
state: 'not_home'
|
||||||
then:
|
then:
|
||||||
- service: script.security_arm_away
|
- service: script.security_arm_away
|
||||||
else:
|
else:
|
||||||
- service: script.security_arm_home
|
- service: script.security_arm_home
|
||||||
- service: script.status_annc
|
|
||||||
data_template:
|
|
||||||
who: common
|
|
||||||
call_security_armed: 1
|
|
||||||
else:
|
else:
|
||||||
- service: script.speech_engine
|
- service: script.speech_engine
|
||||||
data:
|
data:
|
||||||
@ -373,7 +376,12 @@ script:
|
|||||||
code: !secret ring_alarm_code
|
code: !secret ring_alarm_code
|
||||||
- service: input_boolean.turn_off
|
- service: input_boolean.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: input_boolean.lockdown_issue
|
entity_id:
|
||||||
|
- input_boolean.lockdown_issue
|
||||||
|
- input_boolean.security_armed_away
|
||||||
|
- service: input_boolean.turn_on
|
||||||
|
target:
|
||||||
|
entity_id: input_boolean.security_armed_home
|
||||||
- service: script.status_annc
|
- service: script.status_annc
|
||||||
data:
|
data:
|
||||||
who: living_room
|
who: living_room
|
||||||
@ -401,7 +409,12 @@ script:
|
|||||||
entity_id: alarm_control_panel.alexa_guard_9ee3b
|
entity_id: alarm_control_panel.alexa_guard_9ee3b
|
||||||
- service: input_boolean.turn_off
|
- service: input_boolean.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: input_boolean.lockdown_issue
|
entity_id:
|
||||||
|
- input_boolean.lockdown_issue
|
||||||
|
- input_boolean.security_armed_home
|
||||||
|
- service: input_boolean.turn_on
|
||||||
|
target:
|
||||||
|
entity_id: input_boolean.security_armed_away
|
||||||
else:
|
else:
|
||||||
- service: input_boolean.turn_on
|
- service: input_boolean.turn_on
|
||||||
target:
|
target:
|
||||||
@ -421,7 +434,19 @@ script:
|
|||||||
- service: input_boolean.turn_off
|
- service: input_boolean.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: input_boolean.lockdown_issue
|
entity_id: input_boolean.lockdown_issue
|
||||||
|
- if:
|
||||||
|
- condition: state
|
||||||
|
entity_id: input_boolean.security_armed_home
|
||||||
|
state: 'on'
|
||||||
|
then:
|
||||||
- service: script.status_annc
|
- service: script.status_annc
|
||||||
data:
|
data:
|
||||||
who: living_room
|
who: living_room
|
||||||
call_security_not_armed: 1
|
call_security_not_armed: 1
|
||||||
|
- delay:
|
||||||
|
seconds: 1
|
||||||
|
- service: input_boolean.turn_off
|
||||||
|
target:
|
||||||
|
entity_id:
|
||||||
|
- input_boolean.security_armed_home
|
||||||
|
- input_boolean.security_armed_away
|
Reference in New Issue
Block a user