ebaauw / homebridge-deconz

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

Plugins: Homebridge Hue vs. Homebridge deCONZ #70

Closed aschmidt74 closed 2 years ago

aschmidt74 commented 2 years ago

I struggle with some fundamental issue here. All devices visible when running the hue plugin are lost when the deCONZ plugin is enabled (hue disabled).

HomeBridge log reads:

[8/19/2022, 5:05:43 PM] Loaded plugin: homebridge-deconz@0.0.21
[8/19/2022, 5:05:43 PM] Registering platform 'homebridge-deconz.deCONZ'
[8/19/2022, 5:05:46 PM] [deCONZ] Initializing deCONZ platform...
[8/19/2022, 5:05:46 PM] [deCONZ] homebridge-deconz v0.0.21, node v16.17.0, homebridge v1.5.0, homebridge-lib v5.6.5
[8/19/2022, 5:05:46 PM] [deCONZ] Phoscon-GW: dresden elektronik deCONZ / ConBee II gateway v2.17.1
[8/19/2022, 5:05:46 PM] [deCONZ] hardware: x64
[8/19/2022, 5:05:46 PM] [deCONZ] os: Ubuntu 20.04.4 LTS
[8/19/2022, 5:05:46 PM] [deCONZ] restored 1 accessories from cache
[8/19/2022, 5:05:46 PM] [deCONZ] ui server: listening on http://127.0.0.1:42468/
[8/19/2022, 5:05:48 PM] [deCONZ] Phoscon-GW: websocket connected to ws://192.168.0.22:443
[8/19/2022, 5:05:48 PM] [deCONZ] 1 gateways
[8/19/2022, 5:05:48 PM] [deCONZ] created debug dump file /var/lib/homebridge/homebridge-deconz.json.gz

the .json file is 85kB in size and aparently lists all properties of all zigbee devices in question.

aschmidt74 commented 2 years ago

I cleared the cache: Phoscon-GW (homebridge-deconz) and removed all API-keys from the gateway.

but now I cant even get a new API key, only this:

