Sorry for replying to myself, but couldn’t see how to edit my post.
Just wanted to mention that I had seen Migrate query to calculate energy (kWh) - #29 by pawelgl (and others to import timezone), but i think its not supported in 1.8x. At least its not working. So if anyone has a neat trick to do that on top of the double aggregation…
Since i saw the timezone comment I o/c also saw the idea to use integral, but that is a solution to calculate power usage based on a difference of totals (ever increasing consumption counter) vs my goal to sum up current power draw averages/sums over time…
I could do the same o/c but i don’t have the historical data of the energy counter (in the correct format / database) while i do have the historical consumption (+ solar generation), at both high level (total) and also (some) device levels, so its much nicer data although its more difficult to display (since I will have to dynamically sum up 2 years of data in the extreme case, but its fine to wait a few secs for these dashboards).