Sonos/Smartthings Integration

  • 17 September 2018
  • 20 replies
  • 10066 views

Userlevel 6
Badge +9
Glad to see the new sub-forum. My Sonos speakers are an integral part of my Smart Home, which has been built around SmartThings (and webCore) but also utilizes IFTTT, Alexa, and Google Assistant. Just for those considering the possibilities, I'll share a few examples of things I've done. It would be interesting to see ideas and suggestions from other community members on the things they are doing with theirs.

Automated Controls
Scheduled Volume Adjustments for Day and Nighttime (if speakers are inactive)
Auto Adjust Volume to Default When Speakers are Inactive for Preset Period
Play Music at Bedtime & Slowly Fade before Stopping (Sleep Mode)
Music Plays upon Arrival & Pauses on Departure
Music Pauses on Receiving Phone Call
Lower music volume when Doorbell Rings

Voice Control (Alexa / Google)
Adjust Volume of Individual Speaker in Group
Adjust Volume of All Speakers in Group
Play Random Station, Favorite Station or Playlist

Security/Announcements
Security - Home/Away Door Intrusion Alerts (Alarms Sounds & Announcements)
Security - Lights & Music Operate Randomly when on Vacation
Security - If doorbell Rings with No One Home, Plays Sound of Mean Dog Barking (mostly for laughs 😃 )
Misc. Spoken Announcements (i.e., "The Garage Door has been left open")
Announce Estimated Commute Time (uses Google API) Upon Request

Of course, this list doesn't include all the standard tasks available to an Alexa-enabled devices.

This topic has been closed for further comments. You can use the search bar to find a similar topic, or create a new one by clicking Create Topic at the top of the page.

20 replies

Userlevel 7
Badge +22
For security system when you setup your sensors etc. the last page has options for Text/Push Notifications/Audio Notifications/ Alerts with Siren/Alerts with Lights

If you choose Audio notifications - you can then select any sonos speaker as audio device and put in custom message to play if security system set off.
Userlevel 6
Badge +9
@DavidBQ I've shared a couple of my pistons previously and would be willing to share more, but unfortunately Sonos's integration with SmartThings was broken with the 10.1 update. It still works to a point, but several of my pistons are no longer working reliably. I've been told it's an XML parsing issue, which ST should be able to fix, but I can't get anyone over at ST to pay attention and Sonos (somewhat understandably) doesn't view this as their problem—even though they would be best qualified to write a proper custom Device-Type Handler.
Userlevel 6
Badge +9

I like the idea that the OP described of having his speakers return to a preset volume after a period of inactivity. I think this is a great idea. I need to figure out how to do that.

Initially, I was using webCoRE with an ST Hub alone to accomplish this. Since my initial post, I’ve incorporated jishi’s node-server on a raspberryPi.  So now in addition to returning to a preset volume, my groups are also reset and/or modified on schedule (or on command as I move about the house). 

Has anyone had any issues with the Playbase? I’ve integrated Sonos via the Echo and SmartThings. When someone opens the front door via my Yale smart lock, the Sonos announces “Front door was opened by so-and-so” - which is great, but after the announcement the volume of the Playbase is zero

 

Is it possible ti trigger a Sonos playlist or favorite station directly thru webCoRE or do I have to set up a trigger in IFTTT and a Virtual Device in Smartthings.  This is what I have done but it is clunky with IFTTT.  I have also had to write my own piston to turn off all the other switches when I turn on a particular station (I am using ActionTiles for my dashboard on an old Samsung tablet).  So my piston works but it is growing in size with all the IF logic and I would rather communicate from webCoRE to Sonos directly. 

I seem to be able to play a specific track but not a station. I am trying to find the correct station info in ST IDE when the station is actively playing on my Sonos but nothing has worked so far. Play Track seems be be just that...only 1 track/song.

Thanks all.

Userlevel 5
Badge +4

I like the idea that the OP described of having his speakers return to a preset volume after a period of inactivity. I think this is a great idea. I need to figure out how to do that.

I recent added Hubitat Elevation to my many hubs to allow local control of Lutron switches and Picos. I noticed that it was dead simple and baked in to HE to control Sonos text to speech. I use it along with a doorbell sensor (Sage) to alert me when someone rings my doorbell and I’m in the yard (Sonance and patio speakers hooked up to a connect and connect Amp) or in my detached casita that doesn’t have a doorbell chime. Anyway, I’m sure there are lots of things that can be done with the text to speech that I haven’t thought about.

Userlevel 6
Badge +9

@loboent 

I use the node-server developed by @jishi on a raspberry pi for my integration with webCoRE.  It provides a lot of useful capabilities, and can easily play your favorites (playlists or stations). 

Great, how did you achieve your security announcements through Sonos?
Userlevel 7
Badge +22
You can also go into Marketplace button...smart apps tab at top...Music and Sounds...Speaker Companion.

This allows you to control sound notifications from the speaker when certain things happen.
Userlevel 6
Badge +9
Great, how did you achieve your security announcements through Sonos?

