howanghk / homebridge-ewelink

Homebridge plugin to control Sonoff relays with OEM firmware
MIT License
81 stars 46 forks source link

Bearer:accessToken is empty #69

Closed manosioa closed 4 years ago

manosioa commented 4 years ago

Hi, Since this morning i cannot control my sonoff devices.

I searched a bit and from the log i found the following

[eWeLink] An error was encountered while requesting a list of devices while interrogating power status. Verify your configuration options. Response was [{"error":406,"msg":"{\"error\":401,\"msg\":\"Bearer:accessToken is empty\"}"}]

Any thoughts on that?

BR

manosioa commented 4 years ago

So I tried to add "apiHost": "us -api.coolkit.cc:8080", mentioned here And it work as it did for many people having this problem. You should add it to your readme file.

howanghk commented 4 years ago

Hi @manosioa, I am aware of the recent eWeLink API changes on region selection, and a new version is already in the works, still figuring out how to properly sign the request.

manosioa commented 4 years ago

oh ok great! if you need anything to test im avail

howanghk commented 4 years ago

I've added code for resolving server region before performing login. Please update to the latest version (0.1.19) and refer to the README on how to add countryCode to config for this new feature to work.

Gio1978 commented 4 years ago

I have added contrycode, but it not works.

howanghk commented 4 years ago

@Gio1978 saying "not work" didn't help. Please, at least post your homebridge logs.

Gio1978 commented 4 years ago

[2019-12-21 23:10:28] [eWeLink] WebSocket messge received: {"error":400,"reason":"Bad Request","apikey":"0b6c1fa0-2446-4cd6-8291-3b29f2e1a919","sequence":"1576955428055","actionName":"userOnline"}

howanghk commented 4 years ago

@Gio1978 As you can see, your log does not include the error message for this issue: "Bearer:accessToken is empty". The error you're experiencing is not related to this issue at all. You may want to look at issue 67 instead.