Control Sonos Music in 2020?

Hi all,

i'm pretty happy with how well my hubitat is working. I have some issues with zwave device routing but i think i solved most of them by partition my zwave network over multiple hubs and configuring them with the hublink app. That works well, really well.

I now use the hubitat dashboard and the kiosk app on kindle fires to control my lights and creating scenes. That also works well, and with the touch-up of the dashboards with smartly it looks pretty darn nice. very high WAF ratings.

I would like to control sonos with buttons on my dashboard. Typically what i want to control is pause/play and volume from the dashboard. I'd love a button that can play/pause an individual sonos devices. Even better if i can get another button that can control volume for an individual sonos device.

I have a mix of Sonos devices, Connect:amp, playbar, sub, connect and amp. I have 10 Sonos devices (of which three are connected together as a HT system: Playbar + sub + LS + RS).
I'm all on the new sonos S2 platform.

Any suggestions? I saw posts who use external data services with node-red to get a URL to control their sonos and then using hubitat to call those URL endpoints. I can do that, but i figure i first ask if there is anything that is more direct integrated?

Most post i found when searching for this integration seems to be from 2018 so i wanted to learn if there was any new updates on this topic?

Glad to hear WAF is up with smartly help. You can use the built in "Music Player" tile to control your Sonos devices individually. FYI I use Sonos S1 (some of my stuff is older), but what is list below should work either way.

Personally I use the built-in Sonos integration to get my Sonos devices into HE (I have a bunch as well). Then using @Cobra Virtual Music Player I can link multiple Sonos units together so that when I move one 'slider' it adjusts all my Sonos units. Lastly I got some help making a custom dashboard tile (3 tiles 'stacked') to mimic the Sonos app on an HE dashboard.

Resulting dashboard controller... (Top slider controls ALL Sonos units volumes and then the other sliders control the listed devices. "Kitchen Sonos" is my master zone for track/play/pause control)

That looks super cool. I got to get that working! i'll try it out right after work!

1 Like

I got the sonos working. I didn't even think of looking at system apps. I feel a bit silly about that.
Waiting for access to the cobra website. Too bad they don't make their app visible in hubitat package manager, i like that app.

1 Like

:+1:

true dat! but there a long story behind that most likely not happening.

tagging @Royski for help with the registration (since Andy is already tagged above.) They are over "the pond". It's kinda late there, but they'll get ya taken care of.

That's cool. But dang i'm really happy with my dashboard so far. I got one of those kindle fire HD 8 on the sale earlier this week, i think i paid $50 for it without ads. And i put on the kiosk app and it works really well.
My current kiosk screen for my outdoor kindle fire HD 8 tablet. Once i get the virtual music player i'll combine the patio and cabana to a single tile, as i use those areas almost always together. I have a bigger Kindle fire HD 10 that i use to control indoor devices with. I have the garage can lights on automation, but i decided to get it on my dash and turn it on manually as well.

1 Like

Cool!! whateva makes ya smile! Looks nice

Keep an eye on smartly for some additional music tile mods (there are zooms now and more to come with 2.0 and beyond.)

Hi.

Can you make sure that your HE username is used when registering? So use par.botes

We get a lot of grief for the bot denying access, but pretty much most of the time it’s because they don’t use their username as it is here. If the bot finds you, yr as good as in :+1:

1 Like

Smartly is really nice!

The one thing i would love with smartly is to set a uniform color for active tiles and inactive tiles,
The default for this theme: smartly dark, is the grayish inactive and a blue active color. I'd much rather make each tile dark when inactive and light when active. The same color as the sonos tile when inactive and then the color it has currently when active.

Is there an easy way to do that?

Just been approved I see. Welcome :stuck_out_tongue_winking_eye:

1 Like

very cool! i'm downloading it now!

2 Likes

You are using the latest smartly with JSinjector (drag n drop) correct?

If so you can set those in the custom CSS section with a code like this.

.tile.switch.on {
   background-color:rgba(0,0,0,0.5)!important;
}
.tile.switch.off {
   background-color:rgba(0,0,0,0.8)!important;
}

Change the 0's for color and 0.X at the end for opacity. You'll need one for each tile type like dimmer, motion, and mode on/off etc. Any changes made at the very bottom of the custom CSS will be preserved during smartly updates.

I just got the virtual music player working. Neat stuff!
On the smartly i use this link: https://hubitat.ezeek.us/smartly/
I don't know if this is the latest version or not, i saw a post about it a few days ago and decided to give it a try. its seriously nice and thats what i've been working off.

Thanks for the heads up on the json property. I can hack that up easily.

you are all awesome! thanks for the help!

