Sonos/Upnp binding and starting radio streams

924 views
Skip to first unread message

Rene Mayrhofer

unread,
Feb 11, 2014, 9:06:23 AM2/11/14
to ope...@googlegroups.com
Hi everybody,

I have been trying to setup my openHAB instance with the Sonos binding and have it running for basic cases (like sending start and stop commands, mute/unmute, next/previous etc.). This works even through an OpenWRT box that is not configured as a switch between those two subnets for security reasons but as a router - I intend to write a post about howto configure Upnp multicast routing to make this work as soon as I have resolved my current issues.

However, I am so far unable to make the more advanced commands work with the Sonos binding, such as playing a specific track or starting a radio stream. What is the expected format for the "radio" command? One of my items is currently defined as

String Sonos_Bath_playradio          "Sonos Bad Radiostation ein"        (Sonos_Upnp)       {sonos=">[bath:radio]"}

and I have tried sending strings to this item with sendCommand in a rule, e.g. "icecast.omroep.nl/radio2-sb-mp3" and "x-rincon-mp3radio://icecast.omroep.nl/radio2-sb-mp3". I have also tried sending plaintext strings of the radio stations as I see them in the Sonos controller in my favorites list. None of those seem to work.

So if anybody has it running successfully, I would very much appreciate examples of how to use e.g. the "radio" and "playlist" commands in rules or otherwise (and any more complex examples you wish to share, e.g. direct streaming of TTS from openHAB to Sonos, which is still on my would-like-to-have list).

Rene

Karel Goderis

unread,
Feb 11, 2014, 10:05:29 AM2/11/14
to ope...@googlegroups.com
Hi Rene

Presuming that you are running the latest build/snapshot of the binding, you would use for 

Radio : the literal string as defined in "Sonos Favorites" (top entry in "Select a Music Source" in Sonos Controller 4.2) (thus *not* "My Radio Stations" in the Radio menu)
playlist : the literal string as defined in "Sonos Playlists" (somewhere in the middle in the same pane of the Sonos Controller as above)

Because of the somewhat more complex syntax used to define URL used by the Sonos system I opted at the time to use the literal string as defined in the Sonos Controller software, assuming that these lists would not change very often. However, the playURL takes (or should at least take) a complete URL as input.

To check if things are working for you, you could define an entry for Sonos_Bath_playradio in your .sitemap, then use the Sonos Controller to change "radio" channel, and see it change in the OH GUI if all goes well.

Regards
Karel 

--
You received this message because you are subscribed to the Google Groups "openhab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.
For more options, visit https://groups.google.com/groups/opt_out.

Rene Mayrhofer

unread,
Feb 11, 2014, 10:55:59 AM2/11/14
to ope...@googlegroups.com
Hi Karel,

I actually just got it to work, but found that - at least for my Sonos system - putting the radio stations under the favourites did not work, while adding them to "my radio stations" (or something similar, my setup is in German) works. The currenttrack status variable is not all that helpful in figuring out the strings because it not only shows the radio stations but has the currently playing song appended to it.

Is the playURI command already implemented in the 1.4 binding? According to the source code comments at https://github.com/openhab/openhab/blob/master/bundles/binding/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/SonosCommandType.java, it is not.

Do you plan to work on integrating the playURI command with the "say" action in openHAB? It might work with a rygel setup or more simply by creating a temporary file with the TTS, serving that via e.g. minidlna, and passing the URI to Sonos (or other systems - I still plan on working on the Yamaha YNCA binding).

Rene

Karel Goderis

unread,
Feb 11, 2014, 11:06:09 AM2/11/14
to ope...@googlegroups.com
Re

I might have had it wrong on the favorite list (it was one or the other, but Sonos changed the naming of it in a recent version of the Sonos Controller :-) ). 
There are some variations on "current" to get partial info on the song - see the wiki

and yes, I intend to further develop the binding as myself I have invested a lot of $ in a bunch of Sonos equipment shortly. I only need some more time to get it done. 

K
Reply all
Reply to author
Forward
0 new messages