Sonos Issues

1,664 views
Skip to first unread message

mathia...@googlemail.com

unread,
May 1, 2013, 6:37:51 AM5/1/13
to ope...@googlegroups.com
Hi folks,

I am struggling with the integration of Sonos Play:5s into openhab: Here is my sitemap and item configuration:

sitemap
Switch item=lrSonosLed
Text item=lrSonosCT
Switch item=lrSonosAlm label="Alarm"
Switch item=lrSonosMute label="Mute"
Switch item=lrSonosPlay
Switch item=lrSonosStop
Switch item=lrSonosPause
Setpoint item=lrSonosVolume label="Volume" icon="volume" minValue="0" maxValue="100" step="10"

items
String          lrSonosCT       "Now Playing"   (gLivingRoom, Sonos) {   sonos="<[RINCON_000E58852BCC01400:currenttrack]"}
Switch          lrSonosLed      "Led"           (gLivingRoom, Sonos) {sonos=">[ON:RINCON_000E58852BCC01400:led],   >[OFF:RINCON_000E58852BCC01400:led]"}
Switch          lrSonosAlm      "Alarm"         (gLivingRoom, Sonos) {sonos=">[ON:RINCON_000E58852BCC01400:alarm], >[OFF:RINCON_000E58852BCC01400:alarm]"}
Switch          lrSonosMute     "Mute"          (gLivingRoom, Sonos) {sonos=">[ON:RINCON_000E58852BCC01400:mute],  >[OFF:RINCON_000E58852BCC01400:mute]"}
Switch          lrSonosPlay      "Play"         (gLivingRoom, Sonos) {sonos="*[ON:RINCON_000E58852BCC01400:play]"}
Switch          lrSonosStop      "Stop"         (gLivingRoom, Sonos) {sonos="*[ON:RINCON_000E58852BCC01400:stop]"}
Switch          lrSonosPause     "Pause"        (gLivingRoom, Sonos) {sonos="*[ON:RINCON_000E58852BCC01400:pause]"}
Number          lrSonosVolume   "Volume [%.1f]" (gLivingRoom, Sonos) {sonos=">[RINCON_000E58852BCC01400:volume]"}

Here is what works:
  • The status LED can the triggered. 
  • Play button
  • Stop button
  • Pause button
This is what doesn't:
  • The current track is not displayed
  • The alarm button does not turn on/off the alarm clock function for the zone
  • Muting does not work
  • Volume does not show and cannot be manipulated
Here is what is logged when I try to mute / unmute:

osgi> 06:31:42.431 INFO  runtime.busevents[:42] - lrSonosMute received command ON
06:31:42.433 ERROR o.o.b.s.internal.SonosBinding[:527] - Action Invalid Value Exception Invalid boolean value string: On
06:31:42.520 INFO  runtime.busevents[:46] - lrSonosMute state updated to ON

I am pretty sure that most - if not all - of this is related to my personal misconfigurations ;) I feel like I didn't get the concept of configuring openhab, yet. Maybe someone can help.

Message has been deleted

mathia...@googlemail.com

unread,
May 2, 2013, 2:30:48 PM5/2/13
to ope...@googlegroups.com, mathia...@googlemail.com
One more question: Why does 

Switch          lrSonosPlay     "Play"          (gLivingRoom, Sonos) {sonos="*[ON:RINCON_000E58852BCC01400:play]"}
Switch          lrSonosStop     "Stop"          (gLivingRoom, Sonos) {sonos="*[ON:RINCON_000E58852BCC01400:stop]"}

work, but

Switch          lrSonosPP       "Play/Pause"    (gLivingRoom, Sonos) {sonos="*[ON:RINCON_000E58852BCC01400:play], *[OFF:RINCON_000E58852BCC01400:pause]"}

does not?

tre...@gmail.com

unread,
May 2, 2013, 5:19:49 PM5/2/13
to ope...@googlegroups.com, mathia...@googlemail.com
Hello,

Current track works for me in 1.2

Try this:
String CurrentTrack          "CurrentTrack [%s]"    (Sonos,Sonos) {sonos="<[RINCON_000E5000000001400:currenttrack]"}

Im not using mute but if you look in the code for the sonos binding it looks like this is only a status iten not something you can set.

Im using stop and it works perfectly.

C

Karel Goderis

unread,
May 3, 2013, 4:24:34 AM5/3/13
to ope...@googlegroups.com, ope...@googlegroups.com, mathia...@googlemail.com
Mathias

I need to investigate the source to answer your questions because I has been a long time I have developed the sonos binding. 

Don't yet blame yourself as all of this could be due to issues in the code - at the time I was the only one using the binding without further testing by others. Since I intend to use sonos in my new house, I will iron out the bugs anyways.....