1 Like

yep that's it. If you want to get the most out of the pre-release be sure to install the smartly JSinjector via HPM. But that is mostly for drag n drop. Caution if using stacked tiles you cannot use drag n drop (it will mess them all up)

Make sure you put that in the CSS not JSON.

Got it!

I'll play with stacking on sunday. superbusy tomorrow. Thanks a bunch!

On a side note, as a heavy Sonos users, I ended up adding a Raspberry PI to my setup and installed the Sonos HTTP framework and hooked up a Momentary Switch so I could do some more advanced voice controls like "Alexa, play music outside" which will join my outside amp to the corresponding speaker (upstairs) I know will be playing. Likewise I say "Alexa, stop music outside" and it splits the outside speaker from the group playing music". So much better than manually pulling out my phone to join/unjoin speakers.

Sonos HTTP allows a whole bunch of advanced Sonos control you can easily trigger with rest calls via RM or the Momentary switches I'm using for Alexa/Homekit easy support.

Once you add a RPI (or any really always on device), you might also end up exploring other awesomeness like Homebridge (this has made my life and WAF so much better for specific scenarios) if your' using apple devices, or Node-Red (I've installed it but haven't done anything with node red yet) is another awesome advanced tool many here are using to complement HE.

I have a raspberry pi coming alive in the next week or two. I have a pool with pentair automation and I'm getting a pi with the pool controller node.js packages that integrates with hubitat.

I had a Google nest wifi system with 6 nest wifi routers using hardwired backhaul but my internet was unstable. While I debugged that I didn't want to add more network devices. I just did a factory reset and replaced the main router as it was overheating and since then my network seems more stable. So I think I'm ready to add the pi and I can easily add more things that this pi can run.

Thanks for the suggestion!!!

1 Like

Mind elaborating on how you (or the helper :wink:) did this?

1 Like

tile 17 is the top tile. Tile 64/65 are the bottom two. Note if using smartly/drag and drop once you add stacked tiles you can no longer use that feature (it will break the stacks)

#tile-17{
  padding-bottom:8em
}
#tile-17 .tile-contents{
  display:inline-flex
}
#tile-17 .material-icons{
  font-size:43px!important; 
  line-height:1em
}
#tile-17 .vue-slider{
  margin-top:4em!important
}
#tile-17 .trackDescription{
  overflow:hidden;
  white-space:nowrap;
  padding-bottom:1em;
  margin:0.5em
}
#tile-17 .music-player{
  margin-top:-3px
}
#tile-17 .tile-primary,
#tile-64 .tile-primary,
#tile-65 .tile-primary{
  width:100%
}
#tile-64,
#tile-65{
  border:0 none;
  background-color:transparent!important
}
#tile-65{
  margin-top:-1em
}
#tile-64 .tile-title{
  padding-bottom:.5em
}
#tile-64 .music-player,
#tile-65 .music-player,
#tile-64 .trackDescription,
#tile-65 .trackDescription{
  display:none
}
#tile-17 .music-player>div.previous,
#tile-17 .music-player>div.play-pause,
#tile-17 .music-player>div.next,
#tile-17 .music-player>div.muteControl{
  margin-top:0;
  top:unset;
  width:unset;
  position:relative
}
#tile-17 .music-player>div{
  top:4.75em;
  position:absolute;
  width:100%
}
#tile-17 .trackDescription{
  position:absolute;
  left:0;
  top:2.75em;
  height:100%;
  width:auto;
  padding:0;
  animation:slideshow 10s linear infinite
}

@keyframes slideshow {0%{left:100%}100%{left:-150%}}

#tile-17 .tile-primary>.music-player{
  margin-top:5px
}
1 Like

Hello all, apologies for jumping in on this thread with another question, but it does relate to Sonos.

I do see many people using Dashboard and Alexa to control their speakers. In our home, we've actually gone another way and are using the Lutron Pico integration. This isn't going through HE, even though both the Picos and Sonos speakers are paired top HE.

So, long story short, we aren't crazy about how the integration between Lutron and Sonos is working. Our main gripe is how the middle button operates. Instead of cycling through favourites and replacing the Queue as it goes, our playlists end up getting stacked together in a mish mash of everything. Not ideal. I've spoken to techs at Sonos and they told me that I had to speak with Lutron (a wild goose chase if you ask me).

Any advice on how I can create this functionality within HE? When I look at the device page, I don't see anything similar to what I am looking for,

I'm looking for a way to cycle through favourites on my Sonos Speakers from Pico (but could be any remote), abnd replace the queue as I go.

From there, I can get into some more advanced functionality, but I'd liek to tackle this one first.

Thanks,