[SOLVED] playSound issue with openhab in docker

I’m running Openhab in docker using the official image and am trying to play a sound through my sonos using the following rule (with my sonos being set as the default audio sink):

rule "Doorbell"
when
    Item rfReceiver received update
then
    logInfo('Info', 'Doorbell pressed')
    playSound("doorbell.mp3")
end

But on the sonos I can see it attempts to play the file then fails with the error:

Unable to play fb29d017-7978-436d-ab4e-7c0bf74f6483.mp3, cannot connect to http://172.18.0.1:8080

So to me that says that Openhab is sending its internal docker address (172.18.0.1) to Sonos rather than its local network address that Sonos has access to. Is there any way that anyone knows of to change this so the Sonos can actually play the sound?

Thanks.

You can get it working by configuring the callbackUrl on the Sonos Binding and use the HOST_IP:HOST_PORT in the URL which the Sonos device should use to connect to the openHAB runtime.

1 Like

Ah brilliant, that’s sorted it.

Thanks for that, I searched all over the multimedia/audio stuff but for some reason it didn’t occur to me that it would be something I needed to change with the Sonos binding itself.

Thanks for your help.

1 Like