I cannot find any good working examples of using HA + the Sonos integration to kick off playing a specific channel on Sirius (either by name or channel number)
I’ve even looked into the “sonos plus” Node-Red palette and no dice there either…
Anyone got some pointers on how to accomplish this? I’d love to be able to make starting up a Sirius station throughout the house as part of my global morning routine.
After lots of banging my head against the wall for weeks trying to get this working I have found a way to reliably play a SiriusXM channel on Sonos via HA and associating that station with a button on a Lovelace dashboard, and it’s really not that hard. Note that I am using the SiriusXM Canada option in the Sonos App for this. It SHOULD work for others but I have no way of testing that.
These are the step-by-step instructions to get this working:
If you haven’t associated your Sonos speakers with HA then do that first (that’s beyond the scope of this note and there are LOTS of examples to do that).
If there is ANYTHING playing on your Sonos speakers make sure to stop it using HA before you start this configuration or else these notes won’t work.
Make sure that the SiriusXM option is activated in the SONOS APP (on iOS) and that you are logged into the SiriusXM option and can play a SiriusXM station through your Sonos speakers via the SONOS APP.
Get the SiriusXM station that you want playing on your Sonos speakers using the SONOS APP
In HA, go to Developer Tools | States and select a Sonos speaker entity.
Copy the entry for “media_content_id:” (excluding the words “media_content_id:” and the “>” if present). This is going to be an entry starting with “x-sonosapi-hls:Api%3…”
Paste that content into the Content ID field of a Media Button Card (among others).
Add “-static” to the entry so that it says “x-sonosapi-hls-static:Api%3…” (<=THIS IS CRITICAL)
Set the Content Type to “music”
That’s it. It works!! (At least it does for me as of May 10, 2023).
This is using HA 2023.3.6 with Supervisor 2023.4.1 under HAOS 9.5.
@Khyad I appreciate your help and I think this is what I’m looking for. So, I am new to HA (literally installed it this morning) and I clearly have no idea what I’m doing.
I’m trying to figure out how to add a Media Button Card correctly. I see how to add the card itself but then I can’t seem to find a “Content ID” field. Would you mind giving me a screenshot or directing me to another resource. My google searches have not been fruitful.
The simplest way is to add the radio station as a Sonos favorite and then play it using play_media and the favorite id ex: “FV2:0” as described in the integration documentation. Or use the select_source action using the name of the favorite (case sensitive) as the source Id.