Frigate Mobile App Notifications 2.0

Hey SgtBatten, I’m new to Frigate and the notification blueprint. I’m struggling to get the trigger zones working, I’m receiving notifications for all zones rather than my input zones. I just finished reading through the last 90+ days of this thread and have not found a solution. Any suggestions are appreciated. Below is an example of a camera, my notification config, and a trace changed variables from a notification I received.

Notification config:

alias: DrivePTZ North
description: Frigate DrivePTZ North
use_blueprint:
  path: SgtBatten/frigate_0.11_notification.yaml
  input:
    camera: camera.driveptz_north
    notify_device: 57615761db3c6e5da463ee14b683adac
    zone_filter: true
    zones:
      - zone_yard
      - zone_drain
      - driveway
      - walkway
      - south_yard

This is the version I’m using: Frigate Notifications have moved · GitHub

And the output of a trace from a received notification:

this:
  entity_id: automation.automation_8
  state: 'on'
  attributes:
    last_triggered: '2022-11-17T02:17:45.630092+00:00'
    mode: parallel
    current: 0
    max: 10
    id: '1668525013015'
    friendly_name: DrivePTZ North
  last_changed: '2022-11-15T20:10:58.095313+00:00'
  last_updated: '2022-11-17T02:17:48.917838+00:00'
  context:
    id: 01GJ1P1EWWQFQ5XDJBQS5GHF6N
    parent_id: null
    user_id: null
trigger:
  id: frigate-event
  idx: '1'
  alias: null
  platform: mqtt
  topic: frigate/events
  payload: >-
    {"before": {"id": "1668652265.871272-t33dtv", "camera": "DrivePTZ_North",
    "frame_time": 1668652265.871272, "snapshot_time": 0.0, "label": "car",
    "sub_label": null, "top_score": 0.0, "false_positive": true, "start_time":
    1668652265.871272, "end_time": null, "score": 0.71484375, "box": [482, 103,
    561, 137], "area": 2686, "ratio": 2.323529411764706, "region": [364, 0, 684,
    320], "stationary": false, "motionless_count": 0, "position_changes": 0,
    "current_zones": [], "entered_zones": [], "has_clip": false, "has_snapshot":
    false}, "after": {"id": "1668652265.871272-t33dtv", "camera":
    "DrivePTZ_North", "frame_time": 1668652270.169331, "snapshot_time":
    1668652270.169331, "label": "car", "sub_label": null, "top_score":
    0.701171875, "false_positive": false, "start_time": 1668652265.871272,
    "end_time": null, "score": 0.70703125, "box": [483, 104, 564, 136], "area":
    2592, "ratio": 2.53125, "region": [372, 0, 692, 320], "stationary": false,
    "motionless_count": 6, "position_changes": 1, "current_zones": ["street"],
    "entered_zones": ["street"], "has_clip": true, "has_snapshot": true},
    "type": "new"}
  qos: 0
  description: mqtt topic frigate/events
  payload_json:
    before:
      id: 1668652265.871272-t33dtv
      camera: DrivePTZ_North
      frame_time: 1668652265.871272
      snapshot_time: 0
      label: car
      sub_label: null
      top_score: 0
      false_positive: true
      start_time: 1668652265.871272
      end_time: null
      score: 0.71484375
      box:
        - 482
        - 103
        - 561
        - 137
      area: 2686
      ratio: 2.323529411764706
      region:
        - 364
        - 0
        - 684
        - 320
      stationary: false
      motionless_count: 0
      position_changes: 0
      current_zones: []
      entered_zones: []
      has_clip: false
      has_snapshot: false
    after:
      id: 1668652265.871272-t33dtv
      camera: DrivePTZ_North
      frame_time: 1668652270.169331
      snapshot_time: 1668652270.169331
      label: car
      sub_label: null
      top_score: 0.701171875
      false_positive: false
      start_time: 1668652265.871272
      end_time: null
      score: 0.70703125
      box:
        - 483
        - 104
        - 564
        - 136
      area: 2592
      ratio: 2.53125
      region:
        - 372
        - 0
        - 692
        - 320
      stationary: false
      motionless_count: 6
      position_changes: 1
      current_zones:
        - street
      entered_zones:
        - street
      has_clip: true
      has_snapshot: true
    type: new
input_camera: camera.driveptz_north
camera: driveptz_north
camera_name: Driveptz North
base_url: ''
critical: false
alert_once: false
update_thumbnail: false
group_target: ''
zone_only: true
input_zones:
  - zone_yard
  - zone_drain
  - driveway
  - walkway
  - south_yard
zones:
  - zone_yard
  - zone_drain
  - driveway
  - walkway
  - south_yard
input_labels: []
labels: []
presence_entity: ''
cooldown: 30
loiter_timer: 0
fps: 5
state_only: false
input_entity: ''
input_states: []
states_filter: []

These conversations can be a bit long so if you are happy i’ll move it to PM to troubleshoot, then we can post the answer back here if we work it out.

1 Like

I’m having the exact same problem. No alerts on iphone. I’ve no idea how to debug this.

I see all sorts of Frigate activity in the Home Assistant History tab. For example ‘camera 1 person count’ shows an active graph. Frigate’s native Events page correctly shows recordings when people enter various zones. The docker log shows Frigate receiving various mqtt messages. Frigate Lovelace cards show expected clips, etc.

Yet my Blueprints never seem to trigger, even if they are just the camera name (case matched to Frigate), Device (my iphone) and no other options. Adding in options (zones, etc.) doesn’t seem to help.

What version of frigate?
Which blueprint/ version of the blueprint?
Have you confirmed the entity id for the camera entity in HA matches the frigate config?

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