Frigate Mobile App Notifications 2.0

The Trace trigger shows:

platform: mqtt
topic: frigate/events
payload: '{{ camera }}/new'
value_template: >-
  {{ value_json['after']['camera'] | lower | replace('-','_') }}/{{
  value_json['type']}}
id: frigate-event

Timeline:

Triggered by the mqtt topic frigate/events at April 19, 2024 at 12:16:09

Choose: Frigate Event

Frigate Notification () DEBUG: Info: fps: 5, frigate event id: 1713500169.09378-l0z1bt, object (formatted): cat (Cat), Config: camera(formatted): garden_shed(Garden Shed), Base URL: , critical: True, alert once: False, Update Thumbnails: False, Target: Mobile Device cooldown: 30s, loiter timer: 0s, color: steelblue, sound: default, Title: , Message: Animal detected near garden shed, tap_action: /api/frigate/notifications/1713500169.09378-l0z1bt/garden_shed/clip.mp4, button 1 Text/URL: View Clip (/api/frigate/notifications/1713500169.09378-l0z1bt/garden_shed/clip.mp4), button 2 Text/URL: View Snapshot (/api/frigate/notifications/1713500169.09378-l0z1bt/snapshot.jpg), button 3 Text/URL: Silence New Notifications (silence-garden_shed), icon: mdi:home-assistant tv: False, tv_position: center, tv_size: large, tv_duration: 10, tv_transparency: 0%, tv_interrupt: False, Filters: Zones: zone filter toggle on: False, Multi Zone toggle on: False, Required zones: [], Entered Zones: [], Zone Filter TEST: PASS, Required objects TEST: Input: ['dog', 'cat'], TEST: PASS presence entity (not home): Entity: TEST: PASS, disabled times: [], State Filter: state filter toggle on: False, state filter entity: , required states: [], State Filter TEST: PASS,
Frigate Notification () DEBUG (in loop): Info: Last Zones: [], Current zones: [], sublabel: None, iOS sound: yes due critical notifications, Android Sound: enabled, Triggers: New Snapshot: False, Presence Changed: False, stationary moved: False, entered zones changed: False, sublabel changed: False, Conditions: Loitering: 0 or Presence Entity not home: OFF - PASS, zone filter TEST: OFF - PASS, multi-zone filter: OFF - PASS, state filter TEST: OFF - PASS image: "/api/frigate/notifications/1713500169.09378-l0z1bt/snapshot.jpg"

Finished at April 19, 2024 at 12:16:10 (runtime: 0.85 seconds)

I was getting multiple notification in a short period so I used the silence notification option in the blueprint. How do I turn notification back on?

If not interrupted by a restart or something, it will enable itself after the specified time.

But you can simply turn the automation back on any time

I didnā€™t notice where the time is specified

Thereā€™s a slider for setting the silence new notifications time

I see it now. Itā€™s set to 30 min. It seems my issue is notification to my iphone is no longer working. It not your blueprint. Thanks

Is it possible to use an alternative camera stream for the live notifications? I have an MJPEG stream with bounding boxes for motion that Iā€™d prefer to use rather than the camera entity provided by the Frigate integration.

Edit: Looks like the beta may support this

Greetings Sgt!

I was wondering if you could tell me what instance of name the notification is using. I have my cameras numbered so theyā€™re easy to key up and so theyā€™re sorted in a menu, however my notifications (especially noticable with TTS) include the numbers so Iā€™d like to change that.

I changed the friendly name in HA within the Frigate integration, but that didnā€™t work. Is it using the name from the frigate configuration? If thatā€™s the case, would you consider a camera name override, or do you have an alternative suggestion? Iā€™m hesitant to change config since so many other things are downstream that I donā€™t want to break, including the sorting in menus, automations, entity_id, etc.

Also, would you be interested in having contributions on the docs side? My knowledge of coding and blueprints is limited, but maybe I can help in another area.

Thank you so much.

