Sonos devices not discovered?

Whatever I try, I cannot get openHAB to discover my Sonos devices…

Here’s what I have and what I have tried:

I am running a fresh instance of OH 3.3.0 in a docker container on my SynologyNAS.

  • I have rebooted the docker instance
  • I have verified the versions of all components
  • In Karaf, run bundles:list:

276 │ Active │ 80 │ 2.6.1 │ JUPnP Library
277 │ Active │ 80 │ 3.3.0 │ openHAB Add-ons :: Bundles :: Sonos Binding
278 │ Active │ 80 │ 3.3.0 │ openHAB Core :: Bundles :: Configuration UPnP Discovery
279 │ Active │ 80 │ 3.3.0 │ openHAB Core :: Bundles :: UPnP Transport

To me, these seem correct. Is that a good assumption?

I have three Sonos devices: 2x Sonos One(gen2), 1x Sonos Play:5 (gen1)

  • I have rebooted the Sonos devices

The network is UniFi, with multiple AP’s

  • I have verified that UPnP is enabled in the ‘system - services - UPnP configuration’ settings
  • I have verified that UPnP is enabled in my UniFi network settings
  • Using “UPnP Mate” on my phone, I do find the Sonos devices

I conclude from this that UPnP is working properly.

The Sonos devices however are not discovered by OpenHAB…

When I try to add one manually, using the correct ‘Unique Device Name’ (the RINCON_blablaba LocalUID that I find in my Sonos’ web interface on http://192.168.20.153:1400/status/zp), this is what I see in my Karaf logging:

12:36:02.796 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing ‘sonos:zoneplayer:a2164b46b3’ changed from UNINITIALIZED to INITIALIZING
12:37:02.813 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing ‘sonos:zoneplayer:a2164b46b3’ changed from INITIALIZING to OFFLINE (COMMUNICATION_ERROR): The UPnP device RINCON_B8E93
7247xxxxxx is not yet registered.

Lastly, I have also verified that there is no other software active on the SynologyNAS that could be claiming the UPnP port.

I’mat a loss what else could be causing this. Any ideas?

Many thanks,
Ronald

Ok, found the root cause…

I was running OH in a docker container, using ‘bridged’ mode. This created a separate subnet for my openHAB instance, causing the Sonos devices to be on a different subnet than the openHAB server.

The solution was to create the docker container using ‘network’ mode, which placed the openHAB server on the same subnet as the docker host. After that, the Sonos devices were discover in a split second…

Unfortunately it seemed not possible (at least not straightforward) to change this through a configuration setting within the initial docker container. As I was just getting started with this new openHAB instance, I did not bother examining that any further. Instead, I have created a new openHAB docker instance…

Hope this helps anyone else!
Ronald

Hey,

With Network Mode you mean the host Network (which is recommend for openhab docker)?

I also have the Problem that i cant Connect my sonos devices but i already Set docker to Network Mode host.

Im Not a docker expert but i highly recommend you docker Compose. When i started with docker I don’t like to send a really long docker command into the console and remember what things I entered when I want to change something.

So with docker Compose you just have a configuration file for all your containers and when you e.g. Update openhab you just go into it and change the version. Then save, exit and just run

sudo docker-compose up -d --force-recreate

Same for all other settings. I have about 15 containers on my pi and maintain is a dream!

I can recommend you these videos regarding this topic:
For Basics

For grafana, Loki if you are interested (my start with docker Compose)