ebaauw / homebridge-deconz

Homebridge plugin for deCONZ
Apache License 2.0
135 stars 7 forks source link

deConz GET /config command returns error #167

Closed jowallis closed 10 months ago

jowallis commented 11 months ago

I have setup a new clean Homebridge installation with a Raspberry Pi and the Homebridge Raspberry Image. I also switched from the Homebridge/Hue to Hombridge/Deconz plugin, wich all works fine.

Only thing is, that deConz sends all couple of minutes a GET /config command, which fails.

[21/09/2023, 16:13:14] [deCONZ] JoesConbee2: request 342: GET /config [21/09/2023, 16:13:14] [deCONZ] JoesConbee2: warning: request 342: connect ENETUNREACH 192.168.1.164:4530 - Local (0.0.0.0:0)

I reinstalled the Homebridge/Deconz plugin, to ensure it gets the correct API key from deConz, but this didn't solve the problem.

Can anybody help? Thx

ebaauw commented 11 months ago

Looks like Homebridge deCONZ found another deCONZ instance and is trying to connect to that.

What's your config.json? Did you specify hosts or are you discovering deCONZ gateways automatically? In the latter case: what's the output of deconz discover?

What's the output of ui get /gateways?

jowallis commented 11 months ago

I don't know, if I have two instances running.

I have specified the URL in the Hombridge Deconz Menu and it also shows in my config:

{ "name": "deCONZ", "hosts": [ "192.168.1.164:4530" ], "platform": "deCONZ", "_bridge": { "username": "0E:D4:B0:ED:DC:E5", "port": 32955 }

URL and port are correct, since I get to the Phoscon App, if I access it via browser. There I can connect to my Conbee II stick and everything works. Only funny thing is, that I cannot access the Phoscon App via the browser from my phone (which previously worked, when I had everything setup via Synology NAS and Docker).

Both of the mentioned commands result in an error in terminal:

JoeAdmin@JoesPi:~ $ deconz discover -bash: deconz: command not found JoeAdmin@JoesPi:~ $ ui get/gateways -bash: ui: command not found

Do I need to install something to be able to run them?

Thx

ebaauw commented 11 months ago

So Homebridge deCONZ cannot reach the deCONZ gateway, and apparently, neither can your phone. This is an issue with you network setup. I don't know how it's possible that "all works fine" in this case; changes in HomeKit would not be forwarded to deCONZ, and changes from Phoscon would not be reflected in HomeKit.

The commands are included with Homebridge deCONZ. During a regular install, rpm should create links to the bin directory associated with the install. For global installs, that's /usr/local/bin or /usr/bin (depending on how NodeJS was installed); for local installs, it's the .bin directory in the install directory. They should work from the Homebridge UI terminal, otherwise you might need to adjust $PATH. And when Homebridge is installed in a container, obviously, the commands wouldn't be available to the host system.

jowallis commented 10 months ago

Thank you for your advice.

Sorry, I now tried the commands from the Homebridge UI Terminal and get a result for discover, but still not for ui.

JoeAdmin@JoesPi:/var/lib/homebridge $ deconz discover { "192.168.1.164:4530": { "apiversion": "1.16.0", "bridgeid": "00212EFFFF05B3A3", "datastoreversion": "93", "devicename": "ConBee II", "factorynew": false, "mac": "d8:3a:dd:2a:e4:63", "modelid": "deCONZ", "name": "JoesConbee2", "replacesbridgeid": null, "starterkitid": "", "swversion": "2.23.1" } } JoeAdmin@JoesPi:/var/lib/homebridge $ ui get/gateways ui: error: get/gateways: unknown command

I have tested my setup in detail and the situation looks as follows:

Phoscon:

Homebridge via UI:

Homekit App:

Here is how I setup my system:

  1. I have installed the homebridge raspberry image on my raspberry Pi 4
  2. Then I installed Deconz & homebridge & VNC via the raspberry Homebridge menu
  3. Then I restored the accessoires connections the Phoscon App from my backup
  4. Then I installed Homebridge Deconz in Homebridge
  5. I also installed your Homebridge Hue Plugin but de-installed it again to avoid conflicts
  6. In Homebridge Settings i set Network interfaces to the Phoscon URL and selected Avahi as mDNS advertiser
  7. I also updated Node and the Conbee II stick (Node v18.18.0, Conbee II v 2.23.01 with firmware 26780700) My wifi spreads across three floors with one AP per floor using all the same SSIDs.

Do you have any idea, what I did wrong? Thank you!

ebaauw commented 10 months ago

JoeAdmin@JoesPi:/var/lib/homebridge $ ui get/gateways ui: error: get/gateways: unknown command

There should be a space in between get and /gateways.

Does not work via phone: I see the phoscon logo, but the gateway does not show up, so I cannot connect

This has nothing to do with Homebridge deCONZ, but suggests an issue with your network. I suspect the multicast used by UPnP doesn't reach the phone.

Works via laptop & phone: I can connect, switch on and off lights and use dimmer

So Homebridge deCONZ is working.

Very laggy and unreliable via laptop & phone: Shows "updating" for a 10-15 seconds, but eventually shows correct status of my accessories.

I've had that on my large production home; the upgrade to iOS 17 and familiy seems to have improved that a lot.

Could also be multicast used by mDNS for HomeKit to discover accessories (and the Home hub) not reaching the phone.

Closing this issue, as it's not a Homebridge deCONZ issue. Some pointers:

jan666 commented 10 months ago

Sorry for interrupting but there is a bug in deCONZ/Phoscon. It does not work on the iPhone at the moment, see https://forum.phoscon.de/t/phoscon-de-pwa-login-html-does-not-work-anymore/3967/14 - so I guess there is no problem with your phone at this point.

jowallis commented 10 months ago

Thank you for your help ebaauw and thx to jan666 for the hint with the deConz/Phoscon bug.