feat: Add armed_night configuration hooks

This commit is contained in:
2024-09-02 16:51:40 -07:00
parent 485fb3be32
commit 59dc066efc
2 changed files with 40 additions and 14 deletions

View File

@@ -27,11 +27,6 @@ notify:
push:
interruption-level: time-sensitive
- name: general
platform: group
services:
- action: iphone_jp
# `notify.status` used for simple status reporting (e.g. washer done)
# Keeps these notifications separated from security alerts
- name: status
@@ -46,6 +41,11 @@ notify:
data:
group: 'status-notification-group'
- name: general
platform: group
services:
- action: iphone_jp
- name: everyone
platform: group
services:

View File

@@ -39,15 +39,29 @@ input_text:
# -----------------------------------------------------------------------------
# Alarm Settings
input_boolean:
auto_arm_alarm:
auto_arm_alarm_presence:
name: Automatically Arm Alarm on Presence Change
auto_disarm_alarm:
auto_disarm_alarm_presence:
name: Automatically Disarm Alarm on Presence Change
auto_arm_alarm_night:
name: Automatically Arm/Disarm Alarm at Night
disable_camera_events:
name: Disable Camera Events
guest_mode:
name: Guest Mode
input_datetime:
alarm_auto_arm_night_start:
name: Auto-Arm Night Start
initial: '21:00'
has_date: false
has_time: true
alarm_auto_arm_night_end:
name: Auto-Arm Night Start
initial: '05:00'
has_date: false
has_time: true
binary_sensor:
# -----------------------------------------------------------------------------
@@ -134,6 +148,15 @@ template:
mdi:garage
{% endif %}
- name: Security Night
state: >
{% set now = states('sensor.time') %}
{{
states('alarm_auto_arm_night_start') <= time <= '23:59'
or
'00:00' <= time <= states('alarm_auto_arm_night_end')
}}
# -----------------------------------------------------------------------------
# Garage Door Button
input_button:
@@ -215,12 +238,12 @@ automation:
target:
entity_id: switch.garage_door_relay_1
- alias: Auto-Arm Alarm
- alias: Auto-Arm Alarm (Presence)
trigger:
- platform: state
entity_id: sensor.house_presence_status
to: Away
condition: "{{ is_state('input_boolean.auto_arm_alarm', 'on') }}"
condition: "{{ is_state('input_boolean.auto_arm_alarm_presence', 'on') }}"
action:
- service: alarm_control_panel.alarm_arm_away
target:
@@ -228,12 +251,12 @@ automation:
data:
code: !secret alarm_code
- alias: Auto-Disarm Alarm
- alias: Auto-Disarm Alarm (Presence)
trigger:
- platform: state
entity_id: sensor.house_presence_status
to: Just Arrived
condition: "{{ is_state('input_boolean.auto_disarm_alarm', 'on') }}"
condition: "{{ is_state('input_boolean.auto_disarm_alarm_presence', 'on') }}"
action:
- service: alarm_control_panel.alarm_disarm
target:
@@ -308,6 +331,7 @@ automation:
state:
- 'armed_away'
- 'armed_home'
- 'armed_night'
- 'armed_vacation'
action:
- service: input_text.set_value
@@ -320,7 +344,7 @@ automation:
target:
entity_id: alarm_control_panel.ha_alarm
- alias: Trigger Alarm on Motion
- alias: Trigger Alarm on Interior Motion
trigger:
- platform: state
entity_id: binary_sensor.all_motion_sensors
@@ -351,6 +375,7 @@ automation:
condition: state
entity_id: alarm_control_panel.ha_alarm
state:
- 'armed_night'
- 'armed_away'
- 'armed_vacation'
action:
@@ -491,6 +516,7 @@ automation:
payload: new
value_template: "{{ value_json.type }}"
condition:
- condition: "{{ not is_state('alarm_control_panel.ha_alarm', 'disarmed') }}"
- condition: template
value_template: "{{ trigger.payload_json.after.has_clip }}"
action:
@@ -537,7 +563,7 @@ automation:
- if: "{{ event_data['status'] == 200 }}"
then:
- service: notify.everyone
- service: notify.security
data:
title: 'Doorbell'
message: 'Home Doorbell Rang'
@@ -563,7 +589,7 @@ automation:
[View Clip](/api/frigate/notifications/{{ event_data['content']['event_id'] }}/clip.mp4)
else:
- service: notify.everyone
- service: notify.security
data:
title: "Doorbell"
message: "Home Doorbell Rang but could not create event: {{ event_data['content']['message'] }}"