I have a working installation of HA, which e.g. monitors my solar installation (and counts PV generation, battery load/disload and so on). That works as expected, the values i get are fitting to the ones of the PV manufacturer native tools/apps (Fronius, Solarweb).
I wanted to setup a second installation as test instance in addition, so i started rebuildung some stuff there from scratch, also replicating the PV part as mentioned above.
One day a came over the thing, that the new system calculates different (sum) values, but only for battery load/disload, but not for grid load/consumtion or PV generation (i use rieman sums for all, in both installations).
After some digging in, i found out that on the new system the riemann integration has some jumps in its values. I digged further and it seems, that the difference between both systems is that
- the original system uses integration over the “normal/direct” sensor
- the second system uses integration over a template (which simply returns the value of the “normal/direct” sensor (so it is a kind of wrapper)
Both the sensor values (direct one and templated one) are identical, i downloaded both as CSV and did a diff, the values match (the templated values are ~ microseconds later in timestamp as one would expect).
But the riemann integral over both these sensors sum up to different values, there are some jumps for the templated one within which i canot explain.
After these findings i made a template sensor on the first system and added an integral over that one - the result is the same here, the templated integration value differs also and has these jumps.
Oddly enough, the other sensors (PV generation, grind consumption) are configured the same way on both systems and there are no glitches. I have really no idea what could be the reason.
* "SolarNet Entladeleistung" is the "direct" sensor
* "wrapper_Hausspeicher_entladeleistung..." is the template version of it
* "test_integral...direkt" is the rieman sum of the 1st
* "test_integral...wrapper" is the rieman sim of the 2nd