[Nearing Release] Sonos Advanced Controller

And THANK YOU for building this!! The native app is lacking so I also have a bunch of automations that tie into SONOS HTTP running no an rPI to get some of the grouping and join commands working for my needs.

It should be fine. The only thing I can think is that there's probably a limit to the number of "subscriptions" a speaker will allow at once. But since I haven't seen an issue of this, and every "app" does their own subscriptions anyway, I doubt one more will hurt. It should have the same impact on the built-in Sonos app that, say, opening the Sonos app on your phone would cause.

There might be an issue with the built-in one caused by the fact that both use the "magic" 39501 port for routing the "NOTIFY" messages to the app, but I ran both for a while without any trouble.

I've been running just my Sonos Advanced for a while now exclusively. I don't think there's anything the built-in one does that mine doesn't at this point, and quite a lot mine does that it doesn't, obviously.

2 Likes

I think I found a bug. When using the load favorite:

No mater what I select (repeat all, repeat once, none), I'm always getting 'repeat once' which just cycles the first song of the favorite/playlist I chose.

1 Like

Indeed. Looks like I had those still hard-coded from when I originally only had a "load favorite". should be fixed now.

1 Like

Latest version adds an (optional) child device for battery status:


Configurable update interval (since it's polling only, I don't see where battery is exposed as an event, I'll make it event driven if I can find an event I can subscribe to for it).

There's no logic preventing someone from adding a battery status child device to a "One" or a ""SYMFONISK Bookshelf" or any other non-battery-containing speaker. At which point they'll just end up with a blank device that needlessly polls the speaker for non-existent data. I'll have to put in a check to prevent that, but for now at least there's battery stats for anyone who wants it on their Roam, Move, etc.

3 Likes

This is great, really appreciate it. As far as users creating a child battery status device, IMHO you could poll the Sonos device one time to see that the XML battery status data elements are available, as the non battery Sonos devices do not return any XML data…

You are on fire for new features!

Wow, well done. You really are a coding machine!

1 Like

Thank you, can confirm it did.

THANK YOU for this great app, after using the Play text and restore and hearing the music dim down, the word spoken and the music back to the previous state is something I have been hoping for for years now!

Amazing!

1 Like

@daniel.winks - hitting a bug on my first try of using groups.
I created a group that has 3 speakers, initially saw an error in the log but then all of the command now work correctly.

Yay! Amazing!

When I created another "all" group that has 4, ungroup works, but I get the following errors for both the Group Command and the Join Players to Coordinator commands, and nothing changes in my speakers/sonos app unlike the smaller group of 3 that works great:

Only difference is an additional speaker added, specifically a Sonos Amp that controls my outdoor speakers.

I wonder if there's something different with the Amp (which I don't have to test with). At this rate I'm going to end up with a full house of every Sonos product.

I'll DM you here to get some more detailed info for troubleshooting.

2 Likes

This sounds amazing and what I have wanted for years. Can't wait to set it up tomorrow and have a play!

1 Like

I would be surprised if you can group series 1 (amp) and series 2 together.

Hi Daniel,

Thanks for your continued hard work on this - I've just gone ahead and moved from the Sonos Cloud Controller to the Sonos Advanced Controller version published on HPM (which also doesn't need the API key anymore).

One thing I've found so far is that my URL that would have previously played a local MP3 on my HE hub now isn't being parsed and errors, below is the WebCoRE piston and then the associated log from HE:


Do you have any idea what might be causing the error please?

Best wishes,
Guy

I missed a few spots when I swapped things over to local control. It uses a new parent app function, and that function now needs a reference to the child device, where it didn't before.

Got that all fixed up, tested it with my doorbell.mp3, and it's working. New version on HPM.

3 Likes

You are incredible :pray: :pray:

2 Likes

@daniel.winks how do i install the latest? installed the bundle but never done a install that way before.

I've got everything packaged up on HPM. Just waiting for @csteele to approve my GitHub pull request to have my repo added officially. In the meanwhile you can click on "Package Manager Settings" and then "Add a Custom Repository", and add mine is as a custom repo using this link:

https://raw.githubusercontent.com/DanielWinks/Hubitat-Public/main/repository.json

Then it's just normal HPM stuff to install/update it.

whats it called? cant find it once i added the custom repository.

edit think i found it, had to search for tags

1 Like

Done

I'll repeat it here... HPM's Fast Search is tied to a DB running on another system. (HubitatCommunity.com) Rather similar to Fuzzy Search that runs on Dominic's Azure instance. They are independent and have no knowledge of each other but I do know that the Fast Search DB is updated beginning on minutes: :00, :20 and :40 and take about 2 mins to scan the entire Master Manifest tree down into each PackageManifest.

3 Likes

Alright, new version on HPM, and it shouldn't need a custom repository anymore either. Yay.

New version adds balance control for stereo pairs. And balance "current state" display. I recently set up a stereo pair in my office and found that I needed the balance set to "+10R" as I'm much closer to the left speaker when sitting at my desk. So I added in some balance controls so I can automate the balance being set to 10 when I sit down at my desk, and back to 0 when I get up.

The control on the device, for anyone wanting to use it, is -20 to +20, with 0 being centered, -20 being "all the way left" and 20 being all the way right.

I'll probably break out a few different player device drivers for devices of various capabilities in the future, but for now there's just one device driver for all. As such, if you have speakers that aren't a stereo pair, it will still have a command for setting balance. There's some checks in place to prevent it sending any commands to non-stereo pair speakers.

I also changed the virtual player onboarding process a bit. If you change IP address of a speaker, you can click through the discovery screen again, keeping the same speaker(s) selected, and it'll rebuild the device "Data" section with the updated IP address information.

You really want to be using DHCP reservations to keep your speakers on a consistent IP, but if for some reason you need to change it, just clicking through the virtual player discovery screens should get the devices all updated.

Keep any bugs you run into reported, and I'll get them fixed ASAP. Any feature requests are welcome too, but I can't make any promises on if or when they might be implemented. There's a fair bit of limitations on what can be accomplished, between what Hubitat can do and what Sonos allows. Stuff like grouping old S1 speakers with S2 won't ever happen, as Sonos themselves have said it's not possible, for instance. And I don't even have an S1 speaker, so I honestly don't know how much of this app even works with one.

2 Likes