2019-07-11 11:32:37 +00:00
|
|
|
###############################################################################
|
|
|
|
# @author : Jeffrey Stone
|
|
|
|
# @date : 03/13/2019
|
|
|
|
# @package : Security
|
|
|
|
# @description : Everything related to security functions.
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
input_boolean:
|
|
|
|
sentry_mode:
|
|
|
|
name: Sentry Mode
|
|
|
|
icon: mdi:security
|
|
|
|
vacation_mode:
|
|
|
|
name: Vacation Mode
|
|
|
|
icon: mdi:airplane-takeoff
|
|
|
|
guest_mode:
|
|
|
|
name: Guest Mode
|
|
|
|
icon: mdi:account-multiple
|
|
|
|
security_alarm:
|
|
|
|
name: Security Alarm
|
|
|
|
icon: mdi:speaker-wireless
|
|
|
|
fire_alarm:
|
|
|
|
name: Fire Alarm
|
|
|
|
icon: mdi:speaker-wireless
|
|
|
|
garage_after_dark:
|
|
|
|
name: Garage Open After Dark
|
|
|
|
icon: mdi:message-alert
|
|
|
|
lockdown_issue:
|
|
|
|
name: Lockdown Issue
|
|
|
|
icon: mdi:lock-reset
|
|
|
|
security_issue:
|
|
|
|
name: Security Issue
|
|
|
|
icon: mdi:alert-circle-outline
|
|
|
|
|
|
|
|
automation:
|
|
|
|
- id: enable_vacation_mode
|
|
|
|
alias: Enable Vacation Mode
|
|
|
|
initial_state: true
|
|
|
|
trigger:
|
|
|
|
- platform: numeric_state
|
|
|
|
entity_id: sensor.jeff_ett_home
|
|
|
|
above: 180
|
|
|
|
- platform: numeric_state
|
|
|
|
entity_id: sensor.kat_ett_home
|
|
|
|
above: 180
|
|
|
|
condition:
|
|
|
|
- condition: numeric_state
|
|
|
|
entity_id: sensor.jeff_ett_home
|
|
|
|
above: 180
|
|
|
|
- condition: numeric_state
|
|
|
|
entity_id: sensor.kat_ett_home
|
|
|
|
above: 180
|
|
|
|
action:
|
|
|
|
- service: input_boolean.turn_on
|
|
|
|
entity_id: input_boolean.vacation_mode
|
|
|
|
|
|
|
|
- id: morning_standby
|
|
|
|
alias: Morning Standby
|
|
|
|
initial_state: true
|
|
|
|
trigger:
|
|
|
|
- platform: time
|
|
|
|
at: 05:30:00
|
|
|
|
condition:
|
|
|
|
condition: or
|
|
|
|
conditions:
|
|
|
|
- condition: state
|
|
|
|
entity_id: sensor.family_status
|
|
|
|
state: Home
|
|
|
|
- condition: state
|
|
|
|
entity_id: input_boolean.guest_mode
|
|
|
|
state: 'on'
|
|
|
|
action:
|
|
|
|
- service: script.standby
|
|
|
|
|
|
|
|
- id: nightly_lockdown
|
|
|
|
alias: Nightly Lockdown
|
|
|
|
initial_state: true
|
|
|
|
trigger:
|
|
|
|
- platform: time
|
|
|
|
at: '23:00:00'
|
|
|
|
condition:
|
|
|
|
- condition: state
|
|
|
|
entity_id: device_tracker.jeffreystonesiphone
|
|
|
|
state: home
|
|
|
|
- condition: state
|
|
|
|
entity_id: device_tracker.katherinestonesiphone
|
|
|
|
state: home
|
|
|
|
- condition: state
|
|
|
|
entity_id: input_boolean.guest_mode
|
|
|
|
state: 'off'
|
|
|
|
action:
|
|
|
|
- service: script.lockdown
|
|
|
|
|
|
|
|
- id: garage_open_sunset
|
|
|
|
alias: Garage Open At Sunset
|
|
|
|
initial_state: true
|
|
|
|
trigger:
|
|
|
|
- platform: sun
|
|
|
|
event: sunset
|
|
|
|
condition:
|
|
|
|
- condition: state
|
|
|
|
entity_id: binary_sensor.garage_door
|
|
|
|
state: "on"
|
|
|
|
action:
|
|
|
|
- service: script.driveway_on
|
2019-09-07 19:11:00 +00:00
|
|
|
|
2019-07-11 11:32:37 +00:00
|
|
|
|
|
|
|
- id: close_garage_lights_out
|
|
|
|
alias: Close Garage at lights out
|
|
|
|
initial_state: true
|
|
|
|
trigger:
|
|
|
|
- platform: time
|
|
|
|
at: '22:30:00'
|
|
|
|
condition:
|
|
|
|
- condition: state
|
|
|
|
entity_id: binary_sensor.garage_door
|
|
|
|
state: "on"
|
|
|
|
action:
|
|
|
|
- service: input_boolean.turn_on
|
|
|
|
entity_id: input_boolean.security_issue
|
|
|
|
|
|
|
|
- id: door_chime
|
|
|
|
alias: Door Chine
|
|
|
|
trigger:
|
2019-07-12 20:35:11 +00:00
|
|
|
- platform: state
|
|
|
|
entity_id:
|
|
|
|
- binary_sensor.front_door_contact_2
|
|
|
|
- binary_sensor.laundry_room_door_contact_2
|
|
|
|
- binary_sensor.attic_door_contact_2
|
|
|
|
- binary_sensor.back_door_contact_2
|
2019-07-11 11:32:37 +00:00
|
|
|
from: 'off'
|
|
|
|
condition:
|
|
|
|
- condition: state
|
|
|
|
entity_id: input_boolean.audible_notifications
|
|
|
|
state: 'on'
|
|
|
|
- condition: state
|
|
|
|
entity_id: input_boolean.guest_mode
|
|
|
|
state: 'off'
|
|
|
|
action:
|
|
|
|
- service: shell_command.door_chime
|
2019-10-13 20:07:17 +00:00
|
|
|
- service: script.reset_ha_speaker
|
2019-07-11 11:32:37 +00:00
|
|
|
initial_state: true
|
|
|
|
|
2019-07-14 01:38:53 +00:00
|
|
|
- id: door_opened_long
|
|
|
|
alias: Door Opened Too Long
|
|
|
|
trigger:
|
|
|
|
- platform: state
|
|
|
|
entity_id:
|
2019-07-22 14:26:24 +00:00
|
|
|
- binary_sensor.front_door_contact_2
|
|
|
|
- binary_sensor.laundry_room_door_contact_2
|
|
|
|
- binary_sensor.attic_door_contact_2
|
|
|
|
- binary_sensor.back_door_contact_2
|
2019-07-14 01:38:53 +00:00
|
|
|
from: 'off'
|
|
|
|
to: 'on'
|
|
|
|
for: '00:01:00'
|
|
|
|
condition:
|
|
|
|
- condition: state
|
|
|
|
entity_id: input_boolean.audible_notifications
|
|
|
|
state: 'on'
|
|
|
|
action:
|
2019-07-16 01:40:39 +00:00
|
|
|
- service: script.ah_report
|
2019-07-14 01:38:53 +00:00
|
|
|
data_template:
|
2019-07-16 01:40:39 +00:00
|
|
|
speech_message: " the {{ trigger.to_state.attributes.friendly_name }} has been standing open for more than a minute."
|
|
|
|
call_interuption: 1
|
2019-07-14 01:38:53 +00:00
|
|
|
initial_state: true
|
|
|
|
|
|
|
|
- id: garage_opened_night
|
|
|
|
alias: Garage Opened at Night
|
|
|
|
trigger:
|
|
|
|
- platform: state
|
|
|
|
entity_id: group.garage_doors
|
|
|
|
from: 'off'
|
|
|
|
to: 'on'
|
|
|
|
condition:
|
|
|
|
- condition: state
|
|
|
|
entity_id: sun.sun
|
|
|
|
state: below_horizon
|
|
|
|
action:
|
|
|
|
- service: script.driveway_on
|
|
|
|
initial_state: true
|
|
|
|
|
|
|
|
- id: garage_closed
|
|
|
|
alias: Garage Opened at Night
|
|
|
|
trigger:
|
|
|
|
- platform: state
|
|
|
|
entity_id: group.garage_doors
|
|
|
|
from: 'on'
|
|
|
|
to: 'off'
|
|
|
|
action:
|
|
|
|
- service: script.driveway_off
|
|
|
|
initial_state: true
|
|
|
|
|
2019-07-11 11:32:37 +00:00
|
|
|
- id: security_breach_door
|
|
|
|
alias: Security Breach Doors
|
|
|
|
trigger:
|
2019-07-12 20:35:11 +00:00
|
|
|
- platform: state
|
|
|
|
entity_id:
|
2019-07-22 14:26:24 +00:00
|
|
|
- binary_sensor.front_door_contact_2
|
|
|
|
- binary_sensor.laundry_room_door_contact_2
|
|
|
|
- binary_sensor.back_door_contact_2
|
|
|
|
- binary_sensor.side_door_contact_2
|
|
|
|
- binary_sensor.garage_door_contact_2
|
2019-07-11 11:32:37 +00:00
|
|
|
from: 'off'
|
|
|
|
condition:
|
|
|
|
- condition: state
|
|
|
|
entity_id: input_boolean.sentry_mode
|
|
|
|
state: 'on'
|
|
|
|
action:
|
2019-07-16 01:40:39 +00:00
|
|
|
- service: script.jarvis_alert
|
2019-07-12 20:35:11 +00:00
|
|
|
data_template:
|
2019-07-14 01:38:53 +00:00
|
|
|
message: "My security protocols are being overidden,, The {{ trigger.to_state.attributes.friendly_name }} has been opened."
|
|
|
|
- service: script.text_alert
|
|
|
|
data_template:
|
|
|
|
title: "Security Alert!!"
|
|
|
|
message: "{{ trigger.to_state.attributes.friendly_name }} has been opened."
|
2019-07-11 11:32:37 +00:00
|
|
|
- service: input_boolean.turn_on
|
|
|
|
entity_id: input_boolean.security_issue
|
|
|
|
initial_state: true
|
|
|
|
|
2019-07-14 01:38:53 +00:00
|
|
|
- id: sentry_mode_enabled
|
|
|
|
alias: Sentry Mode Enabled Annoucement
|
|
|
|
initial_state: true
|
|
|
|
trigger:
|
|
|
|
- platform: state
|
|
|
|
entity_id: input_boolean.sentry_mode
|
|
|
|
from: 'off'
|
|
|
|
to: 'on'
|
|
|
|
action:
|
2019-07-16 01:40:39 +00:00
|
|
|
- service: script.ah_report
|
|
|
|
data_template:
|
|
|
|
speech_message: >
|
2019-07-14 01:38:53 +00:00
|
|
|
{{ [
|
|
|
|
"Barn door protocol has been activated.",
|
|
|
|
"Anchorage House has been secured! ",
|
|
|
|
"Sentry Mode is active. ",
|
|
|
|
"I am now monitoring the doors and will let you know if anyone attempts to access."
|
|
|
|
] | random }}
|
|
|
|
|
|
|
|
- id: sentry_mode_disabled
|
|
|
|
alias: Sentry Mode Disabled Annoucement
|
|
|
|
initial_state: true
|
|
|
|
trigger:
|
|
|
|
- platform: state
|
|
|
|
entity_id: input_boolean.sentry_mode
|
|
|
|
from: 'on'
|
|
|
|
to: 'off'
|
|
|
|
action:
|
2019-07-16 01:40:39 +00:00
|
|
|
- service: script.ah_report
|
|
|
|
data_template:
|
|
|
|
speech_message: >
|
2019-07-14 01:38:53 +00:00
|
|
|
{{ [
|
|
|
|
"Barn door protocol has been deactivated.",
|
|
|
|
"I am no longer monitoring the access points. ",
|
|
|
|
"Sentry Mode has been switched off. "
|
|
|
|
] | random }}
|
|
|
|
|
2019-07-16 01:40:39 +00:00
|
|
|
- id: guest_mode_feedback
|
|
|
|
alias: Guest Mode Audio Feedback
|
|
|
|
trigger:
|
|
|
|
- platform: state
|
|
|
|
entity_id:
|
|
|
|
- input_boolean.guest_mode
|
|
|
|
from: 'off'
|
|
|
|
to: 'on'
|
|
|
|
action:
|
|
|
|
- service: script.ah_report
|
|
|
|
data_template:
|
|
|
|
speech_message: >
|
|
|
|
{{ [
|
|
|
|
"Guest Mode has been enabled.",
|
|
|
|
"I have switched to the system to guest mode.",
|
|
|
|
"I have enabled guest mode. ",
|
|
|
|
"Guest Mode is on."
|
|
|
|
] | random }}
|
|
|
|
|
2019-07-11 11:32:37 +00:00
|
|
|
script:
|
|
|
|
lockdown_issue:
|
|
|
|
sequence:
|
|
|
|
- condition: state
|
|
|
|
entity_id: group.external_doors
|
|
|
|
state: "on"
|
|
|
|
- condition: state
|
|
|
|
entity_id: sensor.family_status
|
|
|
|
state: "Away"
|
|
|
|
- service: input_boolean.turn_on
|
|
|
|
entity_id: input_boolean.lockdown_issue
|
2019-07-14 01:38:53 +00:00
|
|
|
- service: script.text_notify
|
|
|
|
data_template:
|
|
|
|
title: "Lockdown Issue!"
|
|
|
|
message: "Doors are open and it appears everyone has left!"
|
2019-07-11 11:32:37 +00:00
|
|
|
|
|
|
|
security_check_garage:
|
|
|
|
sequence:
|
|
|
|
- condition: state
|
|
|
|
entity_id: cover.cargo_bay
|
|
|
|
state: open
|
|
|
|
- service: input_boolean.turn_on
|
|
|
|
entity_id: input_boolean.lockdown_issue
|
|
|
|
|
|
|
|
security_check_zones:
|
|
|
|
sequence:
|
|
|
|
- condition: state
|
|
|
|
entity_id: group.doors
|
|
|
|
state: 'on'
|
|
|
|
- service: input_boolean.turn_on
|
|
|
|
entity_id: input_boolean.lockdown_issue
|
|
|
|
|
|
|
|
lockdown:
|
|
|
|
sequence:
|
|
|
|
- condition: state
|
|
|
|
entity_id: group.external_doors
|
|
|
|
state: "off"
|
|
|
|
- service: input_boolean.turn_on
|
|
|
|
entity_id: input_boolean.sentry_mode
|
|
|
|
|
|
|
|
standby:
|
|
|
|
sequence:
|
|
|
|
- condition: state
|
|
|
|
entity_id: input_boolean.vacation_mode
|
|
|
|
state: 'off'
|
|
|
|
- service: input_boolean.turn_off
|
|
|
|
entity_id: input_boolean.sentry_mode
|
|
|
|
- service: input_boolean.turn_off
|
|
|
|
entity_id: input_boolean.security_issue
|
2019-07-14 01:38:53 +00:00
|
|
|
- service: input_boolean.turn_off
|
|
|
|
entity_id: input_boolean.lockdown_issue
|
2019-07-11 11:32:37 +00:00
|
|
|
- service: input_boolean.turn_off
|
|
|
|
entity_id: input_boolean.security_alarm
|
|
|
|
|
|
|
|
visitors_here:
|
|
|
|
sequence:
|
|
|
|
- service: input_boolean.turn_on
|
|
|
|
data:
|
|
|
|
entity_id: input_boolean.guest_mode
|
2019-07-14 01:38:53 +00:00
|
|
|
#- service: shell_command.haunted_guest_welcome
|
2019-07-11 11:32:37 +00:00
|
|
|
|
|
|
|
visitors_gone:
|
|
|
|
sequence:
|
|
|
|
- service: input_boolean.turn_off
|
|
|
|
data:
|
|
|
|
entity_id: input_boolean.guest_mode
|
|
|
|
|
|
|
|
notification_security_alarm_audio:
|
|
|
|
sequence:
|
|
|
|
- service: shell_command.security_alarm
|
|
|
|
|
2019-07-14 01:38:53 +00:00
|
|
|
# notification_sentry_mode_activated_audio:
|
|
|
|
# sequence:
|
|
|
|
# - condition: state
|
|
|
|
# entity_id: input_boolean.audible_notifications
|
|
|
|
# state: 'on'
|
|
|
|
# - condition: state
|
2019-09-07 19:11:00 +00:00
|
|
|
# entity_id: media_player.theater
|
2019-07-14 01:38:53 +00:00
|
|
|
# state: 'idle'
|
|
|
|
# - service: tts.google_say
|
2019-09-07 19:11:00 +00:00
|
|
|
# entity_id: media_player.theater
|
2019-07-14 01:38:53 +00:00
|
|
|
# data_template:
|
|
|
|
# message: "Sentry mode activated"
|
2019-07-11 11:32:37 +00:00
|
|
|
|
2019-07-14 01:38:53 +00:00
|
|
|
# notification_sentry_mode_deactivated_audio:
|
|
|
|
# sequence:
|
|
|
|
# - condition: state
|
|
|
|
# entity_id: input_boolean.audible_notifications
|
|
|
|
# state: 'on'
|
|
|
|
# - condition: state
|
2019-09-07 19:11:00 +00:00
|
|
|
# entity_id: media_player.theater
|
2019-07-14 01:38:53 +00:00
|
|
|
# state: 'idle'
|
|
|
|
# - service: tts.google_say
|
2019-09-07 19:11:00 +00:00
|
|
|
# entity_id: media_player.theater
|
2019-07-14 01:38:53 +00:00
|
|
|
# data_template:
|
|
|
|
# message: "Sentry mode deactivated"
|
2019-07-11 11:32:37 +00:00
|
|
|
|
2019-07-14 01:38:53 +00:00
|
|
|
# notification_sentry_mode_deactiviated_text:
|
|
|
|
# sequence:
|
|
|
|
# - service: notify.jeff_ios
|
|
|
|
# data:
|
|
|
|
# message: Sentry Mode Deactivated
|
2019-07-11 11:32:37 +00:00
|
|
|
|
2019-07-14 01:38:53 +00:00
|
|
|
# notification_sentry_mode_activiated_text:
|
|
|
|
# sequence:
|
|
|
|
# - service: notify.jeff_ios
|
|
|
|
# data:
|
|
|
|
# message: Sentry Mode Activated
|
2019-07-11 11:32:37 +00:00
|
|
|
|
|
|
|
vacation_canceled:
|
|
|
|
sequence:
|
|
|
|
- data:
|
|
|
|
entity_id: input_boolean.vacation_mode
|
|
|
|
service: input_boolean.turn_off
|
2019-07-14 01:38:53 +00:00
|
|
|
|
|
|
|
activate_barn_door_protocol:
|
|
|
|
sequence:
|
2019-07-16 01:40:39 +00:00
|
|
|
- service: script.ah_report
|
|
|
|
data:
|
|
|
|
call_confirmation: 1
|
|
|
|
- delay:
|
|
|
|
seconds: 2
|
2019-07-14 01:38:53 +00:00
|
|
|
- service: input_boolean.turn_on
|
|
|
|
entity_id: input_boolean.sentry_mode
|
|
|
|
|
|
|
|
deactivate_barn_door_protocol:
|
|
|
|
sequence:
|
2019-07-16 01:40:39 +00:00
|
|
|
- service: script.ah_report
|
|
|
|
data:
|
|
|
|
call_confirmation: 1
|
|
|
|
- delay:
|
|
|
|
seconds: 2
|
2019-07-14 01:38:53 +00:00
|
|
|
- service: input_boolean.turn_off
|
|
|
|
entity_id: input_boolean.sentry_mode
|
|
|
|
|
|
|
|
activate_guest_mode:
|
|
|
|
sequence:
|
2019-07-16 01:40:39 +00:00
|
|
|
- service: script.ah_report
|
|
|
|
data:
|
|
|
|
call_confirmation: 1
|
2019-07-14 01:38:53 +00:00
|
|
|
- delay:
|
|
|
|
seconds: 2
|
|
|
|
- service: input_boolean.turn_on
|
|
|
|
entity_id: input_boolean.guest_mode
|
|
|
|
|
|
|
|
|