Code Monkey home page Code Monkey logo

frigate-notify's Introduction

Frigate-notify

Static Badge GitHub Repo stars GitHub release (with filter) Static Badge

About

This project is designed to generate event notifications from a standalone Frigate NVR instance.

Currently Frigate only supports notifications through Home Assistant, which I'm not using right now. So I set out to build a simple notification app that would work with a standalone Frigate server.

Features

Event Polling

  • MQTT
  • Direct via Frigate API

Notification Methods

  • Discord
  • Gotify
  • SMTP
  • Telegram
  • Pushover
  • Ntfy
  • Generic Webhook

Other

Installation

See Install / Setup.

Configuration

An example config file has been provided (example-config.yml). Please copy this & edit to fit your needs.

The sample config contains inline descriptions for each field. For additional details on the available config options & the defaults, see the Config docs.

Screenshots

Discord

Discord

Gotify

Gotify

SMTP

SMTP

Telegram

Telegram

Changelog

Additional details on each release are in the Changelog

Support

Buy Me A Coffee

frigate-notify's People

Contributors

0x2142 avatar dependabot[bot] avatar freefd avatar ryan-willis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

frigate-notify's Issues

Feature: Support Basic authentication and Bearer Token authorization for a connection to Frigate server

Sometimes Frigate and frigate-notify may not be placed in the same non-auth segment, but both can access the MQTT bus. And then we can assume that the Frigate API is protected by some type of auth (e.g., behind a reverse proxy, or we can imagine that Auth! MR is already implemented).
Since frigate-notify uses the net/http package to handle HTTP requests, we can easily implement Basic authentication and authorization based on the static Bearer Token header (generated externally).

Basic Auth description: https://pkg.go.dev/net/http#Request.BasicAuth + https://pkg.go.dev/net/http#Request.SetBasicAuth
Bearer Token description: https://swagger.io/docs/specification/authentication/bearer-authentication/

Thank you.

Feature: Add ability to exclude cameras

Depending on number of cameras installed, it might be possible that we don't want alerts from every camera.

Need to add code & config to allow excluding cameras from alerts.

Feature: Multiple consumers for a single "Alerts" notifier

Sometimes it is necessary to make a broadcast message about the happened event to multiple consumers.
Not to break the top-level implementation and keep the base validations, below is a suggestion on how to augment the model by introducing a list to each of the notifier:

...
alerts:
  telegram:
  - enabled: true
    chatid: 123456789
    token: 123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11
  - enabled: true
    chatid: 987654321
    token: 654321:CBA-FED4321ghIkl-zyx57W2v1u123ew11
  - enabled: true
    chatid: ...
    token: ...
  gotify:
  - enabled: true
    server: gotify.alpha.domain.tld
    token: ABCDEF
    ignoressl: true
  - enabled: true
    server: gotify.beta.domain.tld
    token: CABFED
    ignoressl: true
...

For existing frigate-notify users, backward compatibility with current behavior (single-key approach) can also be kept.

Currently, a workaround to support multiple notifier consumers of the same kind is to run several instances of frigate-notify with different MQTT clientid in the configuration.

Thank you.

Web API default interval is actually 0

The documentation states that the default interval for the web API is 30 seconds.
That seemed fine to me so I didn't add it to my configuration.

It turned out that when omitting the Web API interval in the config, the resulting interval is 0.
This causes some endless polling without a break.

Either the documentation should be adjusted or there's an issue with the handling of the default value of that property.

Random "No snapshot available"

Hello

I use ntfy + discord with mqtt and y have 2 times out of three Random "No snapshot available"

How to debug ? Do you know the problem ?

Frigate (0.14.0-bccffe6)
eclipse-mosquitto:latest

## SAMPLE CONFIG FILE
# For more info, see docs at https://frigate-notify.0x2142.com/config/file/

## Event Collection Methods
# Note: Only enable one - webapi OR mqtt
frigate:
  # Frigate host URL (ex. https://frigate.yourdomain.tld)
  # This is required for both collection methods
  server: http://192.168.1.254:5000
  # Set to true if using SSL & a self-signed certificate
  ignoressl: true
  # Public / internet-facing Frigate URL, if different from above server address
  public_url: https://******.test.fr

  # List of HTTP headers to send to Frigate, in format Header: Value
  headers:
    # Example:
    # - Authorization: Basic abcd1234

  # On startup, frigate-notify will check reachability of Frigate server
  startup_check:
    # Max number of attempts (Default: 5)
    attempts: 10
    # Interval between attempts, in seconds (Default: 30)
    interval: 30

  webapi:
    # Set to true to enable event collection via the web API
    enabled: 
    # Interval between checking for new events, in seconds (Default: 30)
    interval: 
    
  mqtt: 
    # Set to true to enable event collection via MQTT
    enabled: true
    # MQTT host IP
    server: 192.168.1.254
    # MQTT host port. (Default: 1883)
    port: 1883
    # MQTT Client ID (Default: frigate-notify)
    clientid:
    # MQTT Authentication. Leave both blank for anonymous
    username: 
    password: 
    # Optionally set custom topic prefix (Default: frigate)
    topic_prefix: 
  
  cameras:
    # List of cameras to exclude from being monitored
    # Camera names must match frigate configuration
    exclude:

## Alerting methods
# Any combination of alert destinations can be configured
alerts:  
  # General config applies to all alert methods below
  general:
    # Title for any alert messages (Default: Frigate Alert)
    title:
    # Optionally modify default time format in notifications
    # Use Golang's reference time format, or see docs for more info
    timeformat:

  zones:
    # Allow notifications for events outside a zone
    # Set to `drop` to disallow this
    unzoned:
    # List of valid zones to generate alerts
    # If blank, all events with a zone will generate notifications
    allow:
    # List of zones to never generate notifications
    block:

  labels:
    # Filter notifications to only specific labels allowed here
    allow:
      - person
    # List of labels to never generate notifications
    block:

  discord:
    # Set to true to enable alerting via Discord messages
    enabled: true
    # Insert full webhook URL below
    webhook: ***********************
    # Custom notification template, if desired
    template:
  
  gotify:
    # Set to true to enable alerting via a Gotify push notification server
    enabled: false
    # Server URL (ex. https://push.yourdomain.tld)
    server:
    # Application token generated by Gotify
    token: 
    # Set to true if using SSL & a self-signed certificate
    ignoressl:
    # Custom notification template, if desired
    template:
  
  smtp:
    # Set to true to enable alerting via SMTP
    enabled: false
    # SMTP server host (ex. smtp.gmail.com)
    server: 
    # SMTP port
    port: 
    # Whether or not the SMTP server requires TLS (Default: true)
    tls: 
    # Sending address / username
    user:
    # SMTP password for above user
    password:
    # Email alerts sent to any addresses listed below, separated by comma
    recipient:
    # Custom notification template, if desired
    template:

  # Telegram Config
  telegram:
    # Set to true to enable alerting via Telegram
    enabled: false
    # Chat ID of alert recipient
    chatid:
    # Bot API token
    token:
    # Custom notification template, if desired
    template:

  # Pushover Config
  pushover:
    # Set to true to enable alerting via Pushover
    enabled: false
    # Pushover API token for this application
    token:
    # User or Group key for recipients
    userkey:
    # Optional list of target devices by name, separated by comma
    devices:
    # Optional message priority, default is 0
    priority:
    # If priority is 2, retry & expiration must be set
    # Values in seconds. Retry must be 30 or higher
    retry:
    expire:
    # Optional message lifetime
    ttl:
    # Custom notification template, if desired
    template:

  # Nfty Config
  nfty:
    # Set to true to enable alerting via nfty
    enabled: true
    # URL of Nfty server
    server: https://ntfy.sh
    # Nfty topic for notifications
    topic: ****************
    # Set to true if using SSL & a self-signed certificate
    ignoressl:
    # Custom notification template, if desired
    template:

  # Webhook Config
  webhook:
    # Set to true to enable alerting via webhook
    enabled: false
    # URL of webhook receiver
    server:
    # Set to true if using SSL & a self-signed certificate
    ignoressl:
    # List of HTTP headers to send to webhook receiver, in format Header: Value
    headers:
      # Example:
      # - Authorization: Basic abcd1234
    # Custom notification template, if desired
    # Note that template must be valid JSON
    template:

## App Monitoring
# Sends HTTP GET to provided URL for aliveness checks
monitor:
  # Set to true to enable app monitoring
  enabled: false
  # URL for monitoring server
  url: 
  # Interval between monitoring check-in events, in seconds
  interval: 
  # Set to true if using SSL & a self-signed certificate
  ignoressl:

⚠️ We'll be back after a short break!

Hi everyone,

First, I just wanted to say a huge thank you to everyone using Frigate-Notify! While I've built this as a hobby project for my own Frigate instance, I'm really glad to see other people getting value out of it as well. I never really expected many people to find & use it, but as of today the latest release already has over 1,500 downloads 😲 Thank you for being here!

Next, I wanted to put out a quick message that I'll be away for a short while. I will be fairly busy over the next couple of weeks, so I won't have much time to dedicate to this project. Should be back to normal by mid/end of July.

In the meantime, I will still monitor the repo - but I may be slow to respond to issues, discussions, and feature requests.

Thanks again! 😊

Address dependabot alerts

Placeholder issue to fix Dependabot alerts:

golang.org/x/net/http2/h2c - vulnerable to request smuggling attack (High)
golang.org/x/net/html - Infinite Loop vulnerability (High)
golang.org/x/net/http2 Denial of Service vulnerability (High)
golang.org/x/net  - Uncontrolled Resource Consumption (High)

Help me get a proper notification

Hello.
First of all, thank you for developing this tool. Even someone as me managed to configure it.

I created my config.yml to send notifications to telegram, but instead of recieveing them as you show in the readme, I only get a simple line text.
How can I configure it to send me the Snapshot and also the links to view the camera or the clip?

I commented an open issue asking to be able to directly attach the video in the telegram message. It would be awesome, but meanwhile, can you help me ?

