I have a template sensor that measures the monetary value of power consumption in EUR/h, based on the current rates, and an integration sensor to convert that to EUR on the energy bill.
In this graph I see two short periods of power consumption. I’d say the integral increases way too much while the second one seems more realistic. (Didn’t check the exact value.) Also, the value seems to increase even before the power peak ends.
What happens here? My guess would be that the sample frequency of the Rieman sensor is too low. Any other thoughts or how to change this?
Thanks, I changed the method to “left”. I had read that comment in the docs but didn’t understand why. Let me try to explain what happens. When a sensor value does not change, it is not updated, and does not trigger an update of the integral. Therefore, when it finally changes, the previous data point is actually the previous data point that was different, and the trapezoid is calculated over a longer period, yielding a large area. That explains why the first peak in power causes a large increase in energy, while the second peak doesn’t. It also explains why the increase occurs at the beginning of the peak. The graph visualization actually corresponds to the “left” method.