Frigate duplicate notifications

Can you please help me with configuring notifications from Frigate NVR? I have automation that sends me a picture via Telegram bot when Frigate NVR detects a person in the camera feed. But often I receive notifications with duplicated images like this, 2–3 duplicates at the same time:

My automation config:

alias: "Movement at the front door (tg)"
description: ""
trigger:
  - platform: mqtt
    topic: frigate/events
    payload: frontdoorcam
    value_template: "{{ value_json['after']['camera'] }}"
condition:
  - "{{ trigger.payload_json['after']['label'] == 'person' }}"
action:
  - service: notify.telega_oleksii
    data:
      message: Person detected!
      data:
        photo:
          - url: >-
              http://ccab4aaf-frigate:5000/api/events/{{trigger.payload_json["after"]["id"]}}/thumbnail.jpg
  - delay:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
mode: single

Any ideas what I can try to change, so there is no duplicate notifications?
Thank you!

1 Like

I had this issue and if it helps this is the relevant info from my current automations and very rarely do I get duplications anymore, Note also I dont use a delay:

trigger:
  - platform: mqtt
    topic: frigate/events
    payload: garden_cam
    value_template: "{{ value_json.after.camera }}"
condition:
  - condition: template
    value_template: "{{ trigger.payload_json['after']['has_snapshot'] == true }}"
  - condition: template
    value_template: "{{ trigger.payload_json['after']['label'] == 'person' }}"
  - condition: not
    conditions:
      - condition: template
        value_template: "{{ trigger.payload_json['type'] == 'end' }}"

Might be worth having a play.

1 Like

Frigate sends many updates for the event, it is your job to use conditions to only show notifications when you want to

Tried your conditions, but unfortunately it did not work for me - the automation stopped sending notifications at all.

Best thing I can suggest is to look at the sample docs and build from there.
What I ended up doing was to use MQTT Explorer to capture the messages and then picked out the particular parts I wanted to limit the notifications.

I know I’m reviving an old topic, but just in case someone else (or maybe myself) needs help with this in the future. I personally added a condition (on top of other ones, like zone and camera) to my automation, and it did the job.

condition: template
value_template: "{{ trigger.payload_json['type'] == 'new' }}"

What I found is that there are multiple MQTT events based on the “type”. The first event type is “new”, the subsequent ones are “update”, and the last one is “end”.

Depending on your needs, you can adjust accordingly. I used “new” so there’s only one notification when the event is considered “new”. Some may find the type “end” more appropriate for their needs, but the “update” one will more likely generate multiple events.

Hope this helps someone.

1 Like