Frigate Mobile App Notifications 2.0

I have one further problem I am experiencing with this feature if you are able to help…

When I get a notification on my iPhone, the thumbnail image is present, but the video tries to go to the following url

https://{baseurlhere}/api/frigate/notifications/1679129130.94068-zj4cpg/front_door_external/clip.mp4

This returns a 404-not found error.

If I look for the same clip within the Frigate front end, the clip is there, but presented as

https://{baseurlhere}/api/events/1679129130.94068-zj4cpg/clip.mp4

so the path is different, “frigate/notifications” changes to “events” and the camera name is removed.

Is there a configuration setting I have missed that’s mis-presenting the URLs in the notifications?

I’m running Frigate 0.11.1 and HA 2023.3.1

Thanks

anyone getting this error recently? I’m using SgtB’s stable version, tried combing through the traces but no luck

Template variable warning: ‘dict object’ has no attribute ‘sub_label’ when rendering ‘{{ wait.trigger.payload_json[‘after’][‘sub_label’]}}’

Not sure why, it is the correct url for the api. the inclusion of the camera name is extra information but the url still functions in my testing just now.

Is it stopping the notifications from working? did you have them working before?

I recently upgraded from the hunter version to yours, I was getting other errors in the old version. I’ll mess around with it some more

try a fresh automation rather than changing an existing one as there are a lot of changes. I’m here for a little while so PM me and we can sort it out.

Edit: resolved by updating frigate.

1 Like

Great work on the updates!
Would it be possible to have a few extra Android notification options added in your next revision? They should be quite simple to add.

Android:
channel - this will let the user setup custom sounds, override Do Not Disturb, etc…
sticky - makes it so the notification can’t be swiped away without interacting with it.

Both are simple to implement.

    sticky:
      name: (Optional) Sticky - Android Specific
      description: When enabled, the notification will stay active on the device after interacting with it and remain there until cleared.
      default: false
      selector:
        boolean: {}
    channel:
      name: (Optional) Channel - Android Specific
      description: Create a new channel for notifications to allow custom notification sounds, vibration patterns and overide of Do Not Disturb mode. Configured directly on the device.
      default: ''

Then under the data field in the notification, or set it as a variable to continue the same style as the rest.

        channel: !input 'channel'
        sticky: !input 'sticky'

The other thing that would be awesome is the ability to trigger an action completely unrelated to the notification. I’m thinking something like being able to call a script or trigger another automation that will turn on the outside lights for X number of mins, etc…

Try latest beta and let me know. My concern is it causes issues for people who don’t want to use channels. Will need to trial it for a bit.

Any chance for the Telegram blueprint please ?

I been on “(0.11.0.8h) - SgtB” for a while now and it’s been working great, what’s the latest version? @SgtBatten

Tried to adapt this one but not smart enough.

blueprint:
  name: Frigate - Telegram Notification
  description: Create automations to receive Snapshots and Clips from Frigate
  domain: automation
  input:
    camera:
      name: Frigate Camera
      description: The name of the camera as defined in your frigate configuration (/conf.yml).
    target_chat:
      name: Target
      description: "The chat_id to be used by the Telegram bot.
        !secret chat_id is not allowed on Blueprint, you will need the chat_id code.

        "
    notification:
      name: Notification
      description:
        'Select "true" to disable notification, lave "false" to receive
        notification.
        '
      selector:
        select:
          options:
            - "true"
            - "false"
      default: "false"
    base_url:
      name: (Optional) Base URL
      description:
        The external url for your Home Assistant instance. This will default
        to a relative URL and will open the clips in the app instead of the browser,
        which may cause issues on some devices.
      default: ""
    zone_filter:
      name: (Optional) Zone Filter
      description: Only notify if object has entered a defined zone.
      default: false
      selector:
        boolean: {}
    zones:
      name: (Optional) Trigger Zones
      description: A list (-) of zones you wish to recieve notifications for.
      default: []
      selector:
        object: {}
    labels:
      name: (Optional) Trigger Objects
      description: A list (-) of objects you wish to recieve notifications for.
      default: []
      selector:
        object: {}
    presence_filter:
      name: (Optional) Presence Filter
      description: Only notify if selected presence entity is not "home".
      default: ""
      selector:
        entity: {}
  source_url: https://gist.github.com/NdR91/5486a1e55101e062c48545395b7dd9a3