Regards
K

Sent from my iPhone
--
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

mathia...@googlemail.com

unread,
May 3, 2013, 5:12:06 AM5/3/13
to ope...@googlegroups.com, mathia...@googlemail.com
Hi, nice to hear :) Thanks! Can you estimate a time frame in which this is going to happen? Weeks? Months? Years? :D 

Just a general question and suggestion: Is the way Sonos is controlled via UPNP that any different from standard UPNP specifications? If no: why not implement a general UPNP / DLNA binding allowing every device to be controlled? Any technical reasons for this?

cheers
Mathias


Am Mittwoch, 1. Mai 2013 12:37:51 UTC+2 schrieb mathia...@googlemail.com:

Pali

unread,
May 3, 2013, 12:25:30 PM5/3/13
to ope...@googlegroups.com, mathia...@googlemail.com
Hi Karel,

and first of all, thanks for the sonos binding.

I also had problems with Sonos binding, but I never had time to investigate where the problem is. But now I activated little bit.

I have Play5 devices + one SonosBridge. And additionally several other upnp device on my network. 

1) One major problem seems to be that binding assume that all discovered devices are Sonos players. So polling thread try to poll every upnp device.
2) Polling thread does not have exception handling, so first error will kill the thread (no polling anymore). On my case, polling thread will meat first error, when  something is tried to read from device is not an Sonos device.
3) Reason why sonos="*[ON:RINCON_000E58852BCC01400:play], *[OFF:RINCON_000E58852BCC01400:pause]" command not work like expected, seems to be that binding provider return first command where direction is correct.

Br,
Pauli

Karel Goderis

unread,
May 3, 2013, 12:48:33 PM5/3/13
to ope...@googlegroups.com
Hi

The sonos bridge is currently not supported, and at the upnp level only sonos compatible devices are retained upon discovery. Indeed the thread then polls all sonos devices and assumes these are players - need to correct that

3) I need to check in detail

K

Sent from my iPhone

Pauli Anttila

unread,
May 3, 2013, 2:04:37 PM5/3/13
to ope...@googlegroups.com
"at the upnp level only sonos compatible devices are retained upon discovery."
Some reason the filtering does not work on my system. 

e.g. First device is onkyo av receiver and second one is my router.

20:55:16.352 DEBUG o.o.b.s.internal.SonosBinding[:186] - Added a new ZonePlayer with ID e0b059ce-8959-ceb9-1750-ce0989b98039 as configuration for device Sonos [udn=uuid:e0b059ce-8959-ceb9-1750-ce0989b98039, device=(RemoteDevice) Identity: (RemoteDeviceIdentity) UDN: uuid:e0b059ce-8959-ceb9-1750-ce0989b98039, Descriptor: http://192.168.1.34:8888/upnp_descriptor_0, Root: true]

20:55:25.497 DEBUG o.o.b.s.internal.SonosBinding[:186] - Added a new ZonePlayer with ID 11111111-1111-1111-1111-111111111111 as configuration for device Sonos [udn=uuid:11111111-1111-1111-1111-111111111111, device=(RemoteDevice) Identity: (RemoteDeviceIdentity) UDN: uuid:11111111-1111-1111-1111-111111111111, Descriptor: http://192.168.1.1:65535/rootDesc.xml, Root: true]



Another problem is that predefined UDN's does not work

20:16:24.483 DEBUG o.o.b.s.internal.SonosBinding[:915] - Querying network for UPNP with UDN uuid:RINCON_000E5855XXXXXXXX
!SESSION 2013-05-03 20:16:16.336 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.6.0_41
java.vendor=Apple Inc.
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US

!ENTRY org.eclipse.equinox.cm 4 0 2013-05-03 20:16:24.488
!MESSAGE 
!STACK 0
java.lang.NullPointerException
at org.openhab.binding.sonos.internal.SonosBinding.updated(SonosBinding.java:918)
at org.eclipse.equinox.internal.cm.ManagedServiceTracker$1.run(ManagedServiceTracker.java:183)
at org.eclipse.equinox.internal.cm.SerializedTaskQueue$1.run(SerializedTaskQueue.java:36)

Reason is that search is activated before start() method (upnpService is null).

-Pali


2013/5/3 Karel Goderis <karel....@me.com>

Pali

unread,
May 4, 2013, 5:10:29 AM5/4/13
to ope...@googlegroups.com
Hi Karel,

I just committed some improvements on my clone (http://code.google.com/r/paulianttila-ihc-binding/)

1) UPNP now searches AVTransport services and only devices where manufacturer is Sonos will be added. ZoneBridges will be filtered out.
2) Exception handling added to several places to improve stability.
3) sonos="*[ON:RINCON_000E58852BCC01400:play], *[OFF:RINCON_000E58852BCC01400:pause]" should now work.