frigate:
  server: httXXXXXXXXXXX3:5000/
  ignoressl: false
  public_url: httX.XXXXXXXXXX.ud
  headers: 
  startup_check:
    attempts: 5
    interval: 30

  webapi:
    enabled: true
    interval: 

  mqtt: 
    enabled: false
    server: 
    port:
    clientid:
    username: 
    password: 
    topic_prefix: 

  cameras:
    exclude:
  
alerts:  
  general:
    title: Alerta Alarma
    timeformat: Mon, 02 Jan 2006 15:04:05 MST
    nosnap:

  zones:
    unzoned: allow
    allow:
     - zone_0
     - zone_1
    block:

  labels:
    allow:
     - person
     - dog
    block:
     - bird

  discord:
    enabled: false
    webhook: 
    template:

  gotify:
    enabled: false
    server:
    token: 
    ignoressl:
    template:

  smtp:
    enabled: false
    server: 
    port: 
    tls: 
    user:
    password:
    recipient:
    template:

  telegram:
    enabled: true
    chatid: 2XXXXXXXXXXXXXXXX
    token: 73XXXXXXXXXXXXXXXXXXXXXXXXXQZHiFtYI
    template: Detección en {{ .Camera }}. Parece {{ .Label }}!! 

  pushover:
    enabled: false
    token:
    userkey:
    devices:
    priority:
    retry:
    expire:
    ttl:
    template:

  ntfy:
    enabled: false
    server:
    topic:
    ignoressl:
    headers:
    template:

  webhook:
    enabled: false
    server: 
    ignoressl:
    headers:
    template:

monitor:
  enabled: false
  url: 
  interval: 
  ignoressl:

Improvement: Add HTTP retries when the remote side does not respond

I've just faced the rare but painful side effect when the HTTP transport can do retransmission on the L3 but has no retransmissions for L4:

2024/06/23 17:40:35 +0000 INF ../tmp/src/notifier/telegram.go:69 > Alert sent event_id=1719153634.438606-w2iy47 provider=Telegram
2024/06/23 17:40:37 +0000 WRN ../tmp/src/notifier/nfty.go:64 > Unable to send alert error="Post \"https://ntfy.domain.tld/topicname\": dial tcp 192.168.xxx.xxx:443: connect: no route to host" event_id=1719153634.438606-w2iy47 provider=Ntfy

That happened due to reverse proxy pod in front of Ntfy was restarting and therefore unavailable.

Is it possible to add to both functions from https://github.com/0x2142/frigate-notify/blob/main/util/httpclient.go some reasonable retries, let's say 5 or even 6. So the maximum delay could be about 1 minute (6 retries * 10 seconds timeout).

Whether this needs to be configurable or not - idk.

Thank you.

Driveway zone keeps being dropped

Hello, I have an issue with a person on the driveway zone it gets dropped, I have proved the details below, thank you for your time.

previous config for zones - driveway dropped

zones:
# Allow notifications for events outside a zone
# Set to drop to disallow this
unzoned: drop
# List of valid zones to generate alerts
# If blank, all events with a zone will generate notifications
allow:
# List of zones to never generate notifications
block:

current config for zones still driveway being dropped

zones:
# Allow notifications for events outside a zone
# Set to drop to disallow this
unzoned: drop
# List of valid zones to generate alerts
# If blank, all events with a zone will generate notifications
allow:
- driveway
- left_pavement
- right_pavement
- side_path
- top_patio
- bottom_patio
# List of zones to never generate notifications
block:

cameras:
Front_Garden: #Name for your Camera
ffmpeg:
inputs:
- path: rtsp://127.0.0.1:8554/Front_Garden
input_args: preset-rtsp-restream
roles:
- detect
- audio
audio: # <- enable audio events for all camera
enabled: true
max_not_heard: 30
min_volume: 500
listen:
- scream
- yell
- glass
- alarm
- bang
- breaking
- tearing
- smash
- splinter
- fire_alarm
- smoke_detector
- speech
detect:
enabled: true # Detection is enabled
width: 640 # The Cameras resolution
height: 480 # The Cameras resolution
zones:
driveway:
coordinates:
0,339,64,381,59,421,88,480,263,480,555,480,573,408,591,249,591,129,419,117,247,111,215,113,126,145,36,187,0,204
left_pavement:
coordinates: 401,0,170,0,188,117,404,118
right_pavement:
coordinates: 640,0,404,0,404,118,598,135

frigate-notify | 2024/03/30 20:35:52 Frigate Notify - v0.2.5
frigate-notify | 2024/03/30 20:35:52 Starting...
frigate-notify | 2024/03/30 20:35:52 Loading config file: ./config.yml
frigate-notify | 2024/03/30 20:35:52 Validating config file...
frigate-notify | 2024/03/30 20:35:52 MQTT Enabled.
frigate-notify | 2024/03/30 20:35:52 Events outside a zone: drop
frigate-notify | 2024/03/30 20:35:52 Zones to generate alerts for:
frigate-notify | 2024/03/30 20:35:52 - driveway
frigate-notify | 2024/03/30 20:35:52 - left_pavement
frigate-notify | 2024/03/30 20:35:52 - right_pavement
frigate-notify | 2024/03/30 20:35:52 - side_path
frigate-notify | 2024/03/30 20:35:52 - top_patio
frigate-notify | 2024/03/30 20:35:52 - bottom_patio
frigate-notify | 2024/03/30 20:35:52 No zones excluded
frigate-notify | 2024/03/30 20:35:52 Gotify alerting enabled.
frigate-notify | 2024/03/30 20:35:52 Pushover alerting enabled.
frigate-notify | 2024/03/30 20:35:52 Config file validated!
frigate-notify | 2024/03/30 20:35:52 Config file loaded.
frigate-notify | 2024/03/30 20:35:52 Connecting to MQTT Server...
frigate-notify | 2024/03/30 20:35:52 App running. Press Ctrl-C to quit.
frigate-notify | 2024/03/30 20:35:52 Connected to MQTT.
frigate-notify | 2024/03/30 20:35:52 Subscribed to MQTT topic frigate/events
frigate-notify | 2024/03/30 20:39:51 Event ID 1711831191.060235-h8taxr - Camera Front_Garden detected person in zone(s): []
frigate-notify | 2024/03/30 20:39:51 Event ID 1711831191.060235-h8taxr - Start time: 2024-03-30 20:39:51 +0000 UTC
frigate-notify | 2024/03/30 20:39:51 Event ID 1711831191.060235-h8taxr - Dropped since it was outside a zone.