It uses the entity Iā€™d by default. You have control over the title and message so you can simply edit those to have the name you want instead of {{camera}} and leave the other variables set as you need.

Absolutely. Iā€™ve got less and less time for this lately and Iā€™m starting to let people down with updates I feel.

2 Likes

Yes, this one: homeassistant://

Thanks so much for putting this together and for your tireless efforts to help users troubleshoot in this thread! Mobile app notifications are working good, only thing I canā€™t figure out is how attachments would work (or maybe it doesnā€™t work in iOS?), curious if there is a way to also include a link within an email notification or is there a different blueprint for this? I was hoping to be able to notify both mobile app and email at the same time.

Try with an external baseurl, whatever you have setup for remote access

iOS is inconsistent. As above, your best bet is using an external base url. Are you already?

Yes I am for the action buttons etc. I guess I donā€™t know where an ā€œattachmentā€ would show up?

I donā€™t have any iOS devices to show exactly but you can see the android examples in the first post. Perhaps someone can share a screenshot for iOS?

Iā€™m sorry, my fault. I forgot I had checked off Live View Entity - iOS only (Optional)
which overrides the attachmentā€¦
However now I get ā€œfailed to load attachmentā€ even though the same url works for the ā€œview snapshotā€ option.

I stumbled on this last week - its crazy how you think you have everything in HomeAssistant you need, then something else pops up you never knew you needed!!!

I have a config question regarding the notifications only if zones were triggered in order. Basically, I have a pathway and a doorway. I made an automation for a ā€˜door bellā€™ that only triggers when the pathway zone is entered first, then the doorway zone, ie they are coming towards the door rather than someone leaving the house.

For reference, this used the wait_for-trigger, and took me a bit to sort out the syntax - it is thus -

trigger:

  • platform: numeric_state
    entity_id:
    • sensor.pathway_person_count
      above: 0
      for:
      hours: 0
      minutes: 0
      seconds: 0
      condition:
  • condition: time
    after: 08:30:00
    before: ā€˜21:30:00ā€™
    weekday:
    • sun
    • sat
    • fri
    • thu
    • wed
    • tue
    • mon
      action:
  • wait_for_trigger:
    • platform: numeric_state
      entity_id:
      • sensor.doorway_person_count
        above: 0
        continue_on_timeout: false
        timeout: 00:00:10

As is, the Frigate Notifications does not have this (as far as I can tell), so I get alerts and images on iphone when someone is LEAVING my house as well as arriving.

Am I missing some config here, or can someone advise ?

in the blueprint have written : notify.all_devices
but i dont get it on all my device, im i missing somthing?

  - name: all_devices
    platform: group
    services:
      - service: mobile_app_min_lur
      - service: media_player_galaxy_tab_a8
      - service: media_player_sovrum
      - service: mobile_app_mumman_iphone

