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

View File

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