Frigate Mobile App Notifications 2.0

And about the stream?
Is there an alternative way to read the flow of my camera?

You can always manually copy the blueprint yaml into home assistant if import isn’t working

If you aren’t viewing the stream at the time of the event then the event is likely over anyway.

Change on of your action buttons to open frigate instead and you can load the camera feeds there.

Works like a charm. Thank you.

message: >-
      Ein(e) {{ 'Person' if label == 'Person' else 'Auto' if label == 'Car' else
      'Katze' if label == 'Cat' else 'Hund' if label == 'Dog' else 'Fahrrad' if
      label == 'Bicycle' else 'Motorrad' if label == 'Motorcycle' }} wurde auf
      {{ camera_name }} erkannt.

Hey @SgtBatten, does 0.12.0.3c beta still work with the latest Frigate that was released, 0.14? I ask because I sometimes get notifications of FPs on my phone via Frigate Notifications, but not on Frigate itself. I’ve reloaded and made sure that the Home Assistant Frigate integration has been updated, but still have this happen on occasion. Any ideas?

It should, but you can always update to 12.0.4 which is only minor improvements. The frigate 0.14 update didn’t break old stuff, it just introduced new stuff which we are testing in a pull request, not in beta.

I guess what I don’t get is why it comes up with a screenshot and a bounding box around the object that it thought it detected, but can’t find the video when attempting to the view the clip (it says false in the JSON output). When reviewing Frigate itself, it’s nowhere to be found. Any idea what could be causing it if this update doesn’t fix it?

Everything except video attachments are working for me on iOS, Frigate 0.14 (externally hosted, not HA addon), and blueprint 0.12.0.4a.

Anyone have video attachments working? My config:

alias: Frigate Notifications (0.12.0.4a) test
description: ""
use_blueprint:
  path: SgtBatten/Beta.yaml
  input:
    camera: camera.back_door
    notify_device: 1a27f6225565e6989724f8c873e4fea1
    base_url: https://homeassistant.int.xxx
    attachment: thumbnail.jpg
    update_thumbnail: true
    video: >-
      {{base_url}}/api/frigate{{client_id}}/notifications/{{id}}/{{camera}}/clip.mp4
    tap_action: https://frigate.int.xxx
    debug: true

The “View Clip” button works and opens the clip in my browser, so it does exist.

Frigate Notification DEBUG (in loop): Send Notification: False Info: sublabel: None, image: "https://homeassistant.int.xxx/api/frigate/notifications/1723490142.853907-myirbs/thumbnail.jpg" Title: message: A Person was detected on the Back Door camera. iOS sound: enabled, Android Sound: enabled, iOS url: /api/frigate/notifications/1723490142.853907-myirbs/back_door/clip.mp4 video: "https://homeassistant.int.xxx/api/frigate/notifications/1723490142.853907-myirbs/back_door/clip.mp4" critical: False, tts: False Triggers: New Snapshot: False Presence Changed: False, Stationary Moved: False, Entered Zones Changed: False - Disabled, sublabel changed: False, Conditions: Loitering: 0 or Filters: Zones: Zone Filter Enabled: False, Multi Zone Enabled: False, Required Zones: [], Last Zones: [], Entered zones: 0 - [], TEST: PASS, Object Filter: Input: , TEST: PASS, Presence entity (not home): Entity: , TEST: PASS, Time Filter: Disabled times: [], TEST: PASS State Filter: state filter toggle on: False, state filter entity: , required states: [], TEST: PASS, Custom Filter: PASS, triggered by automation

Hello,

I would like to edit the “tap_action” so that it contains a link to a custom url.
I have created a “test” script that generates said url, and also spawns a variable called “path” that I intend to use down below the flow.

alias: Test Generate link
sequence:
  - variables:
      link_id: 0{% for _ in range(39) %}{{ range(10)|random }}{% endfor %}
  - data:
      link_id: "{{ link_id }}"
      entity: camera.porche_sub
      open_limit: 1
      time_to_live: 60
    action: webrtc.create_link
  - variables:
      path: /webrtc/embed?url={{ link_id }}
  - data:
      message: path={{ path }}
    action: persistent_notification.create

Which I then fire this way :

alias: Test Notif IA Frigate
description: >-
  Blabla