Received payload: {'before': {'id': '1711831191.060235-h8taxr', 'camera': 'Front_Garden', 'frame_time': 1711831191.060235, 'snapshot': None, 'label': 'person', 'sub_label': None, 'top_score': 0.0, 'false_positive': True, 'start_time': 1711831191.060235, 'end_time': None, 'score': 0.67578125, 'box': [1, 193, 183, 479], 'area': 52052, 'ratio': 0.6363636363636364, 'region': [0, 124, 356, 480], 'stationary': False, 'motionless_count': 0, 'position_changes': 0, 'current_zones': [], 'entered_zones': [], 'has_clip': False, 'has_snapshot': False, 'attributes': {}, 'current_attributes': []}, 'after': {'id': '1711831191.060235-h8taxr', 'camera': 'Front_Garden', 'frame_time': 1711831191.460495, 'snapshot': {'frame_time': 1711831191.460495, 'box': [0, 189, 181, 476], 'area': 51947, 'region': [0, 140, 340, 480], 'score': 0.70703125, 'attributes': []}, 'label': 'person', 'sub_label': None, 'top_score': 0.70703125, 'false_positive': False, 'start_time': 1711831191.060235, 'end_time': None, 'score': 0.70703125, 'box': [0, 189, 181, 476], 'area': 51947, 'ratio': 0.6306620209059234, 'region': [0, 140, 340, 480], 'stationary': False, 'motionless_count': 1, 'position_changes': 1, 'current_zones': [], 'entered_zones': [], 'has_clip': False, 'has_snapshot': True, 'attributes': {}, 'current_attributes': []}, 'type': 'new'}
Received payload: {'before': {'id': '1711831191.060235-h8taxr', 'camera': 'Front_Garden', 'frame_time': 1711831191.460495, 'snapshot': {'frame_time': 1711831191.460495, 'box': [0, 189, 181, 476], 'area': 51947, 'region': [0, 140, 340, 480], 'score': 0.70703125, 'attributes': []}, 'label': 'person', 'sub_label': None, 'top_score': 0.70703125, 'false_positive': False, 'start_time': 1711831191.060235, 'end_time': None, 'score': 0.70703125, 'box': [0, 189, 181, 476], 'area': 51947, 'ratio': 0.6306620209059234, 'region': [0, 140, 340, 480], 'stationary': False, 'motionless_count': 1, 'position_changes': 1, 'current_zones': [], 'entered_zones': [], 'has_clip': False, 'has_snapshot': True, 'attributes': {}, 'current_attributes': []}, 'after': {'id': '1711831191.060235-h8taxr', 'camera': 'Front_Garden', 'frame_time': 1711831192.060688, 'snapshot': {'frame_time': 1711831191.460495, 'box': [0, 189, 181, 476], 'area': 51947, 'region': [0, 140, 340, 480], 'score': 0.70703125, 'attributes': []}, 'label': 'person', 'sub_label': None, 'top_score': 0.71484375, 'false_positive': False, 'start_time': 1711831191.060235, 'end_time': None, 'score': 0.6953125, 'box': [0, 202, 182, 478], 'area': 50232, 'ratio': 0.6594202898550725, 'region': [0, 144, 336, 480], 'stationary': False, 'motionless_count': 4, 'position_changes': 1, 'current_zones': ['driveway'], 'entered_zones': ['driveway'], 'has_clip': False, 'has_snapshot': True, 'attributes': {}, 'current_attributes': []}, 'type': 'update'}
Received payload: {'before': {'id': '1711831191.060235-h8taxr', 'camera': 'Front_Garden', 'frame_time': 1711831192.060688, 'snapshot': {'frame_time': 1711831191.460495, 'box': [0, 189, 181, 476], 'area': 51947, 'region': [0, 140, 340, 480], 'score': 0.70703125, 'attributes': []}, 'label': 'person', 'sub_label': None, 'top_score': 0.71484375, 'false_positive': False, 'start_time': 1711831191.060235, 'end_time': None, 'score': 0.6953125, 'box': [0, 202, 182, 478], 'area': 50232, 'ratio': 0.6594202898550725, 'region': [0, 144, 336, 480], 'stationary': False, 'motionless_count': 4, 'position_changes': 1, 'current_zones': ['driveway'], 'entered_zones': ['driveway'], 'has_clip': False, 'has_snapshot': True, 'attributes': {}, 'current_attributes': []}, 'after': {'id': '1711831191.060235-h8taxr', 'camera': 'Front_Garden', 'frame_time': 1711831197.260806, 'snapshot': {'frame_time': 1711831195.479761, 'box': [24, 159, 206, 477], 'area': 57876, 'region': [0, 92, 388, 480], 'score': 0.76953125, 'attributes': []}, 'label': 'person', 'sub_label': None, 'top_score': 0.796875, 'false_positive': False, 'start_time': 1711831191.060235, 'end_time': None, 'score': 0.78125, 'box': [13, 163, 210, 477], 'area': 61858, 'ratio': 0.6273885350318471, 'region': [0, 108, 372, 480], 'stationary': False, 'motionless_count': 30, 'position_changes': 1, 'current_zones': ['driveway'], 'entered_zones': ['driveway'], 'has_clip': False, 'has_snapshot': True, 'attributes': {}, 'current_attributes': []}, 'type': 'update'}
Received payload: {'before': {'id': '1711831191.060235-h8taxr', 'camera': 'Front_Garden', 'frame_time': 1711831197.260806, 'snapshot': {'frame_time': 1711831195.479761, 'box': [24, 159, 206, 477], 'area': 57876, 'region': [0, 92, 388, 480], 'score': 0.76953125, 'attributes': []}, 'label': 'person', 'sub_label': None, 'top_score': 0.796875, 'false_positive': False, 'start_time': 1711831191.060235, 'end_time': None, 'score': 0.78125, 'box': [13, 163, 210, 477], 'area': 61858, 'ratio': 0.6273885350318471, 'region': [0, 108, 372, 480], 'stationary': False, 'motionless_count': 30, 'position_changes': 1, 'current_zones': ['driveway'], 'entered_zones': ['driveway'], 'has_clip': False, 'has_snapshot': True, 'attributes': {}, 'current_attributes': []}, 'after': {'id': '1711831191.060235-h8taxr', 'camera': 'Front_Garden', 'frame_time': 1711831201.45869, 'snapshot': {'frame_time': 1711831195.479761, 'box': [24, 159, 206, 477], 'area': 57876, 'region': [0, 92, 388, 480], 'score': 0.76953125, 'attributes': []}, 'label': 'person', 'sub_label': None, 'top_score': 0.796875, 'false_positive': False, 'start_time': 1711831191.060235, 'end_time': None, 'score': 0.71484375, 'box': [0, 184, 211, 476], 'area': 61612, 'ratio': 0.7226027397260274, 'region': [0, 124, 356, 480], 'stationary': True, 'motionless_count': 51, 'position_changes': 1, 'current_zones': ['driveway'], 'entered_zones': ['driveway'], 'has_clip': False, 'has_snapshot': True, 'attributes': {}, 'current_attributes': []}, 'type': 'update'}
Received payload: {'before': {'id': '1711831191.060235-h8taxr', 'camera': 'Front_Garden', 'frame_time': 1711831201.45869, 'snapshot': {'frame_time': 1711831195.479761, 'box': [24, 159, 206, 477], 'area': 57876, 'region': [0, 92, 388, 480], 'score': 0.76953125, 'attributes': []}, 'label': 'person', 'sub_label': None, 'top_score': 0.796875, 'false_positive': False, 'start_time': 1711831191.060235, 'end_time': None, 'score': 0.71484375, 'box': [0, 184, 211, 476], 'area': 61612, 'ratio': 0.7226027397260274, 'region': [0, 124, 356, 480], 'stationary': True, 'motionless_count': 51, 'position_changes': 1, 'current_zones': ['driveway'], 'entered_zones': ['driveway'], 'has_clip': False, 'has_snapshot': True, 'attributes': {}, 'current_attributes': []}, 'after': {'id': '1711831191.060235-h8taxr', 'camera': 'Front_Garden', 'frame_time': 1711831206.460043, 'snapshot': {'frame_time': 1711831204.05758, 'box': [3, 176, 210, 478], 'area': 62514, 'region': [0, 124, 356, 480], 'score': 0.76953125, 'attributes': []}, 'label': 'person', 'sub_label': None, 'top_score': 0.796875, 'false_positive': False, 'start_time': 1711831191.060235, 'end_time': None, 'score': 0.78125, 'box': [12, 165, 207, 473], 'area': 60060, 'ratio': 0.6331168831168831, 'region': [0, 116, 364, 480], 'stationary': True, 'motionless_count': 76, 'position_changes': 1, 'current_zones': ['driveway'], 'entered_zones': ['driveway'], 'has_clip': False, 'has_snapshot': True, 'attributes': {}, 'current_attributes': []}, 'type': 'update'}
Received payload: {'before': {'id': '1711831191.060235-h8taxr', 'camera': 'Front_Garden', 'frame_time': 1711831206.460043, 'snapshot': {'frame_time': 1711831204.05758, 'box': [3, 176, 210, 478], 'area': 62514, 'region': [0, 124, 356, 480], 'score': 0.76953125, 'attributes': []}, 'label': 'person', 'sub_label': None, 'top_score': 0.796875, 'false_positive': False, 'start_time': 1711831191.060235, 'end_time': None, 'score': 0.78125, 'box': [12, 165, 207, 473], 'area': 60060, 'ratio': 0.6331168831168831, 'region': [0, 116, 364, 480], 'stationary': True, 'motionless_count': 76, 'position_changes': 1, 'current_zones': ['driveway'], 'entered_zones': ['driveway'], 'has_clip': False, 'has_snapshot': True, 'attributes': {}, 'current_attributes': []}, 'after': {'id': '1711831191.060235-h8taxr', 'camera': 'Front_Garden', 'frame_time': 1711831213.857236, 'snapshot': {'frame_time': 1711831204.05758, 'box': [3, 176, 210, 478], 'area': 62514, 'region': [0, 124, 356, 480], 'score': 0.76953125, 'attributes': []}, 'label': 'person', 'sub_label': None, 'top_score': 0.796875, 'false_positive': False, 'start_time': 1711831191.060235, 'end_time': None, 'score': 0.640625, 'box': [0, 223, 155, 477], 'area': 39370, 'ratio': 0.610236220472441, 'region': [0, 156, 324, 480], 'stationary': True, 'motionless_count': 113, 'position_changes': 1, 'current_zones': [], 'entered_zones': ['driveway'], 'has_clip': False, 'has_snapshot': True, 'attributes': {}, 'current_attributes': []}, 'type': 'update'}
Received payload: {'before': {'id': '1711831191.060235-h8taxr', 'camera': 'Front_Garden', 'frame_time': 1711831213.857236, 'snapshot': {'frame_time': 1711831204.05758, 'box': [3, 176, 210, 478], 'area': 62514, 'region': [0, 124, 356, 480], 'score': 0.76953125, 'attributes': []}, 'label': 'person', 'sub_label': None, 'top_score': 0.796875, 'false_positive': False, 'start_time': 1711831191.060235, 'end_time': None, 'score': 0.640625, 'box': [0, 223, 155, 477], 'area': 39370, 'ratio': 0.610236220472441, 'region': [0, 156, 324, 480], 'stationary': True, 'motionless_count': 113, 'position_changes': 1, 'current_zones': [], 'entered_zones': ['driveway'], 'has_clip': False, 'has_snapshot': True, 'attributes': {}, 'current_attributes': []}, 'after': {'id': '1711831191.060235-h8taxr', 'camera': 'Front_Garden', 'frame_time': 1711831215.256641, 'snapshot': {'frame_time': 1711831204.05758, 'box': [3, 176, 210, 478], 'area': 62514, 'region': [0, 124, 356, 480], 'score': 0.76953125, 'attributes': []}, 'label': 'person', 'sub_label': None, 'top_score': 0.796875, 'false_positive': False, 'start_time': 1711831191.060235, 'end_time': None, 'score': 0.55859375, 'box': [17, 274, 129, 476], 'area': 22624, 'ratio': 0.5544554455445545, 'region': [0, 160, 320, 480], 'stationary': False, 'motionless_count': 0, 'position_changes': 2, 'current_zones': [], 'entered_zones': ['driveway'], 'has_clip': False, 'has_snapshot': True, 'attributes': {}, 'current_attributes': []}, 'type': 'update'}
Received payload: {'before': {'id': '1711831191.060235-h8taxr', 'camera': 'Front_Garden', 'frame_time': 1711831215.256641, 'snapshot': {'frame_time': 1711831204.05758, 'box': [3, 176, 210, 478], 'area': 62514, 'region': [0, 124, 356, 480], 'score': 0.76953125, 'attributes': []}, 'label': 'person', 'sub_label': None, 'top_score': 0.796875, 'false_positive': False, 'start_time': 1711831191.060235, 'end_time': None, 'score': 0.55859375, 'box': [17, 274, 129, 476], 'area': 22624, 'ratio': 0.5544554455445545, 'region': [0, 160, 320, 480], 'stationary': False, 'motionless_count': 0, 'position_changes': 2, 'current_zones': [], 'entered_zones': ['driveway'], 'has_clip': False, 'has_snapshot': True, 'attributes': {}, 'current_attributes': []}, 'after': {'id': '1711831191.060235-h8taxr', 'camera': 'Front_Garden', 'frame_time': 1711831215.458971, 'snapshot': {'frame_time': 1711831204.05758, 'box': [3, 176, 210, 478], 'area': 62514, 'region': [0, 124, 356, 480], 'score': 0.76953125, 'attributes': []}, 'label': 'person', 'sub_label': None, 'top_score': 0.796875, 'false_positive': False, 'start_time': 1711831191.060235, 'end_time': None, 'score': 0.640625, 'box': [43, 288, 107, 405], 'area': 7488, 'ratio': 0.5470085470085471, 'region': [0, 160, 320, 480], 'stationary': False, 'motionless_count': 0, 'position_changes': 2, 'current_zones': ['driveway'], 'entered_zones': ['driveway'], 'has_clip': False, 'has_snapshot': True, 'attributes': {}, 'current_attributes': []}, 'type': 'update'}
Received payload: {'before': {'id': '1711831191.060235-h8taxr', 'camera': 'Front_Garden', 'frame_time': 1711831215.458971, 'snapshot': {'frame_time': 1711831204.05758, 'box': [3, 176, 210, 478], 'area': 62514, 'region': [0, 124, 356, 480], 'score': 0.76953125, 'attributes': []}, 'label': 'person', 'sub_label': None, 'top_score': 0.796875, 'false_positive': False, 'start_time': 1711831191.060235, 'end_time': None, 'score': 0.640625, 'box': [43, 288, 107, 405], 'area': 7488, 'ratio': 0.5470085470085471, 'region': [0, 160, 320, 480], 'stationary': False, 'motionless_count': 0, 'position_changes': 2, 'current_zones': ['driveway'], 'entered_zones': ['driveway'], 'has_clip': False, 'has_snapshot': True, 'attributes': {}, 'current_attributes': []}, 'after': {'id': '1711831191.060235-h8taxr', 'camera': 'Front_Garden', 'frame_time': 1711831215.458971, 'snapshot': {'frame_time': 1711831204.05758, 'box': [3, 176, 210, 478], 'area': 62514, 'region': [0, 124, 356, 480], 'score': 0.76953125, 'attributes': []}, 'label': 'person', 'sub_label': None, 'top_score': 0.796875, 'false_positive': False, 'start_time': 1711831191.060235, 'end_time': 1711831220.65575, 'score': 0.640625, 'box': [43, 288, 107, 405], 'area': 7488, 'ratio': 0.5470085470085471, 'region': [0, 160, 320, 480], 'stationary': False, 'motionless_count': 0, 'position_changes': 2, 'current_zones': ['driveway'], 'entered_zones': ['driveway'], 'has_clip': False, 'has_snapshot': True, 'attributes': {}, 'current_attributes': []}, 'type': 'end'}

