Statistics Graph just keeps going up!

Hi! I’ve got a few Utility meters, based on Energy consumption from both an Efergy Engage device, and my Solar Inverter.
The Utility Meters work perfectly, counting perfectly and resetting perfectly as they should (daily, weekly etc).

The problem is when I put them in a Statistics graph they just increase forever, and the line just goes up and up and never resets.
Any idea what I am doing wrong?

Here’s one of the meters:

state_class: total_increasing
last_reset: '2021-09-03T14:00:00.003126+00:00'
source: sensor.energy_consumed
status: collecting
last_period: '16.07'
meter_period: daily
tariff: peak
unit_of_measurement: kWh
friendly_name: daily_energy_consumed peak
icon: mdi:counter
device_class: energy

Are you using sum rather than mean in the statistics graph config?

Yes I’m using Sum. If I use Mean it is blank…

You know what sum means right?

“Add”, which is what you are seeing. The values keep adding up.

So your real issue is that the graph is blank when you use mean.

Try waiting a bit as it probably needs to collect samples to calculate the mean.

Yes I do know what Sum means. Mean has always been blank, so Sum was the only option which showed anything.

The problem is your utility meters have the state_class total_increasing rather than measurement.

You can only use mean statistics for sensors with the state_class measurement.

Do not attempt to change the utility meter state_class or you will stuff up the energy panel.

I actually noticed that just after I posted it. That was applied in the last update as I didn’t see it earlier.
I just changed it, but changed it back after you said it will break the energy panel.

So I guess that’s the answer - either use the energy panel, or change the state_class to measurement.
Maybe I could also create a duplicate sensor and have both.

Thanks for your help, your replies were almost literally instant.

Yeah the statistics graph cant work in each mode for every sensor.

Creating a template sensor would be a way around this.