Grouping Sonos speakers

I already have it setup this way, trying to simplify and reduce external dependencies. If node.js can group why can't groovy? Thanks for the suggestion but not what I was looking for.

Because the driver for the Sonos devices currently doesn't support it. It is simply not programmed. I am not saying that it is not possible to change the driver. I was trying to give you a solution with the currently available features.

You can make a feature request in the "Feature Request" category here:
https://community.hubitat.com/c/support/Requests

We are currently in the "Lounge" area and I know that the team doesn't monitor that part of the forum that closely.

Trying to expand on things a bit. I've come up with some logic but I need some help expanding it. I'd like to come up with something that resumes the SONOS after an alert has played on another TTS device. The resume ONLY happens if there was something playing before the alert. It's based on the theory that there is one speaker controlling a group.

The constraints are (for now) that the group never changes and that the alerts are being played on something else (e.g. Alexa or Google Home devices).
The variable is that the group may be or not playing something.

So far I've got something like:
Trigger : Whatever it is
Action: Condition for alert = true
(nested if) - IF (controlling media player) is playing THEN
Send GET to http://IP address:5005/pauseall
END IF
Speak alert to something else
(how do I know there was something playing on the Sonos that I paused?)
Send GET to http://IP address:5005/resumeall
END

I'm having a brain lock on testing for the active node of the SONOS playing something and then sending the GET to resume after the alert.

Take it Hubitat will not be doing this. Too bad. I have an iOS app (SonoSequencr) that allows me to group selected speakers at the touch of a button on my apple watch. Fast and convenient. Would love the ability to do this over http tho (via RM). I have a docker app running sonos api. Not as convenient.

Technically, you can do it via RM using the Sonos API by sending a HTTP GET request to http://[your_sonos_api_IP]:[your_sonos_api_port]/[device_1]/join/[group_1].

Repeat it for each device you want to join to the group.

You can also do it by setting up a preset in the presets directory. Then you could call that preset with http://[your_sonos_api_IP]:[your_sonos_api_port]/preset/preset_name.

1 Like

In response to my earlier post about incurring brain lock, it turns out that things will pause and resume if you send the message on the controlling Sonos for that group.

1 Like

Question on the node.js app. Will it update each speaker with the current track info? Or just the first speaker in the group? Latest release of Sharptools will display the album art for the associated speaker. Works great if the speaker is ungrouped or the lead speaker in the group. If its not, it displays the last track info which looks really funky to listen to Pink Floyd but see Barbara Streisand displayed!!

1 Like

I am not sure. You will have to just test it out. You can do a "status" command in your browser that will tell you what the speakers doing. Maybe that will help.

As for creating something that resembles grouping: I've settled on using the Set Track feature, pointing the player to another one that's already playing what I want in the group, using it from Rule Machine. Note that this does not use node-sonos-http-api.

In my case,

Living Room Sonos: Set Track: x-rincon:RINCON_78XXXXXXXXXX01400

The RINCON_78XXXXXXXXXX01400 number is device UDN. You can get this by inserting the MAC address of the source device (i.e., the device whose audio you want to take over) into RINCON_<MAC-ADDRESS>01400.

2 Likes

Are you finding that this still works? There was an update about 3-4 weeks ago that broke this for me.

Edit: I use playtrackandRestore (not TTS)

I read all of the comments posted herein. The addition of "grouping" to the Sonos Integration app is a legitimate request that deserves attention from Hubitat.

While there are alternatives, no other approach to home sound rises to the level of adoption that Sonos has achieved. Hubitat: please keep your loyal customers apprised of your progress.

Kind regards.

2 Likes

Agree so much. Can hubitat clone the node.js commands across the board?

Any update on Group and Join native Hubitat support? Clearly Sonos is exposing this API otherwise the node.js version would not be able to make this update.

Is that the device you want to join to and play their music, or the reverse -> Have a device not playing anything join the current device playing?

It's the device you want to join and play their music. In my case, I start playing the stream on Kitchen Sonos (RINCON_78XXXXXXXXXX01400), and have my Living Room Sonos join that group and also play that stream.

1 Like

Awesome, thank you.
Have you seen a way to 'remove' that same device from the group without stopping the music on the original device?

I haven't tried that. I imagine you could just set the track to some other stream, or perhaps there's a way to null it. Please let us know if you figure it out!

Although there are some issues that I'm still working through, I have found a way to group Sonos Speakers from within RM.

I've achieved this by using my Harmony Hub (HH) and defining activities that select a subset of Sonos speakers. Running one of these activities removes the selected speakers from any other group they may have been included within and creates a new group. I then use the HH drivers: [Release] Logitech Harmony Hub Driver v0.1.20210725. It is then possible to switch these activities on within RM and the grouping is created.

The Use Case I was trying to achieve was to extend my TV from my Lounge to the Kitchen if the kitchen motion sensor is activated during the evening. To do this I have a rule that creates a Sonos group containing my Arc in the lounge and my Beam in the kitchen. The only issue I've not fixed is that the newly created Sonos group loses the TV input and, although the two speakers are grouped, no audio is heard anywhere! :star_struck: I'm going to create a new post to get help with this little issue! :slight_smile: