Frigate Mobile App Notifications

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

Thank you,

Working nice,

There is one thing what would be handy an on-off state condition example:
If Iam home I would like to get notify when my alarm state armed.

I solved changing the code of frigate_notification.yaml from

        image: /api/frigate/notifications/{{id}}/thumbnail.jpg?format=android
        sound: short_notification.wav
        attachment:
          url: /api/frigate/notifications/{{id}}/thumbnail.jpg
        actions:

to

        image: /api/frigate/notifications/{{id}}/thumbnail.jpg?format=android
        push:
          sound: short_notification.wav
        attachment:
          url: /api/frigate/notifications/{{id}}/thumbnail.jpg
        actions:

and added the same code in all 4 notification cases

@hunterjm By the way, my PR to allow Android to accept video param and convert it to a gif in the notification was merged, might be an interesting option for the blueprint: FEAT: Ability to show video in notification as a gif by NickM-27 Ā· Pull Request #2342 Ā· home-assistant/android Ā· GitHub

3 Likes

Anyone see this error in the notifications on Android? They play video fine etc ā€¦ and homeassistant app works fine too. Posted in the app forum also, but figured maybe someone here has same issue

1 Like

All the time. You can clear it for a moment by swiping right, but it comes back a few seconds later.

At least Iā€™m not alone. I tried everything with the connection etc. Couldnā€™t find anything actually wrong.

hey, did you manage to fix the problem with http error 400? Been having the same issues too.

edit: found your github post and had the same issue, now its working :smiley:

1 Like

For anyone else who doesnā€™t want to dig through GitHub:

It turns out there was a conflict with a previously installed version of Frigateā€”installed on HassOSā€”which was disabled but not uninstalled. Because HA hides disabled integrations I didnā€™t see it. It was only after trying to uninstall everything and start over that I realised the conflict.

1 Like