the one at the top is the power (Watt) used by the garden lights
the one at the bottom is the integration sensor to get the energy (kWh)
The lights were on at midnight and turned off at 6 am. In the energy graph, I see the value raise at 6am and that’s fine.
Then, the lights turned on again tonight at 20:44. You see that in the power graph. But I am really not able to understand why, at the same time, the energy sensor rises, like there was consumption between 6am and 20:44 (while the power sensor reading was 0 the whole period of time!).
You may need to change the method used by the Integration Sensor. The default is trapezoidal and, because of how your light consumes power, you may need to change it to left.
methodstring (Optional, default: trapezoidal)
Riemann sum method to be used. Available methods are trapezoidal, left and right.
Note the comment in the documentation:
In case you have an appliance which produces spikey consumption (like an on/off electrical boiler) you should opt for the left method to get accurate readings.
Th Integration Sensor computes its value when the light’s power changes. That exactly what happened at 06:00 when the power value changed (and decreased to zero).
From the documentation:
The integration sensors is updated upon changes of the source.
My bad, I thougth that “left” was default.
But still it’s not clear why left is suggested for something that produces spikes of consumption, while it’s pretty clear that is better in my case where the consumption is quite “flat”.
Thanks again!
Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. It will help users find answers to similar questions (especially since Energy management was recently added to Home Assistant).