Now using lockdown issue toggle #60

This commit is contained in:
2022-12-01 18:26:31 -05:00
parent 9c59895fd7
commit 719000f8a8
2 changed files with 86 additions and 9 deletions

View File

@ -957,6 +957,35 @@ script:
</p>
{% endmacro %}
{% macro lockdown_issue() %}
<p>
{{ [
'There are active security faults. Please close all doors and windows before arming.',
'Have you ever tried to secure a piece of Swiss cheese? It does not work. Please close all doors and windows.',
'I cannot guard an open window. Please close them, and check all doors as well.'
'Do you want me to be attacked by the local gang of feral infants? Close the doors and windows!'
] | random }}
</p>
{% endmacro %}
{% macro security_armed() %}
<p>
{{ [ 'Security is armed, guard dogs deployed, and lasers set from stun to kill!',
'The security system is armed. Sentry turrets active, be careful out there!',
'Your security is our number one priority. Flamethrower turrets deployed!'
] | random }}
</p>
{% endmacro %}
{% macro security_not_armed() %}
<p>
{{ [ "Security squadron is standing down, but always at your service!",
"Our security forces are currently twiddling their thumbs, awaiting some purpose in their life!",
"Security not armed. Hopefully the defense turrets do not become bored!"
] | random }}
</p>
{% endmacro %}
{% macro time_is() %}
<p>
It is {{ now().strftime("%I:%M %p") }}
@ -1127,6 +1156,18 @@ script:
{{ issue() }}
{% endif %}
{% if call_lockdown_issue == 1 %}
{{ lockdown_issue() }}
{% endif %}
{% if call_security_armed == 1 %}
{{ security_armed() }}
{% endif %}
{% if call_security_not_armed == 1 %}
{{ security_not_armed() }}
{% endif %}
{% if call_time_is == 1 %}
{{ time_is() }}
{% endif %}

View File

@ -195,6 +195,35 @@ automation:
then:
- service: script.security_scheduling
- id: c7927c59-e0fe-48b9-b308-dd90fb774920
alias: Lockdown Issue
trigger:
- platform: state
entity_id: input_boolean.lockdown_issue
from: "off"
to: "on"
action:
- service: script.status_annc
data_template:
who: common
call_interruption: 1
call_lockdown_issue: 1
- wait_template: "{{ is_state('sensor.total_faults','0') }}"
timeout:
minutes: 10
- if:
- condition: state
entity_id: binary_sensor.people_present
state: 'off'
then:
- service: script.security_arm_away
else:
- service: script.security_arm_home
- service: script.status_annc
data_template:
who: common
call_security_armed: 1
script:
security_arm_home:
alias: Security Arm - Home
@ -209,16 +238,18 @@ script:
entity_id: alarm_control_panel.stratton_ave_alarm
data:
code: !secret ring_alarm_code
- service: input_boolean.turn_off
target:
entity_id: input_boolean.lockdown_issue
else:
- service: script.speech_engine
data:
who: common
message: 'There are active security faults. Please close all doors and windows before arming.'
- service: script.text_urgent_alert
data:
who: 'parents'
title: 'Security Not Armed!'
message: 'There are active security faults. Please close all doors and windows before arming.'
- service: input_boolean.turn_on
target:
entity_id: input_boolean.lockdown_issue
security_arm_away:
alias: Security Arm - Away
@ -236,16 +267,18 @@ script:
- service: alarm_control_panel.alarm_arm_away
target:
entity_id: alarm_control_panel.alexa_guard_9ee3b
- service: input_boolean.turn_off
target:
entity_id: input_boolean.lockdown_issue
else:
- service: script.speech_engine
data:
who: common
message: 'There are active security faults. Please close all doors and windows before arming.'
- service: script.text_urgent_alert
data:
who: 'parents'
title: 'Security Not Armed!'
message: 'There are active security faults. Please close all doors and windows before arming.'
- service: input_boolean.turn_on
target:
entity_id: input_boolean.lockdown_issue
security_disarm:
alias: Security Disarm
@ -257,4 +290,7 @@ script:
code: !secret ring_alarm_code
- service: alarm_control_panel.alarm_disarm
target:
entity_id: alarm_control_panel.alexa_guard_9ee3b
entity_id: alarm_control_panel.alexa_guard_9ee3b
- service: input_boolean.turn_off
target:
entity_id: input_boolean.lockdown_issue