graham0/ginlong-wifi

Inverter_tot incorrect

Closed this issue · 1 comments

Have been using this script for a while now, and have made some modifications, including the use of a mysql database.
However, I noticed the inverter_tot to go awry every 6553 kwh...
Problem is that the inverter_tot should not be defined as two but four bytes, starting at offset 71 instead of 73.
The fix:
inverter_tot = 71 # offset 71 & 72 & 73 & 74 total kWh (/10)
...
kwh_total = str(int(hexdata[inverter_tot*2:inverter_tot*2+8],16)/10) # running total kwh from installation

Hi HypnoticYeti,
Thanks for the fix I've updated the project on GitHub.
I have used this script for 5 years now and I didn't realise that the total had gone wrong. I don't use the inverter total, it's inaccurate as it rounds generation down to an integer so any incomplete kWh at the end of the day doesn't get recorded. I use the pulse counter fitted to the generation meter to record a more accurate total generated figure. The inverter figure is 226kWh down after just about 5 years.
I also use MySQL to store the data. I have used some graphing tools and PHP on my web server to visualise the data. you can see it here: https://www.whiteside.me.uk/solar/

Thanks,
Graham0