sorry if this has been answered before, I tried to search, but I’m a newbie with InfluxDB2 and Flux.
I receive cumulative kwH readings from my house energy meter which gets the total power consumption in kWh every 2 minutes.In a simple historical graph this looks like this:
My goal is to split the readings into timed chunks, e.g. to have a bar chart which shows how much kWh were consumed over the last day for every hour (1 bar per hour). So basically I need kWH_total reading at the end of hour - kWH_Total reading at the beginning of the hour.
From reading the forums here I understood the spread function does what I am looking for. I created the following flux script which does the hourly splits, but does not provide me the mentioned difference but probably the count of measures in this timeframe. Any idea what I’m doing wrong?
edit: ok, I just learned there are no Bar Charts in InfluxDB2 and I tried to misuse a Histogram which is probably not possible. Will try in Grafana