ebaauw / homebridge-deconz

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

request 1: /: api error 1: unauthorized user #209

Closed qwertz2021 closed 9 months ago

qwertz2021 commented 9 months ago

Hello guys,

following situation:

Now I get these message:

[04/02/2024, 13:37:30] [deCONZ] Phoscon.gateway: request 1: GET / [04/02/2024, 13:37:30] [deCONZ] Phoscon.gateway: warning: request 1: /: api error 1: unauthorized user [04/02/2024, 13:37:30] [deCONZ] 1 gateways [04/02/2024, 13:37:30] [deCONZ] created debug dump file /var/lib/homebridge/homebridge-deconz.json.gz

No devices are visible in the homebridge ui and in Apple Home but I can see them in the Phoscon App.

Any ideas to fix this unauthorized user issue?

qwertz2021 commented 9 months ago

Add: I seen this thread but I don't know, what's to do in the Eve App: https://github.com/ebaauw/homebridge-deconz/issues/50

Best unset Expose (that should clear the old API key), and, after a half a minute or so, set it again. Homebridge deCONZ will ask you (in the log) to unlock the gateway, so it can obtain a new API key.

What means "Expose"?

qwertz2021 commented 9 months ago

There is no "Expose" Option in the Eve app:

IMG_9276

ebaauw commented 9 months ago

Looks like you backed up/restored Homebridge deCONZ, but not deCONZ itself. The (restored) API key that Homebridge deCONZ used for the previous deCONZ installation is not known to the new deCONZ installation. Indeed, the remedy is to un-expose the gateway, and re-expose it, so Homebridge deCONZ will forget the restored API key and request a new one.

Dynamic settings are now exposed through a separate API, rather than through HomeKit, see https://github.com/ebaauw/homebridge-deconz/wiki/Dynamic-Configuration. See https://github.com/ebaauw/homebridge-deconz/wiki/Dynamic-Configuration#example-6 how to un-expose the gateway.

qwertz2021 commented 9 months ago

@ebaauw

Thanks for your explanation.

Solved with

ui -D put / ‚{“expose“: false}‘
ui -D put / ‚{“expose“: true}‘

...Conbee2 "App verbinden"/restart Homebridge -> et voilà

Thread can be closed.

qwertz2021 commented 9 months ago

One question left.

Looks like you backed up/restored Homebridge deCONZ, but not deCONZ itself. The (restored) API key that Homebridge deCONZ used for the previous deCONZ installation is not known to the new deCONZ installation.

For the next time: The homebridge backup does not include the deCONZ part. How can I backup the API key from my new deCONZ installation or is this not needed?

ebaauw commented 9 months ago

You need to backup and restore deCONZ, through the Phoscon app.

qwertz2021 commented 9 months ago

I had done that, so it's not clear to me why it happened...