Improvement: Migrate WebAPI from REST to WebSocket

Alongside with the existing public REST API, Frigate has internal WebSocket API mostly used by the UI as /ws path.

Perhaps, the Interface Agreement of internal WebSocket API might be changed more often than public REST API. But since the same type of event serialization is used here as for the MQTT payload, the Event information model of frigate-notify can be unified.

Here are several WebSocket messages when the camera caught the 2nd person, while the event for the 1st person had already been alerted:

{"topic": "CameraNameGoesHere/all", "payload": 1}
{"topic": "events", "payload": "{\"before\": {\"id\": \"1715933215.305115-umg80m\", \"camera\": \"CameraNameGoesHere\", \"frame_time\": 1715933215.426083, \"snapshot\": {\"frame_time\": 1715933215.426083, \"box\": [1224, 909, 2369, 1943], \"area\": 1183930, \"region\": [0, 0, 2836, 2836], \"score\": 0.84375, \"attributes\": []}, \"label\": \"person\", \"sub_label\": null, \"top_score\": 0.720703125, \"false_positive\": false, \"start_time\": 1715933215.305115, \"end_time\": null, \"score\": 0.84375, \"box\": [1224, 909, 2369, 1943], \"area\": 1183930, \"ratio\": 1.1073500967117988, \"region\": [0, 0, 2836, 2836], \"stationary\": false, \"motionless_count\": 0, \"position_changes\": 1, \"current_zones\": [], \"entered_zones\": [], \"has_clip\": true, \"has_snapshot\": true, \"attributes\": {}, \"current_attributes\": []}, \"after\": {\"id\": \"1715933215.305115-umg80m\", \"camera\": \"CameraNameGoesHere\", \"frame_time\": 1715933220.702879, \"snapshot\": {\"frame_time\": 1715933215.906813, \"box\": [1227, 328, 2209, 1924], \"area\": 1567272, \"region\": [0, 0, 3072, 3072], \"score\": 0.84375, \"attributes\": []}, \"label\": \"person\", \"sub_label\": null, \"top_score\": 0.837890625, \"false_positive\": false, \"start_time\": 1715933215.305115, \"end_time\": null, \"score\": 0.76953125, \"box\": [1048, 196, 1722, 943], \"area\": 503478, \"ratio\": 0.9022757697456493, \"region\": [971, 113, 1863, 1005], \"stationary\": false, \"motionless_count\": 4, \"position_changes\": 1, \"current_zones\": [], \"entered_zones\": [], \"has_clip\": true, \"has_snapshot\": true, \"attributes\": {}, \"current_attributes\": []}, \"type\": \"update\"}"}
{"topic": "events", "payload": "{\"before\": {\"id\": \"1715933215.305115-umg80m\", \"camera\": \"CameraNameGoesHere\", \"frame_time\": 1715933220.702879, \"snapshot\": {\"frame_time\": 1715933215.906813, \"box\": [1227, 328, 2209, 1924], \"area\": 1567272, \"region\": [0, 0, 3072, 3072], \"score\": 0.84375, \"attributes\": []}, \"label\": \"person\", \"sub_label\": null, \"top_score\": 0.837890625, \"false_positive\": false, \"start_time\": 1715933215.305115, \"end_time\": null, \"score\": 0.76953125, \"box\": [1048, 196, 1722, 943], \"area\": 503478, \"ratio\": 0.9022757697456493, \"region\": [971, 113, 1863, 1005], \"stationary\": false, \"motionless_count\": 4, \"position_changes\": 1, \"current_zones\": [], \"entered_zones\": [], \"has_clip\": true, \"has_snapshot\": true, \"attributes\": {}, \"current_attributes\": []}, \"after\": {\"id\": \"1715933215.305115-umg80m\", \"camera\": \"CameraNameGoesHere\", \"frame_time\": 1715933240.696653, \"snapshot\": {\"frame_time\": 1715933215.906813, \"box\": [1227, 328, 2209, 1924], \"area\": 1567272, \"region\": [0, 0, 3072, 3072], \"score\": 0.84375, \"attributes\": []}, \"label\": \"person\", \"sub_label\": null, \"top_score\": 0.837890625, \"false_positive\": false, \"start_time\": 1715933215.305115, \"end_time\": null, \"score\": 0.76953125, \"box\": [1063, 163, 1711, 1186], \"area\": 662904, \"ratio\": 0.6334310850439883, \"region\": [837, 115, 1945, 1223], \"stationary\": true, \"motionless_count\": 51, \"position_changes\": 1, \"current_zones\": [], \"entered_zones\": [], \"has_clip\": true, \"has_snapshot\": true, \"attributes\": {}, \"current_attributes\": []}, \"type\": \"update\"}"}
{"topic": "events", "payload": "{\"before\": {\"id\": \"1715933297.882261-bal6te\", \"camera\": \"CameraNameGoesHere\", \"frame_time\": 1715933297.882261, \"snapshot\": null, \"label\": \"person\", \"sub_label\": null, \"top_score\": 0.0, \"false_positive\": true, \"start_time\": 1715933297.882261, \"end_time\": null, \"score\": 0.84375, \"box\": [1198, 1106, 2277, 1921], \"area\": 879385, \"ratio\": 1.323926380368098, \"region\": [500, 0, 2592, 2092], \"stationary\": false, \"motionless_count\": 0, \"position_changes\": 0, \"current_zones\": [], \"entered_zones\": [], \"has_clip\": false, \"has_snapshot\": false, \"attributes\": {}, \"current_attributes\": []}, \"after\": {\"id\": \"1715933297.882261-bal6te\", \"camera\": \"CameraNameGoesHere\", \"frame_time\": 1715933298.085144, \"snapshot\": {\"frame_time\": 1715933298.085144, \"box\": [1210, 838, 2199, 1902], \"area\": 1052296, \"region\": [528, 0, 2592, 2064], \"score\": 0.84375, \"attributes\": []}, \"label\": \"person\", \"sub_label\": null, \"top_score\": 0.82421875, \"false_positive\": false, \"start_time\": 1715933297.882261, \"end_time\": null, \"score\": 0.84375, \"box\": [1210, 838, 2199, 1902], \"area\": 1052296, \"ratio\": 0.9295112781954887, \"region\": [528, 0, 2592, 2064], \"stationary\": false, \"motionless_count\": 0, \"position_changes\": 1, \"current_zones\": [], \"entered_zones\": [], \"has_clip\": true, \"has_snapshot\": true, \"attributes\": {}, \"current_attributes\": []}, \"type\": \"new\"}"}
{"topic": "CameraNameGoesHere/person", "payload": 2}
{"topic": "CameraNameGoesHere/all", "payload": 2}
{"topic": "events", "payload": "{\"before\": {\"id\": \"1715933215.305115-umg80m\", \"camera\": \"CameraNameGoesHere\", \"frame_time\": 1715933240.696653, \"snapshot\": {\"frame_time\": 1715933215.906813, \"box\": [1227, 328, 2209, 1924], \"area\": 1567272, \"region\": [0, 0, 3072, 3072], \"score\": 0.84375, \"attributes\": []}, \"label\": \"person\", \"sub_label\": null, \"top_score\": 0.837890625, \"false_positive\": false, \"start_time\": 1715933215.305115, \"end_time\": null, \"score\": 0.76953125, \"box\": [1063, 163, 1711, 1186], \"area\": 662904, \"ratio\": 0.6334310850439883, \"region\": [837, 115, 1945, 1223], \"stationary\": true, \"motionless_count\": 51, \"position_changes\": 1, \"current_zones\": [], \"entered_zones\": [], \"has_clip\": true, \"has_snapshot\": true, \"attributes\": {}, \"current_attributes\": []}, \"after\": {\"id\": \"1715933215.305115-umg80m\", \"camera\": \"CameraNameGoesHere\", \"frame_time\": 1715933298.681261, \"snapshot\": {\"frame_time\": 1715933215.906813, \"box\": [1227, 328, 2209, 1924], \"area\": 1567272, \"region\": [0, 0, 3072, 3072], \"score\": 0.84375, \"attributes\": []}, \"label\": \"person\", \"sub_label\": null, \"top_score\": 0.837890625, \"false_positive\": false, \"start_time\": 1715933215.305115, \"end_time\": null, \"score\": 0.8125, \"box\": [1111, 194, 1826, 811], \"area\": 441155, \"ratio\": 1.1588330632090762, \"region\": [572, 0, 2592, 2020], \"stationary\": false, \"motionless_count\": 0, \"position_changes\": 2, \"current_zones\": [], \"entered_zones\": [], \"has_clip\": true, \"has_snapshot\": true, \"attributes\": {}, \"current_attributes\": []}, \"type\": \"update\"}"}
{"topic": "events", "payload": "{\"before\": {\"id\": \"1715933297.882261-bal6te\", \"camera\": \"CameraNameGoesHere\", \"frame_time\": 1715933298.085144, \"snapshot\": {\"frame_time\": 1715933298.085144, \"box\": [1210, 838, 2199, 1902], \"area\": 1052296, \"region\": [528, 0, 2592, 2064], \"score\": 0.84375, \"attributes\": []}, \"label\": \"person\", \"sub_label\": null, \"top_score\": 0.82421875, \"false_positive\": false, \"start_time\": 1715933297.882261, \"end_time\": null, \"score\": 0.84375, \"box\": [1210, 838, 2199, 1902], \"area\": 1052296, \"ratio\": 0.9295112781954887, \"region\": [528, 0, 2592, 2064], \"stationary\": false, \"motionless_count\": 0, \"position_changes\": 1, \"current_zones\": [], \"entered_zones\": [], \"has_clip\": true, \"has_snapshot\": true, \"attributes\": {}, \"current_attributes\": []}, \"after\": {\"id\": \"1715933297.882261-bal6te\", \"camera\": \"CameraNameGoesHere\", \"frame_time\": 1715933303.092035, \"snapshot\": {\"frame_time\": 1715933298.501607, \"box\": [1167, 566, 2114, 1915], \"area\": 1277503, \"region\": [556, 0, 2592, 2036], \"score\": 0.84375, \"attributes\": []}, \"label\": \"person\", \"sub_label\": null, \"top_score\": 0.84375, \"false_positive\": false, \"start_time\": 1715933297.882261, \"end_time\": null, \"score\": 0.82421875, \"box\": [1609, 303, 2392, 1487], \"area\": 927072, \"ratio\": 0.6613175675675675, \"region\": [951, 57, 2523, 1629], \"stationary\": false, \"motionless_count\": 16, \"position_changes\": 1, \"current_zones\": [], \"entered_zones\": [], \"has_clip\": true, \"has_snapshot\": true, \"attributes\": {}, \"current_attributes\": []}, \"type\": \"update\"}"}
{"topic": "events", "payload": "{\"before\": {\"id\": \"1715933215.305115-umg80m\", \"camera\": \"CameraNameGoesHere\", \"frame_time\": 1715933298.681261, \"snapshot\": {\"frame_time\": 1715933215.906813, \"box\": [1227, 328, 2209, 1924], \"area\": 1567272, \"region\": [0, 0, 3072, 3072], \"score\": 0.84375, \"attributes\": []}, \"label\": \"person\", \"sub_label\": null, \"top_score\": 0.837890625, \"false_positive\": false, \"start_time\": 1715933215.305115, \"end_time\": null, \"score\": 0.8125, \"box\": [1111, 194, 1826, 811], \"area\": 441155, \"ratio\": 1.1588330632090762, \"region\": [572, 0, 2592, 2020], \"stationary\": false, \"motionless_count\": 0, \"position_changes\": 2, \"current_zones\": [], \"entered_zones\": [], \"has_clip\": true, \"has_snapshot\": true, \"attributes\": {}, \"current_attributes\": []}, \"after\": {\"id\": \"1715933215.305115-umg80m\", \"camera\": \"CameraNameGoesHere\", \"frame_time\": 1715933311.689821, \"snapshot\": {\"frame_time\": 1715933215.906813, \"box\": [1227, 328, 2209, 1924], \"area\": 1567272, \"region\": [0, 0, 3072, 3072], \"score\": 0.84375, \"attributes\": []}, \"label\": \"person\", \"sub_label\": null, \"top_score\": 0.84375, \"false_positive\": false, \"start_time\": 1715933215.305115, \"end_time\": null, \"score\": 0.78125, \"box\": [1073, 186, 1736, 1090], \"area\": 599352, \"ratio\": 0.7334070796460177, \"region\": [935, 0, 2547, 1612], \"stationary\": true, \"motionless_count\": 51, \"position_changes\": 2, \"current_zones\": [], \"entered_zones\": [], \"has_clip\": true, \"has_snapshot\": true, \"attributes\": {}, \"current_attributes\": []}, \"type\": \"update\"}"}
{"topic": "events", "payload": "{\"before\": {\"id\": \"1715933215.305115-umg80m\", \"camera\": \"CameraNameGoesHere\", \"frame_time\": 1715933311.689821, \"snapshot\": {\"frame_time\": 1715933215.906813, \"box\": [1227, 328, 2209, 1924], \"area\": 1567272, \"region\": [0, 0, 3072, 3072], \"score\": 0.84375, \"attributes\": []}, \"label\": \"person\", \"sub_label\": null, \"top_score\": 0.84375, \"false_positive\": false, \"start_time\": 1715933215.305115, \"end_time\": null, \"score\": 0.78125, \"box\": [1073, 186, 1736, 1090], \"area\": 599352, \"ratio\": 0.7334070796460177, \"region\": [935, 0, 2547, 1612], \"stationary\": true, \"motionless_count\": 51, \"position_changes\": 2, \"current_zones\": [], \"entered_zones\": [], \"has_clip\": true, \"has_snapshot\": true, \"attributes\": {}, \"current_attributes\": []}, \"after\": {\"id\": \"1715933215.305115-umg80m\", \"camera\": \"CameraNameGoesHere\", \"frame_time\": 1715933320.289114, \"snapshot\": {\"frame_time\": 1715933215.906813, \"box\": [1227, 328, 2209, 1924], \"area\": 1567272, \"region\": [0, 0, 3072, 3072], \"score\": 0.84375, \"attributes\": []}, \"label\": \"person\", \"sub_label\": null, \"top_score\": 0.84375, \"false_positive\": false, \"start_time\": 1715933215.305115, \"end_time\": null, \"score\": 0.84375, \"box\": [1166, 74, 1704, 989], \"area\": 492270, \"ratio\": 0.5879781420765028, \"region\": [934, 0, 2582, 1648], \"stationary\": false, \"motionless_count\": 0, \"position_changes\": 3, \"current_zones\": [], \"entered_zones\": [], \"has_clip\": true, \"has_snapshot\": true, \"attributes\": {}, \"current_attributes\": []}, \"type\": \"update\"}"}

