lukasroegner / homebridge-sonos-multiroom

Plugin for real Sonos multiroom experience in homebridge.
MIT License
35 stars 3 forks source link

After latest update, Multiroom continually finds zero devices, making the cached devices in HomeKit inoperable #18

Closed rfiorentino1 closed 2 years ago

rfiorentino1 commented 2 years ago

I started seeing this problem immediately after updating to 0.6.0, and referenced it a little here but wanted to make a dedicated issue for it. Luckily, the accessories related to multi room are restored in HomeKit, preserving all their automation, which I'm extremely grateful for. However, it seems like randomly, Multiroom will not find any devices for long periods of time and then suddenly find them again. This results in the devices that show up within the home app doing nothing when toggled on and off, because they're not actually linked to Sonos zones. I've restarted homebridge at least five times within the last hour to try to discover devices again, and no luck. But by tomorrow morning, I almost guarantee you it will find them again. Everything has been working perfectly for about two weeks or so, but I needed to restart homebridge tonight for a different plug-in and it started again. Not sure if I'm doing something wrong, or if something else is going on behind the scenes but wanted to let you know. I've played with discovery time out as well, and even setting it to like 30 seconds for the heck of it doesn't change the result.

Also, when the plug-in finds devices normally, Homebridge also restarts normally. When the plug-in is having this problem, the homebridge UI just says starting, for at least a minute, before finally changing to running. Every time the ladder has happened, Multiroom fails to find devices as well.

lukasroegner commented 2 years ago

Have you switched back to 0.5.0 and checked whether your issues are gone? I've done some testing by installing 0.5.0, then 0.6.0, then back to 0.5.0. I haven't recognized any change. The only change that I made from 0.5.0 to 0.6.0 was to preserve accessories if they are not found during discovery.

Have you updated the software version of your Sonos system by chance?

rfiorentino1 commented 2 years ago

Yes, normally I'd do some testing with previous versions, but I've been afraid to do that because I don't want to lose the device association's in HomeKit. If I go back to 0.5.0, multi-room will either create all new devices, deleting automation, or wipe everything out completely if it doesn't discover them. Before the update, there was one zone, master bathroom, that kept continually going completely missing, or showing up as a new device when restarting Homebridge.

This morning, I restarted Homebridge, and as I thought, everything is suddenly working normally again. So strange

I did update my Sonos system a few weeks ago, before the 6.0 update, and all Sonos is up to date now. Do you think that had something to do with it?

I'm going to completely restart all of Sonos, and see if that makes a difference in the coming days.

lukasroegner commented 2 years ago

I did update my Sonos system a few weeks ago, before the 6.0 update, and all Sonos is up to date now. Do you think that had something to do with it?

I don't think so, it was just a guess for why discovery got worse in your system.

rfiorentino1 commented 2 years ago

Restarting all of my Sonos products made no difference, this is still happening. My Homebridge instance is running on a Mac server. Interestingly, if I shut down the server and/or stop Homebridge completely for 30 seconds or so, and then restart, multi-room finds devices just fine. But restarting from the UI either works normally, or displays that "starting" message for like 45 seconds, and finds no devices.

lukasroegner commented 2 years ago

if I shut down the server and/or stop Homebridge completely for 30 seconds or so, and then restart, multi-room finds devices just fine

That would mean it's not an issue with your network, but rather with the software-side. Depending on the method you are using for running Homebridge, maybe if you "restart from the UI", there is not enough time to shut down all plugins gracefully. Thus, the new Homebridge process starts too early and (maybe) some ports are still in use.

There is nothing I can think of at this point, so that I'm closing the issue for now. If you have further insights on how I could help you, feel free to reopen the issue.

rfiorentino1 commented 2 years ago

Yes, that may be something worth looking into, I'll see if I can make the UI wait a few more seconds before restarting Homebridge. But this plugin is the only one that has this type of issue upon restart, and it seems to be fairly recently that this started happening. Maybe an update to Node changed something, etc? just trying to think out of the box because nothing has changed network/machine wise on my end since I've been running Homebridge. Not trying to point fingers at all, just trying to think out loud of possible causes.