Frigate Mobile App Notifications

Excellent blueprint. Thanks so much.

The issue I have is that I always get notifications, even when the group is marked as ‘home’. The notification_device is a single Android device (not a group).

Below is my blueprint configuration:

id: '1646032015087'
alias: Frigate Notification (0.10.0)
description: ''
use_blueprint:
  path: hunterjm/frigate_0.10_notification.yaml
  input:
    notify_device: 7065cb5390285d75bda8cf8c724ef377
    update_thumbnail: true
    camera: front-yard
    cooldown: 60
    presence_filter: group.parents_group

Any ideas?

Same issue here

Same issue. I have zone filter enabled and the trigger zone and trigger object fields defined, but i get every motion (not only motion in the zone and of a specific object type). This use to work fine with the orginal version of the blueprint, but after the 0.10 updated version it stopped filtering the notifications appropriatly

Has anyone managed to get this working with Frigate running on a docker(Unraid), and HASS running on another device/environment(HASS Blue for myself).

Everything works fine, but no matter what I do I can not get the clips/snapshots to load.

I didn’t tested it (yet) but try to update your local blueprint and replace every url starting with

/api/frigate/notifications/

with

{{base_url}}/api/events/

the api is a little bit different when running via HASS or docker/standalone
check out HTTP API | Frigate

There was a bug in the new release for zone filters. I have updated it and hopefully the new logic works as intended.

Since Home Assistant doesn’t allow updating blueprints yet you may need to copy the contents of the gist yourself and replace it in the blueprints folder.

2 Likes

Thank you SO much, I knew it had to do something with that, or atleast I think I did as I sat there staring at the yaml file and the actual event link that frigate fires off from docker.

I appreciate the help, and hopefully others can learn from my issues as well. Your link helped tremendously for my other issues as well(dont know how I missed that under docs)

I updated my blueprint, however, it looks like it does not properly check for the condition of a group being home/away. If I change the Presence Filter to a person it works as expected.

Thanks again for this blueprint, its amazing!

Edit: Let me know if I can gather any debug info for you.
Edit 2: It looks like the presence filter does not work for “persons” either.

For me the presence filter does not work at all - for a person, group or device …

What logs can I provide to check what I’m doing wrong, or if there is a bug in the blueprint?

I started seeing this error in the logs:

Unable to read file /home/user/.homeassistant/blueprints/automation/hunterjm/._frigate_0.10_notification.yaml: 'utf-8' codec can't decode byte 0xb0 in position 37: invalid start byte

Any ideas? Thank you for this blueprint.

Can you show me what your blueprint configuration looks like? You can view as YAML by clicking the three dots in the top right and paste it here. The presence filter seems to work for me. Here is my configuration.

alias: Frigate 0.10 - Foyer
description: ''
use_blueprint:
  path: hunterjm/frigate_beta_notification.yaml
  input:
    camera: foyer
    presence_filter: group.family_presence
    cooldown: 90
    notify_group: ios_jk_phones

Here is mine where presence seems to be ignored …

id: '1646032015087'
alias: Frigate Notification (0.10.0)
description: ''
use_blueprint:
  path: hunterjm/frigate_0.10_notification.yaml
  input:
    notify_device: 7065cb5390285d75bda8cf8c724ef377
    update_thumbnail: true
    camera: rear_yard
    cooldown: 60
    presence_filter: person.mark

Thank you for updating this, it’s working a charm for me!

One question, I am able to set notifications for when an object is stationary (a vehicle, in my use case.)

However, what I want to do is to send a notification when the vehicle is absent (specifically, when the parking space outside my house is empty.)

Is there a way of building something like this using this blueprint? Or will I need to spin together something custom?

I think the presence filter is ignored, or the logic is incorrect, when the update_thumbnail option is True (or my understanding of that is incorrect)

Maybe this line’s logic needs to be redone as it appears new_snapshot will override the logic if I am home or not?

{{ loitering or new_snapshot or (not home and zone_filter and (presence_changed or stationary_moved or zone_only_changed or entered_zones_changed)) }}"

Mine is notifying me for any person detected rather than the persons in the specified zone. Below is the YAML.

alias: NVR Notification
description: ''
use_blueprint:
  path: homeassistant/frigate_0.10_notification.yaml
  input:
    camera: Entryway
    notify_device: bff7ad27c914eb7f604ab09e70cd0e9d
    base_url: redacted
    update_thumbnail: true
    zone_filter: true
    zones:
      - Close
    labels:
      - person

@hunterjm
I’m reposting this request since you now have a new version

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}}

1 Like

I’m glad I’m not alone. I am getting the exact same thing but any object!!

Screen Shot 2022-03-05 at 8.28.06 am

That is correct - the logic for new snapshot will ignore any presence or zone filters currently. Can you try moving it in the brackets before presence_changed and let me know if that fixes your issue?

Sorry, there is a lot going on here and it’s hard to test every situation :slight_smile:

I changed the line:
{{ loitering or new_snapshot or (not home and zone_filter and (presence_changed or stationary_moved or zone_only_changed or entered_zones_changed)) }}

to
{{ loitering or (new_snapshot and not home and zone_filter and (presence_changed or stationary_moved or zone_only_changed or entered_zones_changed)) }}

This seems to work. I have now defaulted though to not sending new snapshots

Been loving this blueprint and it’s been working a charm until recently. I am getting the following in the logs:

Exception in message_received when handling msg on 'frigate/events': '{"before": {"id": "1646081879.171302-lqgm5r", "camera": "front_camera", "frame_time": 1646649591.812268, "snapshot_time": 1646081885.987722, "label": "person", "top_score": 0.84375, "false_positive": false, "start_time": 1646081879.171302, "end_time": null, "score": 0.84375, "box": [1168, 395, 1343, 887], "area": 86100, "region": [855, 180, 1755, 1080], "stationary": true, "motionless_count": 2019817, "position_changes": 1, "current_zones": [], "entered_zones": [], "has_clip": false, "has_snapshot": true}, "after": {"id": "1646081879.171302-lqgm5r", "camera": "front_camera", "frame_time": 1646649652.823172, "snapshot_time": 1646081885.987722, "label": "person", "top_score": 0.84375, "false_positive": false, "start_time": 1646081879.171302, "end_time": null, "score": 0.84375, "box": [1168, 395, 1343, 887], "area": 86100, "region": [855, 180, 1755, 1080], "stationary": true, "motionless_count": 2019898, "position_changes": 1, "current_zones": [], "entered_zones": [], "has_clip": false, "has_snapshot": true}, "type": "update"}' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 47, in wrapper msg_callback(msg) File "/usr/src/homeassistant/homeassistant/components/mqtt/sensor.py", line 284, in message_received self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 539, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 663, in _async_write_ha_state self.hass.states.async_set( File "/usr/src/homeassistant/homeassistant/core.py", line 1363, in async_set state = State( File "/usr/src/homeassistant/homeassistant/core.py", line 1049, in __init__ raise InvalidStateError( homeassistant.exceptions.InvalidStateError: Invalid state encountered for entity ID: sensor.mqtt_sensor. State max length is 255 characters.

Any bright ideas???