Frigate Mobile App Notifications

Possible. I have this running with frigate running on docker on a debian VM (which runs on qemu on proxmox), and I’ve got the frigate integration installed in HASS. I am using HassOS (qemu image) which is running as a VM on Proxmox also.

This blueprint doesn’t communicate directly with Frigate. It uses the HACS Integration. Install and setup Frigate through HACS and you should be good.

I am seeing this same issue/ My automation ends at the first condition,

{{type != ''end''}}

I am using HAOS on a x86 (NUC), and am using the Frigate integration

My blueprint config is pretty simple:

id: '1642119677481'
alias: Frigate Notification
description: Frigate Blueprint
use_blueprint:
  path: hunterjm/frigate_notification.yaml
  input:
    camera: front_east
    notify_device: 73ac7c05451c4c94af8978bdc3d5e2d1
    cooldown: 0
    silence_timer: 0

Here is the package variable:

Executed: January 13, 2022, 5:59:35 PM
this:
  entity_id: automation.frigate_notification
  state: 'on'
  attributes:
    last_triggered: '2022-01-14T00:59:27.208046+00:00'
    mode: single
    current: 1
    id: '1642119677481'
    friendly_name: Frigate Notification
  last_changed: '2022-01-14T00:44:15.999055+00:00'
  last_updated: '2022-01-14T00:59:27.208301+00:00'
  context:
    id: cd7690ad2b166f0f027a9fc4e91f9d4c
    parent_id: null
    user_id: null
trigger:
  id: '0'
  idx: '0'
  platform: mqtt
  topic: frigate/events
  payload: >-
    {"before": {"id": "1642121964.166427-29c9n7", "camera": "front_east",
    "frame_time": 1642121964.496416, "snapshot_time": 1642121964.496416,
    "label": "person", "top_score": 0.78125, "false_positive": false,
    "start_time": 1642121964.166427, "end_time": null, "score": 0.78125, "box":
    [1196, 667, 1607, 1430], "area": 313593, "region": [896, 584, 1832, 1520],
    "current_zones": [], "entered_zones": [], "has_clip": false, "has_snapshot":
    false}, "after": {"id": "1642121964.166427-29c9n7", "camera": "front_east",
    "frame_time": 1642121964.896262, "snapshot_time": 1642121964.496416,
    "label": "person", "top_score": 0.78125, "false_positive": false,
    "start_time": 1642121964.166427, "end_time": 1642121974.492953, "score":
    0.6640625, "box": [1302, 631, 1642, 1362], "area": 248540, "region": [945,
    592, 1857, 1504], "current_zones": [], "entered_zones": [], "has_clip":
    true, "has_snapshot": true}, "type": "end"}
  qos: 0
  description: mqtt topic frigate/events
  payload_json:
    before:
      id: 1642121964.166427-29c9n7
      camera: front_east
      frame_time: 1642121964.496416
      snapshot_time: 1642121964.496416
      label: person
      top_score: 0.78125
      false_positive: false
      start_time: 1642121964.166427
      end_time: null
      score: 0.78125
      box:
        - 1196
        - 667
        - 1607
        - 1430
      area: 313593
      region:
        - 896
        - 584
        - 1832
        - 1520
      current_zones: []
      entered_zones: []
      has_clip: false
      has_snapshot: false
    after:
      id: 1642121964.166427-29c9n7
      camera: front_east
      frame_time: 1642121964.896262
      snapshot_time: 1642121964.496416
      label: person
      top_score: 0.78125
      false_positive: false
      start_time: 1642121964.166427
      end_time: 1642121974.492953
      score: 0.6640625
      box:
        - 1302
        - 631
        - 1642
        - 1362
      area: 248540
      region:
        - 945
        - 592
        - 1857
        - 1504
      current_zones: []
      entered_zones: []
      has_clip: true
      has_snapshot: true
    type: end
id: 1642121964.166427-29c9n7
camera: front_east
camera_name: Front East
object: person
label: Person
entered_zones: []
type: end
base_url: ''
group_target: ''
zone_only: false
input_zones: []
zones: []
input_labels: []
labels: []
presence_entity: ''

Thanks
Chuck

It seems that the first notification is an “end” notification. So I removed the first part of the automation action and jumped right to the end processing, and it mostly works.

However, I had to reduce my recorded image to the (rather small) secondary stream, as the primary stream (4k) will not display on either of my android devices.

I see other people having recordings at 4k, but no explanation of how they display on pocket device. Perhaps iPhone is not as limited.

I cannot at this point change my main feed to 1080p, because the normal NVR takes over the settings. I suspect Android cannot go past 1080p. Unfortunately, the secondary stream is even less than 480!

Chuck

Thanks @hunterjm & @ld9000 . I was able to get it up an running!!!

Hi everyone!!

