Local realtime person detection for RTSP cameras

Hi Faieka,
I just got telegram notifications setup 3 days ago. This is my automation:

alias: Frigate - Person found - Notify Asher - Telegram
description: ''
trigger:
  - platform: mqtt
    topic: frigate/events
condition: []
action:
  - service: notify.ashertelegram
    data:
      message: 'A {{trigger.payload_json["after"]["label"]}} was detected.'
      data:
        photo:
          - url: >-
              https://myexternalurl.ui.nabu.casa/api/frigate/notifications/{{trigger.payload_json["after"]["id"]}}/thumbnail.jpg?format=android
            caption: '{{trigger.payload_json["after"]["id"]}}'
  - delay:
      hours: 0
      minutes: 1
      seconds: 0
      milliseconds: 0
mode: single

edit 2:
I’ve also setup my telegram as a webhook. Eg:

telegram_bot:
  - platform: webhooks
    api_key: mysuper:secretapikey
    allowed_chat_ids:
      - 11111111

edit:
If you manually send a notification to yourself using the dev tools does it work?

1 Like

@asherw83 Hi thanks for the response - No in dev tool it doesn’t work
I don’t use Nabu casa or webhooks yet.
funny enough, when i was using deepstacks before it was fine.

I tied using Node Red as well but no success

Logger: homeassistant.helpers.template
Source: helpers/template.py:1346
First occurred: 2:03:08 PM (4 occurrences)
Last logged: 2:03:54 PM

Template variable error: 'trigger' is undefined when rendering 'automation: - alias: Notify of events trigger: platform: mqtt topic: frigate/drive_way action: - service: notify.telegram_full data_template: message: 'A {{trigger.payload_json["after"]["label"]}} was detected.' data: photo: # this url should work for addon users - url: 'http://ccab4aaf-frigate:5000/api/events/{{trigger.payload_json["after"]["id"]}}/thumbnail.jpg' caption: 'A {{trigger.payload_json["after"]["label"]}} was detected on {{ trigger.payload_json["after"]["camera"] }} camera'} camera'''
Template variable error: 'trigger' is undefined when rendering 'A {{trigger.payload_json["after"]["label"]}} was detected.'

Still the same error :roll_eyes:
Sorry - Normal message from dev tools works via notify.telegram

@ukro can you please stop spoiling this thread? You aks more questions then answering them (which is not an issue initially), but you seem to answer some (including mine) but they are not an answer at all…?

As you wish

I admit that I had the same thought. On the other hand I don’t want to be the judge of how other members contribute to the community.

A less offensive approach is using the community software features

I could have done that. But since I initially thought this guy knew what he was talking about because he was “answering” my question, ignoring was not an option. But yes, now it seems a good approach.

Sorry for a stupid & noob question but how to configure if I want detection from sub-stream and clip from the best quality?

Do like this…

#############################
# PARKERING                 #
#############################
  frigate_parkering:
    ffmpeg:
      inputs:
        - path: rtsp://xxxx:[email protected]:88/videoMain
          roles:
            - clips
            - rtmp
        - path: rtsp://xxxx:[email protected]:88/videoSub
          roles:
            - detect
    width: 640
    height: 480

Main stream is set to -clips & -rtmp
Sub stream is set to - detect …

1 Like

I successfully installed frigate inside proxmox LXC container with mounted network share. If anybody need assistance, PM me,will help. Don’t want to further spam this thread.


Please somebody explain to me, as frigate addon is right away accesible in sidebar. How can i make frigate integration be accesible the same way?
I am using nabucasa(SSL) so i want to be able to see it.
Thank you <3

The only way for know i think i need to make a nginx debian container and generate certificate,and forward traffic from frigate http → nginx(converts to https) → then to iframe panel HASSOS.
Is this the only way?

Keep those questions coming, ukro. Can’t learn if you don’t ask!

1 Like

xD i hope its not sarcasm

1 Like

I successfully installed frigate inside proxmox LXC container with mounted network share.

You could create your own thread in “Share your Projects!” and have all your juicy detail there. :+1:

2 Likes

Been using this for a while now and find it great. I would like to fine tune it now to eliminate the false positives etc.

I cant find any information on how to set up min_area and max_area and how one would calculate the numbers to enter for these parameters.

Can anyone point me in the right direction or give me advice on this please.

On the way :slight_smile:

With these settings how the ffmpeg manages the 2 different resolutions? I guess the 680x480 is the subvideo, but the main should be higher. Why don’t set the main resolution?

I was a bit like :thinking: too. It turns out FFMPEG just takes the native resolution from the camera for the clips stream, and uses the specified resolution for the detect stream (the substream in this case).

Have a look at the detections you’ve been getting on the events page. The bounding boxes show the area of the object, which gives you a general idea. You can also turn bounding boxes on and go for a walk with a portable device, noting down the smallest and largest areas for a person.

Bear in mind that you may wish to set the min_area and max_area a little lower and higher than the values you see.

You can then add those values to the objects section under your camera config:

    objects:
      track:
        - person
        - car
      filters:
        person:
          min_area: 4000
          max_area: 300000
          min_score: 0.5
          threshold: 0.7
1 Like

Because the main stream is not encoded.
When using -detect on a specific stream you have to set the parameters as width and height for that particular stream.

To whom it might be interesting, mounting remote NAS folder to Frigate on Proxmox LXC container.
My first tutorial xD don’t judge and do comment and like if i helped :slight_smile:
https://community.home-assistant.io/t/network-share-on-frigate-hassos-with-nabucasa-ssl-and-proxmox-lxc-container/

1 Like