howanghk / homebridge-ewelink

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

[eWeLink] An error was encountered while requesting a list of devices while interrogating power status. Verify your configuration options. Response was [{"error":400,"msg":"params incomplete"}] #63

Closed migabc closed 4 years ago

migabc commented 4 years ago

Hi,

Today I started getting this error which causes homebridge to crash

Nov 28 20:42:50 raspberrypi homebridge[12796]: [11/28/2019, 8:42:50 PM] [eWeLink] An error was encountered while requesting a list of devices while interrogating power status. Verify your configuration options. Response was [{"error":400,"msg":"params incomplete"}] Nov 28 20:42:50 raspberrypi homebridge[12796]: [11/28/2019, 8:42:50 PM] TypeError: body.filter is not a function Nov 28 20:42:50 raspberrypi homebridge[12796]: at /usr/lib/node_modules/homebridge-ewelink/index.js:364:37 Nov 28 20:42:50 raspberrypi homebridge[12796]: at Object.parseBody (/usr/lib/node_modules/homebridge-ewelink/node_modules/request-json/main.js:74:12) Nov 28 20:42:50 raspberrypi homebridge[12796]: at Request._callback (/usr/lib/node_modules/homebridge-ewelink/node_modules/request-json/main.js:148:26) Nov 28 20:42:50 raspberrypi homebridge[12796]: at Request.self.callback (/usr/lib/node_modules/homebridge-ewelink/node_modules/request/request.js:187:22) Nov 28 20:42:50 raspberrypi homebridge[12796]: at Request.emit (events.js:193:13) Nov 28 20:42:50 raspberrypi homebridge[12796]: at Request.<anonymous> (/usr/lib/node_modules/homebridge-ewelink/node_modules/request/request.js:1044:10) Nov 28 20:42:50 raspberrypi homebridge[12796]: at Request.emit (events.js:193:13) Nov 28 20:42:50 raspberrypi homebridge[12796]: at IncomingMessage.<anonymous> (/usr/lib/node_modules/homebridge-ewelink/node_modules/request/request.js:965:12) Nov 28 20:42:50 raspberrypi homebridge[12796]: at IncomingMessage.emit (events.js:198:15) Nov 28 20:42:50 raspberrypi homebridge[12796]: at endReadableNT (_stream_readable.js:1139:12) Nov 28 20:42:50 raspberrypi homebridge[12796]: at processTicksAndRejections (internal/process/task_queues.js:81:17) Nov 28 20:42:50 raspberrypi homebridge[12796]: [11/28/2019, 8:42:50 PM] Got SIGTERM, shutting down Homebridge... Nov 28 20:42:55 raspberrypi systemd[1]: homebridge.service: main process exited, code=exited, status=143/n/a

Has the protocol changed on the server side?

Thanks, Miguel

ssessa commented 4 years ago

Hi, @migabc. I'm seeing the same error, however my homebridge does not crash but, I get No Response for all my accessories..

rob0101 commented 4 years ago

Same issue here :-(

robsonfj commented 4 years ago

Updating to the latest version fixed for me...

ssessa commented 4 years ago

Updating to the latest version fixed for me...

I'm on v0.1.17 and no luck...

rob0101 commented 4 years ago

Updating to the latest version fixed for me...

Tried that with no success. What api server does your log say you are connecting to ? (mine defaults to us no matter what I try to override it with)

thanks.

rob0101 commented 4 years ago

I found another ewelink api project that seemed to face the same issue and they fixed it a few weeks ago.

https://github.com/skydiver/ewelink-api/issues/21

I've tried to figure out what they did relative to how this project work, but had no luck. @howanghk you may have more luck.

Also, since that project is so active, maybe it'd be worth making their API a dependancy to simplify homebridge-ewelink-max

migabc commented 4 years ago

Upgraded to lastest version. Problem solved Great plug-in Thanks

ssessa commented 4 years ago

Upgraded to lastest version. Problem solved Great plug-in Thanks

Same here, has been working fine since yesterday.

Maybe it was someting on the ewelink services...

howanghk commented 4 years ago

I found another ewelink api project that seemed to face the same issue and they fixed it a few weeks ago.

skydiver/ewelink-api#21

I've tried to figure out what they did relative to how this project work, but had no luck. @howanghk you may have more luck.

Also, since that project is so active, maybe it'd be worth making their API a dependancy to simplify homebridge-ewelink-max

Hi @rob0101, the changes on ewelink-api you've mentioned above is basically the same as the fix provided by maxmacstn in https://github.com/howanghk/homebridge-ewelink/pull/49 , which have been merged and released as of version 0.1.16.

coreybx commented 4 years ago

same error here too. tried updating, it worked again, but then stopped working

Shadowphax commented 4 years ago

Same here .. not working.

manosioa commented 4 years ago

hi, have the exact same problem since this morning. Dont have a clue how to fix this @howanghk

howanghk commented 4 years ago

This may be related to ewelink server now have a new api for resolving user region before login. I am working on a new version that supports the new region resolving API. In the meantime, please 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"
        }
chrisr45 commented 4 years ago

getting the following error [2019-12-22 15:44:07] [eWeLink] Requesting power state for [Eric] [2019-12-22 15:44:08] [eWeLink] An error was encountered while requesting a list of devices while interrogating power status. Verify your configuration options. Response was [{"error":400,"msg":"params incomplete"}]

with this config { "platform" : "eWeLink", "name" : "eWeLink", "countryCode" : "61", "email" : "xxx@xx.com", "password" : "*****", "imei" : "C00A2142-B245-4276-885F-5A21210DAEEA" },

howanghk commented 4 years ago

This should be a server-side stability problem of ewelink. We have not receive "params incomplete" reports for few months. I consider this issue is fixed for now. If it happen again please open another issue.