Closed jessgade closed 6 years ago
Well this is strange! I just started looking at the problem, and I cannot recreate it, but I saw the problem just a few days ago.
I think I know what is wrong though: If you have lost the connection to one inverter, then the comment in the code tells you what is wrong:
As I read the code, it only sums up on connected inverters, so the code fails at the end of the day, when the first inverter stalls.
Incidentally, your 365 days production looks quite off on on at least one account: You have 7.376, 4.165 kWh in the top screenshot, and 13.930 / 10.718 kWh in the lower screenshot. _If you upgraded the perl script between the two runs I understand, if you did not... I have no idea what is right, though I'd expect the lowest number to be right, but if you have deleted the SQL file between rund, then the system subtracts now with 365 days ago (zero), and you get the system production of all time. Did you delete the SQL file?
BR
Henrik
I've looked a bit further at this. I had the problem reappear even with my little initial code change.
I'm convinced that the problem is that the JSON serialization/deserialization is non-deterministic A sorting mechanism needs to be applied to the perl JSON serialization and a similar sort needs to be in the HTML reading mechanism to ensure that the data is read in the same order.
This would explain why a slight code change would affect the program execution to 'magically' make the data appear correct.
I made an ugly hack where I changed the HTML code to find the Max totalpower and Max totalkwh from the read data and this makes it work again.
EDIT: I cant explain the 365 production data on the first screenshot - I might have deleted the SQL file. :-)
..or the code has been run with one, respectively two inverters connected?
This is still a problem, I has always been there.
Best Regards Peter Lanng
I've downloaded version 0.17 but the webserver only shows the output from one inverter. I'm using a Raspberry Pi Zero W and have two Eversolar TL-3000 inverters. The Combined Energy is also only the contribution from the same inverter and not both.
I examined the Perl code (I have no experience in perl) and made a slight change, since I've noticed that a set of variables are declared but not really used. I changed only the second last line in the following code from :
to:
And to my surprise using the $pac variable made the webserver output work?! The Combined energy also suddenly work despite the fact that the declared variable for this haven't been used.