I'm new to Hubitat. I've managed to port over my entire SmartThings/WebCore system, and everything works EXCEPT anything related to Sonos. The Hubitat developers have clearly spent 99% of their efforts on Speech Synthesis for Sonos. It seems that's all I can do!
I want to play music from a Rule. Preferably a playlist. The Hubitat integration requires a URI to be passed into the "Play" command.
From what I can tell I can only get this x-rincon-queue URI. A bit of googling tells me that this refers to Sonos' internal queue as opposed to any identifiable playlist. It's actually an Apple music playlist, but nothing in this JSON refers to apple music.
Its the TrackURI I need for the playTrack() function. Except I'm looking to play a playlist not a track. But I can't find out what the URI is of the playlist I want to play.
The URI process is a search and try method using a browser. There are a lot of services, with varying results - so good luck. I do not have a list of these, but they are easy to find (i.e., radio.com, etc).
For my Samsung WiFi Speakers, the below is a list of verified sounds - just a start. Note that these url's point to some of the many on-line services.
I use the playTrack command to access the aforementioned playlist. Below is the exact execution of a button on my SharpTools dashboard that allows my wife to easily trigger her playlist.
I use the node-sonos-http-api to augment the built-in integration.
You have to run in on another computer that can run nodejs (which is basically anything).
You could use it temporarily to pull URIs for various tracks or playlists. Or you could use it permanently to play favorites and playlists, as well as grouping and playback control.
In the end, I use the built-in app for TTS only and node-sonos-http-api for everything else Sonos related. I have it running on a Raspberry Pi on my network.
Thanks I'm going to look into this when I have time. There's a Docker image for node-sonos-http-api that I can install on my Synology NAS. Just need to figure out how to configure it and interact with it.
There's an API reference that gets served from the device you host it on. In my experience, that interface is a little bit out of date, though it works well for the main functionality.
You can also consult the long readme on GitHub to get a more in-depth and complete description of the available API entrypoints.