skydiver / ewelink-api

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

Unable to use power consumption with sonoff POW Elite #217

Open Danny24 opened 1 year ago

Danny24 commented 1 year ago

Hi,

I am trying to use my sonoff POW Elite (Powr316d) with the API to recover the power consumption from a Raspberry Pi. But it fails, it says: "error: 404, msg: 'No power usage data found'" However all the other options in the API works well, I can eve toggle the device ON state. This same code works just fine with a sonoff POW R3. And I can see the data correctly in the app and in the web browser. So I think is something related to the device or the API, not my code. Can you help me make this work? Or at least give me an alternative way to archive this?

Greetings!

baugp commented 9 months ago

I patched it, check my fork https://github.com/baugp/ewelink-api

Danny24 commented 9 months ago

Thanks a lot, I will check it out and give feedback :)

Danny24 commented 9 months ago

Dumb question, how I can test this change since there is no new release available?

baugp commented 9 months ago

npm uninstall ewelink-api npm install https://github.com/baugp/ewelink-api

Danny24 commented 9 months ago

Thanks, I will test it on the weekend and give feedback.

Danny24 commented 9 months ago

Thanks :)

I uninstalled the original one and installed the one you told me.

I have been trying over the weekend, but the problem persist. It still says "{ error: 404, msg: 'No power usage data found' }" when using the sonoff pow elite. With the sonoff pow r3 it works just nice.

getDevice('sonoff_id') works fine but getDevicePowerUsage('sonoff_id',true) returns error 404.