Skip to content

Instantly share code, notes, and snippets.

@qvr
Forked from hunterjm/frigate_0.10_notification.yaml
Last active June 14, 2025 07:44
Show Gist options
  • Select an option

  • Save qvr/7d377baa72c47dcf94626e41e559acb1 to your computer and use it in GitHub Desktop.

Select an option

Save qvr/7d377baa72c47dcf94626e41e559acb1 to your computer and use it in GitHub Desktop.
Frigate Notifications
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 include an actionable notification allowing you to view the clip and snapshot.
With this blueprint, you need to configure a [notification group][1] which may contain one or more devices for which the notifications are sent.
### Software Version Requirements
Minimum Home Assistant Version: 2022.2
Minimum Frigate Version: 0.10.0 Beta 10
Minimum Frigate Integration Version: 2.2.0
Minimum iOS Version: 15.0
### Required entities:
- Frigate Camera Name
- The name of a Notification Group
### Optional features:
- You can optionally send the notification as a critical alert.
- 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.
- 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
[3]: https://blakeblackshear.github.io/frigate/configuration/objects
domain: automation
source_url: https://gist.github.com/qvr/7d377baa72c47dcf94626e41e559acb1
input:
camera:
name: Frigate Camera
description: The name of the camera as defined in your frigate configuration.
notify_group:
name: Notification Group
description: >
The name of the notification group to call. Assumes the group members are running the
official Home Assistant app to receive notifications.
default: ""
notify_unique_channel:
name: (Optional) Unique notification channel
description: Add the camera name to notification channel so you can set separate notification sound etc.
default: false
selector:
boolean:
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 does not work well on iOS.
default: ""
critical:
name: (Optional) Critical Notification
description: Send as a critical notification to the mobile device.
default: false
selector:
boolean:
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:
zones_suppress:
name: (Optional) Suppress Zones
description: Suppress notifications if the object is first detected in one of the zones in this list (-).
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
lock_control:
name: (Optional) Notification Unlock Option
description: Add option to unlock this lock entity as part of the actionable notification.
default: ""
open_suppress:
name: (Optional) Suppress if entity Open
description: Suppress notifications if this entity state is "Open"
default: ""
silence_timer:
name: (Optional) Silence New Object Notifications
description: >
How long to silence notifications for this camera when requested as part of the
actionable notification. Note: This only applies to new objects. Existing tracked
objects
default: 30
selector:
number:
max: 300
min: 0
unit_of_measurement: minutes
mode: parallel
trigger_variables:
camera: !input camera
trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: 'silence-{{ camera }}'
id: silence
- platform: event
event_type: mobile_app_notification_action
event_data:
action: 'unlock-{{ camera }}'
id: unlock
- platform: mqtt
topic: frigate/events
payload: "{{ camera }}/new"
value_template: "{{ value_json['after']['camera'] }}/{{ value_json['type']}}"
id: frigate-event
variables:
camera: !input camera
camera_name: "{{ camera | replace('_', ' ') | title }}"
base_url: !input base_url
critical: !input critical
group_target: !input notify_group
notify_unique_channel: !input notify_unique_channel
channel: "{{ 'Frigate ' + camera if notify_unique_channel else 'Frigate' }}"
zone_only: !input zone_filter
input_zones: !input zones
zones: "{{ input_zones | list }}"
input_zones_suppress: !input zones_suppress
zones_suppress: "{{ input_zones_suppress | list }}"
input_labels: !input labels
labels: "{{ input_labels | list }}"
presence_entity: !input presence_filter
cooldown: !input cooldown
lock_control: !input lock_control
open_suppress: !input open_suppress
fps_value: "{{ states('sensor.' + camera + '_camera_fps') }}"
fps: "{{ fps_value|int(0) if is_number(fps_value) or 5 }}"
action:
- choose:
- alias: "Silence New Object Notifications"
conditions:
- condition: trigger
id: silence
sequence:
- service: automation.turn_off
target:
entity_id: "{{ this.entity_id }}"
data:
stop_actions: false
- delay:
minutes: !input silence_timer
- service: automation.turn_on
target:
entity_id: "{{ this.entity_id }}"
- alias: "Unlock door"
conditions:
- condition: trigger
id: unlock
sequence:
- service: lock.unlock
target:
entity_id: "{{ lock_control }}"
- alias: "Frigate Event"
conditions:
- condition: trigger
id: "frigate-event"
- "{{ is_state(this.entity_id, 'on') }}"
- "{{ not this.attributes.last_triggered or (now() - this.attributes.last_triggered).seconds > cooldown }}"
sequence:
- variables:
id: "{{ trigger.payload_json['after']['id'] }}"
object: "{{ trigger.payload_json['after']['label'] }}"
label: "{{ object | title }}"
# Dynamic Variables per event
initial_home: "{{ presence_entity != '' and is_state(presence_entity, 'home') }}"
initial_entered_zones: "{{ trigger.payload_json['after']['entered_zones']|first }}"
- alias: "Notifications enabled for object label"
condition: template
value_template: "{{ not labels|length or object in labels }}"
- alias: "Suppression zones while alarm disarmed"
condition: or
conditions:
- "{{ not zones_suppress|length or not zones_suppress|select('in', initial_entered_zones)|list|length > 0 }}"
- condition: state
entity_id: alarm_control_panel.alarmo
state:
- "armed_away"
- "armed_home"
- alias: "Opening suppression while alarm disarmed"
condition: or
conditions:
- "{{ not open_suppress|length or not is_state(open_suppress, 'on') }}"
- condition: state
entity_id: alarm_control_panel.alarmo
state:
- "armed_away"
- "armed_home"
- alias: "Notify on new object"
choose:
- conditions:
- "{{ not zone_only or initial_entered_zones|length > 0 }}"
- "{{ not zones|length or zones|select('in', initial_entered_zones)|list|length > 0 }}"
- "{{ not initial_home }}"
sequence:
- service: "notify.{{ group_target }}"
data:
message: "A {{ label }} was detected on the {{ camera_name }} camera."
data:
tag: "{{ id }}"
group: "frigate-notification-{{ camera }}"
# Android Specific
image: "/api/frigate/notifications/{{id}}/thumbnail.jpg?format=android"
clickAction: "{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4"
ttl: "{{ iif(critical, 0, 3600000) }}"
priority: "{{ iif(critical, 'high', 'normal') }}"
notification_icon: "mdi:cctv"
channel: "{{ channel }}"
importance: "urgent"
visibility: "public"
# iOS Specific
url: "{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4"
attachment:
url: "{{base_url}}/api/frigate/notifications/{{id}}/thumbnail.jpg"
push:
interruption-level: "active"
# Actions
actions:
- action: "{{ 'unlock-' + camera if lock_control else 'URI' }}"
title: "{{ 'Unlock Door' if lock_control else 'View Clip' }}"
uri: "{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4"
destructive: "{{ 'true' if lock_control else 'false' }}"
- action: URI
title: View Snapshot
uri: "{{base_url}}/api/frigate/notifications/{{id}}/snapshot.jpg"
- action: "silence-{{ camera }}"
title: Silence New Notifications
destructive: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment