It would be useful if integrations were allowed to add helper entities per default.
Eg. if an API of a solar inverter don’t provide applicable values for use in the energy panel a “template entity” (can be solved by python calculation in the integration code, not templates per se) providing the needed state should be added by default - instead of having users reach for template entities manually (and thus learning the syntax).
Thinking about it, Riemann sum is probably a bad usecase. If there are downtimes (HA, the integrated device or anything inbetween) we would generate wrong values and it would not be obvious to a user
Any kind of values are wrong when HA is down and your sensor doesn’t accumulate the usage (kWh) itself but gives only instantaneous values like W. You either don’t count that time at all or you interpolate. Of course this behavior should be well documented.