with the blueprint everything works flawlessly but i have a question.
Then notification sends me the thumbnail that is coming from the second video stream of my dahua so extremely in low res

with this link:
/api/frigate/notifications/{{id}}/thumbnail.jpg?format=android

i would like to use the snapshot direcly that is with much more resolution, i tried everything but seems not working

i tried with this link
‘{{base_url}}/api/frigate/notifications/{{id}}/snapshot.jpg’
but doesn’t work i got ssl error.

How did you have the snapshot in the notification and not the thumbnail?

Any advice are more than welcome!!
I would like also to thank @hunterjm for the incredible contribution!

Marco

1 Like

This blueprint has been great! I have one question though regarding the objects. I have the Zone filter enabled and the object detection set for person and car. I cannot seem to get notifications for anything other than a person. Is there something that has to be configured in the frigate config or something I may be missing?

What type of phone?

Thanks for this awesome blueprint @hunterjm!
I made some changes, because I just have to tinker with it a little - but it is a phantastic starting point. :+1:

I have the same problem. Have you been able to resolve the issue?

Hello. And who managed to set up automation for telegramm? He also wants to place several cameras in one automation. Is it possible?

@BeardedTek @hunterjm
I too was looking to get a higher resolution thumbnail image for notifications? I have troubleshooted by adding the suggested “?bbox=1” to the end of each “snapshot.jpg” entry in the Blueprint, but it still looks to be low resolution in my iOS notifications?

Were you all able to figure this out, it seems like you settled on “changing the thumbnail to snapshot,” but I’m unsure how to do this? Was it possible to retrieve the snapshot using the local media folders instead, perhaps using the latest image in the Snapshot folder?

Got it, seems my changes didn’t apply, needed to restart Home Assistant.

To use the full resolution image instead of the thumbnail, one just needs to replace all instances of “thumbnail.jpg” with “snapshot.jpg” in the Blueprint code!

3 Likes

Hi,

does this blueprint needs updating given this deprecation?
https://github.com/home-assistant/core/pull/61078

I imported it quite a lot time ago hence my question

@hunterjm
Can you add an option to view the live feed?
I used the following for a link to the camera stream and it seems to work pretty well.

<HASS_URL>/api/camera_proxy_stream/camera.{{trigger.payload_json[“after”][“camera”]}}?token={{states.camera.frontdoor.attributes.access_token}}

I’d rather use a long-lived token but I’ve searched and haven’t found a way to do this.
This workaround uses the temporary token so it expires after a few minutes.

EDIT:

I tested with the following to add the stream and it works pretty well.
I copied your blueprint and updated the following section

                          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: URI
                              title: Stream
                              uri: https://home.valdeswithans.com:23453/api/camera_proxy_stream/camera.{{trigger.payload_json["after"]["camera"]}}?token={{states.camera.office.attributes.access_token}}
                            - action: "silence-{{ camera }}"
                              title: Silence New Notifications
                              destructive: true

for the URL, I tried inserting {{camera}} instead of my actual camera name but the automation wouldn’t load

uri: https://your_URL/api/camera_proxy_stream/camera.{{trigger.payload_json[“after”][“camera”]}}?token={{states.camera.{{camera}}.attributes.access_token}}

it works fine if I use the actual camera name

uri: https://your_URL/api/camera_proxy_stream/camera.{{trigger.payload_json[“after”][“camera”]}}?token={{states.camera.office.attributes.access_token}}

Would it be possible to add a timeout for the notification? I.e have the notification automatically dismiss after a set amount of time?

Anyone else have issues with the cooldown not working? I have it set for 60 seconds, but still get spammed with notifications when someone walks by the camera.

Any idea why I can’t delete automations created with this blueprint through the UI? I had to manually remove them from my automation file.

For those on this thread that use my notification blueprint, I have updated it for the 0.10 release. You can import it below and try it out yourself.

:no_entry: Requirements

  • Frigate: 0.10 Beta 10+
  • Home Assistant: 2022.2+
  • Frigate Integration: v2.2.0+
  • iOS 15.0+ or Android with the latest Home Assistant Mobile App installed

:rocket: Features

  • Optionally send the notification as a critical alert (potentially faster delivery on android, noise maker on iOS)
  • Choose whether or not to update the notification when a better thumbnail becomes available.
  • Set a loitering timer to notify you of stationary objects that remain for a set period of time.

:beetle: Bugfixes

  • The old blueprint ran in single mode and only tracked a single object. With stationary objects in frame this means you were probably missing notifications. This version will send a notification for every tracked object. When they are stationary and start moving again it will send another notification.

:arrow_down: Import

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

2 Likes

I still cannot see the snapshots from this notification the address comes up unresolvable regardless of if I use nothing, nabu.casa external address or my own reverse proxy as the base url.

My own automation that takes camera snapshot on motion sensor trigger and sends it to telegram works with either address, but obviously I’d prefer to use this.