From 719000f8a80700618422b64fd22f037ae8a684af Mon Sep 17 00:00:00 2001
From: Tony Stork
+ {{ [ + '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 }} +
+ {% endmacro %} + + {% macro security_armed() %} ++ {{ [ '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 }} +
+ {% endmacro %} + + {% macro security_not_armed() %} ++ {{ [ "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 }} +
+ {% endmacro %} + {% macro time_is() %}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 %} diff --git a/packages/security.yaml b/packages/security.yaml index 00da890..eba1c93 100644 --- a/packages/security.yaml +++ b/packages/security.yaml @@ -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 \ No newline at end of file + entity_id: alarm_control_panel.alexa_guard_9ee3b + - service: input_boolean.turn_off + target: + entity_id: input_boolean.lockdown_issue \ No newline at end of file