Sonos Buttons?

What if the button definitions were up at the system device level as well, then you could choose a zone along with the button number to play it on that zone. That way you don't have to define them on every button device.

Actually, what do you need the Sonos device IPs for for each sonos speaker? Looking at the code it looks like it's for album art URIs but if you get /zones there's absoluteAlbumArtUri properties for currentTrack and nextTrack under both the coordinator and the members of each zone.


I am having trouble with the buttons. I added the device and input the node's IP and MAC addresses. But I got nothing return if I hit the "Refresh" button. I went to the Log, and it does show that it interact with the Node server.

What did I do wrong? Refresh doesn't show anything.

Did you do the step to addChildSpeaker? That is where you will see the actual functionality for join/leave, album art (if available), and others. There is a readme with installation and usage instructions in the link that I shared here: Control Sonos Music in 2020? - #26 by tomw

Yes. I did add the child speaker. From the parent device log in HE, I could see it’s retrieving info from http API node. Please see below:

dev:30402022-09-19 02:16:56.319 pm = [[uuid:RINCON_7828CAB4C56E01400, coordinator:[uuid:RINCON_7828CAB4C56E01400, state:[currentTrack:[artist:Richard Clayderman, title:How Deep Is Your Love, album:Ballade Pour Adeline: Richard Clayderman's Best Songs of Love, albumArtURI:/getaa?s=1&u=x-sonos-http%3alibrary%252ftracks%252f349cf8d4-9173-4678-9667-745a6f5f279e%252f.mp3%3fsid%3d201%26flags%3d0%26sn%3d6, duration:227, uri:x-sonos-http:library%2ftracks%2f349cf8d4-9173-4678-9667-745a6f5f279e%2f.mp3?sid=201&flags=0&sn=6, radioShowMetaData:, absoluteAlbumArtURI:http://10.1.1.xx:1400/getaa?s=1&u=x-sonos-http%3Alibrary%252ftracks%252f349cf8d4-9173-4678-9667-745a6f5f279e%252f.mp3%3Fsid%3D201%26flags%3D0%26sn%3D6, streamInfo:, type:track], nextTrack:[uri:x-sonos-

So, it looks like it’s getting info. But child speaker does not get any log. And, I hit Refresh button in parent and child, nothing is showing in device page. Anything else I did wrong?

I installed the driver from HPM, should I copy the code straight from GitHub?

No, installing from HPM should work fine.

Will you PM me that full log output as well as a screenshot of the settings on your child device page(s)? Something may be broken in my logic that traverses the response to try to find the album art.

If you open that absoluteAlbumArtURI in a web browser from a machine on your local network, does it display correctly? What actually shows up on the device page in Hubitat? Feel free to PM me responses to these so we can iterate and debug to figure it out.

I posted v1.1.1 to GitHub and HPM with a fix for this issue.

Thanks for helping me track it down, @roger89.

1 Like

I have 2 HE hubs. Can I have more than 1 webhook statements in the settings.json file? If yes what will the webhook statements look like?

Is it this one?

"webhook" : "http://hub1 IP:39501" ,
"webhook" : "http://hub2 IP:39501"

Or this one:

"webhook" : "http://hub1 IP:39501"
"webhook" : "http://hub2 IP:39501"

You're over on the node-sonos-http-api side now, so I can't speak authoritatively about how it is implemented. But I looked at his code and I think it will only support one webhook host. If either of your examples worked, it would be the first one. Or maybe like this:

[{"webhook": "[http://hub1](http://hub1/) IP:39501"}, {"webhook": "[http://hub2](http://hub2/) IP:39501"}]

But I think you're going to have better luck replicating that attribute sideband somehow from the first (webhook receiving) hub to the second. Like a rule in the first hub that is triggered by that attribute changing and which sends the new value to the second hub using Maker API or similar.