From 1c63d609bffeb411f5ab7ff95f1f75276cb178fe Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Thu, 2 Feb 2023 02:30:55 +0100 Subject: [PATCH] Add discord notifications --- configuration/automations/alarm.yaml | 18 ++-------- scripts/11.cctv.yaml | 50 ++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 16 deletions(-) diff --git a/configuration/automations/alarm.yaml b/configuration/automations/alarm.yaml index 1dfe2d5..4fce1eb 100644 --- a/configuration/automations/alarm.yaml +++ b/configuration/automations/alarm.yaml @@ -23,14 +23,7 @@ action: - service: alarm_control_panel.alarm_trigger entity_id: alarm_control_panel.home_alarm - - service: notify.mobile_app_iphone - data: - title: "ALARM! Pending for disarm" - message: > - {{ state_attr(trigger.entity_id, 'friendly_name') }} - data: - entity_id: camera.hallway - url: "/lovelace-tablet/security" + - service: script.cctv_notify_hallway - id: alarm-away-living-roomn alias: '[Alarm] Trigger alarm when not at home (Living Room)' @@ -71,14 +64,7 @@ action: - service: alarm_control_panel.alarm_trigger entity_id: alarm_control_panel.home_alarm - - service: notify.mobile_app_iphone - data: - title: "ALARM! Pending for disarm" - message: > - {{ state_attr(trigger.entity_id, 'friendly_name') }} - data: - entity_id: camera.living_room - url: "/lovelace-tablet/security" + - service: script.cctv_notify_hallway - id: alarm-away-remaining alias: '[Alarm] Trigger alarm when not at home' diff --git a/scripts/11.cctv.yaml b/scripts/11.cctv.yaml index ab4adae..ff0c397 100644 --- a/scripts/11.cctv.yaml +++ b/scripts/11.cctv.yaml @@ -31,3 +31,53 @@ cctv_off: - switch.hallway_recordings - switch.hallway_snapshots - switch.hallway_detect + +cctv_notify_hallway: + alias: CCTV notify hallway + sequence: + - service: notify.mobile_app_iphone + data: + title: "ALARM! Pending for disarm" + message: > + {{ state_attr(trigger.entity_id, 'friendly_name') }} + data: + entity_id: camera.hallway + url: "/lovelace-tablet/security" + - service: camera.snapshot + data: + filename: /config/www/cctv/hallway.jpg + target: + entity_id: camera.hallway + - service: notify.home_assistant + data: + title: "ALARM. Pending to disarm " + message: "Motion in hallway" + target: [ "1070507369164984372" ] + data: + images: + - "/config/www/cctv/hallway.jpg" + +cctv_notify_living_room: + alias: CCTV notify living room + sequence: + - service: notify.mobile_app_iphone + data: + title: "ALARM! Pending for disarm" + message: > + {{ state_attr(trigger.entity_id, 'friendly_name') }} + data: + entity_id: camera.living_room + url: "/lovelace-tablet/security" + - service: camera.snapshot + data: + filename: /config/www/cctv/living_room.jpg + target: + entity_id: camera.hallway + - service: notify.home_assistant + data: + title: "ALARM. Pending to disarm " + message: "Motion in living room" + target: [ "1070507369164984372" ] + data: + images: + - "/config/www/cctv/living_room.jpg"