How to configure Sonos binding

3,387 views
Skip to first unread message

Jan Assmann

unread,
Aug 9, 2013, 7:50:57 AM8/9/13
to ope...@googlegroups.com
Hi guys,

I just installed openhab. The installation and first start went fine. Now, I want to connect my first elements to my openhab server and decided to get my sonos speakers running. I read much stuff but I don't get how to configure the binding from scratch. In my opnehab.cfg is no setting for the sonos binding :-( Thank youu for any help

Kevin Rasmussen

unread,
Aug 12, 2013, 7:24:11 AM8/12/13
to ope...@googlegroups.com
You have to just add the information yourself.

Simply just add:

###################### SONOS Binding ###############################
sonos:openhabSonosDeviceID1.UDN
sonos:openhabSonosDeviceID2.UDN
etc...

Then in your item file:

Switch PlayLivingRoom {sonos="*[ON:openhabSonosDeviceID1:play]"}
Switch StopLivingRoom {sonos="*[ON:openhabSonosDeviceID1:stop]"}
..........

In your sitemap file:

Switch item=PlayLivingRoom
Switch item=StopLivingRoom

And the same procedure for your next zone pointing at your openhabSonosDeviceID2.

Kevin Rasmussen

unread,
Aug 12, 2013, 7:41:55 AM8/12/13
to ope...@googlegroups.com
And it is - btw - not the IP address which you should enter as the SONOS device UDN.
The UDN can be read directly by http://SONOSDVEVICEIP:1400/status/topology

But my experience is that the UDN is equal to: "RINCON_" + <SONOS device MAC address without any delimiter> + "01400". There is a perfect example for how this should look in the other thread you posted your question.
The MAC address can actually be seen in the info section of the SONOS mobile device app.
But the safest way is to access the above url. :-)

Karel Goderis

unread,
Aug 12, 2013, 12:37:23 PM8/12/13
to ope...@googlegroups.com
The default section was (for some reason) missing from the default.cfg - an trouble ticket has been recorded for this

K

--
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.
 
 

Karel Goderis

unread,
Aug 12, 2013, 1:11:30 PM8/12/13
to ope...@googlegroups.com
Kevin

The main reason for not using IP addresses in the .cfg is that Sonos at any point in time could change the naming convention in the future (but I doubt it) and the UDN's are used in the UPNP Discovery process.  I tried to stick to UDN's so that the Sonos binding could serve as an example for other UPNP-based bindings, e.g. it was the learning curve to climb using the underlying Cling UPNP library. The underlying UPNP library does the necessary conversion from an UPNP address to an IP address when it queries devices, so we do not need to bother with that..... (also, that resolves any DHCP related dependencies in your configuration scripts)

K


Jan Assmann

unread,
Aug 18, 2013, 2:11:24 PM8/18/13
to ope...@googlegroups.com
Hi guys,

I tried to connect my sonos devices, but openhab_debug throws me following error:
20:10:45.412 INFO  runtime.busevents[:42] - Sonos_Play received command ON
20:10:45.474 ERROR o.o.b.s.internal.SonosBinding[:732] - UPNP device is not defined for Sonos Player with ID office
Command has been sent successfully.

I only added this line to my items file:
Switch Sonos_Play "Play" (Living, Sonos) {sonos="*[ON:office:play]"}
And updated the openhab.cfg:
sonos:office.RINCON_000E58FA350201400

What is going wrong

Karel Goderis

unread,
Aug 18, 2013, 3:55:00 PM8/18/13
to ope...@googlegroups.com
Jan

In openhab.cfg you should have:

sonos:office.udn=RINCON_000E58FA350201400

Karel

Jan Assmann

unread,
Aug 18, 2013, 4:45:53 PM8/18/13
to ope...@googlegroups.com
Hi Karel,

I added the "udn" to the cfg. But still no success. Additionally I have the strange behavior that openhab throws many of this lines in DEBUG mode:
22:38:01.643 DEBUG o.o.b.s.internal.SonosBinding[:198] - Remote device updated: AVM Berlin FRITZ!Box Fon WLAN 7390 avm
22:37:51.999 DEBUG o.o.b.s.internal.SonosBinding[:138] - Discovery started: Samsung Electronics Samsung CLX-3180 Series 1.0

Karel Goderis

unread,
Aug 19, 2013, 3:54:07 PM8/19/13
to ope...@googlegroups.com
Hi Jan

Can you post me the Sonos lines of your debug log?

The other devices, that is normal, as the UPNP library does a global scan of the "universe" to detect all upnp capable devices, but afterwards it filters out the Sonos devices. Nothing to worry about. 

Tx
K

Jan Assmann

unread,
Aug 23, 2013, 6:05:28 PM8/23/13
to ope...@googlegroups.com
Hi Karel,

here is my openhab debug log. Still not working :-(

Thanks for your help 
openhab.log

Pauli Anttila

unread,
Aug 24, 2013, 2:11:57 AM8/24/13
to ope...@googlegroups.com
Hi Jan,

You have installed all bindings on the add-on folder. You definitely should install only those bindings which you really need.

But the problem itself, you are using Sonos PLAY5 + ZB100 + OpenHAB 1.2, which is not fully working combination. Could you try with OpenHAB 1.3 version, it should solve the problem. I own also PLAY5 and ZB100 devices and I needed to make few small improvements to Sonos binding and those are only on 1.3 branch. If I remember correctly, the problem was related to zone bridge. Version 1.2 binding tries to poll also the zone bridge, which kill the polling thread.

Br,
Pali

Karel Goderis

unread,
Aug 26, 2013, 3:50:51 AM8/26/13
to ope...@googlegroups.com
Indeed, the ZB is not supported (yet), as it does not do useful things. What is strange however, is that the binding registers your other devices as Sonos devices. Normally the binding filters the UPNP replies it gets using some characteristics that are only available on the Sonos devices, so this puzzles me. 

K

Jan Assmann

unread,
Aug 29, 2013, 7:43:32 AM8/29/13
to ope...@googlegroups.com
Pali, can you describe where I can get the 1.3 branch? Are there other activities to do, like compiling or building? And how to do it?

Thanks for your help

Thomas Eichstädt-Engelen

unread,
Aug 29, 2013, 8:23:25 AM8/29/13
to ope...@googlegroups.com
Hi Jan,

you can download Snapshot Builds from our CI-Server - https://openhab.ci.cloudbees.com/job/openHAB/.

Best,

Thomas E.-E.
Reply all
Reply to author
Forward
0 new messages