Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the power reading on SP2 #69

Open
mitjaromih opened this issue Jan 7, 2021 · 1 comment
Open

the power reading on SP2 #69

mitjaromih opened this issue Jan 7, 2021 · 1 comment

Comments

@mitjaromih
Copy link

the power reading on SP2 in "contrib-broadlink-controlne" does not work except sp3s this works. In this "contrib-broadlink" it works SP2 but it doesn't work SP3s. So I would ask you if you can arrange for SP2 to work in "contrib-broadlink-controlne"

@molodec100
Copy link

molodec100 commented Apr 9, 2022

I made changes in SP2.js

WAS

case 0x08:
                   if (Number.isInteger(payload[7])) //possible fix for issue #7
                   {
                       this.emit("energy", { energy: (payload[7] * 256 + payload[6]) + payload[5] / 100.0}); 
                   }
                   else
                   {
                       this.emit("energy", { energy: (payload[7].charCodeAt(0) * 256 + payload[6].charCodeAt(0)) + payload[5].charCodeAt(0) / 100.0}); 
                   }
                   break;

NOW

case 0x08:
                  this.emit("energy", { energy:  (payload[7].toString(16)+ payload[6].toString(16)+payload[5].toString(16))/100});
                  break;

Now the SP3S shows a power similar to the readings from IHS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants