Error "connect ECONNREFUSED ..."

Problem:
All of my devices that were set up under the Phoscon / deconz gateway are unresponsive in HomeKit.

The Homebridge log (currently version 2.0.2) regularly shows:
[deCONZ] warning: 192.168.178.42 config: request 1: connect ECONNREFUSED 192.168.178.42:80
[deCONZ] warning: {IP adr. same as above, due to forum posting restrictions}: connect ECONNREFUSED {same as above} - retrying in 60s

Everything was working fine before. However, I was getting “ECONNREFUSED” error messages even before updating Homebridge to 2.x.

The configuration for the Homebridge-deCONZ plugin is:
{
“name”: “deCONZ”,
“noResponse”: false,
“stealth”: false,
“hosts”: [
“{same as above, due to forum posting restrictions}”
],
“platform”: “deCONZ”
}

Adding a port entry in the config file, such as 4530, 8080, or 8090, does not solve the problem.

I can access the Phoscon GW’s graphical interface at “http://homebridge.local:4530/pwa …”. I can see all my devices there. The GW is displayed in the top right corner with the IP address “{same as above, due to forum posting restrictions}”.

In the Phoscon app on the iPhone, my gateway appears at {same as above, due to forum posting restrictions} and suddenly another one at {Link: due to forum posting restrictions} “ten.ninety-nine.two.thirty-eight” as “undefined.” I have no idea where the second gateway suddenly came from.

In the Homebridge terminal, I get the following information:
pi@homebridge:/var/lib/homebridge $ sudo systemctl status deconz
● deconz.service - deCONZ: ZigBee gateway – REST API
Loaded: loaded (/lib/systemd/system/deconz.service; enabled; preset: enabled)
Drop-In: /etc/systemd/system/deconz.service.d
└─override.conf
Active: active (running) since Tue 2026-05-12 16:42:43 CEST; 2 days ago
Main PID: 165829 (deCONZ)
Tasks: 7 (limit: 3927)
CPU: 1h 52min 39.253s
CGroup: /system.slice/deconz.service
└─165829 /usr/bin/deCONZ -platform minimal --http-port=4530 --ws-port=4531

May 12 16:42:43 homebridge systemd[1]: Started deconz.service - deCONZ: ZigBee gateway – REST API.
May 12 16:42:43 homebridge deCONZ[165829]: QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to ‘/tmp/runtime-pi’
May 12 16:42:43 homebridge deCONZ[165829]: libpng warning: iCCP: known incorrect sRGB profile
May 12 16:42:44 homebridge deCONZ[165829]: This plugin does not support propagateSizeHints()
May 12 16:42:44 homebridge deCONZ[165829]: This plugin does not support propagateSizeHints()
May 12 16:42:44 homebridge deCONZ[165829]: This plugin does not support propagateSizeHints()
pi@homebridge:/var/lib/homebridge $ ^C
pi@homebridge:/var/lib/homebridge $

https://phoscon.de/discover” does this:
id “XYZ”
internalipaddress “{IP adr. same as above, due to forum posting restrictions”
macaddress “XYZ”
internalport 4530
httpsport 443
name “Phoscon-GW”
publicipaddress “–.–.–.–”

But to change the configuration of the Homebridge-deCONZ plugin to “{IP adr. same as above, due to forum posting restrictions:443,” do the following:
[deCONZ] warning: {IP adr. same as above, due to forum posting restrictions:443 config: request 1: socket hang up
[deCONZ] warning: {IP adr. same as above, due to forum posting restrictions:443: not a deCONZ gateway - retrying in 60s

What the heck is broken here, and how can I fix it?

If there isn’t a simple :wink: solution, I’m willing to delete everything from Phoscon / deconz. But please don’t mess up my Homebridge installation (currently running Raspberry Pi OS Lite (Debian) Bookworm on a Raspberry Pi 4 4 GB, Model B, Rev. 1.2, c03112). And how do I get it reinstalled? Using hb-config?

Yes, I know, after that I’ll have to reconnect all my devices to Phoscon deCONZ.

Please help. :slight_smile:

Perhaps something similar too Error connecting to deCONZ gateway at core-deconz · Issue #170012 · home-assistant/core · GitHub

There is something I don’t understand

I can access the Phoscon GW’s graphical interface at “http://homebridge.local:4530/pwa

[deCONZ] warning: 192.168.178.42 config: request 1: connect ECONNREFUSED 192.168.178.42:80

IDK for the IP but why not the same port ?
Phoscon use the same IP and Port than the API.

165829 /usr/bin/deCONZ -platform minimal --http-port=4530 --ws-port=4531

Your plugin still trying to connect at port 80 ?

Yes same question here. Why port 80. Never and nowhere setup as pref.

And change the config to port “4531” make this:
[deCONZ] warning: 192.168.178.42:4531 config: request 1: timeout after 5 seconds
[15/05/2026, 20:27:32] [deCONZ] warning: 192.168.178.42:4531: timeout after 5 seconds - retrying in 60s

I’ll check out the link for topic 170012 tomorrow. I’m too groggy today.

After reading the whole thread I think it doesn´t have some helpful information to my case. But thx. :slight_smile:

Here the API information from “http://homebridge.local:4530/pwa/index.html …”. Question: Why are there “hundreds” of almost identical entries under “whitelist”?

Simple text file

“name”: “Phoscon#B1497x769”

Thoses one are created everytime you connect to phoscon, to avoid them you can bookmark the page after the login page
You can delete them without problem, for exemple like here > Error connecting to deCONZ gateway at core-deconz · Issue #170012 · home-assistant/core · GitHub

Ok, thx for the info. I used to use this link/bookmark before, too. But I haven’t been using it lately because I’m constantly trying out different ports. That’s probably why there are hundreds of entries.

The link to the other issue isn’t helping me.

Yep the link is not usefull for your problem, but you have a request to delete all useless API key inside.

And just to be sure, all is working in Phoscon ? The problem is in HomeKit ?

Yes, I think it’s a communication issue between Phoscon/deconz and HomeKit. The problem with this error message started when I had to install a backup after I probably didn’t shut down a working existing installation properly.

You can check how many deconz instance you have, but for information, only one can work in same time.
Try to ask on HomeBridge plugin side ?
For information the plugin need to use the same ip and port you are using to access phoscon to make request.
For return it use the websosket, to see wich one port is used can check in Phoscon/help/api Information/config

Sure, logical.

I did. But they give up and sent me here.

But now, all of a sudden, I can no longer log in to the gateway via the browser using the Phoscon app. My password is being rejected.
However, everything is working again in HomeBridge and, consequently, HomeKit. All of my devices connected via Phoscon / deconz are visible and responding again.

It’s all so erratic and can’t be explained logically.

Disabling HTTPS has worked on other systems. Maybe it will help here, too

/usr/bin/deCONZ -platform minimal --http-port=4530 --https-port=0 --ws-port=4531

I’ll give this a try on this weekend. :slight_smile:

I don’t know your OS, but on classic OS thoses command can help

ps ax | grep deCONZ

Too show how many deconz intance are running, or

sudo netstat -tulpn | grep "deCONZ"

Damn, I’m short on time again. I’ll take a look at it over the weekend and get back to you then