130 lines
3.8 KiB
YAML
130 lines
3.8 KiB
YAML
# Security Package
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# Security Device Customization
|
|
homeassistant:
|
|
customize_glob:
|
|
"binary_sensor.*_door":
|
|
device_class: door
|
|
"binary_sensor.*_window":
|
|
device_class: window
|
|
binary_sensor.all_doors:
|
|
device_class: door
|
|
binary_sensor.all_windows:
|
|
device_class: window
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# Manual Alarm Control Panel
|
|
alarm_control_panel:
|
|
- platform: manual
|
|
code: !secret alarm_code
|
|
arming_time: 30
|
|
delay_time: 20
|
|
trigger_time: 600
|
|
disarm_after_trigger: false
|
|
disarmed:
|
|
trigger_time: 0
|
|
armed_home:
|
|
arming_time: 0
|
|
delay_time: 0
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# Alarm Settings
|
|
input_boolean:
|
|
auto_arm_alarm:
|
|
name: Automatically Arm Alarm on Presence Change
|
|
auto_disarm_alarm:
|
|
name: Automatically Disarm Alarm on Presence Change
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# Door and Window Groups
|
|
binary_sensor:
|
|
- platform: group
|
|
name: All Doors
|
|
entities:
|
|
- binary_sensor.front_door
|
|
- binary_sensor.laundry_door
|
|
- binary_sensor.living_room_door
|
|
|
|
# - platform: group
|
|
# name: Living Room Window
|
|
# entities:
|
|
# - binary_sensor.living_room_window_left
|
|
# - binary_sensor.living_room_window_right
|
|
|
|
- platform: group
|
|
name: All Windows
|
|
entities:
|
|
- binary_sensor.dining_room_front_window
|
|
# - binary_sensor.dining_room_side_window
|
|
# - binary_sensor.kitchen_left_window
|
|
# - binary_sensor.kitchen_right_window
|
|
# - binary_sensor.laundry_window
|
|
- binary_sensor.office_window
|
|
# - binary_sensor.living_room_window
|
|
# - binary_sensor.guest_room_front_window
|
|
# - binary_sensor.guest_room_side_window
|
|
# - binary_sensor.bathroom_window
|
|
# - binary_sensor.bedroom_side_window
|
|
# - binary_sensor.bedroom_back_window
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# Security Automations
|
|
automation:
|
|
- alias: Auto-Arm Alarm
|
|
trigger:
|
|
- platform: state
|
|
entity_id: sensor.house_presence_status
|
|
to: Away
|
|
condition: "{{ is_state('input_boolean.auto_arm_alarm', 'on') }}"
|
|
action:
|
|
- service: alarm_control_panel.alarm_arm_away
|
|
target:
|
|
entity_id: alarm_control_panel.ha_alarm
|
|
data:
|
|
code: !secret alarm_code
|
|
|
|
- alias: Auto-Disarm Alarm
|
|
trigger:
|
|
- platform: state
|
|
entity_id: sensor.house_presence_status
|
|
to: Just Arrived
|
|
condition: "{{ is_state('input_boolean.auto_disarm_alarm', 'on') }}"
|
|
action:
|
|
- service: alarm_control_panel.alarm_disarm
|
|
target:
|
|
entity_id: alarm_control_panel.ha_alarm
|
|
data:
|
|
code: !secret alarm_code
|
|
|
|
- alias: Notify on Alarm Arm/Disarm
|
|
trigger:
|
|
- platform: state
|
|
entity_id: alarm_control_panel.ha_alarm
|
|
to: disarmed
|
|
- platform: state
|
|
entity_id: alarm_control_panel.ha_alarm
|
|
to: armed_home
|
|
- platform: state
|
|
entity_id: alarm_control_panel.ha_alarm
|
|
to: armed_away
|
|
- platform: state
|
|
entity_id: alarm_control_panel.ha_alarm
|
|
to: armed_night
|
|
- platform: state
|
|
entity_id: alarm_control_panel.ha_alarm
|
|
to: armed_vacation
|
|
action:
|
|
- service: notify.telegram_home
|
|
data:
|
|
message: >
|
|
{%
|
|
set person = states.person
|
|
|selectattr('attributes.user_id', 'eq', trigger.to_state.context.user_id)
|
|
|first|default({'attributes':{'friendly_name':'Automation'}})
|
|
%}Alarm changed to {{
|
|
trigger.to_state.state|replace('_', ' ')|title
|
|
}} by {{
|
|
person.attributes.friendly_name
|
|
}}
|