Deconz and openhab fight a fight part II

Successor to Deconz and openhab UI fight a fight deconz wins - #23 by bdv, but not totally…

Still openhabian, update to the latest stable releases…

Situation is that since upgrade to Openhab 4, the problem was solved, but then 4.0.3 kicked in, and the behaviour is back, slightly different than before though…

When I reboot the OpenHAB MainUI is not accessible, the deconz UI is.

After this sequence

openhabian@openhabian:~ $ sudo systemctl stop openhab
openhabian@openhabian:~ $ sudo systemctl stop deconz
openhabian@openhabian:~ $ sudo systemctl start openhab
openhabian@openhabian:~ $ sudo systemctl start deconz

Everything works back just fine.

So I have the feeling that the UI of deconz starts and blocks the UI of Openhab, so still a port thing?

Config of deconz file.

Description=deCONZ: ZigBee gateway – REST API
Wants=deconz-init.service deconz-update.service
ExecStart=/usr/bin/deCONZ -platform minimal --http-port=8081 –ws-port=8081

Any hints?

Maybe this link is a possible way to handle the start order? a combination of after and requires would solution it going forward if it really is some port conflicts.

And this one as well.

Thanks, good option. I’ll look into it.

Key will be if openhabian update will overwrite the sequence or not…

I think the problem is

that both ports are configured to start on the same port.
This is not possible. So during the startup of deconz there is already a port conflict and to get both up and running one of the will be started on a different port.
I have the impression that your solution of the old thread was not done in an optimal way.

Is the config that you posted in this thread this file ?

ls -l /etc/systemd/system/
lrwxrwxrwx 1 root root 34 Feb 25  2022 /etc/systemd/system/ -> /lib/systemd/system/deconz.service

In my case this is the original / unmodified service file that comes with deconz package.
There is an override.conf file that overrides this configuration and and allows local modifications to the original configuration:

cat /etc/systemd/system/deconz.service.d/override.conf
ExecStart=/usr/bin/deCONZ -platform minimal --http-port=8090 --ws-port=9443

As you can see for http-port port 8090 ( deconz/phoscon UI ) will be used and for ws-port port 9443 ( websocket ) will be used.

I always wondered that port-part, but got this from others.

I’ll try this as soon as I get home and give you feedback @Wolfgang_S

I use openhabian, and deconz is installed through Openhabian config.

Weird thing is I did not have the issue on 4.0-4.0.2

deconz.service is in /etc/systemd/system

I adapted the file with a different ws-port.

  • after reboot same issue; with ws port to 9443
  • after reboot same issue; with http port to 8090 (where phoscon comes online properly :slight_smile: ) and ws port to 9443 but openhab error remains the same

In the log I found this:

Some further searching led me to this

openhabian@openhabian:~ $ sudo netstat -ltnp | grep -w ‘:8080’


openhabian@openhabian:~ $ lsof -i :8080


openhabian@openhabian:~ $ sudo fuser 8080/tcp
8080/tcp: 353


openhabian@openhabian:~ $ ps -p 353
353 ? 00:00:20 deCONZ

Found the culprit. Still deconz.

So the file with the service in /etc/systemd/system changes the ports, but some other file is requesting the 8080 to for deconz.

I added a line to the init service, which I guess starts first,

GNU nano 5.4 deconz-init.service
Description=deCONZ: ZigBee gateway – Initialisation

But no success.

I tried with after in the same init service

GNU nano 5.4 deconz-init.service
Description=deCONZ: ZigBee gateway – Initialisation

No succes…

2023-10-23 12:10:50.928 [ERROR] [j.pax.web.service.internal.Activator] - Unable to start Pax Web server: Failed to bind to /

Any other pointers?

As far as I understand your post now deconz starts but ylu still get the original error message and your analysis shows that deconz also sits on the openhab port ?
To me this sounds like deconz service is started two times.
Did you revert all intermediate file changes and just tried the override.conf?


Deconz started before also. Change started after update to 4.0.3. All files reverted.

The only override.conf file I can find on my system is “/etc/systemd/system/openhab.service.d/override.conf”, standard openhabian install.

Please create the mentioned override.conf file.
override.conf is a systemd “feature” to override system defaults stored in the system wide services configuration file. While editing the services file will be overwritten with the next upgrade of the deconz package the override.conf file will survive that upgrade.

deconz override.conf - Google Suche should list a few threads about that topic while systemd override.conf - Google Suche shows a few threads about override.conf itself.

1 Like

This was indeed the solution. Thanks @Wolfgang_S (and sorry for late reply but holidays and stuff)

For others, this way I (hopefully finally) solved it:

make folder deconz.service.d in /etc/systemd/system
make file override.conf in /etc/systemd/system/deconz.service.d
copy info from file deconz.service in the /etc/systemd/system-folder in this override.conf
reboot :slight_smile:

1 Like