skydiver / ewelink-api

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

Error power usage data not found. #165

Open o-SAM-a-98 opened 2 years ago

o-SAM-a-98 commented 2 years ago

Hi, I have been using this API with my device, the Sonoff POW. All the other functions work supported by this device work, like for example toggling function and the status function. My issue is that when I request power usage data from the device I get nothing.
this is what i get { error: 'No power usage data found' } keeping in mind that i have the latest firmware installed.

Any assistance with this issue will be greatly appreciated. Regards, Sam

Inflames1981 commented 2 years ago

Good day Sam,

Did you find a solution to the issue? I'm having the same problem on my Sonoff POW R2 devices.

whizyrel commented 2 years ago

Me too

sean-trace commented 2 years ago

A fix for this would be great!

bartwell commented 2 years ago

Here is a solution: https://github.com/skydiver/ewelink-api/issues/133#issue-775436153

baugp commented 2 years ago

I followed https://github.com/skydiver/ewelink-api/issues/133 and got it to work most of the time. I found a bug in DevicePowerUsageRaw.get() that it cannot handle multiple websocket responses which occur sometimes. Below are changes that I made to fix it. With this, it works 100% of the time for me.