Frigate Mobile App Notifications 2.0

Hi
just a note to say thanks - I tried the beta fork of the blueprint on your github. Works perfectly.

I was actually using a modded version of the original blueprint so maybe that was the issue.

it may be worth you re-posting a link to your github as I think a lot of people will be on old versions of the blueprint but asking you for help!

also like the extra options you have included around renaming the buttons etc…

Thanks again

Great to hear, and thank you for the feedback.

I’ve been trying to avoid spamming it in hunterjms absence but yes, seeing as the blueprint from the OP doesn’t work with frigate 0.11 more and more people are popping in with issues.

Rather than post the links again, heres a link to a post i’ll maintain with the details.

feature request - it would be great to have a state based critical filter - so notifications are only critical based on the state of another sensor.

Similar to the cooldown state option.

Well i didn’t realise it when i added it but you can actually already do that using the critical notification options in the beta (not in stable).
instead of a boolean true or false it accepts a template, so you could have any combination of things determine if it is critical or not including the state of another entity.

i’ll try that - thanks

I was, yeah. I just moved over to using your blueprint, and it works absolutely fine.

Thanks for publishing it!

Thanks for the help!

Frigate is 0.10.1-83481AF, blueprint ui says Frigate Notification (0.10.0)
Frigate Notifications are turned on, per the Developers Tools → States tab.
I’m not quite sure what entity id means, but an example from Frigate Debug:
“cameras”: {
“camera1”: {
HA seems to proper-case all its entities (e.g. Camera1 Person), but I’ve tried entering camera1 and Camera1 into various alerts, none have ever fired.

In the Logbook tab, the only events I see are 'Camera1 person occupancy" detected occupancy and then cleared (no occupancy detected). I also see similar zone occupancy transitions. I don’t see other routine Frigate activity events. In reading the blueprint gist, I don’t see the string occupancy, so I’m wondering if my Frigate instance just isn’t creating the events that the blueprint looks for?

Hey guys,

I’m battling to get this to work. I can get normal notifications, but this blueprint never fires (even if I try manually run it).

The automation that DOES work:

id: '1668626588146'
alias: Motion Detected
description: ''
trigger:
  - type: motion
    platform: device
    device_id: 7b6aedf60a69eb6329da488164e83d75
    entity_id: binary_sensor.front_camera_motion
    domain: binary_sensor
condition: []
action:
  - device_id: 617cef11d9c9fd560d54e3a5d8fb125e
    domain: mobile_app
    type: notify
    message: Motion detected!
    title: Camera J1
mode: single

Blueprint config (not working):

id: '1668627099974'
alias: Send image on motion detection
description: Motion detected
use_blueprint:
  path: hunterjm/frigate_0.10_notification.yaml
  input:
    camera: Front Camera #have tried front_camera as well
    notify_device: 617cef11d9c9fd560d54e3a5d8fb125e
    critical: true
    presence_filter: camera.front_camera

frigate.yml:

mqtt:
  host: 192.168.8.135
  user: mqtt-user
  password: test123

cameras:
  front_camera:
    ffmpeg:
      inputs:
        - path: rtsp://rudeboy:[email protected]:8080/h264_pcm.sdp
          roles:
            - detect
            - rtmp
    detect:
      width: 640
      height: 480
      fps: 5

detectors:
  cpu1:
    type: cpu
  cpu2:
    type: cpu

ffmpeg:
  global_args: -hide_banner -loglevel verbose

# Include all cameras by default in Birdseye view
birdseye:
  enabled: True
  mode: continuous

I’m not sure how to troubleshoot this - could someone possibly point me in the right direction?

The blueprint doesn’t look at the occupancy sensors, it is triggered by mqtt messages that frigate generates.

The entity id is the unique string for each entity that has the format domain.name. in your case I’d expect it would be camera.camera1.

I typically look in settings>entities and search.

The proper case name you mention is referred to as the friendly name

Theres a fair bit to confirm in your case. Is mqtt setup? Are there any errors in the frigate or mqtt add-on logs?

1 Like

Definitely needs front_camera if that’s how it is written in frigate.

Are you using frigate 0.11 or 0.10? There’s a fix required for 0.11 if using that version of the blueprint

Are you getting any traces at all or zero triggers if the automation?

Also you can’t manually run it from the automation screen.

Hi again

I tried the custom template for critical notification

I have away and night input booleans which I set so that only critical alerts would sound when one of them was on:

“{{‘false’ if is_state(‘input_boolean.night_mode’, ‘off’) else ‘true’ }}”

the logic is reversed but it should work - however, what Im seeing is that critical is firing at all times instead!

Any idea why that might be happening? Thanks

Is there a version of this that works properly for version 0.11 of Frigate?

I’m not sure if it an actual issue or just a display issue for me currently but the quote symbols you have used above are not the right symbols and cause errors in the template editor when i pasted it into my own.

try copying this "{{'false' if is_state('input_boolean.night_mode', 'off') else 'true' }}"

You need to fix the fps_value line as discussed earlier in this thread or use my or any other fork which already has a fix applied. The blueprint works great in 0.11 still, it just has one little error.

think that was just an error in the copy / paste to the forum.

Whatever I set - it triggers critical using the syntax from the beta fork.

Using stable - the boolean works fine - but obviously I cant use template conditions.

btw this also seems to ignore the cooldown period.

just a heads up -

Ive spotted a syntax error in the code around ios sound notifications:

in the action section of each automation you have :

push:
   sound: "{{ iif(update, 'none', sound) }}"

but to get sounds to play you need to format it:

  push:
    sound:
        name: "{{ iif(update, 'none', sound) }}"
1 Like

Once again, thank you for your help.

I think mqtt add-on is set up, possibly even correctly. Everything else in the Frigate integration works fine, I can view new clips, etc.

From the logs, I’m getting an error in the automation script:

2022-11-17 17:51:04.746 ERROR (MainThread) [homeassistant.components.automation.frigate_notification_0_10_0_2] Error rendering variables: ValueError: Template error: int got invalid input 'unknown' when rendering template '{{ fps_value|int if is_number(fps_value) or 5 }}' but no default was specified

(Note my Hikvision cameras can only provide the motion feed at 6fps…)

A full transaction looks like:

2022-11-17 17:51:04.742 DEBUG (MainThread) [homeassistant.components.automation.frigate_notification_0_10_0_2] Automation trigger 'None' triggered by mqtt topic frigate/events
2022-11-17 17:51:04.746 ERROR (MainThread) [homeassistant.components.automation.frigate_notification_0_10_0_2] Error rendering variables: ValueError: Template error: int got invalid input 'unknown' when rendering template '{{ fps_value|int if is_number(fps_value) or 5 }}' but no default was specified
2022-11-17 17:51:04.754 DEBUG (MainThread) [homeassistant.components.automation.new_automation_any_camera_3] Automation trigger 'None' triggered by mqtt topic frigate/events
2022-11-17 17:51:04.762 ERROR (MainThread) [homeassistant.components.automation.new_automation_any_camera_3] Error rendering variables: ValueError: Template error: int got invalid input 'unknown' when rendering template '{{ fps_value|int if is_number(fps_value) or 5 }}' but no default was specified
2022-11-17 17:51:04.773 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received message on frigate/camera3/person: b'1'
2022-11-17 17:51:12.540 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received message on frigate/camera3/person: b'0'
[ and a binary message that I edited out ]

I now see others having the same issue on the github gist. Attempting to edit the yaml blueprint to avoid this error…

Yes you need to edit the fps_value line (around line 165ish in the blueprint)

change the word or to else

Thanks, I took the format from the docs here but I have no way to test as it’s iOS only. defintely wrong?

Sounds | Home Assistant Companion Docs (home-assistant.io)

I just tested by setting cooldown to 300, walking in front of my cam, leaving and waiting 30 seconds then walking in front of it again and the second event was correctly not sent to my phone. Were you referring to a specific situation? I’ve not edited the cooldown code at all from original.

I changed the int to int(0) and it also seems to work.

Thanks again for your help!

1 Like