use_blueprint:
  path: SgtBatten/Stable.yaml
  input:
    camera: camera.porche_2
    notify_device: 7ebed67d640b24ff8f3a9789d9b22094
    attachment: snapshot.jpg?bbox=1
    update_thumbnail: true
    tv: false
    base_url: https://hass.redacted.com
    sound: custom.caf
    alert_once: true
    custom_action_auto:
      - action: script.turn_on
        metadata: {}
        data:
          myvar1: zzz
          myvar2: ggg
        target:
          entity_id: script.test
    tap_action: "{{base_url}}{{path}}"

This does not work. What I am trying to do in this yaml code is to run the “script.test” so that it returns/publishes the “path” variable, that i then need to use in the tap_action.
When testing, “path” returns “none”, so when i tap the notification on my phone it redirects me to “https://hass.redacted.comnone”.
When i run my “script.test” individually through “settings > automations > scripts”, i can see it generates a string fine, and the message in the “persistent_notification” contains correct values.

What is the correct way of achieving this ? I am new to scripting in HA. Could it be a variable scope issue ? How to solve this ?

Thank you

I have been working with the new blueprint and have the same issue with video clips. I don’t see them at all but I suspect it is because of my Frigate config. I don’t create a video clip for the events I am testing with. If I look in the Frigate media folder there are no clips associated with the specific object and zone I am testing with. I need to test with a different area that I do store clips for and see if that shows the video clip via the action button.

With these notifications, it appears possible to create alerts without having the associated clips actually stored in Frigate. In this case, the expectation of video clips being available and the underlying Frigate config need to match.

The Front Street zone is what I am testing with. Based on this config, there are no clips being stored. I would need to add the Front Street to the alerts and then it will probably work. Testing


The frigate/events topic is not 1 to 1 with stored events, never has been.

Could be that,

Could be you aren’t recording clips on that camera or situation

The reviews topic uses in the latest 0.14 frigate and also in the pull request on the blueprint GitHub is a 1 to 1 detection.

I’m not super familiar with what you are doing but The blueprint doesn’t wait for the script, it wasn’t intended to get data back, just to trigger the action.

What if you didn’t use a random string but the frigate event ID instead that way you manually set the tap action to the known url that will be created by the script.

The link is random because the link is set to expire after X seconds and/or after it has been open Y times. This adds extra layers of security because the link is reachable from the world wide web (not a LAN url).
What does custom_action_auto do ? I does not even run script.test in my example above. Isn’t it what it is supposed to do ? Would a delay solve the problem ? Or is “custom_action_auto” supposed to be executed AFTER the tap_action has been interpreted ?
Thank you.

What’s your suggestion here? Are you suggesting to try another “topic” besides “frigate/events”? Is there a “frigate/reviews” that I could try instead?

Look at the pull request for frigate 0.14 on the GitHub page for this blueprint. You can use that version of the blueprint.

Yes but the frigate ID is also unique and random and known. So instead of trying to create a random link and feed it back, use the ID from the event which doesn’t need to be fed back to he blueprint.

Are you certain? What logs are you getting. Is it being triggered by an update?

custom action auto fires only during the initiation of the automation if all conditions are met. If they aren’t met at the beginning it wouldn’t work.

“Yes but the frigate ID is also unique and random and known” → I need, on top of the uniqueness and randomness, the id to be expirable. So that if an attacker guesses/finds the url, it will only work during X seconds or X times (as I explained earlier). For such a protection, you need a id that is rolling, not an id that is “known”, aka “fixed” or “static”, no matter how long/complex chars. It has to change so that past links/urls/ids become obsolete.

“Are you certain? What logs are you getting. Is it being triggered by an update?” Where do I find such logs ? I don’t know, I expected you to tell me how to run a script in your yaml tbh :smiley: All I know is my “script.test” within “custom_action_auto” is not fired.

So I understand I can’t have callbacks. How about the following trick then : I would have a script than runs once a day a sets an entity like “input_text.my_unique_id”. Is it possible to retrieve “my_unique_id” inside your “tap_action”, such as “{{{ my_unique_id}}}”. How ?

Thank you.

that’s not true. The frigate integration has a configuration option to set how long after the event started that the unauthenticated access is allowed, so you could make it so the link only works for 5 minutes for example. Or you can disable that and make it only work if you provide an auth token.

Frigate does not have such a thing.

it does

1 Like