In most cases, WebSocket integration allows getting rid of the MQTT bus while keeping the same pace of event notifications.
This can also help overcome the trouble with different data format that was shown at #54 (comment).

send clip in notification (not "only" the URL)?

Currently I use homeassistant to receieve notfications and there i can send a clip directly to Telegram. I am wondering if this work with firagete-notify as well since it is quite nice like telegram shows a preview (like a thumbnail video) .

thanks and kind regards

Recommended Web api or MQTT

I have used both ways and trying to figure out what is the best practice or recommended one to use? MQTT or the web api? I am fairly new to this and tried both ways and they work but don’t know what is the best practice for use with pushover.

Thanks for any hints or tips on this.

Failed to load config from file

Running docker with

version: "3.0"
services:
  frigate-notify:
    image: ghcr.io/0x2142/frigate-notify:latest
    environment:
      - TZ=Europe/Stockholm
    volumes:
      - /mnt/dietpi_userdata/config.yml:/app/config.yml
    restart: unless-stopped

config.yml

frigate:
  server: 192.168.0.32:5000
  ignoressl: false
  # Public / internet-facing Frigate URL, if different from above server address
  public_url:

  # List of HTTP headers to send to Frigate, in format Header: Value
  headers:
    # Example:
    # - Authorization: Basic abcd1234

  # On startup, frigate-notify will check reachability of Frigate server
  startup_check:
    # Max number of attempts (Default: 5)
    attempts: 3
    # Interval between attempts, in seconds (Default: 30)
    interval: 30

  webapi:
    # Set to true to enable event collection via the web API
    enabled:
    # Interval between checking for new events, in seconds (Default: 30)
    interval:

  mqtt:
    # Set to true to enable event collection via MQTT
    enabled:true
    # MQTT host IP
    server: 192.168.0.243
    # MQTT host port. (Default: 1883)
    port:
    # MQTT Client ID (Default: frigate-notify)
    clientid:
    # MQTT Authentication. Leave both blank for anonymous
    username:
    password:
    # Optionally set custom topic prefix (Default: frigate)
    topic_prefix:

But getting error

2024/08/03 16:42:37 +0200 INF Frigate Notify - v0.3.2
2024/08/03 16:42:37 +0200 INF Starting...
2024/08/03 16:42:37 +0200 FTL Failed to load config from file! error="yaml: line 1: did not find expected key"

I have run out of ideas please could I have same help?
Thanks

Crashing after mqtt event received

Testing this out, I'm having an issue where the docker crashes when sending the notification to gotify I think. Here is the log:

