howanghk / homebridge-ewelink

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

An error was encountered while requesting a list of devices #3

Closed JacVid closed 5 years ago

JacVid commented 5 years ago

Hello and thanks for your job on eWelink devices.

I'm facing issue while configuring my device with your plugin.

Here are the logs I have:

[1/6/2019, 9:59:19 AM] [eWeLink] A total of [0] accessories were loaded from the local cache [1/6/2019, 9:59:19 AM] [eWeLink] Sending login request with user credentials: {"phoneNumber":"+33XXXXXXX","password":"XXXXXXXXXXXX","version":"6","ts":"1546768759","nonce":"154676875971700","appid":"XXXXXXXXXXXXXXXXXXXXXXXX","imei":"XXXXXXXXXXX","os":"iOS","model":"iPhone10,6","romVersion":"11.1.2","appVersion":"3.5.3"} [1/6/2019, 9:59:19 AM] [eWeLink] Login signature: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX [1/6/2019, 9:59:21 AM] [eWeLink] Server did not response with an authentication token. Response was [{"error":404,"info":"user global getis not exit"}] [1/6/2019, 9:59:21 AM] [eWeLink] Requesting a list of devices from eWeLink HTTPS API at [https://us-api.coolkit.cc:8080] [1/6/2019, 9:59:22 AM] [eWeLink] An error was encountered while requesting a list of devices. Response was [{"error":401}]

Any idea of what i've mistaken ?

Best regards.

howanghk commented 5 years ago

Hi, it seems the plugin cannot authenticate with the phone number and password you provided. The phone number should be all digits without space and symbols. If you are sure you have input the correct phone number and it still not work for you, try setting apiHost to eu in your config:

"apiHost": "eu-api.coolkit.cc:8080"
JacVid commented 5 years ago

Hello,

thanks for your help.

I tried without the "+" in the phone number and I add the URL you gave me, but it doesn't help...

Here are the logs...

[1/6/2019, 11:25:26 AM] [eWeLink] A total of [0] accessories were loaded from the local cache [1/6/2019, 11:25:26 AM] [eWeLink] Sending login request with user credentials: {"phoneNumber":"33XXXXXXX","password":"XXXXXXXXXXXX","version":"6","ts":"1546768759","nonce":"154676875971700","appid":"XXXXXXXXXXXXXXXXXXXXXXXX","imei":"XXXXXXXXXXX","os":"iOS","model":"iPhone10,6","romVersion":"11.1.2","appVersion":"3.5.3"} [1/6/2019, 11:25:26 AM] [eWeLink] Login signature: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX [1/6/2019, 11:25:27 AM] [eWeLink] Server did not response with an authentication token. Response was [{"error":400,"info":"msg is not complete"}] [1/6/2019, 11:25:27 AM] [eWeLink] Requesting a list of devices from eWeLink HTTPS API at [https://eu-api.coolkit.cc:8080] [1/6/2019, 11:25:27 AM] [eWeLink] An error was encountered while requesting a list of devices. Response was [{"error":401}]

howanghk commented 5 years ago

Hi JacVid,

The + and country code is necessary.

In case the phone number in your country may or may not contains a "0" prefix, use it. It seems the phone number in France should be 10 digit long, and the phone number provided in your log only contains 7 Xs. It should be +330xxxxxxxxx.

JacVid commented 5 years ago

Thanks for your help.

with "+33XXXXXXXXX" or "0XXXXXXXXX" I have the same problem.

Regarding the URL:

https://eu-api.coolkit.cc:8080 or https://us-api.coolkit.cc:8080 doesn't change anything.

I'm so sad not be able to drive my device which works perfectly with the APP on the iphone and with Alexa...

howanghk commented 5 years ago

Hi JacVid,

Please double check if you use phone number or email to login the ewelink app.

I did some google search and it seems only email login is supported in Europe version of the eWeLink app? However I am not an european citizen and I cannot confirm that.

JacVid commented 5 years ago

Hello,

Yes, you are right, I logged in eWelink with my email. So do I need to change something in the config file ?

howanghk commented 5 years ago

Hi JacVid,

If that is the case, please make sure no phoneNumber included in the config, only put your email there, like this:

        {
            "platform" : "eWeLink",
            "name" : "eWeLink",
            "email" : "your-login@email.com",
            "password" : "your-login-password",
            "imei" : "01234567-89AB-CDEF-0123-456789ABCDEF"
        }
JacVid commented 5 years ago

Ok let me try :)

JacVid commented 5 years ago

Thanks a lot, now it works fine !

I'm very grateful !

howanghk commented 5 years ago

Good to know. Have fun with your new HomeKit integration!