mode: single
max_exceeded: silent
trigger:
  platform: mqtt
  topic: frigate/events
  payload: !input "camera"
  value_template: "{{ value_json['after']['camera'] }}"
variables:
  id: "{{ trigger.payload_json['after']['id'] }}"
  camera: "{{ trigger.payload_json['after']['camera'] }}"
  camera_name: "{{ camera | replace('_', ' ') | title }}"
  target_chat: !input "target_chat"
  object: "{{ trigger.payload_json['after']['label'] }}"
  label: "{{ object | title }}"
  entered_zones: "{{ trigger.payload_json['after']['entered_zones'] }}"
  type: "{{ trigger.payload_json['type'] }}"
  base_url: !input "base_url"
  zone_only: !input "zone_filter"
  input_zones: !input "zones"
  zones: "{{ input_zones | list }}"
  input_labels: !input "labels"
  labels: "{{ input_labels | list }}"
  presence_entity: !input "presence_filter"
  notification: !input "notification"
condition:
  - "{{ type != 'end' }}"
  - "{{ not zone_only or entered_zones|length > 0 }}"
  - "{{ not zones|length or zones|select('in', entered_zones)|list|length > 0 }}"
  - "{{ not labels|length or object in labels }}"
  - "{{ not presence_entity or not is_state(presence_entity, 'home') }}"
action:
  - service: telegram_bot.send_photo
    data:
      target: "{{ target_chat }}"
      disable_notification: "{{ notification }}"
      caption: |
        Person Detected. Camera: {{ camera_name }}
      url: >-
        {{base_url}}/api/frigate/notifications/{{id}}/snapshot.jpg
  - repeat:
      sequence:
        - wait_for_trigger:
            - platform: mqtt
              topic: frigate/events
              payload: "{{ id }}"
              value_template: "{{ value_json['after']['id'] }}"
          timeout:
            minutes: 2
          continue_on_timeout: false
        - condition: template
          value_template: "{{ wait.trigger.payload_json['type'] == 'end' }}"
        - service: telegram_bot.send_video
          data:
            target: "{{ target_chat }}"
            disable_notification: "{{ notification }}"
            caption: "Person Detected. Camera: {{ camera_name }}"
            url: >-
              {{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4
      until: "{{ wait.trigger.payload_json['type'] == 'end' }}"

Hmm, does seem odd. The clips link was working back on Frigate 0.10 and the old blueprint, but as you say the URL looks correct under 0.11 and your blueprint, so not sure why my Frigate instance doesn’t like it.

I’m hoping to move over to 0.12 as soon as it’s available anyway, so for now I’ve just tweaked the URL’s in your blueprint to suit my purpose which is working just fine, so I’ll have to remember not to update it willy nilly!

Thanks

0.11.0.13 mate with a beta version too

1 Like

You were trying to open it immediately were you? It might not have existed yet?

Those API endpoints are from the frigate integration not frigate itself, so check that’s up to date.

Hello everyone. I’m needing some help. Im running the latest HAOS, Frigate Proxy addon go2rtc addon, and frigate integration. Im trying to get video and image messages sent through the app as the blueprint above is suppose to help us do. However, I download the blueprint, create the automation, and when I test it to try and run it (even if I try to trigger it by standing in front of the camera) nothing happens. No trigger, no nothing. What is the prequasite if there is any before using this blueprint? There should be no reason not to be able to get this working. My HAOS is on VM via Synology and Frigate is on a separate server. Any help would be appreciated.

The thing I didn’t see mentioned is mqtt. If that is installed, is frigate sending messages to the topic frigate/events?

The automation looks for mqtt messages from frigate.

Edit: One more question, which blueprint are you using?

Sorry, I feel really stupid right now but I just can’t get this blueprint to work:

image

Is there any error in my config? Can someone help? Should be something obvious.

Hmm, fairly immediate but then it’s not available afterwards either.

Might be a simple answer, the base url in the blueprint is it supposed to point to you HA url or your Frigate url? I have it set to Frigate currently.

Home assistant.

@fridayAr

The blueprint in the OP has a bug. Please try one of my updated ones Here.

So guess not too behind, will have to maybe update soon but the current one works great at least.