Newbie for Sonos Grouping

Hi Everyone,
New to Sharptools, but in the short time that I’ve started building my dashboards, google searches and these forums have been a huge help in teaching me everything I need to know to get what I want set up. The one thing that I cannot seem to figure out is sonos grouping/ungrouping from SharpTools. Based on what I’ve read in hours of google searching, it doesn’t seem like this is something that has been figured out yet.
I saw a this post https://github.com/jishi/node-sonos-http-api. which talked about a workaround for grouping and ungrouping speakers but not sure if these commands would work on SharpTools rules. Could anyone confirm?

If so, next step would be to teach myself how to set up the node.js on my Synology NAS to run.

2 Likes

You could use a Virtual HTTP Switch to make a call to the node-sonos-http-api project you linked above.

We’ve also been considering a native / direct integration with Sonos. Can you help me better understand what you would expect to see in a Sonos integration? What specific tiles and interactions would you expect?

Device-Centric Approach of SmartThings

One of the limitations with the SmartThings device model is everything must be a ‘device’ with a unique and persistent identifier.

As you may be aware, Sonos groups are much more ephemeral in nature - you can create them, remove them, regroup them, etc all on demand. So there’s not really a concept of ‘groups’ for the current Sonos integration with SmartThings other than being able to send some basic commands to the group that a device is associated with.

eg. For a specific speaker, you could send a muteGroup() command which would mute the group if the particular player/speaker was part of a group.

IFTTT takes a similar device-centric approach to their Sonos integration as SmartThings.

 


 

:warning: The content that follows includes brainstorming / conceptual design concepts.

Mixing Approaches

Device Centric

As we consider a direct integration with Sonos, we can see the potential for both approaches being valuable. Being able to have individual speakers available as tiles on a dashboard similar to the current device-centric integrations is certainly helpful. And perhaps grouping quick-actions for group commands for the device could be added to the Other Actions dialog:

Groups

Similarly, we’ve been thinking about a slightly different type of tile that would show the various music groups available within a home. This would enable you to setup a single tile and position it on your dashboard like a normal tile and it would show a scrollable view of the groups that are available (if any).

That way depending on your preferred approach to managing multi device or multi group music playback, you could choose which option worked best for you.

1 Like

Thanks Josh!
Maybe I misunderstood how this script works.

Definitely would need to research more on using the virtual HTTP switch you mentioned to utilize that script

I have used both Samsung Multiroom and now moved to Sonos. The biggest challenge that has me avoiding a full embrace is the grouping feature (or lack there of).

Both of the approaches Josh presents are acceptable ways for me. I would probably implement both ways on my dashboard. At times I want to be able to have music in one room and other times I want grouped everywhere.

1 Like

ok so after much trial and error, I was able to get the GitHub node.js application running and the commands work! However, when i link the http commands in sharptools, it is opening a window saying “success” for the command. Is there a way to block this window from opening and just staying on the Sharptool Dashboard?

Thanks for the update! Have you tried the Virtual HTTP Switch device handler linked above?

The Virtual HTTP Switch enables you to create a device in SmartThings which can call HTTP endpoints on your network which sounds like it would work perfectly for your use-case. You can then authorize these to SharpTools and use them like normal Thing tiles.

Other thoughts (tap to expand)

Based on the comment about a window opening, I assume you are currently using a Hyperlink tile within SharpTools. If the Node.js server had a valid SSL certificate (eg. IF it was HTTPS, you could use the Hyperlink REST API syntax - which it likely isn’t if it’s a local Node.js setup)

Thanks for your prompt reply Josh! When copying the 2 codes into device handler (1) and smartapps(1), I see the button creator in MySmartApps in ST. When I try to create a button I get a “Something went wrong error please reinstall…” after typing the required label for the button

Hi Josh,
Replying to this post. I can understand and appreciate how difficult it is to work with Sonos groups - it seems many are having the same issue.

Heres my set up
3 Sonos One speakers in main room (usually grouped together and stays that way in sonos)
1 in office
1 in Master Bedroom
1 in Master Bathroom

I’d like to be able to do is be in the main room starting music and if I am, lets say cleaning the apartment, then from the dashboard have an option to group the master bedroom and bathroom speakers to the main room group and when im done, pull them back out of the group.

Obviously, another request unrelated to this topic, but I’ve seen in other posts, is the ability to see the “Que” list of songs that Sonos has and be able to scroll down and jump ahead to a song I want to hear. For example, one of my favorite apple music playlists in sonos has over 300 songs. I’d like to scroll down and pick a song at the bottom after i Identify it.

Obviously, these are nice to have requests and requests for development are being prioritized. But just thought I’d mention it. I’m sure this platform will develop and grow over time only reassuring my investment in the tablets, software, etc.

Thank you for your genuine interest in my use case.

2 Likes

I would double check that you’ve published both the Device Handler and SmartApp. If that doesn’t help, you might post in the DTH author’s thread as they will be best suited to help with their custom app.

image

Hi, i would really like to know how to click on a tile in Sharptools and have the Sonos app open up where i can choose what music service i want to play in whatever room of my smarthome. I want to be able to open the entire sonos app by clicking a tile. If you go to 5:20 in the timeline of this Youtube video, you see this guy do it on some RTI system. https://www.youtube.com/watch?v=fYQSOYslMi8

You might try a hyperlink tile with the URL set to:

sonos://
2 Likes

@josh is my understanding of this correct that in order to set this up, I would need a node.js server running on a rasp pi or something similar?

Yeah, the jishi/node-sonos-http-api project runs on node.js, so you would need something to run it on (eg. a Raspberry PI, NAS, always-on PC, etc).

ahh okay thanks, I actually already have some in house candidates in that case. Do you have experience setting this up? Is it time intensive?

I have not tried it.

Homeassistant shows JOIN and UNJOIN commands to sharptools as well as a groupMembers attribute…

Does anyone have any experience or success with grouping by using the Rule engine? Possible? I don’t know how to specify which device to join and how to display it as an input argument in the rule engine.

I have this set up with Smartthings/raspberry pi/sharptools and have been the rpi3 for a few years with much success. I have recently started using the Web Requestor and Sharptools and it works just as expected.

I normally use it to call a preset or a playlist which will then group rooms, etc. I also have a couple of ‘groupall’, ‘pause’ and ‘join’ commands for joining specific rooms to other rooms, which I call with a simulated switch (see below).

image

FYI, I use the ip address as a variable because I had to change it once and thus had to change it everywhere I was calling it – which I vowed to never have to do again!

To ungroup, a specific room here is how I do it:
image

1 Like

I found a long workaround to group and ungroup sonos speakers using homeassistant. I’m curious if there is a simpler way that anyone might have found.

I’ve read and tried the technique mentioned above … but i think its beyond my expertise as a nonprogrammer.

My current setup for a few devices is

  1. sharptols rule pushes virtual button
  2. virtual button pushed automation uses the Media player: Join

It’s fine but it ends up with alot of virtual buttons when you look at all the permutations.

I’ve noticed in rules there is an option to use the join function, but I cant figure out the right syntax for it to work. Any ideas?

I feel like I should probably wait 24 hours before posting.

I think I found a slightly more simple method. This one is without intermediat step of virutal buttons:

  1. make an automation in home assistant using the Media player: Join WITHOUT a trigger
  2. import the automation in sharptools
  3. Make a sharptools rule to push that automation
  4. Place rule on your dashboard.

The automation placed directly on the dashboard (without the rule ) did not work.

1 Like