Calculation of mean energy consumption for an given time range

Hey there,

since a whole year I’m collecting Energy Data of our house in an influxDB. In Grafana I’m using InfluxQL for query the data and everything works fine.

My problem is, that I want to query the typical enery consumption of the day by aggregate the data in one graph. The Time axis should be from 00:00 to 24:00. For the selected time range the Data axis should show the graph of the addition of the data in this period divided by the number of days selected by the time range.
I currently have trouble to say Grafana to do this operation. In my researches about this, I learned, that there could be a challenge with the unix timestamp.

I would be pretty happy if anyone could give me an hint to do this.

Hi @markusbuecher97 and welcome to the Grafana forum.

What you describe is possible, but I only know how to do it using Flux (not InfluxQL). Are you willing to perhaps set up a test system that you could configure with Flux and try it out there? Not sure how many other queries you have built over the past year (and thus how complicated converting everything would be).

Here is the query for how to select the number of days in the time range: