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

Suggestion: easily open up endless integration options while reducing code and complexity #162

Open
JayGuerette opened this issue May 13, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@JayGuerette
Copy link

Instead of adding/maintaining new databases, notification options, API integrations, & species configurations, just add a hooks that are called every time there is a realtime detection.

Define in the config the name of the executable including argument templates like these examples:

In addition to arguments expose the complete note record as environment variables:
BIRDNET_DATE
BIRDNET_TIME
BIRDNET_COMMON_NAME
BIRDNET_CONFIDENCE
etc.

Based on this, users could use shell scripts instead for more complex integrations:

#! /bin/bash
count=$(valkey-cli --raw -u redis://myserver:6379/0 HINCRBY birdnet ${BIRDNET_COMMON_NAME// /_} 1)
[[ $count -eq 1 ]] && notify-send -a BirdNet 'Previously undetected bird' "$BIRDNET_COMMON_NAME"

Any allowed/configured executable must by placed in or symlinked from a preconfigured directory. Then you expose it to your container: docker run -v $HOME/hooks:/hooks ghcr.io/tphakala/birdnet-go:latest

In the examples above we have Postgresql, notifications, redis/valkey, and custom REST API support with no additional code base dependencies or complexity.

The currently built-in birdweather integration could be extracted from the code base and put into a stand-alone executable that is called as a hook.

@tphakala
Copy link
Owner

Yeah it is quite easy to do, and I don't see any reason why not to implement this. Hoever I would not like to exclud any direct integrations out either as while this allows any integration you ever need, it requires quite complex setups from end user.

@tphakala tphakala added the enhancement New feature or request label May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants