I don’t have an answer but what’s in your log? I got a lot of Sonos related errors lately. Maybe something broke in the integration
Nothing Sonos-related in the logs. Where should I look?
which version are you using? I have 2021.5.1 and everything works fine
As I put in the OP - 2021.5.2.
ah sorry. I missed it.
i can see a change in the 2021.5.2
- Fix Sonos polling bug (@jjlawren - #50265) (sonos docs)
so not sure if this might broke it
Enabled debug for the sonos integration and find this, no errors.
Could perhaps make sense to anyone reading? Seems like there is some activity on github around sonos integration so keeping fingers crossed.
192.168.16.135 is my Associated Product and the rest are players. All on Sonos S2 and using SonosNet through a Boost.
2021-05-11 11:06:59 DEBUG (Sonos-Discovery) [homeassistant.components.sonos] Reached _discovered_player, soco=<SoCo object at ip 192.168.16.135>
2021-05-11 11:06:59 DEBUG (MainThread) [homeassistant.components.sonos.speaker] Async seen: <SoCo object at ip 192.168.16.135>, was_available: True
2021-05-11 11:06:59 DEBUG (Sonos-Discovery) [homeassistant.components.sonos] Reached _discovered_player, soco=<SoCo object at ip 192.168.16.130>
2021-05-11 11:06:59 DEBUG (MainThread) [homeassistant.components.sonos.speaker] Async seen: <SoCo object at ip 192.168.16.130>, was_available: True
2021-05-11 11:07:00 DEBUG (Sonos-Discovery) [homeassistant.components.sonos] Reached _discovered_player, soco=<SoCo object at ip 192.168.16.133>
2021-05-11 11:07:00 DEBUG (MainThread) [homeassistant.components.sonos.speaker] Async seen: <SoCo object at ip 192.168.16.133>, was_available: True
2021-05-11 11:07:00 DEBUG (Sonos-Discovery) [homeassistant.components.sonos] Reached _discovered_player, soco=<SoCo object at ip 192.168.16.134>
2021-05-11 11:07:00 DEBUG (MainThread) [homeassistant.components.sonos.speaker] Async seen: <SoCo object at ip 192.168.16.134>, was_available: True
2021-05-11 11:07:00 DEBUG (Sonos-Discovery) [homeassistant.components.sonos] Reached _discovered_player, soco=<SoCo object at ip 192.168.16.132>
2021-05-11 11:07:00 DEBUG (MainThread) [homeassistant.components.sonos.speaker] Async seen: <SoCo object at ip 192.168.16.132>, was_available: True
2021-05-11 11:07:00 DEBUG (Sonos-Discovery) [homeassistant.components.sonos] Reached _discovered_player, soco=<SoCo object at ip 192.168.16.131>
2021-05-11 11:07:00 DEBUG (MainThread) [homeassistant.components.sonos.speaker] Async seen: <SoCo object at ip 192.168.16.131>, was_available: True
Some fairly significant changes were made to Sonos in 2021.5.0, and a few fixes were added in 2021.5.2.
If I understand correctly, you can see favorites as before, but selecting one to play using HA has no effect? If you start using the Sonos app does everything work as expected?
The log messages above are all normal.
If I understand correctly, you can see favorites as before, but selecting one to play using HA has no effect? If you start using the Sonos app does everything work as expected?
Correct.
From Sonos app (macOS, iPad, iPhone) all works fine.
Checking further - I see I can start and stop playback from HA. HA also picks up what is playing.
What I cannot do is select a new source to play (i.e. from my Favorites, for example the P1 radio station).
Hmm, I can reproduce in 2021.5.2, but not in the development branch I’ve been running daily. Let me see what’s different in this service.
It appears that the internal favorites list is somehow populated twice, which means it doesn’t know what to do when it gets redundant matches. Not sure why yet, but at least the cause is known.
Attempting a fix here: Hotfix for Sonos favorites race condition by jjlawren · Pull Request #50495 · home-assistant/core · GitHub.
Quick testing with 2021.5.3 reveals that it is working! Well done!
Just tested my alarm with 2021.5.3 and that works again too! Great job, thanks for the quick fix.
2021.5.3 introduced this bug for my Symfonisk, the favorites list being doubled and unable to play any of them through the cards or media_player.select_source
service.
I rolled back to 2021.5.2 which had fixed the cards not being updated with the current state.
THEN I checked my Sonos software for an update and there was one (It feels like I updated it like a week ago). With the latest Sonos update (13.1 build 63288230) 2021.5.2 would not play favorites, but upgrading to 2021.5.3 got it all working again.
I have a suspicion that the favorites doubling issue has a small chance of still happening in 2021.5.3 even after the fix. I couldn’t reproduce the problem in my own setup but perhaps it’s still possible to occur under some race condition. If it does happen again, please try restarting HA and see if that resolves it.
On a side note, the current state of the integration in dev
(which will be in 2021.6) is quite different and somewhat simpler/cleaner. It got a bit messy adding the new sensors for 2021.5 as the integration wasn’t originally built to handle multiple platforms. It’s feeling much better now after a rework in dev
and I’m running side-by-side to monitor for any other possible issues.
Anyway, sorry for the rough ride. I’m trying my best to improve the integration and appreciate the feedback and patience.
Hmmm… Just got Sonos 13.1 installed overnight and now the issue is back on some players even with HA 2021.5.3. Noticeable our Arc (with two One as surround speakers) and an old Play:3 have problems to start playing from HA.
Any logs that would indicate a problem? I would assume restarting HA would bring them back.
I see how this is still possible. Will work on one more hotfix and then I have a plan to rewrite how favorites and handled in 2021.6. It’s very inefficient now.
(Another) Fix for 2021.5 submitted:
Rewrite for 2021.6 in progress:
I’ve been having this same issue with being unable to select a source (on 2021.5.3). Found this thread and am happy to see that it already has some attention on it. @jjlawren - Just want to give a big thank you for being so on top of this. It’s a great feeling when you have a problem and you find that there are already capable, motivated people handling it.