Sonos Automation


#1

I want to start playing a Pandora station on a specified set of Sonos devices. Is that possible? I can start playing what was previously playing, but would like to be able to manage the media via HA instead.


#2

I currently have my Sonos speakers integrated within Hubitat. From the device page, you can find the State Variable “uri”. This value is what you want for the playTrack command.

I am not currently doing this in webCoRE, in full disclosure. I previously did this in webCoRE with Arylic’s Up2Stream DIY audio boards (using their API). Now, I have a button on my SharpTools dashboard that my wife can click to start playing her Pandora playlist (no matter what state the Sonos app is currently in).


#3

In order to accomplish this in webCoRE, I set up jishi’s node.js server for Sonos on a Raspberry PI. By executing simple GET requests within pistons, I am able to perform all kind of tasks, some quite complex, to control my Sonos system throughout the house. This includes setting groups, volumes, and playing favorite playlists and stations, just to name a few.

For example, to play a station, I add the station to my Sonos Favorites and then within a piston execute the “play favorite” command like this.

http://192.168.1.25:5005/SonosOffice/favorite/myFavoriteStation

You can take this even further with presets — setting groups, volumes, and stations in one line.