Iam very new to influxdb with flux lang so i have trouble to get the right syntax and hope somebody can help.
So, what i want to do is to calculate the total energy production over a day from my PV, the start of producing energy is in the morning (see attached raw data) after sunrise and end at sunset.
(starts with a 0 value (no sun) and grows up over the day, and than in the afternoon it goes down to zero at sunset), and at the end i will build it up in a bar chart for a month so that i can see what i have produced per day over a month
the problem is that the data stored in the database at every change is the total produced at this moment, so i cannot sum up all values. (see raw data)
I think what i need is to calculate the difference over the day or cumulative sum (i don’t know)
so here are the raw data from a simple query
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == “SenecEnergyProduction”)
|> filter(fn: (r) => r["_field"] == “value”)
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|> yield(name: “mean”)
and the raw data output
i hope you understand what i want to do, and somebody can helb me