Sonos playlists etc?

haha already stuck... image is booted, logged in as root. cant install the npm. cant find sudo. basically its like the image is locked down to the gills. readme is useless for setup too.
soldier on

There is no sudo for root....

I realized that after I typed it... So yeah unfortunately there is no real guide for this that I can find... I usually dont need one, but im not strong in linux... basic functions to build arcade emulators etc.

from what it shows on that link, it should be as simple as (at least to get started)
imaging the sd, booting up, logging in, and running that npm for dependancies, but thats where it basically bombs out early.
I think the problem is I need to move some of the files I dl'd from github to a directory where the npm install is looking at. So Im poking around that now :slight_smile:

Here is a guide on how to install node.js via nvm on Linux, maybe they can help

So I am working off a different angle of just cloning the git... seems to be progressing.

EDIT - he/she really assumes some linux knowledge ahead of time... perhaps if/when I get this working I will write something up for the home automators who arent that bright (like me)

You could make your life even easier and use docker

1 Like

@njschwartz, long time no see. I'm sure you're making reference to my Sonos Playlist Control app that I had on ST. I tried to port it over to HE but there are a few differences with how HE integrates with Sonos. The differences were subtle but still threw a wrench in the simplicity of how it worked with ST. I did a rewrite for HE but never shared it because I still feel it's a bit wonky...That said, it works great for my needs. I just didn't really have the motivation to work on it further. I have also shared it with a few others privately (@aaron @bill.d) and they had success, Not sure if they still use it though.

@Dunginhawk, feel free to try it out if the http-api proves to be too challenging and you want everything to be handled within HE.
You would need to install both the parent and child apps and also the virtual container driver to store your presets. Feel free to reach out to me if you get stuck along the way.

P.S. it far from perfect but functional:


Do you have any plans on being able to group speakers? If not, is the best course of action to create a preset in the API for a group and then choose the "main" speaker for the preset?

Update: This does seem to work.

Would it be better to create virtual buttons since there isn't an "off" or "pause" function with the switch?

1 Like

I am up and running, after a lot of little oddities :slight_smile: now i just have to work with it to output what I want :slight_smile: stay tuned

@homeauto2112, was your reply directed at me?

1 Like

Yes sir :smile:

My app is limited by what HE provides in its speaker driver. If they eventually support grouping then I can try to add that functionality.

I can't say for sure because I don't know how you created the virtual speaker for "main".

In the virtual container are the "presets" that act as momentary switches (essentially buttons). The app was designed to allow you to start playback of a preset easily (from a dashboard or button device). It is not designed for speaker control...that will have to be done from the speaker device itself.

Edit: also forgot to mention that the reason I used switches (with autoOff) is that they could be used with Voice Assistants to start playback of the presets.

1 Like

I'm sorry. I don't know the correct word for it. When a group is created, there is speaker which controls the group as a whole (e.g. play/pause). At this point, I created one preset with the API and call that with a HTTP GET command. Then I use your switch to pick what feeds that group.


The use of switches vs buttons makes a lot of sense. I didn't think about the Voice or being able to execute it within RM.

Brilliant app. Thank you so much for putting it together!


@stephack I got your app installed. At this point Im a little lost on what to do from here. DO you have a writeup anywhere on how to create a preset button etc? I created a virtual device for a sonos player, but I dont think thats what I should be doing (there is no option for integrating with spotify or any presets etc)
As my friend always says "ur doing it wrong" haha

I never really planned on posting this I never wrote any documentation. I actually haven't even opened the app in almost a year so I barely remember how to configure

This app was designed to work with the built in HE Sonos App. Do you already have the Hubitat Sonos integration configured?


Here are some screenshots. I have it working with Radio, Apple Music and Spotify.

The process I followed was to start a stream to the speaker of choice. Then when I created the preset I flipped the "Recently Played URI's" and copy and pasted that into the URI: of the preset.

1 Like

Sorry @Dunginhawk, been a really crazy day at work. Did you get this working or do you still need help?

Ok, so I dont see preset control or child... are those drivers or apps code? I only see sonos.

In case you do, here's a quick overview.

  1. Select your sonos speaker
  2. Configure Presets
    This is the screen you are presented with

Number of presets:
This will dynamically create the input fields used to create each preset for this particular speaker. I limited it 6 because anything more than that seemed to cause the hub to crawl for a bit. This was almost a year ago so I may be able to increase this number. I haven't ever needed more than 5 presets for a speaker so I left it at 6.

Preset Name:
This is the name of the station/preset. It will be the name of the Virtual Switch created for this preset so name it accordingly...especially if you plan to use this with a voice assistant like Alexa.

This is the URI of the preset/station/playlist you want to start when the preset switch is turned on. If you already have one saved you can just paste it here and off you go. In most cases you would need to get the URI. This is where ST and HE strayed in their Sonos implementations. In ST This was easily extracted and fairly consistent. With HE different uri types were needed based on what was being certain radio stations needed, a certain uri (or portion of a uri to work correctly. It got confusing fast. In any case I created an option that would do it's best to get you the correct uri and also give you other probable options.

Show Recently Played URI's:
Enable this to display the URI of the most recently played audio on the speaker chosen. If this is blank, then start playback of one of your favorite stations and hit the Refresh Recent List button. You should end up with a list like this:

You can then copy and paste any uri of your choosing into the Test URI input and click the Test button. If it plays the station as expected, then this is the uri you need. Just copy it into the URI field of the preset. Rinse and repeat for as many presets as needed (up to 6 max) and save.
For some stations/playlists you might get more than one option. If the first uri you test does not work try the next in the list. I tried to gather the best options for the different playlists and present them in the Recents List.

When you save give it time to complete. It is actually generating a Virtual container device and then creating up to 6 virtual switches within that container. It might takes a few seconds to complete.

When all is said and done you should see a container device in your device list, with all your presets list under it. You can add these switches to a dashboard or assign to a button device or turn on via voice assistant. The switch has an autoOff so it is essentially a momentary button. There is no off option just different button to load different stations..kinds like presets on your car radio.