Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Gotify notification component #941

Merged
merged 7 commits into from
Mar 20, 2025

Conversation

InterN0te
Copy link
Contributor

@InterN0te InterN0te commented Mar 18, 2025

Add Gotify notification component

This PR adds a new Gotify notification component to Viseron that allows sending notifications to a Gotify server when recordings start.

Features

  • Send notifications to a Gotify server when recordings are triggered
  • Configure notification priority (1-10)
  • Filter notifications by object type (e.g., person, car, cat)
  • Support for camera-specific configuration overrides
  • Option to include thumbnail images of detected objects in notifications

Configuration

The component can be configured in the Viseron configuration file:

gotify:
  gotify_url: "https://gotify.example.com"  # URL to your Gotify server
  gotify_token: "YOUR_APPLICATION_TOKEN"     # Application token from Gotify
  priority: 5                               # Priority of the notifications (1-10)
  detection_label: "person,cat"             # Labels of objects to send notifications for
  send_thumbnail: false                     # Send a thumbnail of the detected object
  cameras:
    camera1:                              # Camera identifier with empty config
    camera2:                              # Another camera identifier
      detection_label: "car"              # Override detection label for this camera
      send_thumbnail: true                # Override thumbnail setting for this camera

Implementation Details

  • Listens for the EVENT_RECORDER_START event to send notifications only when recordings are triggered
  • Supports filtering by object labels to reduce notification spam
  • Handles image resizing and encoding for thumbnail delivery
  • Runs in a separate thread to avoid blocking the main application
  • Properly handles errors and provides fallback to text-only notifications if image processing fails

Warning

I had to edit scripts/gen_docs/main.py to remove "description": null from the config.json generation to be able to commit (cf. fix convert to dictionary)

Note

This PR was in #938 but I started from a clean branch to understand the commit error so, here we go again

Copy link

netlify bot commented Mar 18, 2025

Deploy Preview for viseron ready!

Name Link
🔨 Latest commit ad2b670
🔍 Latest deploy log https://app.netlify.com/sites/viseron/deploys/67dc0eb24194130008435a02
😎 Deploy Preview https://deploy-preview-941--viseron.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@roflcoopter
Copy link
Owner

Thanks for the updates, good work.

Same question here as on your other PR, is it ready to be merged or is there anything else you would like to add?

@InterN0te
Copy link
Contributor Author

Nope, it's ready to go for me

Thanks for your job, nice project

@InterN0te
Copy link
Contributor Author

Or perhaps one last change, but you're telling me: shouldn't the Discord, Gotify, or Telegram components be included in a new filter in the documentation?
What about a Notification category ?

@InterN0te
Copy link
Contributor Author

Created #947 to add Notification category. If you merge it first, I will update #941 and #944 to set them under new Notification label

@roflcoopter
Copy link
Owner

Good idea, #947 is merged!

@roflcoopter roflcoopter merged commit 127ac0a into roflcoopter:dev Mar 20, 2025
18 of 20 checks passed
@roflcoopter
Copy link
Owner

Great, thanks again!

@InterN0te InterN0te deleted the gotify-component branch March 20, 2025 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants