britkat1980 / giv_tcp

TCP connection (from inverter) and MQTT implementation
71 stars 32 forks source link

fix scaling of I_PV* and I_AC #180

Open divenal opened 2 months ago

divenal commented 2 months ago

Sorry, I prepared this a while back, but never got round to creating a pull request. Things have probably moved on a bit sinse then, but I'm sure you'll be able to find the relevant code. (Didn't really matter before, but if we're to be consolodating on a modbus library, better to get it right.)

The modbus code was using the wrong scaling factor for input registers I_PV1, I_PV2 and I_AC - should be DECI rather than CENTI, since the raw register appears to be in units of 0.1A

givtcp was compensating by multiplying the I_PV values received by 10. Better to fix it in the underlying library than in the client code.