jeanmarc77 / 123solar

123Solar is a lightweight set of PHP/JS files that makes a web logger to monitor your photovoltaic inverter(s). It just need a web server and PHP, no databases are even needed. The philosophy is: To keep it simple, fast, with a low foot print to run on cheap and low powered devices.
GNU General Public License v3.0
36 stars 12 forks source link

Update mi600-webif.php #28

Closed soe135 closed 1 year ago

soe135 commented 1 year ago

After a few days of production we face the problem that our calculated KWHT-value shows a positive drift compared to the (real) stored KWHT-value in the inverter. This problem results from rounding problems by the smaller number of decimal places of the value KWKT in the webif of the inverter. To solve this problem I implemented a self learning correction factor wich allows us a slightly reduce of our calculated KWHT-value over a longer time range to eleminate this positve drift. So should the calculated KWHT-value gradually approach the real value stored in the inverter over this longer time range. Based on the proposal of jeanmarc77 the location of the files 'mi600.log', 'mi600.dat' and 'lastKWHtotal.dat' was now moved from the data-directory of the inverter to the sub-directory 'errors'. If you have already used the 123solar app before the application of this patch you have to move the the file 'lastKWHtotal.dat' manually from inverters data-directory to the 'errors'-subdirectory before you restart 123solar again! If you don't do this file movement step first it could be that the recent KWHT-value is now initially read from the WebIf of the inverter. Maybe the value from inverters WebIf could be lower than the value in the original file 'lastKWHtotal.dat'. In this case you can be faced with some distortions in showing the power-graph on the index page of 123solar.