2024/03/13 21:46:37 Event ID 1710380793.366356-hjwenm on camera driveway1 detected person in zone(s): []
2024/03/13 21:46:37 Event Start time: 2024-03-13 21:46:33 -0400 EDT
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x4976b5]

goroutine 19 [running]:
io.ReadAll({0x0, 0x0})
/usr/local/go/src/io/io.go:704 +0x55
github.com/0x2142/frigate-notify/notifier.SendAlert({0xc0002c4080, 0x74}, {0x0, 0x0}, {0x0?, 0x0?})
/app/notifier/alerts.go:16 +0x3b
github.com/0x2142/frigate-notify/events.processEvent({0x0?, 0x0?}, {0x850fd0, 0xc000198050})
/app/events/mqtt.go:96 +0x54a
github.com/eclipse/paho%2emqtt%2egolang.(*router).matchAndDispatch.func2()
/go/pkg/mod/github.com/eclipse/[email protected]/router.go:218 +0x930
created by github.com/eclipse/paho%2emqtt%2egolang.(*router).matchAndDispatch in goroutine 6
/go/pkg/mod/github.com/eclipse/[email protected]/router.go:173 +0x21c

Here is the config file:

frigate:
server: 10.1.0.10:5000
ignoressl: false

webapi:
enabled: false
interval: 30

mqtt:
enabled: true
server: 10.1.0.10
port: 1883
clientid:
username: REDACTED
password: REDACTED

cameras:
exclude:
- breakroom
- office
- reception

alerts:
general:
title: Test

gotify:
enabled: true
server: 10.0.0.10:8070
token: REDACTED
ignoressl: false

monitor:
enabled: false
url:
interval:
ignoressl:

Reduce logging or introduce debug log option

At the moment two log messages are created at every polling occurrence.
Those look like:

2024/05/16 20:46:06 Checking for new events...
2024/05/16 20:46:06 Found 0 new events.

When using podman the default logging driver is journald.
The used log priority/level is 3 (which appears as a warning) for whatever reason.

In cases where the polling worked fine and there were no new events, the logging could be avoided completely.
This would prevent the logs from getting flooded and only the messages of interest would go towards the log.
A configuration option for debug logging could be added in addition for some special use cases.

In my case I used a workaround to direct the logs into a "k8s" file instead using journald:

    logging:
      driver: k8s-file
      options:
        path: /opt/frigate/notify.log
        max-size: 10mb

send image in notification instead of URL

This is very similar to #98 but i think it is easier and faster to implement as it doesn't require transcoding or uploading a lot of data.

I would like this project to be able to send a picture instead of the frigate url.

Incomplete notifications in Telegram

First of all:
Thank you for this awesome frigate extension!
This was the only part of frigate that I was missing really badly.
This reddit post lead me here and I'm very glad about it.

I only noticed a few issues with the generated Telegram notifications:

  • The percentage values for the labels are at 0% always.
  • The camera and event clip links stopped working after some time (not sure if this is uptime related or not). Since the frigate instance is running at a remote location with seldom activities I cannot easily investigate if it may heal itself automatically again. I can try it myself in a few days.

I'm using version v2.7.0 of this software and 0.13.2 of frigate.

Failed to load config file! Error: config.yml: file not found

Hi. Disclaimer - not an expert, using portainer.

Have this error:

Failed to load config file! Error: config.yml: file not found

I've double checked typos, have the config.yml in the folder below, config.yml has rw-r-r

version: "3.0"
services:
frigate-notify:
image: ghcr.io/0x2142/frigate-notify:latest
container_name: frigate-notify
environment:
- TZ=Etc/UTC
volumes:
- "/home/1/frigate-email:/config/app/"
restart: unless-stopped

Any thoughts please welcomed? Ready to facepalm if I'm missing something obvious!

Support for sub_label

Is your feature request related to a problem? Please describe.
Using Frigate and Plate Recogniser. Plate Recogniser adds sub_label to recognised car licence plates, I would like to block events, when my car is recognised, by defining its licence plate in config like:¨

alerts:
  sublabels:
    block:
      - MY_PLATE_XYZ

Describe the solution you'd like
Possibility to allow/block notification based on sub_label (same functionality as with "label").

In MQTT there is attribute sub_lablel: ... "sub_label": ["MY_PLATE_XYZ", null] ..., so should be possibly easy to scrape.

Sequence: new event without snapshot, update in same zone does not trigger notification

Describe the bug
When object enters allowed zone, Frigate might not yet have snapshot or clip, so notification is not generated: Event dropped - No snapshot or clip available
Later update event is received, already with snapshot or clip, but it is inside same zone: Event dropped - Already notified on this zone

Expected behavior
When snapshot or clip is available, even event comes from same zone, it should be notified. Problematic condition in code: here.

To Reproduce
Steps to reproduce the behavior:

  • Enter allowed zone, leave allowed zone without entering different zone or leave through zone not allowed for notifications.

Versions:

  • Frigate NVR: 0.14.0
  • Frigate-Notify: 3.4.0

Frigate-Notify Logs:

2024/08/15 17:00:55 +0200 INF New event received event_id=1723734055.172552-sw1glv
2024/08/15 17:00:55 +0200 INF Event Detected camera=Zahrada event_id=1723734055.172552-sw1glv label=person zones=
2024/08/15 17:00:55 +0200 INF Event dropped - Outside of zone. event_id=1723734055.172552-sw1glv zones=
2024/08/15 17:00:56 +0200 INF Event update received event_id=1723734055.172552-sw1glv
2024/08/15 17:00:56 +0200 INF Event Detected camera=Zahrada event_id=1723734055.172552-sw1glv label=person zones=zahrada
2024/08/15 17:00:56 +0200 INF Event dropped - No snapshot or clip available event_id=1723734055.172552-sw1glv
2024/08/15 17:00:56 +0200 INF Event update received event_id=1723734055.172552-sw1glv
2024/08/15 17:00:56 +0200 INF Event Detected camera=Zahrada event_id=1723734055.172552-sw1glv label=person zones=zahrada
2024/08/15 17:00:56 +0200 INF Event dropped - Already notified on this zone camera=Zahrada event_id=1723734055.172552-sw1glv label=person zones=zahrada
2024/08/15 17:01:02 +0200 INF Event update received event_id=1723734055.172552-sw1glv
2024/08/15 17:01:02 +0200 INF Event Detected camera=Zahrada event_id=1723734055.172552-sw1glv label=person zones=zahrada
2024/08/15 17:01:02 +0200 INF Event dropped - Already notified on this zone camera=Zahrada event_id=1723734055.172552-sw1glv label=person zones=zahrada
2024/08/15 17:01:03 +0200 INF Event update received event_id=1723734055.172552-sw1glv
2024/08/15 17:01:03 +0200 INF Event Detected camera=Zahrada event_id=1723734055.172552-sw1glv label=person zones=
2024/08/15 17:01:03 +0200 INF Event dropped - Outside of zone. event_id=1723734055.172552-sw1glv zones=
2024/08/15 17:01:03 +0200 INF Event update received event_id=1723734055.172552-sw1glv
2024/08/15 17:01:03 +0200 INF Event Detected camera=Zahrada event_id=1723734055.172552-sw1glv label=person zones=terasa
2024/08/15 17:01:03 +0200 INF Event dropped - Not on zone allow list. event_id=1723734055.172552-sw1glv zones=terasa
2024/08/15 17:01:08 +0200 INF Event update received event_id=1723734055.172552-sw1glv
2024/08/15 17:01:08 +0200 INF Event Detected camera=Zahrada event_id=1723734055.172552-sw1glv label=person zones=terasa
2024/08/15 17:01:08 +0200 INF Event dropped - Not on zone allow list. event_id=1723734055.172552-sw1glv zones=terasa
2024/08/15 17:01:14 +0200 INF Event update received event_id=1723734055.172552-sw1glv
2024/08/15 17:01:14 +0200 INF Event Detected camera=Zahrada event_id=1723734055.172552-sw1glv label=person zones=terasa
2024/08/15 17:01:14 +0200 INF Event dropped - Not on zone allow list. event_id=1723734055.172552-sw1glv zones=terasa
2024/08/15 17:01:20 +0200 INF Event update received event_id=1723734055.172552-sw1glv
2024/08/15 17:01:20 +0200 INF Event Detected camera=Zahrada event_id=1723734055.172552-sw1glv label=person zones=terasa
2024/08/15 17:01:20 +0200 INF Event dropped - Not on zone allow list. event_id=1723734055.172552-sw1glv zones=terasa

^^^ where Zahrada is allowed zone, Terasa is not listed in allowed zones.

Additional context
Seems it will be necessary to have some in-memory map of event IDs and booleans flagging that notification was already sent?

Improvement: More mature logging approach

Is your feature request related to a problem? Please describe.
With the current logging approach it's not so easy to distinguish happened things from the logs:

