ewelink-api
ewelink-api copied to clipboard
Accessible devices don't appear in getDevices()
When running getDevices()
, I was receiving an empty array []
. However, if I log into the ewelink app and find the device ID of one of the BLue50 SX1 smart plugs I have and manually put it into getDevice()
it connects successfully and can be controlled.
const connection = new ewelink({
email: '[MY_EMAIL]',
password: '[MY_PASSWORD]',
region: 'us'
});
//this doesn't work, returns an empty array
const devices = await connection.getDevices();
console.log(devices);
//this works, returns the device successfully
const device = await connection.getDevice([KNOWN_DEVICE_ID])
console.log(device);
The advice given in #88 for non-sonoff devices didn't help - I still receive an empty array.
The device firmware is 3.4.1 (current version), and my ewelink app is on v4.4.1
sadly i don't have a non sonoff device to test
you can take a look if this issue helps: https://github.com/skydiver/ewelink-api/issues/88#issuecomment-643574472
if not, hopefully someone can help 🤞
@skydiver may be worth a look at the v2 of the coolkit api? I’ve left a link of the official reference, and a link to my homebridge plugin which uses it. My plugin also works with non-sonoff devices, basically all ewelink devices. HTH :)
https://github.com/CoolKit-Technologies/apiDocs/blob/master/en/APICenterV2.md#api-center
https://github.com/bwp91/homebridge-ewelink/blob/master/lib/eWeLinkHTTP.js
Thank you @bwp91
Definitely i will take a look
I was using this one https://coolkit-technologies.github.io/apiDocs/#/en/PlatformOverview but didn't know there is a version 2
@skydiver would be very happy to get more involved with this project if needed
Hey @bwp91, of course, help is always welcome
I ran into a similar problem, but the devices show up when using [email protected] version. It stopped working after 2.0.1. I don't see many differences in the code though.
Seems like the change required for me was the change of APP_ID and APP_SECRET. Once I changed them back to the old values from ewe-link version 2.0.0 everything seems to work again.