howanghk / homebridge-ewelink

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

Login doesn't work anymore bearer not found #65

Closed caineone79 closed 4 years ago

caineone79 commented 4 years ago

I use a rasperrypi with homebridge to control my devices and have that plugin installed. It worked for a long while but stops working some weeks ago. I found the following line at the log from homebridge:

[2019-12-11 9:13:47 AM] [eWeLink] Server did not response with an authentication token. Response was [{"error":404,"msg":"user is not exit"}] [2019-12-11 9:13:47 AM] [eWeLink] Requesting a list of devices from eWeLink HTTPS API at [https://us-api.coolkit.cc:8080] [2019-12-11 9:13:47 AM] [eWeLink] An error was encountered while requesting a list of devices. Response was [{"error":406,"msg":"{\"error\":401,\"msg\":\"Bearer:accessToken is empty\"}"}]

I tried to login on the EWE App on the smartphone with the same user and password which is configured on homebridge and it works well. So this shouldn't be the issue.

Any ideas how to fix that issue?

Thanks in advance!

howanghk commented 4 years ago

It seems ewelink server now have a new api for resolving user region before login. You can try adding apiHost to config, with one of the following value and see if it works:

us-api.coolkit.cc:8080
eu-api.coolkit.cc:8080
as-api.coolkit.cc:8080
cn-api.coolkit.cc:8080

Like this:

        {
            "platform" : "eWeLink",
            "name" : "eWeLink",
            "apiHost": "eu-api.coolkit.cc:8080",
            "phoneNumber" : "+12345678901",
            "password" : "your-login-password",
            "imei" : "01234567-89AB-CDEF-0123-456789ABCDEF"
        }
caineone79 commented 4 years ago

Thanks for that fast response. Yes, with the additional line it works again very well. Thank you so much.

From: Wong Ho Wang notifications@github.com Reply to: howanghk/homebridge-ewelink reply@reply.github.com Date: Wednesday, 11. December 2019 at 09:58 To: howanghk/homebridge-ewelink homebridge-ewelink@noreply.github.com Cc: Marko Beyer mail@marko-beyer.com, Author author@noreply.github.com Subject: Re: [howanghk/homebridge-ewelink] Login doesn't work anymore bearer not found (#65)

It seems ewelink server now have a new api for resolving user region before login. You can try adding apiHost to config, with one of the following value and see if it works: us-api.coolkit.cc:8080 eu-api.coolkit.cc:8080 as-api.coolkit.cc:8080 cn-api.coolkit.cc:8080 Like this:         {             "platform" : "eWeLink",             "name" : "eWeLink",             "apiHost": "eu-api.coolkit.cc:8080",             "phoneNumber" : "+12345678901",             "password" : "your-login-password",             "imei" : "01234567-89AB-CDEF-0123-456789ABCDEF"         } — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

howanghk commented 4 years ago

Thanks for confirming connecting to the correct regional api works.