Frigate Mobile App Notifications

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

I’ve created an add-on which expands upon this concept.
fEVR - frigate Event Video Recorder (pronounced fee-ver) that expands upon what frigate can do.

Open your Home Assistant instance and show the add add-on repository dialog with a specific repository URL pre-filled.

It uses a stripped down and modified version of this blueprint to send information about events that meet defined criteria in the automation via a custom HTTP api.

fEVR then fetches event information including the event snapshot and event clip using frigate’s HTTP API, stores it indepently from frigate, and stashes information about the event in an SQLite database.

When loaded, the interface grabs frigates config via it’s API and writes it’s menu according to frigate’s defined menu and has links to each object tracked by the camera and a direct link to frigate’s mjpeg stream for a quick live view.

Also available as a standalone docker container as well.

Hope someone finds this useful!!!

1 Like

Mate did you have any luck getting this working?

nope… awaiting an update to the blueprint.

in the meantime ive disabled the automation as i was getting hundreds of false positive notifications a day anytime someone walked past my house rather than onto the pathway leading to my home…

1 Like

The blueprint was updated a day or two ago I think. Did you try the updated version?

Also, try to disable the ‘Update Thumbnail’ option?

I misssed that (was looking for a hunterjam post with an update)… just tried it out and its working again

Thanks!!!

Sorry, I made modifications to based on some issues reported in Discord but forgot to post that here.

2 Likes

All working now. Thank you very much!!!

Hi all!

I’m trying to change the default notification sound of the Frigate Notification…

I found on frigate_notification.yaml the “sound:” tag, but if I try to put a “/media/sound/notification.mp3” it doesn’t work.

Is there a possibility to change that sound?

Thank you all

If you are using iOS, you need to upload the sound in the App Settings and reference it by name. There are some pre-loaded sounds you can use as well. See Sounds | Home Assistant Companion Docs

I tried also this step and nothing happens…
I uploaded from companion app menu an it converted the sound in wav, then put it in this way

        sound: "short-notification.wav"

In 2 places like that, but there is always the default sound.

If I try to use the classic notification in other automations, the new sound works.

I have problems only with frigate notification