tphakala / birdnet-go

Realtime BirdNET soundscape analyzer
Other
137 stars 14 forks source link

HomeAssistant Add-on #119

Open tphakala opened 2 months ago

tphakala commented 2 months ago

There is demand for HomeAssistant Add-on

Tasks to achieve this:

alexbelgium commented 2 months ago

Hi, you don't need to do anything actually - the creator of the addon will just create his own Dockerfile based on yours. Given you're already using /data and /config folders it will be super fast to create one, complexity will be only to add the ingress feature. I'll try a quick & dirty one to but I think another dev was interested in developing a more elaborated one

matthew73210 commented 2 months ago

Hi, you don't need to do anything actually - the creator of the addon will just create his own Dockerfile based on yours. Given you're already using /data and /config folders it will be super fast to create one, complexity will be only to add the ingress feature. I'll try a quick & dirty one to but I think another dev was interested in developing a more elaborated one

I was looking for you haha, used loads of your wrapped addons. Was going to ping you a message. I hadn't got round to doing it but your method always seems to work. Cheers ;)

isZumpo commented 2 months ago

@alexbelgium looks great! Nice work!

Only one question, how is versioning usually done with these addons? I see that it is currently grabbing the latest release of the birdnet-go docker image. Is this done on some sort of cadence? Would like to avoid a scenario where lots of homeassistant users are on-boarded using this addon, then start complaining about things that were fixed x weeks back, just not integrated to the addon yet.

Birdnet-go is currently lacking any type of version tagging, and the :latest tag might even be unstable. That is probably something we have to work on within the project soon, making it more stable for these types of integrations :)

alexbelgium commented 2 months ago

Hi, indeed my addon will be based on whatever image is tagged as "latest" when its image was built. I have an automated script that checks every saturday if a new release was issued on github (using https://github.com/dvershinin/lastversion) then builds a new version of the addon. That of course only works if there is a version tagging. Otherwise updates can be done manually but as I have many addons and not enough time I very rarely do it ;-)

alexbelgium commented 2 months ago

Hi, you don't need to do anything actually - the creator of the addon will just create his own Dockerfile based on yours. Given you're already using /data and /config folders it will be super fast to create one, complexity will be only to add the ingress feature. I'll try a quick & dirty one to but I think another dev was interested in developing a more elaborated one

I was looking for you haha, used loads of your wrapped addons. Was going to ping you a message. I hadn't got round to doing it but your method always seems to work. Cheers ;)

Hehe, you are welcome to be owner of the addon and to store it on your repo or to contribute to mine! I knew you were interested to do this addon and didn't want to cut in front of you, but I was using my BirdNet app this morning in the garden and wanted so much to implement it on my rpi that I just went and build the addon :-)

ps : addon is currently not working I'm in the process of adding a few dependencies and try to figure out automatic mapping of HA microphone to ALSA_CARD but it should work soon

alexbelgium commented 2 months ago

Hi, latest version is still in dev but at least is starting :-) I just need to add a mic to my rpi

To configure the app you need to install the Filebrowser addon from my repo, and go to /addon_configs/db21ed7f_birdnet-go/config.yaml

alexbelgium commented 2 months ago

it works :-) I've connected a standard microphone, not changed any option, played a sound from my phone, and the bird was detected.

alexbelgium commented 2 months ago

I'm trying to enable ingress do you have a way to pass a subpath?

Currently I'm nginx's sub_filter option and it nearly works (version testingress3). The only failure is when saving the options, the url fetch is http://192.168.178.23:8123/settings?update=success instead of the normal one used for ingress (http://192.168.178.23:8123/api/hassio_ingress/fcnEz5vXPQ4TCoohEVewDHkA2z30dWm-iVLJP8CGSK4/settings)

alexbelgium commented 2 months ago

it works even with rtsp streams it is great ! to do that, just encode realtime --rtsp rtspurl in the COMMAND option in the addon option :-)

Your app is really great thanks !

image
matthew73210 commented 2 months ago

Hi, you don't need to do anything actually - the creator of the addon will just create his own Dockerfile based on yours. Given you're already using /data and /config folders it will be super fast to create one, complexity will be only to add the ingress feature. I'll try a quick & dirty one to but I think another dev was interested in developing a more elaborated one

I was looking for you haha, used loads of your wrapped addons. Was going to ping you a message. I hadn't got round to doing it but your method always seems to work. Cheers ;)

Hehe, you are welcome to be owner of the addon and to store it on your repo or to contribute to mine! I knew you were interested to do this addon and didn't want to cut in front of you, but I was using my BirdNet app this morning in the garden and wanted so much to implement it on my rpi that I just went and build the addon :-)

ps : addon is currently not working I'm in the process of adding a few dependencies and try to figure out automatic mapping of HA microphone to ALSA_CARD but it should work soon

Unfornatly I can't be consistent with my contributions so probs best to only have one official add-on repo. And they way you do them is very easy to use and consistant.

geiseri commented 2 months ago

Not going to lie, this is awesome. I installed the home-assistant add-on last night and in 10 seconds had it hooked up to my frigate addon's rtsp service. I wonder if it would be possible to have it consume the hls stream from the home assistant camera. Out of the box though this is really slick!

COUBOT commented 2 months ago

Do I have to set something up so that the statistics page can show something? Or is it not yet working for the addon

alexbelgium commented 2 months ago

I think it is under dev by tphakala ; I guess there is tons of work needed to port Birdnet-pi webui to go (I've also set in my repo an addon based on birdnet-pi but it is much more resources intensive)

isZumpo commented 1 month ago

Hi, indeed my addon will be based on whatever image is tagged as "latest" when its image was built. I have an automated script that checks every saturday if a new release was issued on github (using https://github.com/dvershinin/lastversion) then builds a new version of the addon. That of course only works if there is a version tagging. Otherwise updates can be done manually but as I have many addons and not enough time I very rarely do it ;-)

Sorry for being a bit late to respond :)

That all sounds great! Will see if I can maybe get some automatic tagging going for this project such that it gets easier to track it for external users of it

tphakala commented 1 month ago

There is version tagging in place already

isZumpo commented 1 month ago

There is version tagging in place already

Excellent! Will see if I can get the versioning working with the docker images in the workflows. I suppose it would be nice for the :latest tag to always point at the most recent "real" release in this case 0.5.2. In addition, docker images should be tagged once a release is made since there is no :0.5.2 right now.

Currently every commit to the master branch is made into a image and tagged with the git hash. It might make more sense to always point :dev or something similar towards these rather than :latest which should be used for more stable releases.

isZumpo commented 1 month ago

There is version tagging in place already

Excellent! Will see if I can get the versioning working with the docker images in the workflows. I suppose it would be nice for the :latest tag to always point at the most recent "real" release in this case 0.5.2. In addition, docker images should be tagged once a release is made since there is no :0.5.2 right now.

Currently every commit to the master branch is made into a image and tagged with the git hash. It might make more sense to always point :dev or something similar towards these rather than :latest which should be used for more stable releases.

Managed to get this feature in last week in this PR. Now we will just have to wait for a new official release of birdnet-go, maybe @tphakala can create one soon? Then the equivalent docker image tag will be generated.

It can also be noted that :latest will now always point at the latest official release. If you want the latest and greatest from the main branch before a release is made, then the :dev tag can be used.