I have the value of my Electricity counter (kWh) in a series.
Now, I’d like to show in a pie-chart the power consumed over $__interval.
With a fixed time of -say- a day, this query works:
SELECT max(“value”)-min(“value”) FROM “eg.Wohnzimmer.Hauptlicht.Verbrauch” WHERE $timeFilter GROUP BY time(1d) fill(previous)
But when using
SELECT max(“value”)-min(“value”) FROM “eg.Wohnzimmer.Hauptlicht.Verbrauch” WHERE $timeFilter GROUP BY time($__interval) fill(previous)
I get a way to small value (0.67 vs expected ~5). When formating as a timeseries, I can see that my query does not create one value, but many values (differences)
the derivative would have the Unit kW. That is the Power. I want the work (kWh).
Thus, I do not need a derivative or an Integral (latter I would need if I had the Power and would want the Work, and that is what I always find when searching).
I just need the difference of my counter at the beginning of the interval and the end of the interval.