Forked from hunterjm/frigate_notification.yaml
Created
April 16, 2022 03:21
Revisions
-
hunterjm revised this gist
May 25, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,7 +12,7 @@ blueprint: - Mobile App Device **or** the name of a Notification Group ### Optional features: - You can limit notifications to objects entering **any** pre-defined [zones][2] in Frigate. - You can specify which [zones][2] to be notified about. This must be a list (e.g.): ```yaml - backyard -
hunterjm revised this gist
May 25, 2021 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ blueprint: description: | ## Frigate Mobile App Notification This blueprint will send a notification to your device when a Frigate event for the selected camera is fired. The notification will initially include the thumbnail of the detection, but will update to include actionable notifications allowing you to view the saved clip/snapshot when available, or silence the notification for a configurable amount of time. With this blueprint, you may send the notification to multiple devices by leaving "Device" blank and instead use a [notification group][1]. @@ -24,7 +24,7 @@ blueprint: ``` - You can disable notifications if a presence entity or group is "home". - You can configure a cooldown for the camera to reduce the number of notifications when back-to-back events occur. - You can silence future notifications for a defined amount of time through actionable notifications. This is helpful in situations where you know you will be triggering detections for an extended period of time, like when the kids are playing outside. [1]: https://companion.home-assistant.io/docs/notifications/notifications-basic#sending-notifications-to-multiple-devices [2]: https://blakeblackshear.github.io/frigate/configuration/cameras#zones -
hunterjm revised this gist
May 25, 2021 . 1 changed file with 28 additions and 31 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,13 +3,9 @@ blueprint: description: | ## Frigate Mobile App Notification This blueprint will send a notification to your device when a Frigate event for the selected camera is fired. The notification will initially include the thumbnail of the detection, but nclude an actionable notification allowing you to view the saved clip when available. With this blueprint, you may send the notification to multiple devices by leaving "Device" blank and instead use a [notification group][1]. ### Required entities: - Frigate Camera Name @@ -27,11 +23,8 @@ blueprint: - car ``` - You can disable notifications if a presence entity or group is "home". - You can configure a cooldown for the camera to reduce the number of notifications when back-to-back events occur. - You can silence future notifications for a defined amount of time through actionable notifications. This is helpful in situations where you know you will be triggering detections for an extended period of time. i.e. kids playing outside. [1]: https://companion.home-assistant.io/docs/notifications/notifications-basic#sending-notifications-to-multiple-devices [2]: https://blakeblackshear.github.io/frigate/configuration/cameras#zones @@ -147,15 +140,19 @@ action: data: tag: '{{ id }}' group: 'frigate-notification-{{ camera }}' image: '/api/frigate/notifications/{{id}}/thumbnail.jpg?format=android' # Android attachment: # iOS url: '/api/frigate/notifications/{{id}}/thumbnail.jpg' default: - service: "notify.{{ group_target }}" data: message: 'A {{ label }} was detected on the {{ camera_name }} camera.' data: tag: '{{ id }}' group: 'frigate-notification-{{ camera }}' image: '/api/frigate/notifications/{{id}}/thumbnail.jpg?format=android' # Android attachment: # iOS url: '/api/frigate/notifications/{{id}}/thumbnail.jpg' - repeat: sequence: - wait_for_trigger: @@ -180,11 +177,11 @@ action: group: 'frigate-notification-{{ camera }}' url: '{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4' # iOS clickAction: '{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4' # Android image: '/api/frigate/notifications/{{id}}/thumbnail.jpg?format=android' # Android sound: none attachment: # iOS url: '/api/frigate/notifications/{{id}}/thumbnail.jpg' # lazy: true actions: - action: URI title: View Clip @@ -204,11 +201,11 @@ action: group: 'frigate-notification-{{ camera }}' url: '{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4' # iOS clickAction: '{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4' # Android image: '/api/frigate/notifications/{{id}}/thumbnail.jpg?format=android' # Android sound: none attachment: # iOS url: '/api/frigate/notifications/{{id}}/thumbnail.jpg' # lazy: true actions: - action: URI title: View Clip @@ -219,14 +216,14 @@ action: - action: 'silence-{{ camera }}' title: Silence Notifications destructive: true until: "{{ wait.trigger.payload_json['type'] == 'end' }}" - wait_for_trigger: - platform: event event_type: mobile_app_notification_action event_data: action: 'silence-{{ camera }}' timeout: seconds: !input cooldown continue_on_timeout: false - delay: minutes: !input silence_timer -
hunterjm revised this gist
May 2, 2021 . 1 changed file with 26 additions and 20 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -147,21 +147,15 @@ action: data: tag: '{{ id }}' group: 'frigate-notification-{{ camera }}' image: '/api/frigate/notifications/{{id}}/thumbnail.jpg' default: - service: "notify.{{ group_target }}" data: message: 'A {{ label }} was detected on the {{ camera_name }} camera.' data: tag: '{{ id }}' group: 'frigate-notification-{{ camera }}' image: '/api/frigate/notifications/{{id}}/thumbnail.jpg' - repeat: sequence: - wait_for_trigger: @@ -184,14 +178,20 @@ action: data: tag: '{{ id }}' group: 'frigate-notification-{{ camera }}' url: '{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4' # iOS clickAction: '{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4' # Android image: '/api/frigate/notifications/{{id}}/thumbnail.jpg' # video: '/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4' sound: none # attachment: # lazy: true actions: - action: URI title: View Clip uri: '{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4' - action: URI title: View Snapshot uri: '{{base_url}}/api/frigate/notifications/{{id}}/snapshot.jpg' - action: 'silence-{{ camera }}' title: Silence Notifications destructive: true @@ -202,14 +202,20 @@ action: data: tag: '{{ id }}' group: 'frigate-notification-{{ camera }}' url: '{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4' # iOS clickAction: '{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4' # Android image: '/api/frigate/notifications/{{id}}/thumbnail.jpg' # video: '/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4' sound: none # attachment: # lazy: true actions: - action: URI title: View Clip uri: '{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4' - action: URI title: View Snapshot uri: '{{base_url}}/api/frigate/notifications/{{id}}/snapshot.jpg' - action: 'silence-{{ camera }}' title: Silence Notifications destructive: true -
hunterjm revised this gist
May 1, 2021 . 1 changed file with 10 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -54,6 +54,13 @@ blueprint: name: Notification Group description: The name of the notification group to call. default: "" base_url: name: (Optional) Base URL description: > The external url for your Home Assistant instance. This will default to a relative URL and will open the clips in the app instead of the browser, which may cause issues on some devices. default: "" zone_filter: name: (Optional) Zone Filter description: Only notify if object has entered a defined zone. @@ -115,6 +122,7 @@ variables: label: "{{ object | title }}" entered_zones: "{{ trigger.payload_json['after']['entered_zones'] }}" type: "{{ trigger.payload_json['type'] }}" base_url: !input base_url group_target: !input notify_group zone_only: !input zone_filter input_zones: !input zones @@ -183,7 +191,7 @@ action: actions: - action: 'URI' title: 'View Clip' uri: '{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4' - action: 'silence-{{ camera }}' title: Silence Notifications destructive: true @@ -201,7 +209,7 @@ action: actions: - action: 'URI' title: 'View Clip' uri: '{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4' - action: 'silence-{{ camera }}' title: Silence Notifications destructive: true -
hunterjm revised this gist
May 1, 2021 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -139,7 +139,7 @@ action: data: tag: '{{ id }}' group: 'frigate-notification-{{ camera }}' image: '/api/frigate/notifications/{{id}}/thumbnail.jpg?format=android' attachment: url: '/api/frigate/notifications/{{id}}/thumbnail.jpg' content-type: jpeg @@ -150,7 +150,7 @@ action: data: tag: '{{ id }}' group: 'frigate-notification-{{ camera }}' image: '/api/frigate/notifications/{{id}}/thumbnail.jpg?format=android' attachment: url: '/api/frigate/notifications/{{id}}/thumbnail.jpg' content-type: jpeg @@ -176,7 +176,7 @@ action: data: tag: '{{ id }}' group: 'frigate-notification-{{ camera }}' image: '/api/frigate/notifications/{{id}}/thumbnail.jpg?format=android' attachment: url: '/api/frigate/notifications/{{id}}/thumbnail.jpg' content-type: jpeg @@ -194,7 +194,7 @@ action: data: tag: '{{ id }}' group: 'frigate-notification-{{ camera }}' image: '/api/frigate/notifications/{{id}}/thumbnail.jpg?format=android' attachment: url: '/api/frigate/notifications/{{id}}/thumbnail.jpg' content-type: jpeg -
hunterjm revised this gist
May 1, 2021 . 1 changed file with 42 additions and 14 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -29,6 +29,9 @@ blueprint: - You can disable notifications if a presence entity or group is "home". - You can configure a cooldown for the camera to reduce the number of notifications when back-to-back events occur. - You can silence future notifications for a defined amount of time through actionable notifications. This is helpful in situations where you know you will be triggering detections for an extended period of time. i.e. kids playing outside. [1]: https://companion.home-assistant.io/docs/notifications/notifications-basic#sending-notifications-to-multiple-devices [2]: https://blakeblackshear.github.io/frigate/configuration/cameras#zones @@ -84,6 +87,17 @@ blueprint: max: 300 min: 0 unit_of_measurement: seconds silence_timer: name: (Optional) Silence Notifications description: > How long to silence notifications for this camera when requested as part of the actionable notification. default: 30 selector: number: max: 300 min: 0 unit_of_measurement: minutes mode: single max_exceeded: silent @@ -143,10 +157,10 @@ action: - repeat: sequence: - wait_for_trigger: - platform: mqtt topic: frigate/events payload: "{{ id }}" value_template: "{{ value_json['after']['id'] }}" timeout: minutes: 2 continue_on_timeout: false @@ -166,10 +180,13 @@ action: attachment: url: '/api/frigate/notifications/{{id}}/thumbnail.jpg' content-type: jpeg actions: - action: 'URI' title: 'View Clip' uri: '/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4' - action: 'silence-{{ camera }}' title: Silence Notifications destructive: true default: - service: "notify.{{ group_target }}" data: @@ -181,10 +198,21 @@ action: attachment: url: '/api/frigate/notifications/{{id}}/thumbnail.jpg' content-type: jpeg actions: - action: 'URI' title: 'View Clip' uri: '/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4' - action: 'silence-{{ camera }}' title: Silence Notifications destructive: true - wait_for_trigger: - platform: event event_type: mobile_app_notification_action event_data: action: 'silence-{{ camera }}' timeout: seconds: !input cooldown continue_on_timeout: false - delay: minutes: !input silence_timer until: "{{ wait.trigger.payload_json['type'] == 'end' }}" -
hunterjm revised this gist
May 1, 2021 . 1 changed file with 12 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -123,18 +123,20 @@ action: type: notify message: 'A {{ label }} was detected on the {{ camera_name }} camera.' data: tag: '{{ id }}' group: 'frigate-notification-{{ camera }}' image: '/api/frigate/notifications/{{id}}/thumbnail.jpg' attachment: url: '/api/frigate/notifications/{{id}}/thumbnail.jpg' content-type: jpeg default: - service: "notify.{{ group_target }}" data: message: 'A {{ label }} was detected on the {{ camera_name }} camera.' data: tag: '{{ id }}' group: 'frigate-notification-{{ camera }}' image: '/api/frigate/notifications/{{id}}/thumbnail.jpg' attachment: url: '/api/frigate/notifications/{{id}}/thumbnail.jpg' content-type: jpeg @@ -158,11 +160,12 @@ action: type: notify message: 'A {{ label }} was detected on the {{ camera_name }} camera.' data: tag: '{{ id }}' group: 'frigate-notification-{{ camera }}' image: '/api/frigate/notifications/{{id}}/thumbnail.jpg' attachment: url: '/api/frigate/notifications/{{id}}/thumbnail.jpg' content-type: jpeg # actions: # - action: 'URI' # title: 'View Clip' @@ -174,6 +177,7 @@ action: data: tag: '{{ id }}' group: 'frigate-notification-{{ camera }}' image: '/api/frigate/notifications/{{id}}/thumbnail.jpg' attachment: url: '/api/frigate/notifications/{{id}}/thumbnail.jpg' content-type: jpeg -
hunterjm revised this gist
Apr 21, 2021 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -35,6 +35,7 @@ blueprint: [3]: https://blakeblackshear.github.io/frigate/configuration/objects domain: automation source_url: https://gist.github.com/hunterjm/23c1588a9f2b8b9c2a62ffc364e17f8c input: camera: name: Frigate Camera -
hunterjm created this gist
Apr 21, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,185 @@ blueprint: name: Frigate Notification description: | ## Frigate Mobile App Notification This blueprint will send a notification to your device when a Frigate event for the selected camera is fired. The notification will initially include the thumbnail of the detection, but will update to include an actionable notification allowing you to view the saved clip when available. With this blueprint, you may send the notification to multiple devices by leaving "Device" blank and instead use a [notification group][1]. ### Required entities: - Frigate Camera Name - Mobile App Device **or** the name of a Notification Group ### Optional features: - You can limit notifications to objects entering pre-defined [zones][2] in Frigate. - You can specify which [zones][2] to be notified about. This must be a list (e.g.): ```yaml - backyard ``` - You can specify what type of [objects][3] to be notified about. This must be a list (e.g.): ```yaml - person - car ``` - You can disable notifications if a presence entity or group is "home". - You can configure a cooldown for the camera to reduce the number of notifications when back-to-back events occur. [1]: https://companion.home-assistant.io/docs/notifications/notifications-basic#sending-notifications-to-multiple-devices [2]: https://blakeblackshear.github.io/frigate/configuration/cameras#zones [3]: https://blakeblackshear.github.io/frigate/configuration/objects domain: automation input: camera: name: Frigate Camera description: The name of the camera as defined in your frigate configuration. notify_device: name: Device description: The device must run the official Home Assistant app to receive notifications. default: false selector: device: integration: mobile_app notify_group: name: Notification Group description: The name of the notification group to call. default: "" zone_filter: name: (Optional) Zone Filter description: Only notify if object has entered a defined zone. default: false selector: boolean: zones: name: (Optional) Trigger Zones description: A list (-) of zones you wish to recieve notifications for. default: [] selector: object: labels: name: (Optional) Trigger Objects description: A list (-) of objects you wish to recieve notifications for. default: [] selector: object: presence_filter: name: (Optional) Presence Filter description: Only notify if selected presence entity is not "home". default: "" selector: entity: cooldown: name: (Optional) Cooldown description: Delay before sending another notification for this camera after the last event. default: 30 selector: number: max: 300 min: 0 unit_of_measurement: seconds mode: single max_exceeded: silent trigger: platform: mqtt topic: frigate/events payload: !input camera value_template: "{{ value_json['after']['camera'] }}" variables: id: "{{ trigger.payload_json['after']['id'] }}" camera: "{{ trigger.payload_json['after']['camera'] }}" camera_name: "{{ camera | replace('_', ' ') | title }}" object: "{{ trigger.payload_json['after']['label'] }}" label: "{{ object | title }}" entered_zones: "{{ trigger.payload_json['after']['entered_zones'] }}" type: "{{ trigger.payload_json['type'] }}" group_target: !input notify_group zone_only: !input zone_filter input_zones: !input zones zones: "{{ input_zones | list }}" input_labels: !input labels labels: "{{ input_labels | list }}" presence_entity: !input presence_filter condition: - "{{ type != 'end' }}" - "{{ not zone_only or entered_zones|length > 0 }}" - "{{ not zones|length or zones|select('in', entered_zones)|list|length > 0 }}" - "{{ not labels|length or object in labels }}" - "{{ not presence_entity or not is_state(presence_entity, 'home') }}" action: - choose: - conditions: "{{ not group_target }}" sequence: - device_id: !input notify_device domain: mobile_app type: notify message: 'A {{ label }} was detected on the {{ camera_name }} camera.' data: tag: "{{ id }}" group: "frigate-notification-{{ camera }}" attachment: url: "/api/frigate/notifications/{{id}}/thumbnail.jpg" content-type: "jpeg" default: - service: "notify.{{ group_target }}" data: message: 'A {{ label }} was detected on the {{ camera_name }} camera.' data: tag: '{{ id }}' group: 'frigate-notification-{{ camera }}' attachment: url: '/api/frigate/notifications/{{id}}/thumbnail.jpg' content-type: jpeg - repeat: sequence: - wait_for_trigger: - platform: mqtt topic: frigate/events payload: "{{ id }}" value_template: "{{ value_json['after']['id'] }}" timeout: minutes: 2 continue_on_timeout: false - condition: template value_template: "{{ wait.trigger.payload_json['type'] == 'end' }}" - choose: - conditions: "{{ not group_target }}" sequence: - device_id: !input notify_device domain: mobile_app type: notify message: 'A {{ label }} was detected on the {{ camera_name }} camera.' data: tag: "{{ id }}" group: "frigate-notification-{{ camera }}" attachment: url: "/api/frigate/notifications/{{id}}/thumbnail.jpg" content-type: "jpeg" # actions: # - action: 'URI' # title: 'View Clip' # uri: '/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4' default: - service: "notify.{{ group_target }}" data: message: 'A {{ label }} was detected on the {{ camera_name }} camera.' data: tag: '{{ id }}' group: 'frigate-notification-{{ camera }}' attachment: url: '/api/frigate/notifications/{{id}}/thumbnail.jpg' content-type: jpeg # actions: # - action: 'URI' # title: 'View Clip' # uri: '/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4' until: "{{ wait.trigger.payload_json['type'] == 'end' }}" - delay: seconds: !input cooldown