[Nearing Release] Sonos Advanced Controller

It should work without needing to delete things. I changed how favorites worked a lot since I found a way to access them and get notified of any changes made too. So now it works with a child device on on of the speakers. You only need to enable it on a single device. I put it on my Arc, since it's hard-wired and has a stronger CPU than some of my other speakers, but the extra load is really minimal so it doesn't particularly matter. So just pick a speaker and enable the favorites child device on it.

That child device is where it lists the favorites so you know which number to use, and it stores them as permanent states, so you won't need to click on "get favorites" each time you want to see them. And if you add/delete a favorite, it updates automatically now.

1 Like

Pandora favorite stations will play when using Load Favorite Full but none of my Amazon Music favorite stations will play. They will load and you can see album art and other track info. They just will not automatically play. You can select play and they will play. Not sure what is going on.

Question about this In concept. It’s always seemed to me when people talk about this, the use-case is that there is music or some long-running audio playing and then a TTS announcement collides with it. Which makes sense.

I have a similar but different use-case. What happens if TTS1 is still uttering when TTS2 is invoked. Does TTS2 get put in queue? Does TTS2 interrupt TTS1? What happens if TTS1 is a lot longer than TTS2? You get the idea.

I’ve never found a good way to resolve this. Thankfully it’s an edge case — doesn’t happen that often so I’ve mostly. Ignored it. Curious if others have a solution?

Sonos Advanced actually already handles this. It will queue up the second TTS until the first finishes.

1 Like

From a standpoint of the code in Sonos Advanced, those are all just "Sonos Favorites". My code doesn't really have any idea what service they're coming from. There's some options for "Load Favorite" regarding whether it clears/replaces the queue or appends, whether it auto-plays or not, and if you're telling it "replace queue, auto-play" and it's not... then that's either an issue on Amazon's side or Sonos'.

First time SAC user here. My use-case for now is limited to issuing and queuing TTS. I created the device and have tried a few different speak commands (playText, playHighPriorityTTS, etc.) from the device details screen and keep getting the same basic error in the logs, per below (and no TTS coming out of the speakers). Any idea what this could mean or how I can troubleshoot?

2024-04-07 12:37:26.962 PMerrorgroovy.lang.MissingMethodException: No signature of method: java.lang.String.call() is applicable for argument types: (com.hubitat.app.DeviceWrapper, java.math.BigDecimal) values: [Sonos Advanced - Christina Whole House, 40] Possible solutions: wait(), chars(), any(), trim(), size(), split() on line 3129 (method playHighPriorityTTS)

For context, I only have one Sonos device which is connected to a whole house audio matrix device (Monoprice 6) which distributes to speakers around the house. I therefore have not created a group device, which I'm assuming is optional.

@daniel.winks, pinging you again on the above message. Any ideas on how I can troubleshoot?

@daniel.winks I removed this app a few weeks ago since it wasn't playing well with my setup, Unifi & S1's. Made the Network changes to Unifi and installed it a couple of day ago and it seems to working, not getting the album covers from local music or Pandora but that not a huge deal. Thanks for putting this together. Much appreciated!

1 Like

I tried searching this thread, but I might have missed something.

How do you get rule 5.1 to group and ungroup my Sonos speakers?

I can’t seem yo find it anywhere within the rule 5.1 app???

There are a few ways to do it, none super pre-packaged or elegant (that I'm aware of).

I just use RM5. I create a virtual speaker device as the group device. And then I wrote rules that uses a change in that device as the trigger. The actions apply the event (e.g., increase in volume, change in input source, mute/unmute, etc.) to each of the individual devices. Below is one such rule -- this one manages volume for the group.

Also - if memory serves, @Cobra has written a device driver that did some of this. But he'd have to comment as I'm not sure I've got that right.

So if you created the sonos grouping with this integration, you can do something like this and pick the command you want:


e.g. I pick the joinPlayersToCoordinator for my scenario since it's usually me adding my outdoos speaker.

Here's what my full rule would look like with this integration. Very easy and straightforward;

1 Like

Just added my sonos roam and unfortunately it does seem to work with this integration. I tried tts and play, neither of which work. Sonos roam is connected to same wifi are my other working sonos device and is mains powered and always on

This is a great tool for Sonos, much better than the one that comes with Hubitat. I used it for a couple weeks and it worked well. Unfortunately I moved everything to another Hubitat and now I get a weird error each time I try to add the Sonos speaker to the new system. The System Sonos Integration does not have this issue (but doesn't have the ability of doing TTS and then going back to playing music.) I have tried 0.7.3 and 0.7.0 on two hubitats and still get the same error. It looks like a DNS error, but I have confirmed that I am using the default DNS (8.8.8.8, 8.8.4.4, etc.) The first speaker appears in devices, but trying to do anything with it results in Error 500. Running the latest platform on C-7 & C-5.

Here is the log when trying to create the Sonos speakers:
[dev:187] 2024-04-27 16:37:57.475 [warn] null: Name or service not known

[dev:187] 2024-04-27 16:37:37.910 [error] java.lang.IllegalArgumentException: Must provide host, eventSubURL, timeout, and dni on line 4029 (method subscribeToEvents)

[dev:187] 2024-04-27 16:37:35.821 [error] java.net.UnknownHostException: null: Name or service not known on line 940 (method secondaryConfiguration)

[dev:187] 2024-04-27 16:37:31.033 [warn] null

[dev:187] 2024-04-27 16:37:23.658 [warn] null: Name or service not known

I’ve installed this app with the hope of forcing my TTS messages to “queue up” single threaded, i.e., to prevent message interruption. But I can’t get past installing the app. See explanation and error log eight messages up in this thread.

If Daniel is no longer active (or maybe just busy), does anyone else know? Even things I can try or places to look? Please forgive me if I’m coming off overly insistent or aggressive. I’m deeply appreciative of the open sharing that goes on in these parts. I’m just really stuck on this. And the wife gets annoyed when Jarvis talks over Jarvis. TIA.

Why don't you start again? Remove the device etc and app and update then ensure the Sonos is reserved in your router.

Then create it again and test it all from the device page. Take screenshots of any errors and post.

@BorrisTheCat, thanks I did what you suggested and noticed an error in the log (see below) when installing the app. The app did report finding my Sonos, but the error makes it seem as if it didn’t. The corresponding device errors are the same as reported above. Does the provide any insight as to the nature of my problem. @daniel.winks, any ideas?

Summary

Do you have the driver's installed?

I assumed so since I used HSM. And I did just doublecheck and see 6 drivers that were installed.

Thanks for asking.

Another idea (just shooting in the dark): I have a Sonos Connect. @daniel.winks, is it possible SAC doesn't support Connect? I'm not a Sonos expert by any stretch, but I get the impression that Connect is an older model.

@ThunderboltsRock's comment above about the Roam made me wonder the same.

Connect is an S1 model, I believe only S2 compatible models are supported