At least now the binding works nicely with my Sonos Play5 devices.

Could you check the modifications and test if it still work on your system?

I assume that those mods should also solve the issue http://code.google.com/p/openhab/issues/detail?id=269

Regards,
Pali 


perjantai, 3. toukokuuta 2013 21.04.37 UTC+3 Pali kirjoitti:
"at the upnp level only sonos compatible devices are retained upon discovery."
Some reason the filtering does not work on my system. 

e.g. First device is onkyo av receiver and second one is my router.

20:55:16.352 DEBUG o.o.b.s.internal.SonosBinding[:186] - Added a new ZonePlayer with ID e0b059ce-8959-ceb9-1750-ce0989b98039 as configuration for device Sonos [udn=uuid:e0b059ce-8959-ceb9-1750-ce0989b98039, device=(RemoteDevice) Identity: (RemoteDeviceIdentity) UDN: uuid:e0b059ce-8959-ceb9-1750-ce0989b98039, Descriptor: http://192.168.1.34:8888/upnp_descriptor_0, Root: true]

20:55:25.497 DEBUG o.o.b.s.internal.SonosBinding[:186] - Added a new ZonePlayer with ID 11111111-1111-1111-1111-111111111111 as configuration for device Sonos [udn=uuid:11111111-1111-1111-1111-111111111111, device=(RemoteDevice) Identity: (RemoteDeviceIdentity) UDN: uuid:11111111-1111-1111-1111-111111111111, Descriptor: http://192.168.1.1:65535/rootDesc.xml, Root: true]



Another problem is that predefined UDN's does not work

20:16:24.483 DEBUG o.o.b.s.internal.SonosBinding[:915] - Querying network for UPNP with UDN uuid:RINCON_000E5855XXXXXXXX
!SESSION 2013-05-03 20:16:16.336 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.6.0_41
java.vendor=Apple Inc.
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US

!ENTRY org.eclipse.equinox.cm 4 0 2013-05-03 20:16:24.488
!MESSAGE 
!STACK 0
java.lang.NullPointerException
at org.openhab.binding.sonos.internal.SonosBinding.updated(SonosBinding.java:918)
at org.eclipse.equinox.internal.cm.ManagedServiceTracker$1.run(ManagedServiceTracker.java:183)
at org.eclipse.equinox.internal.cm.SerializedTaskQueue$1.run(SerializedTaskQueue.java:36)

Reason is that search is activated before start() method (upnpService is null).

-Pali


2013/5/3 Karel Goderis <>
Hi

The sonos bridge is currently not supported, and at the upnp level only sonos compatible devices are retained upon discovery. Indeed the thread then polls all sonos devices and assumes these are players - need to correct that

3) I need to check in detail

K

Sent from my iPhone
To unsubscribe from this group and stop receiving emails from it, send an email to .
To post to this group, send email to .

--
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 .
To post to this group, send email to .

Karel Goderis

unread,
May 4, 2013, 12:37:14 PM5/4/13
to ope...@googlegroups.com
Hi Pali

The code that does the filtering is 

         Service service = device.findService(new UDAServiceId("ZoneGroupTopology"));

e.g. look for devices that have this ZoneGroupTopology as a service, and I thought it would be specific enough to be limited to only Sonos devices. I can not imagine that a router would advertising this kind of service. This must be somehting related to the Cling library....

Regards
Karel

Karel Goderis

unread,
May 11, 2013, 6:58:36 AM5/11/13
to ope...@googlegroups.com
Yes - in UPNP you have somehting called "profiles" that define what a device can do, or can not do. And not every manufacturer is sticking to the standard profiles, making a "universal" UPNP "media player" for example very hard to achieve.
Sonos is not following the standard profiles 100%, and certainly not for the "zoning" features...

K

mathia...@googlemail.com

unread,
May 18, 2013, 9:24:38 AM5/18/13
to ope...@googlegroups.com
Hi, 

could you provide your build as a JAR?

thanks
Mathias

Karel Goderis

unread,
May 18, 2013, 9:27:43 AM5/18/13
to ope...@googlegroups.com
Thomas,

can you pull in the patches for Pauli's clone?

K

mathia...@googlemail.com

unread,
May 19, 2013, 7:54:49 AM5/19/13
to ope...@googlegroups.com
Does the 1.2.1 version of the addons package now contain the Sonos improvements?

Christian Radermacher

unread,
Sep 25, 2013, 5:50:56 AM9/25/13
to ope...@googlegroups.com, mathia...@googlemail.com
Hello,

i tested the Sonos Binding in Version 1.3.1 an have the Issue that the Binding search all upnp Devices and find my Synology NAS, I have an Warning every second.

11:37:31.226 WARN  o.t.c.p.RetrieveRemoteDescriptors[:138]- Received device descriptor without or with invalid Content-Type: http://192.168.114.201:5000/ssdp/desc-DSM-bond0.xml
11:37:31.284 WARN  o.t.c.p.RetrieveRemoteDescriptors[:264]- Service descriptor retrieval failed: http://192.168.114.201:5000/dummy.xml, 404 Not Found

I think this is the same as in this Thread. I use the ID in the config file with no solution.
Is there someone else who have the same Problem?

Greetings Christian

mathia...@googlemail.com

unread,
Sep 28, 2013, 6:22:39 AM9/28/13
to ope...@googlegroups.com, mathia...@googlemail.com
Hi, after a while I tried again so get  the Sonos Binding to work - this time with org.openhab.binding.sonos-1.3.0.jar. 

String ct4           "CurrentTrack"     (All) {sonos="<RINCON_000E58F0747601400:currenttrack]" autoupdate="false"}
String rd4           "Radio"            (All) {sonos="<RINCON_000E58F0747601400:radio]" autoupdate="false"}
Switch led4          "LedStatus"        (All) {sonos="<[ON:RINCON_000E58F0747601400:led], <[OFF:RINCON_000E58F0747601400:led]" autoupdate="false"}

and

Text item=ct4
Text item=rd4
Switch item=led4

results in not output at all on the text fields. The LED switch does not work either.

cheers
Mathias

Karel Goderis

unread,
Sep 28, 2013, 8:55:09 AM9/28/13
to ope...@googlegroups.com
Matthias

Can you please post log entries/file?

Tx
K

Sent from my iPhone
--
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.

dong...@gmail.com

unread,
Sep 28, 2013, 9:25:51 AM9/28/13
to ope...@googlegroups.com
@: Karel:
I'm struggling at the moment with another problem of the Sonos binding.
In the code the configured Sonos devices are stored in a map called sonosZonePlayerCache.
Currently I have eight Sonos devices all around the house. Every time I start openHAB it seems that sometimes eight entries are stored in this map where the key is the RINCON id and sometimes I have sixteen entries in this map (for each Sonos device two entries -> one entry where the key is the RINCON and the other entry where the key is the given name from the openhab.cfg).

Now if I have only eight entries in this map where the key is always the RINCON my openHAB frontend shows only unitialized values because in my item definition I'm using the configured names from the cfg and not the RINCON id.
For example: String sonosBathroomCurrentTrack "&nbsp;[%s]" (groupSonos) {sonos="<[bathroom:currenttrack]", autoupdate="true"}


Karel Goderis

unread,
Sep 28, 2013, 9:53:27 AM9/28/13
to ope...@googlegroups.com
This is most probably a bug - can you log an issue for this - I will look at this shortly
K

Sent from my iPhone

dong...@gmail.com

unread,
Sep 28, 2013, 3:27:48 PM9/28/13
to ope...@googlegroups.com
Issue created

dong...@gmail.com

unread,
Oct 12, 2013, 1:18:46 AM10/12/13
to ope...@googlegroups.com, dong...@gmail.com
From time to time I have another problem with the Sonos binding.
I get a lot of fatal errors because of a not well-formed xml.

07:02:58.645 ERROR o.o.b.s.internal.SonosBinding[:1226] - Could not parse MetaData from String <DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:r="urn:schemas-rinconnetworks-com:metadata-1-0/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"><item id="R:0/0/0" parentID="R:0/0" restricted="true"><dc:title>aData><NextURI></NextURI><NextURIMetaData></NextURIMetaData><PlayMedium>NETWORK</PlayMedium><RecordMedium>NOT_IMPLEMENTED</RecordMedium><WriteStatus>NOT_IMPLEMENTED</WriteStatus></u:GetMediaInfoResponse></s:Body></s:Envel</dc:title><upnp:class>object.item.audioItem.audioBroadcast</upnp:class><desc id="cdudn" nameSpace="urn:schemas-rinconnetworks-com:metadata-1-0/">SA_RINCON65031_</desc></item></DIDL-Lite>
[Fatal Error] :1:461: The element type "dc:title" must be terminated by the matching end-tag "</dc:title>".

As you can see the element s:Envel seems not be closed correctly. Is this maybe a problem of the Sonos interface and not the Sonos binding?

Karel Goderis

unread,
Oct 13, 2013, 3:49:26 AM10/13/13
to ope...@googlegroups.com
It has to be the sonos interface as we take the XML string "as is" 

Could you enlighten me on when this exactly happens? It has been a time since I wrote the binding, but the NOT_IMPLEMENTED etc in the XML string in itself is a bit weird / needs to be investigated....

K

Reply all
Reply to author
Forward
0 new messages