Frigate Mobile App Notifications

Ok, some errors just showed up in the HA Frigate Proxy Addon logs:

2021/10/29 12:30:49 [error] 356#356: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 172.30.32.2, server: ccab4aaf-frigate-proxy, request: "GET // HTTP/1.1", upstream: "http://192.168.0.XXX:5000//", host: "192.168.0.XXX:8123", referrer: "http://192.168.0.XXX:8123/ccab4aaf_frigate-proxy"

I’m not sure if it’s related. The timestamps don’t correspond with the events/notifications.

Found the issue. Changed the ffmpeg record line to the following and now downloaded recordings and notifications actions play on an iPhone and in QuickTime.

record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an -tag:v hvc1

i added a sun condition to use it only at night with an offset. Maybe it could be done better to enable or disable this functionality with a boolean value or even better by specify a hour range or a schedule.

Hi there,
I understand or believe the blueprint that you can only select as a condition the entity “zone/home”?
I would only like to receive a notification if an entity value is “false”.

My presence detection in my Smarthome is a value (boolean)
true = present
false = absent
and can be changed by a switch. (We don’t want to use zones…)

How can I solve this?
I was thinking about to “convert” the value from:
true > home
Then could I use the changed value as a zone?

You could do that, or go to your configuration folder and edit the blueprint to meet your needs. The blueprint was designed mostly for device tracker or person entity states and/or groups, which is the typical use case for presence detection in Home Assistant.

i cant code :confused: and just started with home assistant last week. (i am an old ioBroker Guy)

would it not be enough just to edit “home” to “true” ?

It should be.

Hey @hunterjm, thanks for sharing, I configured this earlier today but it doesnt seem to trigger, any idea what the issue maybe?

Automation Yaml Config

alias: Frigate Actionable Notification
description: ''
use_blueprint:
  path: hunterjm/frigate_notification.yaml
  input:
    camera: frontdoor
    zone_filter: false
    labels: {}
    silence_timer: 3
    notify_group: group
    base_url: https://m_url.ui.nabu.casa

Yes, the group is named group.

notify.group

I have the following automation which triggers and notifies.

alias: Frigate Notify Group
description: Object detection notification from Frigate
trigger:
  - platform: mqtt
    topic: frigate/events
condition:
  - condition: template
    value_template: '{{ trigger.payload_json["type"] == "end" }}'
action:
  - service: notify.group
    data:
      message: A {{ label }} was detected on the {{ entered_zones }}.
      data:
        photo:
          - url: >-
              https://my_url.ui.nabu.casa/api/frigate/notifications/{{trigger.payload_json["after"]["id"]}}/thumbnail.jpg
            caption: >-
              'A {{trigger.payload_json["after"]["label"]}} was detected at the
              Front {{trigger.payload_json["after"]["entered_zones"]}}'.
  - delay:
      seconds: 30
  - service: notify.group
    data:
      message: A {{ label }} was detected on the {{ entered_zones }}.
      data:
        video:
          - url: >-
              https://my_url.ui.nabu.casa/api/frigate/notifications/{{trigger.payload_json["after"]["id"]}}/{{trigger.payload_json["after"]["camera"]}}/clip.mp4
            timeout: 1000
            caption: >-
              'Video of {{trigger.payload_json["after"]["label"]}}" detected at
              the Front {{trigger.payload_json["after"]["entered_zones"]}}'.
mode: single
initial_state: true

Is it possible to perform conditions on the automation based on the camera name?
I want to set up conditions based on the camera name, I managed to send the camera name on the notification on the action section (with no conditions) but when trying to check the value in the condition I get false.

alias: Motion detected
trigger:
  - platform: mqtt
    topic: frigate/events
condition:
  - condition: template
    value_template: '"{{ trigger.payload_json[''after''][''label''] == ''person'' }}"'
action:
  - service: notify.mobile_app_iphone
    data_template:
      message: A {{trigger.payload_json["after"]["label"]}} was detected
      data:
        image: >-
          https://myurl/api/frigate/notifications/{{trigger.payload_json["after"]["id"]}}/thumbnail.jpg?format=android
        tag: '{{trigger.payload_json["after"]["id"]}}'
        when: '{{trigger.payload_json["after"]["start_time"]|int}}'
      title: '{{trigger.payload_json["after"]["camera"] }}'

I’m happy to to have Frigate, Webrtc, the Frigate card running and have an iPhone sp the automation exposed this shortfall with IOS being helpful. Is there any thought that the Frontend could somehow understand that the request to display the clip or snapshot needs to go to the browser or do you anticipate this subdomain and proxy will be the long term solution? I can learn about subdomains and proxy servers but would be happy to hold tight if there is some hope of a bit more packaged up solution. Thanks for providing a great tool. I can say that I’ve tried templates but really just enough to be very thankful for what you’ve done. Any insight or guess where this might go is appreciated. I’m also willing to request something from the front end team if that is right place to go. THanks

Has anyone been able to modify the blueprint to send the photos to slack?
I’ve tried this but it doesn’t seem to arttach the photo, just send the text message

      - data:
          data:
            file:
              path: /api/frigate/notifications/{{id}}/thumbnail.jpg
          message: 'test'
          title: Detected
        service: notify.myslack
1 Like

This blue print is great.

Just having one issue. I have 2 instances of HA. Frigate added to both (container homeassisant).

The snapshots will not open on 1 of them but will on the other (after I swap the app configuration to point to one or the other).

Scratching my head over this one. I get the alert on my phone but just cannot open the clips, lets say on homeassistant 1.

Yes seems to be a conflict - I shut one instance down and then tested again. I could view the published snapshots and clips.

I’d like to try to send them to telegram so I have a record easy to access rather than having to open homeassistant if I need to see them again as the notification can disappear.

Only got mqtt in nodered to send messages so far

1 Like

@hunterjm Does this blueprint work with Home Assisstant Core?

I currently have Frigate, Mosquitto and HA Core all running in separate containers.

Works fine, as does viewing notifications when outside the lan (nabu casa). Make sure you have the Frigate integration installed in HA, it acts as a proxy.

Can I install the frigate integration on core?

@mwolter I’ve copied the integration folder to custom_components - what next? I don’t see it after a reboot

OK, I now receive the notification. However, when I clip view clip or snapshot I get a 404 :confused:

Don’t remember needing to do anything special, just followed the instructions. Recommending removing and installing it through HACS, much easier. Then will need to read the instructions to configure the integration then the notes at the top of this page for the notification.

Install HACS

Then follow the instructions

I was hoping if someone could help setting up a time argument so I can send critical notifications at night so it bypasses a silenced device. I tried duplications the blueprint and made modifications to it but the changes do not appear in home assistant when creating a new automation from the duped blueprint.