skydiver / ewelink-api

eWeLink API for JavaScript
https://www.npmjs.com/package/ewelink-api
MIT License
264 stars 108 forks source link

Error 401: Wrong account or password -- again #220

Open nareso opened 11 months ago

nareso commented 11 months ago

I got an Error 401 same as #212 today. https://github.com/skydiver/ewelink-api/issues/212

This error does not occur with sonoff devices but occurs with 4ch products that have the PSF-B04 module when using setDevicePowerState methods.

Is there anyone with the same symptoms?

ghost commented 9 months ago

HI, I think that is not error on my application, I have another application that connect to websocket with the same APP_ID AND APP_SECRET with the old api ewelink-api. ¿may be? I need to created another app en https://dev.ewelink.cc/ , but there is not possible..

It is recommended to share a token or split the devices into two accounts and share them with another account.

apadilla83 commented 9 months ago

HI, I think that is not error on my application, I have another application that connect to websocket with the same APP_ID AND APP_SECRET with the old api ewelink-api. ¿may be? I need to created another app en https://dev.ewelink.cc/ , but there is not possible..

It is recommended to share a token or split the devices into two accounts and share them with another account.

Yes, i will do it thanks

baugp commented 9 months ago

I managed to patch this repo in my fork. It works on my Sonoff S31 plug, but I haven't tested on other devices. I only spent a few hours as I needed to get it to work asap. Therefore, I haven't patched every function, don't expect it to work well on other devices. The changes between v1 and v2 API are minimal. I only patched these:

If you look at the diff, it's not that much. I belive this project can be patched to migrate to v2 API entirely with minimal effort. https://github.com/baugp/ewelink-api/commit/2f4d1b0de3507ab1538c7a1e175e555b0b2fbdd2

majeka commented 8 months ago

I managed to patch this repo in my fork. It works on my Sonoff S31 plug, but I haven't tested on other devices. I only spent a few hours as I needed to get it to work asap. Therefore, I haven't patched every function, don't expect it to work well on other devices. The changes between v1 and v2 API are minimal. I only patched these:

* login

* getDevice

* getDevices

* getDevicePowerState

* setDevicePowerState

* getDevicePowerUsage

If you look at the diff, it's not that much. I belive this project can be patched to migrate to v2 API entirely with minimal effort. baugp@2f4d1b0

Hello! Can you tell me how you made the transition from v1 to v2? It is possible to give example code, etc. Do I understand correctly that changes were made to node-red-contrib-ewelink? or did they transfer everything to HTTP requests?

I managed to get the token, I would like to continue using node-red-contrib-ewelink