ewelink-api icon indicating copy to clipboard operation
ewelink-api copied to clipboard

Accessible devices don't appear in getDevices()

Open lachlansleight opened this issue 4 years ago • 7 comments

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

lachlansleight avatar Sep 09 '20 00:09 lachlansleight

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 avatar Oct 12 '20 23:10 skydiver

@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

bwp91 avatar Oct 13 '20 19:10 bwp91

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 avatar Oct 13 '20 19:10 skydiver

@skydiver would be very happy to get more involved with this project if needed

bwp91 avatar Oct 14 '20 18:10 bwp91

Hey @bwp91, of course, help is always welcome

skydiver avatar Oct 18 '20 22:10 skydiver

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.

vdkuil avatar Dec 15 '20 07:12 vdkuil

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.

vdkuil avatar Dec 17 '20 13:12 vdkuil