2024/06/10 13:08:42 DBG Debug logging enabled
2024/06/10 13:08:42 INF Frigate Notify - v0.3.0
2024/06/10 13:08:42 INF Starting...
2024/06/10 13:08:42 DBG Loading config file: ./config.yml
2024/06/10 13:08:42 INF Config file loaded.
2024/06/10 13:08:42 DBG Validating config file...
2024/06/10 13:08:42 DBG Checking connection to Frigate server...
2024/06/10 13:08:42 INF Successfully connected to http://frigate:5000
2024/06/10 13:08:42 DBG Frigate server is running version 0.13.2-6476f8a
2024/06/10 13:08:42 DBG MQTT Enabled.
2024/06/10 13:08:42 DBG Events without a snapshot: allow
2024/06/10 13:08:42 DBG Events outside a zone: allow
2024/06/10 13:08:42 DBG All zones included in alerts
2024/06/10 13:08:42 DBG No zones excluded
2024/06/10 13:08:42 DBG All labels included in alerts
2024/06/10 13:08:42 DBG No labels excluded
2024/06/10 13:08:42 DBG Telegram alerting enabled.
2024/06/10 13:08:42 DBG Ntfy alerting enabled.
2024/06/10 13:08:42 INF Config file validated!
2024/06/10 13:08:42 DBG Connecting to MQTT Server...
2024/06/10 13:08:42 INF App running. Press Ctrl-C to quit.
2024/06/10 13:08:42 INF Connected to MQTT.
2024/06/10 13:08:42 INF Subscribed to MQTT topic: frigate/events
2024/06/10 13:10:35 INF New event received event_id=1718025034.99825-2n4h7l
2024/06/10 13:10:35 INF Event Detected camera=camera-name event_id=1718025034.99825-2n4h7l label=person zones=
2024/06/10 13:10:35 DBG Event start time: 2024-06-10 13:10:34 +0000 UTC event_id=1718025034.99825-2n4h7l
2024/06/10 13:10:36 DBG Custom message template used event_id=1718025034.99825-2n4h7l provider=Telegram rendered_template="Detection at 2024-06-10 13:10:34 +0000 UTC\nCamera: <b>camera-name</b>\nLabel: person (70%)\n\n\nLinks: <a href=\"https://domain.tld/cameras/camera-name\">Camera</a>  | <a href=\"https://domain.tld/api/events/1718025034.99825-2n4h7l/clip.mp4\">Event Clip</a> \n\n"
2024/06/10 13:10:36 INF Alert sent event_id=1718025034.99825-2n4h7l provider=Ntfy
2024/06/10 13:10:37 INF Alert sent event_id=1718025034.99825-2n4h7l provider=Telegram

