Problems with running deCONZ / RaspBee / ZigBee on OpenHAB

I am running OpenHAB on a Raspberry 3

also i have running a ZigBee Gateway (RaspBee from Dresden Elektronik with deCONZ as Software) on it.
For using my Philips and Osram lights.

In the latest Beta Software from deCONZ they also emulates a Hue Bridge
so OpenHAB can find it with the hue Binding a i am got rid of the Bridge

deCONZ would like to run his own Webportal on Port 80 or 8080
see file: /usr/bin/deCONZ-autostart.sh

provide service on port 80

which setcap
OPTIONS="–auto-connect=1 --dbg-error=1"

if [ $? -eq “0” ] && [ “$OS_ID” == “raspbian” ]; then
# assume getcap also exists
caps=getcap /usr/bin/deCONZ

    if [[ "$caps" == *cap_net_bind_service+ep* ]]; then
            echo capabilities ok
    else
            sudo setcap cap_net_bind_service=+ep  /usr/bin/deCONZ
            echo set capability to open ports lower 1024
    fi

    OPTIONS+=" --http-port=80"

else
OPTIONS+=" --http-port=8080"
fi

so i have changed OPTIONS+=" --http-port=80" to OPTIONS+=" --http-port=9090"

ok deCONZ website runs now on 9090 while openHAB on 8080

until this its all no Problem…

But i also have other devices i would use with Amazon Alexa and so i have Installed the
Hue Emulation on the OpenHAB

In Settings i have Set the “Optional discovery address” to 192.168.1.235

and changed my “/etc/network/interfaces” so i have 2 IP-Adresses

Network for Simulated Philips Hue Bridge

auto eth0
iface eth0 inet static
address 192.168.1.235
netmask 255.255.255.0
gateway 192.168.1.1
network 192.168.1.0
broadcast 192.168.1.255

Network for OpenHAB, Alexa and MQTT

auto eth0:0
allow-hotplug eth0:0
iface eth0:0 inet static
address 192.168.1.236
netmask 255.255.255.0

but now i Stuck on the following Error comes every 3 seconds in the openhab.log

2017-05-25 00:11:06.145 [ERROR] [tion.internal.HueEmulationUpnpServer] - Socket error with UPNP server
java.net.BindException: Die Adresse wird bereits verwendet (Bind failed)
at java.net.PlainDatagramSocketImpl.bind0(Native Method)[:1.8.0_121]
at java.net.AbstractPlainDatagramSocketImpl.bind(AbstractPlainDatagramSocketImpl.java:93)[:1.8.0_121]
at java.net.DatagramSocket.bind(DatagramSocket.java:392)[:1.8.0_121]
at java.net.MulticastSocket.(MulticastSocket.java:172)[:1.8.0_121]
at java.net.MulticastSocket.(MulticastSocket.java:136)[:1.8.0_121]
at org.openhab.io.hueemulation.internal.HueEmulationUpnpServer.run(HueEmulationUpnpServer.java:98)[192:org.openhab.io.hueemulation:2.1.0.201705212134]

when i kill the deCONZ process the Error stopps and the OpenHAB Hue emulation is running

Anyone have a idea how can i fix this ?

In which IP/port runs the hue when it works?

So the UPNP port is the same for all programs. You have two programs running that support UPNP. On is openHAB. I can’t say what the other one is but for the most part you cannot run two UPNP servers on the same host at the same time. One way to get around this is to run the services in containers like Docker. Or you can run them on separate hosts. If it is possible, turn off UPNP for one of the services (I don’t know if or how to do that in OH). Or just live with the error and know that your phone apps will not be able to automatically find your OH on the network.

Search the forum for “Plex Docker” and you should find a thread where someone set up their server to run Plexmediaserver and openHAB on the same machine using Docker. Both Plex and openHAB use UPNP and so conflict for that port.

The port in question is 5000.

Thank you rlkoshak for your post.

So my really old, unused and slow (but fast enough) Raspberry Pi 1 has new Assignment…
I have installed the ZigBee Gateway now on it.

Problem Solved

Thank you

Hi @hannes.dinges
would you please be so kind and let me know which deCONZ version supports the Hue bridge emulation and where to get it? Thx in advance.
Kind regards,
Christian

Hi Christian,

this is easy :wink:

http://www.dresden-elektronik.de/rpi/deconz-dev/

v2.04.40

but dont forget… its a beta :wink:

Best Regards
Hannes

Hi,

the problem remains and I dont know what more to do. I have the problem that deCONZ and OpenHAB2 are connected by default to the same IP address but with different ports. I get this error when I try to configure the “Raspbee controller” with Hue Binding at Paper UI:

2017-07-28 02:23:20.459 [INFO ] [binding.hue.handler.HueBridgeHandler] - Creating new user on Hue bridge 192.168.42.100 - please press the pairing button on the bridge.
2017-07-28 02:23:20.471 [WARN ] [binding.hue.handler.HueBridgeHandler] - Failed creating new user on Hue bridge
java.io.FileNotFoundException: http://192.168.42.100/api/
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1872)[:1.8.0_131]
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)[:1.8.0_131]
at org.eclipse.smarthome.binding.hue.internal.HttpClient.doNetwork(HttpClient.java:62)[189:org.eclipse.smarthome.binding.hue:0.9.0.201707190720]
at org.eclipse.smarthome.binding.hue.internal.HttpClient.post(HttpClient.java:36)[189:org.eclipse.smarthome.binding.hue:0.9.0.201707190720]
at org.eclipse.smarthome.binding.hue.internal.HueBridge.link(HueBridge.java:759)[189:org.eclipse.smarthome.binding.hue:0.9.0.201707190720]
at org.eclipse.smarthome.binding.hue.internal.HueBridge.link(HueBridge.java:750)[189:org.eclipse.smarthome.binding.hue:0.9.0.201707190720]
at org.eclipse.smarthome.binding.hue.handler.HueBridgeHandler.createUserOnPhysicalBridge(HueBridgeHandler.java:340)[189:org.eclipse.smarthome.binding.hue:0.9.0.201707190720]
at org.eclipse.smarthome.binding.hue.handler.HueBridgeHandler.createUser(HueBridgeHandler.java:328)[189:org.eclipse.smarthome.binding.hue:0.9.0.201707190720]
at org.eclipse.smarthome.binding.hue.handler.HueBridgeHandler.onNotAuthenticated(HueBridgeHandler.java:314)[189:org.eclipse.smarthome.binding.hue:0.9.0.201707190720]
at org.eclipse.smarthome.binding.hue.handler.HueBridgeHandler$1.run(HueBridgeHandler.java:139)[189:org.eclipse.smarthome.binding.hue:0.9.0.201707190720]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_131]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)[:1.8.0_131]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)[:1.8.0_131]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)[:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_131]
at java.lang.Thread.run(Thread.java:748)[:1.8.0_131]

I think that the “http://IP/api” is the problem because the 2 programs are trying to address themselves the same. I dont know how to do for avoid that. Trying to add two different static IPs doesnt solve anything, deCONZ address all of the static IP automatically.

Thanks in advance if somebody know what to do.