I actually use webCoRE with SmartThings to customize my various announcements, as I find ST's built-in security features a little too limited for me. However, as Chris notes there are options using SmartThings alone.
Userlevel 7
Badge +22
Oh yea with a lot of the custom apps and webcore you can do pretty much anything
Thanks Chris and Master T

I'll try webCoRE as well. But when I tried smartthings, it worked but the volume level of Sonos was very low. Is there any solution for this problem?
Userlevel 7
Badge +22
You can set volume levels from smartthings fir when plays
Hi, many thanks for your post! I am a big ST/IFTT/GA/WebCore fan as well, but I haven't been able to make much progress with Sonos How are you doing this one?

Play Random Station, Favorite Station or Playlist

Todd

I ended up connecting all my Sonos Favorites via IFTTT and a Virtual Switch in Smartthings.  Then I had to write a piston to manage all the switches so only 1 Switch shows on at any 1 time and I can pause by tapping the Switch/Station that is currently playing. I control everything thru ActionTiles.

Would have been a lot easier if I could play a Sonos Station/Favorite directly from webCoRE.  I am not a big fan of IFTTT.

 

https://community.webcore.co/t/controlling-multiple-sonos-stations-via-ifttt-and-actiontiles/15563

 

in case anyone is looking for something similar.

Userlevel 6
Badge +9
Play Random Station is easily accomplished through a webCoRE piston. But first you have to capture the URIs for the stations you want the piston to chose from, which you can do by parsing the trackData from the speakers. For an example of how to do that try backup code 8qqd.

Play Favorite Station or Playlist is available through an IFTTT action, which of course can be triggered via Alexa or a webCoRE piston. For playlists, create the Playlist first and then add it to your Sonos favorites via the desktop app.
For security system when you setup your sensors etc. the last page has options for Text/Push Notifications/Audio Notifications/ Alerts with Siren/Alerts with Lights

If you choose Audio notifications - you can then select any sonos speaker as audio device and put in custom message to play if security system set off.
I have done the same alerts with the Classic version of SmartThings, but have not figured out how to do with the latest Version of SmartThings. The Marketplace and Sonos does not exist on the new version.
Sorry if this a duplicate response. I have done the same alerts with the Classic version of SmartThings, but have not figured out how to do with the latest Version of SmartThings. The Marketplace does not exist on the new version SmartThings, neither does the SmartThings lab. Any help is greatly appreciated.
Glad to see the new sub-forum. My Sonos speakers are an integral part of my Smart Home, which has been built around SmartThings (and webCore) but also utilizes IFTTT, Alexa, and Google Assistant. Just for those considering the possibilities, I'll share a few examples of things I've done. It would be interesting to see ideas and suggestions from other community members on the things they are doing with theirs.

Automated Controls
Scheduled Volume Adjustments for Day and Nighttime (if speakers are inactive)
Auto Adjust Volume to Default When Speakers are Inactive for Preset Period
Play Music at Bedtime & Slowly Fade before Stopping (Sleep Mode)
Music Plays upon Arrival & Pauses on Departure
Music Pauses on Receiving Phone Call
Lower music volume when Doorbell Rings

Voice Control (Alexa / Google)
Adjust Volume of Individual Speaker in Group
Adjust Volume of All Speakers in Group
Play Random Station, Favorite Station or Playlist

Security/Announcements
Security - Home/Away Door Intrusion Alerts (Alarms Sounds & Announcements)
Security - Lights & Music Operate Randomly when on Vacation
Security - If doorbell Rings with No One Home, Plays Sound of Mean Dog Barking (mostly for laughs 😃 )
Misc. Spoken Announcements (i.e., "The Garage Door has been left open")
Announce Estimated Commute Time (uses Google API) Upon Request

Of course, this list doesn't include all the standard tasks available to an Alexa-enabled devices.



Hey Master T this is fantastic! Would you consider sharing your Pistons for those of us new to Sonos and WebCoRE?
Hi everyone,

Is there a way to play a Spotify playlist? What about loop a Spotify track?

Here's what I've been able to do (using WebCore with SmartThings):

Play a single Spotify track:
Set track to x-sonos-spotify:spotify%3atrack%3a3YqknScYcFrRQR23VZG8RB?sid=12&flags=8224;

Play a Spotify station:
Set track to x-sonosapi-radio:spotify%3aartistRadio%3a3Kt34aALAZu5GUd3WRqsrZ?sid=12&flags=8300

I can't play a Spotify playlist, e.g.

Set track to x-sonos-spotify:10062a6cspotify%3auser%3aericbogs%3aplaylist%3a3HsH3hBIXg47gD814dhj6L?sid=12&flags=10860

or

Set track to x-rincon-cpcontainer:10062a6cspotify%3auser%3aericbogs%3aplaylist%3a3HsH3hBIXg47gD814dhj6L?sid=12&flags=10860

Any ideas?