mmcc-xx/WhosAtMyFeeder

Wrap this as a home assistant addon?

Opened this issue · 33 comments

Hello,

Great work on the project. It feels like this might see more widespread use and be easier to install for beginners if we wrapped it as a Home Assistant Addon.

You can see some examples at my (or many others) Home Assistant Addons repository: https://github.com/bertybuttface/addons

I'm happy to assist with this.

Cheers

Awesome - thanks. I'll take a look and try to understand what is involved. I think I'd like to combine the other app I'm working on, which detects birds by sound, into one bird detection system and make an overall addon.

Actually maybe it would make sense to add-on ify this before trying something grander. What do you think it would look like? Would do you think it would expose to the HA environment?

So the Home Assistant Addon would just run this web app as normal. The interface would be the same as it is right now but it would appear as a tab in Home Assistant using ingress. The goal would be to simplify installation and usage.

The next thing we could do is consider a Home Assistant Integration which would actually pull the data from this app into Home Assistant to use in a useful way. It may be however that this is not useful so we don't build the integration at all.

I'm not sure exactly how it works but I think with Frigate you can extend detections with extra data. That might be nice if it is not done already.

So if it is installed as an addon, can it still run in a container or does the code need to be executed in the OS directly?

I'm not sure exactly how it works but I think with Frigate you can extend detections with extra data. That might be nice if it is not done already.

I didn't know that was possible. I'll look into this. If you have link handy for someplace this is discussed that would be helpful.

Right now, I'm just monitoring the "snapshots" MQTT publications but I was thinking of switching to monitoring events instead so the detections could be associated with a specific event, and probably just store photo with the best score for a given event.

Still runs in a container, I'll have a go at knocking up an example.

https://github.com/bertybuttface/addons/tree/main/whosatmyfeeder

Not tested yet but that is the general gist of it.

So part of the reason I'm pretty ignorant of HA addons is that I run HA via Docker and as such don't have the full addon UI available. When I've installed addons it is via copying a directory into my HA custom components directory, like this one for the Frigate add on: https://github.com/blakeblackshear/frigate-hass-integration/tree/master/custom_components

Do you know how I'd go about installing the add on you made?

Ah yeah I think you are conflating two concepts:

Integrations (which are either in built components or custom components)

and

Addons (which are separate Docker containers that don't even need to directly interact with Home Assistant)

The link above (build is broken, I'll take a look later) probably isn't that useful to you if you already run under Docker.

I'll take a look at getting these bird species detections into Frigate using Sub Detections but that is probably best handled under a separate issue.

We can also take a look at a Home Assistant integration (and a lovelace card to display the data) but I'm not fully sure how that would look right now.

Ah yeah I think you are conflating two concepts:

Ohhhh...... I thought they were the same thing :)

If you want to build the addon, I'm happy to pull it in (or reference your repo if you'd prefer). But since I'm not really set up to test it or document it, I'll have to ask you to do so.

Absolutely no problem, happy to maintain the HA Add on, I'll put in a pull request with a link once it's working, cheers.

@bertybuttface is the hass addon functional? I added your repo and installed it but it crashes on startup without a config.

Not yet I'll push what I have so far.