The user cannot easily understand:

  1. Which module produced the log entry.
  2. Where the important part is located because the entries are only partially colored (and I'm not sure the global logger must always use ConsoleWriter, btw):
    image
  3. Parsing by automated tools, since the entries do not have a uniform structure.
  4. What time is displayed, as no time zone and format is specified.

Describe the solution you'd like
More mature logging can be conceptualized as:

  1. A single overlay function that handles logging.
  2. Unified (form and text), enriched enough, log record format (see References section below).

References

  1. https://datatracker.ietf.org/doc/html/rfc5424#section-6
  2. https://betterstack.com/community/guides/logging/logging-best-practices/
  3. https://betterstack.com/community/guides/logging/log-formatting/

docker image for arm64

Hi Matt,

Just wondering if you are able to publish docker image for arm64 as well? I got an error saying no matching manifest for linux/arm64/v8 in the manifest list entries.

Thanks.

SMTP without TLS doesn't work

Hi Matt,

Thank you for developing such application! It fills a gap which allows you to avoid having to run a mqtt broker!

I'm trying to use the SMTP alerts but I think there is a problem.
My SMTP relay is in my LAN, and does not need to authenticate or the use of TLS/SSL to send emails.

So, when frigate-notify is about to sends the alert, it gives me this error even if I specified the TLS option in the Yaml:

2023/11/29 19:24:46 Checking for new events...
2023/11/29 19:24:46 Found 1 new events.
2023/11/29 19:24:46 Event ID 1701282275.839471-y31jy3 detected person in zone(s): []
2023/11/29 19:24:46 Event Start time:  2023-11-29 19:24:33 +0100 CET
2023/11/29 19:24:51 Failed to send SMTP message: dial failed: STARTTLS mode set to: "TLSMandatory", but target host does not support STARTTLS
2023/11/29 19:24:51 SMTP alert sent
2023/11/29 19:25:21 Checking for new events...

Here is the alert section of my config file:

alerts:  
  general:
    title: "Frigate_Alert"
    
  smtp:
    enabled: true
    server: 192.168.0.254
    port: 25
    tls: false
    user:
    password:
    recipient: [email protected],[email protected]

Do you have any idea where the problem could come from?

I saw the import of the variable in smtp.go#L17, but I'm not sure it is reused in the SendSMTP function.

Many thanks for your help!

minor documentation issue

Nice utility, thank you!

Describe the bug
In config.yml,

server: xxx.xxx.xxx.xxx:5000 does not work
it only works with
server: http://xxx.xxx.xxx.xxx:5000

Expected behavior
A clear and concise description of what you expected to happen.

either document this with an example, or accept the IP:port combination without the leading http:

Feature: Healthcheck for the application itself

The frigate-notify docker image is Scratch-based, which means any additional utils are missing (even shell and ps tools).

In this situation, to add the ability to perform healthcheck there is an approach like the traefik did. Compose notation:

servicename:
...
    healthcheck:
      test: traefik healthcheck --ping
...

Thus, probably, the following could also be enough:

./frigate-notify healthcheck

The list of possible unhealthy criteria:

  1. Configuration malformed: https://github.com/0x2142/frigate-notify/blob/main/config/config.go#L199-L214
  2. Frigate (over Web API): https://github.com/0x2142/frigate-notify/blob/main/config/config.go#L252-L281
    1. Endpoint is unreachable (monitor feature)
    2. Authentication has failed (Feature Request)
    3. HTTP response codes >= 400
  3. MQTT: https://github.com/0x2142/frigate-notify/blob/main/events/mqtt.go#L20-L51
    1. Endpoint is unreachable
    2. Authentication has failed
    3. Topic does not exist
  4. Notifier X is configured
    1. Endpoint is unreachable
    2. Authentication has failed

Bug: Double event processing for "unzoned: allow" and having zones defined in Frigate

Description

The system duplicates event processing for zoned and unzoned areas while the configuration has default unzoned: allow.
This bug is floating (heisenbug).

Scene

image

Notification

ZoneA is colored by pink.
Path for ObjectA is colored by green.
image

ZoneA is colored by pink.
Path for ObjectB is colored by blue.
image

Frigate-Notify Version:

v0.2.8

Configuration

frigate:
  server: http://<frigate-instance>:5000
  ignoressl: false

  mqtt:
    enabled: true
    server: <mqtt-instance>
    port: 1883
    clientid: <frigate-notify-clientid>
    username: <frigate-notifiy-username>
    password: <frigate-notifiy-password>

alerts:
  telegram:
    enabled: true
    chatid: <telegram-chatid>
    token: <telegram-token>

Logs

ObjectA path

2024/05/23 12:40:09 Event ID 1716457201.716703-zcul86 - New event received.
2024/05/23 12:40:09 Event ID 1716457201.716703-zcul86 - Camera <camera-name> detected person in zone(s): []
2024/05/23 12:40:09 Event ID 1716457201.716703-zcul86 - Start time: 2024-05-23 12:40:01 +0000 UTC
2024/05/23 12:40:10 Event ID 1716457201.716703-zcul86 - Telegram alert sent
2024/05/23 12:40:12 Event ID 1716457201.716703-zcul86 - Event updated from Frigate.
2024/05/23 12:40:12 Event ID 1716457201.716703-zcul86 - Camera <camera-name> detected person in zone(s): [<zoneA-name>]
2024/05/23 12:40:12 Event ID 1716457201.716703-zcul86 - Start time: 2024-05-23 12:40:01 +0000 UTC
2024/05/23 12:40:12 Event ID 1716457201.716703-zcul86 - Entered new zone: <zoneA-name>
2024/05/23 12:40:13 Event ID 1716457201.716703-zcul86 - Telegram alert sent

ObjectB path

2024/05/27 15:06:23 Event ID 1716811576.873335-lltf2e - New event received.
2024/05/27 15:06:23 Event ID 1716811576.873335-lltf2e - Camera <camera-name> detected person in zone(s): []
2024/05/27 15:06:23 Event ID 1716811576.873335-lltf2e - Start time: 2024-05-27 15:06:16 +0000 UTC
2024/05/27 15:06:24 Event ID 1716811576.873335-lltf2e - Telegram alert sent
2024/05/27 15:06:25 Event ID 1716811576.873335-lltf2e - Event updated from Frigate.
2024/05/27 15:06:25 Event ID 1716811576.873335-lltf2e - Camera <camera-name> detected person in zone(s): [zoneA-name]
2024/05/27 15:06:25 Event ID 1716811576.873335-lltf2e - Start time: 2024-05-27 15:06:16 +0000 UTC
2024/05/27 15:06:25 Event ID 1716811576.873335-lltf2e - Entered new zone: zoneA-name
2024/05/27 15:06:26 Event ID 1716811576.873335-lltf2e - Telegram alert sent

Expected behavior

The system processes a particular event only once and regardless of existing zones if configuration unzoned: allow is set.

ntfy button is local URL instead of public url

Hello,

Thank for the work !

I have find a "problem"

In ntfy notification this button is local URL

image

Is this normal behavior?

frigate:
  # Frigate host URL (ex. https://frigate.yourdomain.tld)
  # This is required for both collection methods
  server: http://192.168.1.254:5000
  # Set to true if using SSL & a self-signed certificate
  ignoressl: true
  # Public / internet-facing Frigate URL, if different from above server address
  public_url: https://nvr**********.test.fr

Regards

Adding bounding boxes to image previews in Pushover notification

Hi there!

First of all... thank you for everyone's hard work on this tool. I was dreading having to set up HA purely to enable for notifications for Frigate, so this was a godsend!

The question I have - I've successfully configured Pushover to receive notifications, everything is firing correctly, but I can't seem to adjust any parameters in the included message image snapshot (specifically I'm looking to include bounding boxes in the image).

I've tinkered with camera level MQTT settings as per frigate's documentation, but changes to any parameters there don't seem to take effect? Am I messing in the wrong place? I can't quite figure out where Pushover is grabbing screenshots from.

Again, I'm just looking to include a bounding box in the preview. If this is not available, so be it!

Thanks!

Add more filter criteria for alerting

First things first, thanks for this amazing hassle free implementation and that I can avoid a enormous Home Assistant / HACS / Plugins / Notification setup with 30 moving parts !

Is your feature request related to a problem? Please describe.
What I would like to have is more grained filter options when to alert. As you can see in my screenshot I'm filtering by label=person, as this is a crowded place I dont want to get any notifications on day time. I'm using frigate with a Coral TPU and want to benefit from the detector information.

Describe the solution you'd like

  • add more parameters to labels like probability >80%
  • add a time range to filter detection time and only notify after 10pm until 6am for example

Additional context
image

Feature: Allow "topic_prefix" to be defined for the MQTT broker

Intro:
First of all, thanks a ton for such a useful tool that helps not to invent some weird overengineered integrations just to get notifications from the Frigate.

The original Frigate implementation allows to override the MQTT topic prefix: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/configuration/reference.md?plain=1#L22-L24.

However, the code is currently fixed to the default topic name: https://github.com/0x2142/frigate-notify/blob/main/events/mqtt.go#L127.

Is it possible to relax this and allow the users to define their own topic_prefix through configuration, with the fallback to the "frigate"?

Thank you.

yaml: line 23: did not find expected key

Describe the bug
I followed the instructions for the config but no matter what I try I can't get it to load the config file with my ntfy server enabled. I kind of expect the problem to be me doing something boneheaded but I can't figure it out so I am posting here.

Expected behavior
yaml doesn't fail to load config on a did not find expected key error and the software starts up and runs

To Reproduce
start up frigate-notify with my config.yml

Versions:

  • Frigate NVR: 0.14.0-beta4
  • Frigate-Notify: docker latest v0.3.2

Frigate-Notify Config:

frigate:
  server: http://frigatestable:5000
  ignoressl: true

  startup_check:
    attempts: 5
    interval: 30
  webapi:
    enabled: true
    interval: 30
alerts:
  general:
    title: Frigate Alert
    timeformat: Mon, 02 Jan 2006 15:04:05 MST
    nosnap: allow
  zones:
    unzoned: drop
    allow:
      - frontdoorpeops
  ntfy:
    enabled: true
    server: https://ntfy.mahserver.com
    topic: frigateyyc
    ignoressl: false
    headers:
      - Authorization: Bearer tk_ihwgccyeaqpe086fzra0ymg9z7ffe
    template: {{ .Camera }} spotted {{ .Label }}

This works if I comment out ntfy: and everything below.

Frigate-Notify Logs:

2024/07/14 08:33:15 -0600 DBG main.go:48 > Debug logging enabled
2024/07/14 08:33:15 -0600 INF main.go:51 > Frigate Notify - v0.3.2
2024/07/14 08:33:15 -0600 INF main.go:52 > Starting...
2024/07/14 08:33:15 -0600 DBG config/config.go:186 > Attempting to load config file: /app/config/config.yml
2024/07/14 08:33:15 -0600 FTL config/config.go:201 > Failed to load config from file! error="yaml: line 20: did not find expected key"

Additional context
If I disable ntfy: and below it works. line 20 is ntfy: according to nano. I really do think I am just doing something wrong here but I've tried a whole bunch of stuff and I can't figure out what I am doing wrong so I am posting as a bug in case it is a bug with the ntfy code.
Screenshots
If applicable, add screenshots to help explain your problem.

Infrequent notifications

Hi there,

Mostly loving this utility so far, definitely like not having to use HA for the notifications.

Anyway - I hardly ever receive notifications when there's cars or people. Dogs seem to work pretty much all the time.

Is this related to the /review project on Frigate v14? Is there anything I can do in the meantime so I get all notifications?

Thanks.

Telegram support

Hello,
Would it be possible to add telegram to the list of notification methods please.

"unzoned: drop" never notifies

Describe the bug
After upgrade to v0.3.3, using unzoned: drop all notifications from Frigate are dropped and claimed as unzoned.

Expected behavior
Only unzoned events are dropped.

To Reproduce
Steps to reproduce the behavior:

  • set unzoned: drop in config.ylm

Versions:

  • Frigate NVR: 0.14.0
  • Frigate-Notify: 0.3.3

Frigate-Notify Config:

alerts:
  zones:
    unzoned: drop

Frigate-Notify Logs:

frigate-notify  | 2024/08/15 16:22:12 +0200 INF events/mqtt.go:67 > Event update received event_id=1723670881.760396-138hna
frigate-notify  | 2024/08/15 16:22:12 +0200 INF events/mqtt.go:85 > Event Detected camera=Vchod event_id=1723670881.760396-138hna label=car zones=garaz
frigate-notify  | 2024/08/15 16:22:12 +0200 DBG events/mqtt.go:88 > Event start time: 2024-08-14 23:28:01 +0200 CEST event_id=1723670881.760396-138hna
frigate-notify  | 2024/08/15 16:22:12 +0200 INF events/filters.go:76 > Event dropped - Outside of zone. event_id=1723670881.760396-138hna zones=

Additional context
When removing unzoned from config, everything is notified, even when zone is not defined in "zones: -> allow: ...".
Seems there is some issue in notification filtering logic.
In log there is visible, that filters.go is missing the zone, it is suddenly empty.
In v 0.3.2 there was not such issue.

Documentation of server address is incomplete

The documentation states that the frigate server property should get assigned the "IP or hostname of the Frigate NVR".

In reality this should be a URL.
In my case the value, which works and doesn't throw any warnings, is http://frigate-host:5000

Therefore the documentation should be extended.
Further, it may be a good idea to use frigate's default port 5000 in case no port number was provided in the URL.

using binary with same config as docker got error sending gotify notification

ubuntu lxc

using binary with same config as docker got error sending gotify notification
Aug 16 12:22:47 frigatenotify frigate-notify[393]: text/template.Must(...)
Aug 16 12:22:47 frigatenotify frigate-notify[393]: /opt/hostedtoolcache/go/1.22.4/x64/src/text/template/helper.>
Aug 16 12:22:47 frigatenotify frigate-notify[393]: github.com/0x2142/frigate-notify/notifier.renderMessage({_, _}, {{0x>
Aug 16 12:22:47 frigatenotify frigate-notify[393]: /home/runner/work/frigate-notify/frigate-notify/notifier/ale>
Aug 16 12:22:47 frigatenotify frigate-notify[393]: github.com/0x2142/frigate-notify/notifier.SendGotifyPush({{0x858300,>
Aug 16 12:22:47 frigatenotify frigate-notify[393]: /home/runner/work/frigate-notify/frigate-notify/notifier/got>
Aug 16 12:22:47 frigatenotify frigate-notify[393]: created by github.com/0x2142/frigate-notify/notifier.SendAlert in go>
Aug 16 12:22:47 frigatenotify frigate-notify[393]: /home/runner/work/frigate-notify/frigate-notify/notifier/ale>
Aug 16 12:22:47 frigatenotify systemd[1]: frigate-notify.service: Main process exited, code=exited, status=2/INVALIDARG>
Aug 16 12:22:47 frigatenotify systemd[1]: frigate-notify.service: Failed with result 'exit-code'.

a part from installing binary file do we need to install any other requirement?

Anyone else seeing erroneous event notifications?

I have two of my cameras configured to send notifications via Gotify, and they are working, but this morning I have gotten about 12 notifications that say a Person was detected on one of the cameras. When I click the Camera link in the notification, I see all the events for that camera, but there are not any events saved for today. The most recent event was yesterday evening and was a car.

So I'm not sure why these erroneous event notifications are being generated when there is actually no event in Frigate.

Add Documentation on Debugging, how to bypass Zone already Alerted and configure its timeout

First, let me say thank you for creating this. While I am a HA user, I don't want frigate integrated to HA for reasons. This is something that was sorely missing from frigate and I'm really happy that you created and shared this.

 Please add documentation on how to debug this.
Is there a log file that can be accessed somewhere?

as a newb, I setup everything (config below), and when I got home expected to get notified that a person was detected. I got nothing. I used docker compose attach to see the log files, but the only thing I can see is:

2024/05/16 01:56:15 Event ID 1715824522.190759-8cy0nu - Camera LivingRoom detected person in zone(s): []
2024/05/16 01:56:15 Event ID 1715824522.190759-8cy0nu - Start time: 2024-05-16 01:55:22 +0000 UTC
2024/05/16 01:56:15 Event ID 1715824522.190759-8cy0nu - Zone already alerted, skipping...

Figuring I set things up wrong, I changed the config file. Noticed there was a new release, pulled and started the container
Once again, I get a screen filled with Zone already alerted, skipping....

I don't see any configuration to change the duration of an alerted zone. How long does it take to reset? How can I change it to be shorter? How can I reset the zone so I can hopefully see what's wrong and why the alerts didn't go out?

frigate:
  server: nope:5000
  ignoressl: true

  webapi:
    enabled: false
    interval: 30

  mqtt:
    enabled: true
    server: nope
    username: nope
    password: nope

  alerts:
    general:
      timeformat: Mon, 02 Jan 2006 15:04:05 PST
    labels:
      allow:
        - person
    zones:
      unzoned: allow

    pushover:
      enabled: true
      token: nope
      userkey: nope

    smtp:
      enabled: true
      server: mail.nope.net
      port: 587
      tls: true
      user: [email protected]
      password: nope
      recipient: [email protected]

Feature: Use a template to generate the message

To give users more flexibility, frigate-notify could allow them to specify the format of message using templating engines like Jinja2 or Go Templates.

There is an assumption, the user would like to define the individual template for each notifier type.
Since the frigate-notify uses YAML based single configuration file, the template could be built-in as a dedicated top-level configuration section. For example:

frigate:
...
alerts:
...
monitor:
...
template: # or message_template
  telegram: |
    {{ if .event }}
    Detection at {{ .event.StartTime }}
    Camera: {{ .event.Camera }}
    Label: {{ .event.Label }} {{ event.TopScore }}

    {{ if ge (len .event.Zones) 1 }}
    Zone(s): {{ .event.Zones }}
    {{ end }}

    Links: [Camera]({{ .config.ServerUri }}/cameras/{{ .event.Camera }})
    {{- if .event.HasClip }}
    | [Event Clip]({{ .config.ServerUri }}/api/events/{{ .event.ID }}/clip.mp4)
    {{ end }}
    {{ end }}
...

As usual, if no template is specified, a default template will take effect for a particular notifier.

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.