Hello,
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)
So, I seem to have differences now between each two datapoints in the interval. I try to sum them up with
SELECT cumulative_sum(max("value")-min("value")) FROM "eg.Wohnzimmer.Hauptlicht.Verbrauch" WHERE $timeFilter GROUP BY time($__interval) fill(previous)
(I tried sum as well)
But that gives me “No data”
So, finally I tried:
SELECT max("value") - min("value") FROM "eg.Wohnzimmer.Hauptlicht.Verbrauch" WHERE $timeFilter
It gives me a value of 4.5
Is this what I want?
Greetings,
Hendrik