@hermy65 happy to report this now works (or at least it gets as far as displaying the web UI, I've not seen any detections yet)

rw377 commented

happy to report this now works (or at least it gets as far as displaying the web UI, I've not seen any detections yet)

Probably a dumb question, but what is the proper repo URL to add the HASS addon? I'm getting errors in Home Assistant when trying to add it from your addon list using https://github.com/bertybuttface/addons/tree/main/whosatmyfeeder (or https://github.com/mmcc-xx/WhosAtMyFeeder/)

That's the correct link. What processor architecture are you using? (e.g. i386, arm64 etc)

What is the error message you are getting?

rw377 commented

Oh sorry you need to add the whole Addon Repo if that's what you mean:

https://my.home-assistant.io/redirect/supervisor_add_addon_repository/?repository_url=https%3A%2F%2Fgithub.com%2Fbertybuttface%2Faddons

Ahh duh okay, that worked, thank you!

Great! Let me know if you get any trouble with it. I can see roughly 30 to 50 people are using the package but I've not had any bug reports. I suspect there are at least some rough edges so I'd very much appreciate hearing about any you run into so they can be fixed.

rw377 commented

Great! Let me know if you get any trouble with it.

Since you mention it, I did notice something today. I can add this as a separate issue on your repo if you want rather than continue this thread. But the TL;DR is that if I click in to a bird in 'Detection Summary', I get a list of birds but the thumbnail is broken and if I click the broken thumbnail, the video doesn't work. The thumbnails and videos work fine on the main page under "Recent Detections" though. I did try an incognito browser to ensure it wasn't a cache thing too.

Main page / recent detections working:
image

Clicking into detection, the thumbnails/videos are broken:
image

I really appreciate you making the HASS addon! And of course I really appreciate mmcc-xx's work on the addon as a whole too, it's all such a cool project.

Edit: Side question - would it ever be possible to have HASS know the species found from Who'sAtMyFeeder or would that require a separate HASS integration?

Will take a look at that this week, thanks for the bug report. That is related to the relative / absolute URL issue, at the moment my temporary fix is a massive hack, will put something better in place.

It is indeed a very cool project, I hope the home assistant addon makes it easier to install for more people.

@bertybuttface thank you for developing this addon, would have loved to use it to get an easy access to WhosatMyFeeder.. Too bad it's deprecated. Would you be willing to explain roughly what would be necessary to fix the addon integration, so maybe I (or someone else) can take over?

Please see my response here:

#42

I pushed version 1.1.0 give it a go and see if it solves your problems.

@rw377 @tamueller

I pushed version 1.1.0 give it a go and see if it solves your problems.

@rw377 @tamueller

Thanks for the update. I am getting an error when trying to update via the addon. Is there a different way this should be done?
image

Apologies the build system hadn't been updated in a while so it couldn't build 1.0.0

I have pushed out 1.1.1 which has built correctly and has some extra fixes.

Should all be working now. Might need to refresh (top right corner)

Apologies the build system hadn't been updated in a while so it couldn't build 1.0.0

I have pushed out 1.1.1 which has built correctly and has some extra fixes.

Should all be working now. Might need to refresh (top right corner)

The update works and the broken thumbnail issue is now fixed also. Thanks for adding this!

No worries sorry it took me so long to get round to it. Thanks for your time helping get this fixed.

@bertybuttface awesome, thank you for updating this - I just installed it and worked out of the box.

@bertybuttface What are your thoughts on adding this feature listed in #45 into the HA addon? It is one line of code that sends an MQQT topic for the species being identified. Is this something you could do or would this have to be pulled into this repo?

@rw377 Sure, I maintain a fork of this project here: https://github.com/bertybuttface/WhosAtMyFeeder

That is what the Home Assistant Addon pulls in. If you make a pull request there with the changes you want (please make sure they are tested, I do not have time to do any testing right now) and I'll take a look.

So thankful that this addon exists for those of us who are overwhelmed by starting this whole journey. Unfortunately while I was able to get the addon into my HA, it won't connect to Frigate. My log looks like this

Calling Main
Time: 2024-08-21 18:00:17.529
Python version
3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110]
Version info.
sys.version_info(major=3, minor=9, micro=2, releaselevel='final', serial=0)
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
Starting MQTT (flask disabled, use gunicorn)
Starting MQTT client. Connecting to: 192.168.7.126
MQTT Connected

So it connects to MQTT I think but then just stops there. I've been looking but I'm at a loss of what to do now. Would be grateful for any help anyone can provide on this!

So thankful that this addon exists for those of us who are overwhelmed by starting this whole journey. Unfortunately while I was able to get the addon into my HA, it won't connect to Frigate. My log looks like this

Calling Main Time: 2024-08-21 18:00:17.529 Python version 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110] Version info. sys.version_info(major=3, minor=9, micro=2, releaselevel='final', serial=0) INFO: Created TensorFlow Lite XNNPACK delegate for CPU. Starting MQTT (flask disabled, use gunicorn) Starting MQTT client. Connecting to: 192.168.7.126 MQTT Connected

So it connects to MQTT I think but then just stops there. I've been looking but I'm at a loss of what to do now. Would be grateful for any help anyone can provide on this!

Until you get a bird in the garden it shouldn't do anything else so this may be correct.

To be honest though this is all now fairly well unmaintained, both the original package and my wrapper.

Frigate have been doing a lot of work lately to change how plugins work (via ZeroMQ now so much more performant), also AI models have improved in the multiple years since this was published.

Once the dust settles at Frigate I will rewrite this and try to get some community involvement for longevity.

Good luck and thanks for your kind message, look forward to hearing more from you.

So thankful that this addon exists for those of us who are overwhelmed by starting this whole journey. Unfortunately while I was able to get the addon into my HA, it won't connect to Frigate. My log looks like this
Calling Main Time: 2024-08-21 18:00:17.529 Python version 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110] Version info. sys.version_info(major=3, minor=9, micro=2, releaselevel='final', serial=0) INFO: Created TensorFlow Lite XNNPACK delegate for CPU. Starting MQTT (flask disabled, use gunicorn) Starting MQTT client. Connecting to: 192.168.7.126 MQTT Connected
So it connects to MQTT I think but then just stops there. I've been looking but I'm at a loss of what to do now. Would be grateful for any help anyone can provide on this!

Until you get a bird in the garden it shouldn't do anything else so this may be correct.

To be honest though this is all now fairly well unmaintained, both the original package and my wrapper.

Frigate have been doing a lot of work lately to change how plugins work (via ZeroMQ now so much more performant), also AI models have improved in the multiple years since this was published.

Once the dust settles at Frigate I will rewrite this and try to get some community involvement for longevity.

Good luck and thanks for your kind message, look forward to hearing more from you.

Really appreciate the work you've done but understand if it's too much to maintain. There's been quite a few birds that have come that have been detected by frigate but weren't picked up by the add on so I think there's some type of disconnect....oh well. I'll keep a lookout if you work on this more, really love the concept!