ebaauw / homebridge-deconz

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

api error 1: unauthorized user #50

Closed pdenissen closed 2 years ago

pdenissen commented 2 years ago

Hi @ebaauw ,

I'm trying to setup my Raspbee II in Homebridge. With some struggles I have my Raspbee working and I'm able to add switches and lights in the Phoscon GUI. So that's great.

Now I'm trying to connect the "Homebridge Deconz" plugin but somehow I'm not getting it connected to the API. In the log console I'm getting the error: [deCONZ] Phoscon-GW: warning: request 14: api error 1: unauthorized user

My config looks like this:

{
    "name": "deCONZ",
    "hosts": [
        "192.168.68.114:4530"
    ],
    "platform": "deCONZ"
}

I'm not sure how or where to set "Expose". (Set Expose on the Gateway Settings service of the gateway accessory to retry obtaining an API key) How does this work?

I hope you can help me out on this.

Thank you very much.

ebaauw commented 2 years ago

The message is weird, in that it would occur only if Homebridge deCONZ uses an old API key (user) that has since been removed from deCONZ.

You need to look at the Gateway accessory in a decent HomeKit app, like Eve. 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.

pdenissen commented 2 years ago

Hi @ebaauw ,

Yes, that works! I have installed the Eve app on my phone and unset the Expose option. After a few minutes I enabled all Expose options in the Eve app. After a minute or what Homebridge starting to obtain the API keys.

Thanks a lot for your help! Keep up the good work!