[8/19/2022, 5:50:45 PM] [deCONZ] Phoscon-GW: warning: unlock gateway and set Expose to obtain an API key`

of course the 'button' is pressed.

netstat on the gateway shows this:

tcp        0      0 0.0.0.0:81              0.0.0.0:*               LISTEN      458/deCONZ
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      458/deCONZ

so the plugins Gateway should be <gatewaysIP>:81, right?! "forceHttp": true is in effect too.

[edit] another cache.clear was reqired to obtain an API-key. so this part seems to work agn.

now I see this in the homebridge log:

[8/19/2022, 6:27:22 PM] Loaded plugin: homebridge-deconz@0.0.21
[8/19/2022, 6:27:22 PM] Registering platform 'homebridge-deconz.deCONZ'
[8/19/2022, 6:27:25 PM] [deCONZ] Initializing deCONZ platform...
[8/19/2022, 6:27:25 PM] [deCONZ] homebridge-deconz v0.0.21, node v16.17.0, homebridge v1.5.0, homebridge-lib v5.6.5
[8/19/2022, 6:27:25 PM] [deCONZ] hardware: x64
[8/19/2022, 6:27:25 PM] [deCONZ] os: Ubuntu 20.04.4 LTS
[8/19/2022, 6:27:25 PM] [deCONZ] ui server: listening on http://127.0.0.1:46185/
[8/19/2022, 6:27:27 PM] [deCONZ] Phoscon-GW: set Serial Number to "00212EFFwhatever"
[8/19/2022, 6:27:27 PM] [deCONZ] Phoscon-GW: set Manufacturer to "dresden elektronik"
[8/19/2022, 6:27:27 PM] [deCONZ] Phoscon-GW: set Model to "deCONZ / ConBee II"
[8/19/2022, 6:27:27 PM] [deCONZ] Phoscon-GW: set Firmware Revision to "0.0.0"
[8/19/2022, 6:27:27 PM] [deCONZ] Phoscon-GW: set Software Revision to "2.17.1"
[8/19/2022, 6:27:27 PM] [deCONZ] Phoscon-GW: dresden elektronik deCONZ / ConBee II gateway v2.17.1
[8/19/2022, 6:27:27 PM] [deCONZ] Phoscon-GW Gateway Settings: set Expose to true
[8/19/2022, 6:27:27 PM] [deCONZ] Phoscon-GW Gateway Settings: set Expose Lights to false
[8/19/2022, 6:27:27 PM] [deCONZ] Phoscon-GW Gateway Settings: set Expose Sensors to false
[8/19/2022, 6:27:27 PM] [deCONZ] Phoscon-GW Gateway Settings: set Expose Groups to false
[8/19/2022, 6:27:27 PM] [deCONZ] Phoscon-GW Gateway Settings: set Expose Schedules to false
[8/19/2022, 6:27:27 PM] [deCONZ] Phoscon-GW Gateway Settings: set Heartrate to 30 seconds
[8/19/2022, 6:27:27 PM] [deCONZ] Phoscon-GW Gateway Settings: set Log Level to 2
[8/19/2022, 6:27:27 PM] [deCONZ] Phoscon-GW Gateway Settings: set Restart to false
[8/19/2022, 6:27:27 PM] [deCONZ] Phoscon-GW Gateway Settings: set Search to false
[8/19/2022, 6:27:27 PM] [deCONZ] Phoscon-GW Gateway Settings: set Transition Time to 0.4 seconds
[8/19/2022, 6:27:27 PM] [deCONZ] Phoscon-GW Gateway Settings: set Unlock to false
[8/19/2022, 6:27:27 PM] [deCONZ] Phoscon-GW Button: set Service Label Index to 1
[8/19/2022, 6:27:27 PM] [deCONZ] Phoscon-GW: request 1: POST / {"devicetype":"homebridge-deconz#homebridge"}
[8/19/2022, 6:27:27 PM] [deCONZ] Phoscon-GW: warning: request 1: api error 101: link button not pressed
[8/19/2022, 6:27:27 PM] [deCONZ] Phoscon-GW: unlock gateway to obtain API key - retrying in 15s
[8/19/2022, 6:27:42 PM] [deCONZ] Phoscon-GW: websocket connected to ws://192.168.0.22:443
[8/19/2022, 6:27:43 PM] [deCONZ] Phoscon-GW: set Firmware Revision from "0.0.0" to "0x26780700"
[8/19/2022, 6:27:43 PM] [deCONZ] 1 gateways
[8/19/2022, 6:27:43 PM] [deCONZ] created debug dump file /var/lib/homebridge/homebridge-deconz.json.gz
[8/19/2022, 6:28:27 PM] [deCONZ] Phoscon-GW Button: Programmable Switch Event: Single Press
[8/19/2022, 6:29:27 PM] [deCONZ] Phoscon-GW Button: Programmable Switch Event: Single Press
[8/19/2022, 6:30:27 PM] [deCONZ] Phoscon-GW Button: Programmable Switch Event: Single Press
[8/19/2022, 6:31:27 PM] [deCONZ] Phoscon-GW Button: Programmable Switch Event: Single Press

So how would I expose Lights & Sensors ?!

ebaauw commented 2 years ago

In Eve, or another decent HomeKit app, set Expose Lights in the Gateway Settings service, see README.

aschmidt74 commented 2 years ago

thanks for the fast response, and I re-red the readme, and did a search for the terms, however; my eve app (on iPhone) has no Gateway Settings or Services!

?are you referring to this: EveS

So where xactly needs the Expose Lights to be set? Is it a switch? is it a named group? is it part of a config-file?

This seems essentially important but I'm missing this important hint or snapshot in the readme. ?are you referring to this: https://github.com/ebaauw/homebridge-deconz/wiki/Device-Accessory

Is #475 an important part of the README? I am lacking context and a simple step-by-step example, sorry. Even with that information I cant get it to work.

ebaauw commented 2 years ago

That screenshot is from a gateway accessory exposed by Homebridge Hue, not by Homebridge deCONZ.

aschmidt74 commented 2 years ago

You see, I am just guessing in the dark; There was no trace of hue or homebridge-hue running in my system - but maybe homekit is a little slow to get my change of plugins.

regardless; where can I set Expose Lights in the Gateway Settings service ?! please can you give me a hint to that...

ebaauw commented 2 years ago

Same place as above screenshot, but then for the accessory exposed by Homebridge deCONZ.

Are you running Homebridge deCONZ in a child bridge, or a separate (new) Homebridge instance? If so, did you pair it to HomeKit?

aschmidt74 commented 2 years ago

I did not chosoe the child-bridge option, nor is there another HB instance. all mentioned above happens in the one and main HB instance.

ebaauw commented 2 years ago

Just checked: running Homebridge Hue and Homebridge deCONZ in the same Homebridge instance should work just fine.

The Accessories view in Eve shows two gateway accessories: one from Homebridge Hue (upper) and one from Homebridge deCONZ (lower): IMG_0003

The Rooms view in Eve shows four services: two from Homebridge Hue (lower two), and two from Homebridge deCONZ (upper two): IMG_0004

You need the Gateway Settings service from Homebridge deCONZ.

aschmidt74 commented 2 years ago

Thank you! That's a terribly important step in the setup ;) maybe a tiny little snapshot will help others greatly! Two more things:

28FC6A01-0634-4AD6-A041-F33390EB2F7A

ebaauw commented 2 years ago

can I add an API-Key in the cfg? I don't want to re-authenticate the app every time.

No, you cannot, and you don’t need to. It’s stored with the gateway accessory in cachedAccessories.

Once a device is set to expose=off in eve it vanishes, as intended. But what if I changed my mind? Where would I get a hand on such devices in order to expose them again?

The gateway accessory gets a. Device Settings service, where you can re-expose the device. Clear Expose Lights, etc to get rid of these Device Settings. That won’t affect the devies already exposed; it’s more like an “auto-expose new lights” settings.

aschmidt74 commented 2 years ago

thank you once more for your support and explanation! the whole plugin works like a charm - once its enabled properly ✅