Sum over given time period

Unfortunately I couldn’t find a suitable thread for my question.

My electricity consumption meter shows the current consumption (VA) every second.

100
110
109
108
110

My data is in an InfluxDB (1.8).

I would like to determine the total consumption of the set period and display it with the Plugin Stat.

Since the interval changes depending on the period, I need to calculate the value. But how do I do that?

1 hour:

3 hours:

1 Like

Can it really be that my question is so difficult?

I would like to determine the consumption for the displayed/selected period.

Unfortunately, I couldn’t find an example of this on play.grafana.com.

The goal is to display kWh. So if the values are determined every 10 minutes, the values of three hours must first be divided by 3 then by 60 / 10 minutes.

How can I divide the sum like this?

I have a similar issues. Is there any solution?