Open ThePhiMuc opened 3 weeks ago
Without digging deeper, I think you are seeing this issue - https://github.com/homebridge/bonjour/issues/12
This is very disappointing.
I have just been struggling with the exact same issue today - except that I cannot go back to Bonjour. Am stuck on Avahi for network stability elsewhere.
Hope this can work with Avahi as well in future.
Does the homebridge UI / accessories tab work for you? It uses a slight different package for discovery.
The accessories tab works better 95% of the time. Only get misalignment when I’m testing / rebooting / trying to get Node_Red to work. But “eventually” that always does come back to fully OK. Note I have 2 instances each on their own RPi.
I was thinking about migrating Homebridge-automation to the same package to manage discovery, but as you shared that doesn't resolve it.
Am thinking the only solution is to fix the issue I shared above
Further behaviour: just now I opened up node-red for a quick check.
I didn't dig deep here but yesterday there have been two homebridge instances running in my network (the one on the old Pi, one at the new one - no child-bridges are used). That's not a large amount and they have not been on the same machine. But (which might cause trouble) they have been using the same homekit pin (I imported a Homebridge backup to the new machine). After I migrated everything to the new machine I stopped the old homebrindge installation and rebootet the new Pi. I've switched back to AVAHI a few moments ago and now the plugin is working fine, even AVAHI is selected. This lets me assume that you're right and it might be that network-package-problem which can not occour here anymore 'cause there's only one Homebridge instance now...
What I'm wondering about: I definitely stopped the homebridge service on the old Pi but the plugin wasn't able to find the nwe instance using AVAHI yesterday. My first thought was "they are using the same Pin, maybe the plugin doesn't know where to get the devices from". So I stopped the old instance which didn't help (even after restarting Nodered). Afterwards I changed to Bonjour and opened this feature-request. But maybe that has been a caching problem or something like that.
So from my point of view I'm fine - but I think using more than one instance is a common usecase and it might be a good idea to find a fix for that ;)
So HDeKnop might be more helpful here for further investigation ;-)
Have been playing around with different permutations to try and somehow find a consistent behaviour that would indicate for you where the issue is. (details on that below)
So far all I can say is:
Like I said: yesterday I thought everything was resolved. This afternoon I open up Node-Red and only connection errors on all devices. Drop-down menu empty. Just as I write this sentence I checked and see that it is working again ... connections established and drop-down populated with all 62 devices.
As context on how I'm setup:
I have 3 separate RPis each with its own homebridge instance. 1x homebridge OS, 1x homebridge on Bookworm with desktop, 1x homebridge on Bookworm on RPI 5 Each instance runs a different set of plugins. (overkill - this is running my house even as I'm expanding with new plugins etc ... so need to limit impact of failures). I've been alternately trying node-red on (any one) of these Pi's or my Macbook. Always same behaviour. (and as we speak its still working ...)
Really would love to get this stable enough that I can move my automations out of Homekit and into your plugin ;-)
I don't know enough to find what is causing this - but am happy to be a testcase or follow your instructions if you can tell me what to look for.
FYI - Will be looking at this in the short term, and will migrate to the same homebridge instance discovery as the UI. Then can tackle the issue with the common module between the two.
Current Situation
I was moving my NodeRed installation to a new Raspi. The new one is running Homebridge, too. On the new one, Homebridge devices could not be found by your plugin, the dropdown was empty.
After digging around a while I found that the Homebridge installation at the old Raspi was set to "Bonjour HAP" as mDNS Advertiser, the one et the new Raspi was set to AVAHI (which seems to be the standard at new installations now).
Everything was working fine again, as soon I set "Bonjour HAP" as advertiser at the new Homebridge installation. So for me it seems that your plugin is successfully communicating with Homebridge if Bonjour HAP is used, but not if Homebridge is set to AVAHI.
I don't know what the benefits of the different advertisers are - but it would be great, if your plugin would suport AVAHI, too.
CU, Philipp
Proposed Change
Add the possibility to use AVAHI as mDNS Advertiser
Additional Context
No response