I have been struggling with HE's Sonos Integration about 2 years. I have both HE and SmartThings. I really want to dump Smartthings, but Sonos integration in HE is so imperfect that is holding me back.**
In SmartThings, you can see the detail attributes for songs/album titles, artists, including album art URL for each Sonos speaker. And all these attributes are synced in real time for all Sonos speakers as a group of 7 different speakers (all S1) in SmartThings. That means in SmartThing App (ActionTiles or SharpTools), I can pause and play on just one Sonos speaker and all the Sonos speakers in the group would behave and pause/plan in unity. I can just put one Speaker Tile on Dashboard, and I can tell what song is playing with album art shown in SharpTools.
In HE, not only all the attributes for each Sonos speaker are out of sync, most of them are retained different song/albums titles from months or weeks ago for each Sonos speaker.
Another big problem with Sonos in HE is that the “master” of speaker jumps around if you reboot the master Sonos speaker, and there’s no way to know which one is selected until you examine each speaker in HE portal to find the new ‘master’; therefore, you cannot pause/resume music on all the Sonos speakers as a group with 1 selected speaker tile on Dashboard. In other words, I cannot uniformly pause and play songs for all Sonos speakers as a group in multiroom setup.
Am I doing something wrong with Sonos Integration in HE? I have searched this community and Reddit, and it seems no one has complained about similar Sonos frustration in Hubitat. How do you get the nice and similar Sonos experience and Integration in HE as we can currently enjoy in SmartThings? Will HE developers explore to make Sonos Integration as smoothly and nicely as in SmartThings?
Are all your Sonos devices on a static assigned ip address? I do not have the issues that you are reporting. Here are my attributes of my 'Master Kitchen Group' which controls 13 other Sonos speakers:
Current States
level : 24
mute : unmuted
status : paused
trackData : {"audioSource":"Sonos Q","station":null,"name":"The Drifter","artist":"Neil Diamond","album":"On The Way To The Sky","trackNumber":"7","status":"paused","level":"24","mute":"unmuted","uri":"x-rincon-queue:RINCON_5CAAFDF07B8001400#0","trackUri":"x-sonos-spotify:spotify%3atrack%3a7cBewSNnfUTg3hS681nmGH?sid=12&flags=8224&sn=34","transportUri":"x-rincon-queue:RINCON_5CAAFDF07B8001400#0","enqueuedUri":"x-rincon-cpcontainer:1004206cspotify%3aalbum%3a5lOAyD9C2rOYOxqPwVf6ZJ?sid=12&flags=8300&sn=34","metaData":"On The Way To The Skyobject.container.album.musicAlbumOn The Way To The SkyNeil Diamondhttps://i.scdn.co/image/ab67616d0000b2734321dde276366b630f853d7cNeil DiamondSA_RINCON3079_X_#Svc3079-0-Token","trackMetaData":"x-sonos-spotify:spotify%3atrack%3a7cBewSNnfUTg3hS681nmGH?sid=12&flags=8224&sn=34bd:0,sr:0,c:0,l:0,d:0/getaa?s=1&u=x-sonos-spotify%3aspotify%253atrack%253a7cBewSNnfUTg3hS681nmGH%3fsid%3d12%26flags%3d8224%26sn%3d34The Drifterobject.item.audioItem.musicTrackNeil DiamondOn The Way To The Sky"}
trackDescription : The Drifter by Neil Diamond from On The Way To The Sky
volume : 24
My only disappointment(s) with HE Sonos built in driver is that
Cannot group or re-group speakers
Play a dynamic text announcement without disrupting the current playlist.
Save current configuration, change settings, and restore to saved configuration.
I also have those details attributes from master speaker, but only shown on just this one master speaker. Are you saying all other non-master Sonos speaker also same the same attributes as the master? All in sync in real time?
They all have fixed IP addresses. Sonos master election protocol kicks in right away as soon as the master speaker reboots. Once randomly selected, the new master doesn’t change until you reboot the new master. Assigning fixed IP address won’t help in this situation, you would not know which speaker got selected as Master.
I only have detail HE attributes for the current Sonos Group master, which in my case, is always the 'Kitchen Left Sonos' Five. All the other Sonos players (10) and (3) subs do not have any playlist active and their playlist queue is clear and they are grouped with the Kitchen Left Sonos Five. I only have the Kitchen Left Sonos Five as a HE device as the other players are just slaves and do not need to be part of the HE system.
All my Sonos players get their fixed ip address from the DHCP router by their unique mac address. I control some of the Sonos attributes (e.g. volume, mute, next, etc) using the HE device directly from a dashboard of the Kitchen Left Sonos Player device, or I can control it within our Amazon Echo(s). I also have a custom RPi python script that checks and re-groups all my players every hour, saves the current active playlist and player configuration info, etc and restores it when I need via a voice command. This is because I have a Sonos Arc and it tends to want to separate from the group and other issues.
From what I read, when a Sonos player needs to access the internet, it does so directly. However in a Sonos Group, the first member fetches the stream on behalf of all the members, and distributes it locally to the others. You can check your Sonos configuration details by browsing http://ip_address_of_a_sonos_player:1400/support/review
For many transactions a master controller will access the internet directly itself, but sometimes it gets the Associated ZP to do so on its behalf. The Associated ZP is the Sonos player a controller uses to talk to the system in general, and is not necessarily the same as the player currently being controlled. The Associated ZP initially selected is the first player to respond to the SSDP multicast when a controller starts, so it is pot luck which gets chosen. It can change subsequently.
Here is a snapshot of my Sonos System's Kitchen Left Group Controller and Master.
Thanks for your reply! I got one question below resulting from your answer.
So, I get your python script gives the benefit of consistent grouping behavior. But wouldn't the master gets randomly selected from one of your remaining 13 Sonos speakers if your "Kitchen Left Sonos" somehow gets rebooted? How did you ensure your "Kitchen Left Sonos" will be "the" master all the time?
Our Kitchen Sonos stereo group is aways our whole house player 'Group Master' and usually the only player group with an active playlist. I'm not sure about player reboots since I have not experienced any issues should power be disrupted and/or Sonos upgrades. I really do not follow which is the assigned master controller since our Kitchen group controls the whole house playlist.
The Python 3 script I developed insures this defined configuration by periodically checking via a cron job the individuals players grouping as well as adjusts each volume levels to a pre-defined level I like. I do this group check as sometimes these players get adjusted differently during the day because of individual listening preferences in a room, a phone call. TTY message, etc. The Sunroom group is muted as a default since we rarely go out there during the cold season and it is a Sonos Arc surround stereo group and occasionally likes to depart from the Kitchen group as it functions as a TV surround sound.
Here is the output of my python grouping using SoCo (Sonos Controller) a high level Python 3 library to control One's Sonos ® speakers. I ungrouped the Move and Sunroom player groups to show how it works.
pi@raspberrypi6:~ $ python3 /home/pi/sonos/sonos.py -g -v 0 Group: Kitchen, PAUSED PLAYBACK: 'I've Been This Way Before' by 'Neil Diamond' on '50th Anniversary Collector's Edition'
Name: Bathroom Volume: 47%
Name: Craft Room Volume: 41%
Name: Dining Room Volume: 42%
Name: Kitchen Volume: 24%
Group: Move, STOPPED: No Music Selected
Name: Move Volume: 42%
Group: Sunroom, STOPPED: No Music Selected
Name: Sunroom Volume: 31% (Muted)
Changing Bathroom volume from 47 to 47
Changing Craft Room volume from 41 to 41
Changing Dining Room volume from 42 to 42
Changing Kitchen volume from 24 to 24
Changing Move volume from 42 to 42
Changing Sunroom volume from 31 to 31 Group: Kitchen, PAUSED PLAYBACK: 'I've Been This Way Before' by 'Neil Diamond' on '50th Anniversary Collector's Edition'
Name: Bathroom Volume: 47%
Name: Craft Room Volume: 41%
Name: Dining Room Volume: 42%
Name: Kitchen Volume: 24%
Group: Move, STOPPED: No Music Selected
Name: Move Volume: 42%
Group: Sunroom, STOPPED: No Music Selected
Name: Sunroom Volume: 31% (Muted) Grouping all Sonos Devices to Kitchen in Party Mode
Kitchen - Already in Kitchen Group - Skipping
Craft Room - Already in Kitchen Group - Skipping Move - Not in a group - Joining to Kitchen - Done
Dining Room - Already in Kitchen Group - Skipping
Bathroom - Already in Kitchen Group - Skipping Sunroom - Not in a group - Joining to Kitchen - Done
Waiting for Sonos to stabilize... Sleeping for 4 secs Group: Kitchen, PAUSED PLAYBACK: 'I've Been This Way Before' by 'Neil Diamond' on '50th Anniversary Collector's Edition'
Name: Bathroom Volume: 47%
Name: Craft Room Volume: 41%
Name: Dining Room Volume: 42%
Name: Kitchen Volume: 24%
Name: Sunroom Volume: 31% (Muted)
Name: Move Volume: 42%
I'm in the process of moving over from ST and was disappointed to find HE's Sonos Integration lacking a number of key attributes like groupRole, groupID, and groupVolume. With a significant number of Sonos units throughout the house, these are really key to my automations.
@bthrock, I agree with you that existing HE native Sonos integration is pretty basic/limited and would be nice to have these soco.groups module API capabilities added by HE internal developers.
The SoCo Python library on a Raspberry Pi is what I have for my Sonos advanced grouping control and so much more. It keeps track of my overall grouping during the day, resets volume levels to a default every morning and a few other house keeping chores with my Sonos Arc.
I would try to port this advanced capability to HE, but I suspect it might be a resource intensive issue and I already have quite a few applications running on my C5 and C7 that they are reasonably handling, hence my preference to offload other resource intensive applications line Sonos control to the RPi.
Yes, the capabilities of that module would be invaluable to me. Being new, I don't know how to suggest, vote, or otherwise request such changes.
And I hate to complain on the first date.
I run a node.js on a Raspberry Pi to manage the majority of the housekeeping chores like grouping, volume resets, etc., much as you do with python library, but several of these actions are triggered by groupRole, groupID, etc. and then executed via webhook.
I totally agree. It’s surprising that Hubitat developers and community have not invested much time and resources in Sonos group control such as volume or displaying correct songs from different groups.
I don’t know what to say given Sonos is quite popular in consumer market.
I could do almost everything on Hubitat except with Sonos. I am forced to keep my smartthings hub just for Sonos group control. Very disappointing
I'd like to weigh in on this thread/topic. I'm a new Vera-to-Hubitat convert, and one (but not the primary) of the reasons I chose Hubitat was native Sonos integration. Unfortunately, I quickly found, as many community members have commented, that the HE Sonos integration lacks several important features.
For me, the big miss is lack of ability to group speakers. I saw that one member got around this using his Logitech Harmony Hub, and that has been my solution for several years as Vera had no Sonos integration at all. However, Logitech has completely phased out their remote control product line, and Harmony Hub is no longer supported. In fact, the Alexa integration to Harmony Hub died about a month ago and the Harmony Hub is now useless.
I would really like to see Hubitat enhance their Sonos integration a bit. As it stands, I can't use Hubitat to control my Sonos in any useful way.
The integration is quite poor, I agree. It might improve if the Websocket API was publically available, but to the best of my knowledge it is not. (I'm happy to be corrected on that).
One pretty good option is to use the Sonos Control API, which is something I use to help manage my system.
I've been very pleased with my Sonos integration. I'm curious what features you might be thinking are missing. I only ask because I'd like to know what all is capable.
I was able to group my speakers without any issues. I only have two; but they grouped as a pair using the app; and have performed perfectly. Actually, I bought my first Sonos and let hubitat recognize it. Then when I added the second, I just paired it in the app. I never had to do anything additional in Hubitat. Just my $0.02.
@joshlobe - as I mentioned, the most critical missing function for me is speaker grouping. I can obviously group speakers in the Sonos app, as you have done, and then control the group with Hubitat. However, that isn't very helpful in my multi-zone system. I have five different Sonos zones in my home. In some cases, I play music on all the zones together. However, there is often different music playing in different zones, or music is being played only in a single zone. For example, at night I put on some atmospheric music to help me sleep - I only play that in the bedroom, as one might expect. So, I almost always setup a group before each music selection.
With my Google Voice/Harmony Hub setup (which is still working, for now), I can issue voice commands that not only select and start playing music, but also group the speakers on which I want to play. I was able to do the same with my Alexa/Harmony Hub combination in my other home (four Sonos zones in that one) until the Alexa skill decided to die. I think it's just a matter of time before the Google skill dies too.
So, getting speaker grouping in the Hubitat Sonos integration would be a huge improvement for me, personally, and allow me to effectively utilize Hubitat for Sonos control, rather than the Harmony Hub + voice assistant, for which the clock is now ticking on end-of-life.
I see. Thanks for the detailed reply. That's slightly discouraging to hear, as I was already planning to add another Sonos or two into the mix for the kids. So you're saying you'd like to select (in hubitat) to which "zone" the TTS is delivered during a routine?
You can deliver TTS to any individual speaker using the built-in integration. And you can also do all of the playback control and play specific tracks (assuming you have saved the URL beforehand).
The issue that @SF_Sig is raising is that you can't group and ungroup speakers in the built-in integration, among other useful features.
So if you wanted to do something driven from Hubitat instead of the Sonos mobile app on your phone, like have a button controller that caused certain speakers to be grouped or ungrouped, or something even more clever like driving grouping behavior based on motion, presence, or other sensors, you have to use an additional (and external) integration to do so.
There's the cloud-based API that is officially supported by Sonos which @SF_Sig linked to. It works well but requires you to write a custom app for Hubitat and obviously has a cloud reliance.
There's also the node-sonos-http-api which many folks in this community use. It runs locally on your network but requires an additional always-on computer, which you have to buy and maintain. And you still have to write a custom integration for Hubitat or write multiple complicated Rule Machine rules to control it.
So even though you can make a solution to drive grouping automations from Hubitat, it isn't supported natively to Hubitat and requires some additional work no matter which way you do it.
You probably have not used smartthings before. What smartthings can do is that you can see the album cover, song/album titles, and play/skips songs from “any” Sonos speakers regardless which one is Master. HE cannot do that at all. You cannot do any of this on random Sonos speaker. You can only achieve this on one single speaker, the master.
Please tell me if I’m wrong. I would like to know if I miss the “true” Sonos Integration in HE.