A scene including Sonos now includes a ‘Play a Favourite’ control (that uses a number)
In the new Advanced GUI the attribute presets enumerates the favourites -
Right now four favourites shown in the Sonos app from top to bottom seem to be enumerated 3 2 1 0, in the Sonos device they are selected by name but listed in ascending number
Yup, all my Sonos converted today. And it’s a bit shaky right now. Track/album art is not updating reliably. And forward/back not always enabling when it should. I probably need a hub reboot (aka pull the plug these days).
There is more discussion of the Sonos Driver’s development through beta and capabilities in this post.
As you noted, the “Play a Favorite” requires a favoriteId, not a favorite name (it is hoped this capability will be added in a future release). You will find, however, that as you create, delete, edit, and replace favorites the Id’s will change and won’t be consecutive. Most of my favoriteIds are three digits now (Sonos allows up to 72 or 73 favorites, as I recall).
Also, in the device settings for each player there is a valuable new “Load Favorites Queuing Action,” which determines how a playlist favorite will affect any existing queue. This setting can be different for each player, but cannot be modified inside a Routine or Rule. This setting has no affect on station favorites.
I was seeing the audio stopping after a second and starting again when testing a Sonos scene with a favourite but I think it happens if the Media Playback control is enabled (as was needed to start playing before the Sonos edge driver) and the Play a Favourite control is enabled at the same time -logically the Media Playback Play control is no longer needed with Play a Favourite
Reboot seems to have resolved the issues I mentioned above. However, setVolume from SharpTools (so via the SmartThings API) is no longer working. The SharpTools logs and CLI logcat do not show any issues.
EDIT: Actually no Sonos commands from SharpTools are working for me.
All is working on my system. But before taking this further, perhaps this Sonos discussion should be split off to its own thread or moved to the thread I previously posted? @nayelyz
Fair enough. Just to add a little more while we are here … I noticed when I rebooted the ST hub it took a long time to declare all the Sonos devices (I have 15) online. I did get one volume change to work in the SmartThings app, but just the once.
We have around the same number of devices. I haven’t counted lately for fear my wife would find out.
I would be tempted to reboot all my Sonos devices, but I know that’s a PITA because we no longer have access to the reboot command. Also, I admit I’m spitballing here because despite having worked through any number of issues with the driver while it was in beta, I’ve never seen what you’re describing.
Are you seeing anything in the CLI logs when you try to issue the commands?
It looks like the commands are making it. Here’s a set volume to zero followed by a pause. The actual device did not respond.
2023-07-12T22:00:13.956297687+00:00 TRACE Sonos Received event with handler capability
2023-07-12T22:00:13.987814354+00:00 INFO Sonos <Device: 02121f9a-649c-4101-acb9-0d16f2e04fca (Kitchen)> received command: {"command":"setGroupVolume","args":{"groupVolume":0},"positional_args":[0],"capability":"mediaGroup","component":"main"}
2023-07-12T22:00:13.991569979+00:00 TRACE Sonos Found CapabilityCommandDispatcher handler in Sonos
2023-07-12T22:00:13.992137562+00:00 DEBUG Sonos Kitchen all connections running? table: 0x16826d8
2023-07-12T22:00:13.993164895+00:00 WARN Sonos No sonos connection for handling capability command
2023-07-12T22:00:14.002725437+00:00 DEBUG Sonos Kitchen device thread event handled
2023-07-12T22:00:22.781312024+00:00 TRACE Sonos Received event with handler capability
2023-07-12T22:00:22.791853316+00:00 DEBUG Sonos Kitchen device thread event handled
2023-07-12T22:00:22.792484816+00:00 WARN Sonos No sonos connection for handling capability command
2023-07-12T22:00:22.794482649+00:00 DEBUG Sonos Kitchen all connections running? table: 0x18d1a08
2023-07-12T22:00:22.796141399+00:00 TRACE Sonos Found CapabilityCommandDispatcher handler in Sonos
2023-07-12T22:00:22.797468899+00:00 INFO Sonos <Device: 02121f9a-649c-4101-acb9-0d16f2e04fca (Kitchen)> received command: {"command":"pause","args":{},"positional_args":{},"capability":"mediaPlayback","component":"main"}
The WARN Sonos No sonos connection for handling capability command seems iffy. So perhaps I do need to reboot the Sonos devices to get the connections all reestablished.
I rebooted an ungrouped Sonos device and started a new track from the Sonos app. It’s playing fine. The track is not updating in the ST app and I still cannot get any commands to work from ST. I have not rebooted the ST hub again since rebooting the Sonos device. I’m out of time right now but will come back to it later.
All controls are working for me with SmartThings and SharpTools. What’s not working is Track and Album Art with stations. It works with Albums and Playlists but if you then go to a Sonos Radio Station, it does play that station, but the Track and Album Art do not change from whatever was there last.
I have not had the opportunity yet. If you, can thank you.
Both correct.
They did.
It is all commands. I don’t think it’s an API issue though. I think the problems are right in SmartThings as the same issues exist in the SmartThings app.
Please do note the logcat data above for one of my tests.