`

Iā€™am at a lost here.
I had this running a long time ago but i cannot manage to get it up and running again.
Frigate is running ok, same is for mqtt.
Running the latest versions of all the apps.
The automation doesnā€™t seem te be triggered.

Frigate config

mqtt:
  host: 192.168.50.65
  user: mqtt_user
  password: '123456'
  stats_interval: 60
  topic_prefix: frigate
  client_id: frigate

####################################################################################################################################################################

database:
  path: /config/frigate.db

####################################################################################################################################################################

detectors:
  coral_edge1:
    type: edgetpu
    device: pci:0
  #coral_edge2:
  #  type: edgetpu
    # device: pci:1

####################################################################################################################################################################

go2rtc:
  streams:
    deurbel:
    # - rtsp://admin:[email protected]:554/cam/realmonitor?channel=1&subtype=2
    - ffmpeg:http://192.168.50.211/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=159753456Ed!#video=copy#audio=copy#audio=opus
      # - rtsp://192.168.50.211/Preview_01
    deurbel_sub:
     - "ffmpeg:http://192.168.50.211/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=admin&password=159753456Ed!"
    # - ffmpeg:http://192.168.50.211/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=admin&password=159753456Ed!#video=copy#audio=copy#audio=opus

###################################################################################################################################################################

cameras:
  deurbel:
    ffmpeg:
      output_args:
        record: preset-record-generic-audio-copy
      inputs:
      - path: rtsp://192.168.50.65:8554/deurbel
        input_args: preset-rtsp-restream
        roles:
          - record
      - path: rtsp://192.168.50.65:8554/deurbel_sub
        input_args: preset-rtsp-restream
        roles:
          - detect

###################################################################################################################################################################
####### Algemene instellingen ##########
###################################################################################################################################################################
    objects:
      track:
      - person
      # filters:
      #   person:
      #     min_area: 5000
      #     max_area: 100000
        #  treshold: 0.7
    # #   # - bird
    # #     #- dog
    # #     #- cat
    detect:
      width: 1280
      height: 720
      fps: 5

    snapshots:
      enabled: true
      timestamp: true
      bounding_box: true
      retain:
        default: 10

    record:
      enabled: true
      retain:
        days: 10
        mode: all
      events:
        retain:
          default: 10
          mode: all

    motion:
      # Optional: The threshold passed to cv2.threshold to determine if a pixel is different enough to be counted as motion. (default: shown below)
      # Increasing this value will make motion detection less sensitive and decreasing it will make motion detection more sensitive.
      # The value should be between 1 and 255.
      threshold: 130

      mask:
      - 0,720,183,720,113,619,0,623
      - 0,720,183,720,113,619,0,623
ui:
  live_mode: webrtc

################################################################################################################################################################

mqtt sees the published topic frigate/events

{
    "before": {
        "id": "1714310308.015522-c13r07",
        "camera": "deurbel",
        "frame_time": 1714310312.80957,
        "snapshot": {
            "frame_time": 1714310312.415423,
            "box": [
                0,
                0,
                547,
                708
            ],
            "area": 387276,
            "region": [
                0,
                0,
                792,
                792
            ],
            "score": 0.68359375,
            "attributes": []
        },
        "label": "person",
        "sub_label": null,
        "top_score": 0.82421875,
        "false_positive": false,
        "start_time": 1714310308.015522,
        "end_time": null,
        "score": 0.71484375,
        "box": [
            2,
            0,
            430,
            719
        ],
        "area": 307732,
        "ratio": 0.5952712100139083,
        "region": [
            0,
            0,
            856,
            856
        ],
        "stationary": false,
        "motionless_count": 3,
        "position_changes": 1,
        "current_zones": [],
        "entered_zones": [],
        "has_clip": true,
        "has_snapshot": true,
        "attributes": {},
        "current_attributes": []
    },
    "after": {
        "id": "1714310308.015522-c13r07",
        "camera": "deurbel",
        "frame_time": 1714310312.80957,
        "snapshot": {
            "frame_time": 1714310312.415423,
            "box": [
                0,
                0,
                547,
                708
            ],
            "area": 387276,
            "region": [
                0,
                0,
                792,
                792
            ],
            "score": 0.68359375,
            "attributes": []
        },
        "label": "person",
        "sub_label": null,
        "top_score": 0.82421875,
        "false_positive": false,
        "start_time": 1714310308.015522,
        "end_time": 1714310318.014752,
        "score": 0.71484375,
        "box": [
            2,
            0,
            430,
            719
        ],
        "area": 307732,
        "ratio": 0.5952712100139083,
        "region": [
            0,
            0,
            856,
            856
        ],
        "stationary": false,
        "motionless_count": 3,
        "position_changes": 1,
        "current_zones": [],
        "entered_zones": [],
        "has_clip": true,
        "has_snapshot": true,
        "attributes": {},
        "current_attributes": []
    },
    "type": "end"
}
QoS: 0 - Retain: false

Not triggered, or no notifications?

Either way, seeing the yaml of the automation (blueprint) itself is gonna be necessary to help. The MQTT looks alright to me compared to some Iā€™ve had properly notify.