Convert total consumption to day, month, year

Hi

I’m using Home Assistant and I’m new to Grafana (V.7.3.2) and influxdb (V.4.3.0)

I have my electricity meter where I have my total consumption as a unit. so this device does not make sense as it just rises

I want a graph showing consumption per. hour, day, month, year.

Can anyone help me with this?

Welcome to the Grafana forum.

What you describe is certainly possible, but let’s first clarify that you want to use the “time picker” in the upper right (Last 15 min, Last 7 days, Previous Month, etc.), so that you get just one single value for the total consumption over the chosen time period?

If yes, then you probably want a Stat panel that looks something like this, correct?
image

Hi

Thanks, it is something like that I want, but is the graf starting from 0 in the selected period?

I don’t want the graf to start from the total value from that given point.

You are almost there.

Here is what the Stat Panel graph looks like over the Last 3 hours view using the Last choice in the calculation dropdown on the right. 180 kW is the most recent power consumption value.

When you change the dropdown on the right to Total, you get 11.2 MW, which is the sum of all values over the same 3-hour time window.

If I change the time picker to Last 30 minutes, I get 1.85 MW, which is the total over the last 30 minutes.

Make sense?

Hi
i can not get it to show my consumption over a gived period, it only shows my total consumption

this is my meter in home assistant
Udklip2

this is my meter in influxdb:

It does not appear that you changed the dropdown here to Total. Try that and please report back.

image

Then i get an strange number

In your query SELECT statement, change mean() to Last() and see what changes.

Sorry
I’m not quite sure what you mean, could you send a screenshot?

It didn’t change anything

With Last()

With Mean()

It might be worth flipping the Table View toggle switch at the top of the screen to see your values. I cannot see your Kwh usage per minute or per hour (no labels on the y-axis), but at first glace you have a value of 53652 over 3 hours and 89407 over 6 hours. Do either of these values make sense?

I can’t get any out of this numbers
At 1PM my meter was on 5957kwh and at now at 7PM it is 5972kwh

So I don’t know what those numbers are

1 Like

What does the data look like in table view?

where do I find the table view?

At the top above the graph is a toggle switch

thanks

Try selecting Difference in the Calculation dropdown box on the right:

Hi

It looks like it works with difference👍 Thanks

But how do I make a graf, I can’t find the place to insert difference in time series graf of graf (old)

Glad that gives you the results you want. Please mark the above as Solution.

Now, you state that you want a time series graph, but earlier I asked if you want to use the “time picker” in the upper right (Last 15 min, Last 7 days, Previous Month, etc.), so that you get just one single value for the total consumption over the chosen time period (i.e. a Stat Panel with the Difference in the calculation dropdown)? In the Stat Panel, you can include the Sparkline which shows the trend over the time period (so that you can at least see if it’s rising, falling or staying the same). But I do not see how you can display a time series graph AND display the difference value on the same panel. Have you considered using 2 panels, like this?

I would like to have two panels, so one tells me my total consumption in the given period, and the other gives me a more detailed graf in the given period like you showed in the picture

I just can’t find the way to insert difference in time series graf of graf (old)