Entity is using state class 'total_increasing' which is impossible considering device class ('power')

Hello,

i get the following error with a helper which should count the exporting energy from my pv. The unit is Watt.
Error: is using state class ‘total_increasing’ which is impossible considering device class (‘power’)

Any idea o get rid of this error?

The error should list which sensor. Go to Developer Tools → States, find that entity and copy the attribute details from the right hand column and paste them here.

Thanky for your quick answer…

state_class: total_increasing
source: sensor.export_power_3
status: collecting
last_period: 0
last_valid_state: 0
meter_period: daily
cron pattern: 0 0 * * *
last_reset: 2024-04-17T04:42:20.230976+00:00
unit_of_measurement: W
device_class: power
friendly_name: Einspeisung

Hi,
Was there any solution to this? I am getting the same error for a couple of my power sensors.

Power sensors shouldn’t be of type total_increasing — that doesn’t make any sense.

What are you trying to do?

I created a helper, so the power used for the day can be used as an individual device on the energy tab, it works fine.
But with the helper I have no influence of the ‘state_class’ the helper must have done that, so i get these errors in the log.

You’re misunderstanding power and energy. Explain what sensors you have, what they measure and what you are trying to achieve.

Typically, you’ll have a power sensor that continually measures the power draw in Watts. This number will vary up and down. A printer might draw nearly 0W in idle up to perhaps 100W for a busy laser printer.

You can then integrate that sensor over time to measure the energy used over a certain time (daily, perhaps), usually measured in Wh (watt-hours) or kWh (kilowatt-hours).

That energy sensor can be total_increasing: it will continually rise until reset.

As an analogy, think of power as speed and energy as distance. You can measure the distance travelled in a day, but “speed in a day” makes no sense, except as an average speed (which can only be calculated once you know the day’s total distance).

Hi Troon, thank you for your insights. While I do understand the difference between power and energy, my real issue is how to create the appropriate energy sensor from a power sensor, using a helper.
The embarrassing part here, is that My Energy tab was happily working for the individual devices, such as my printer, and others like dishwasher, washing machine, dryer, etc…
And they were working because I had previously, correctly, created ‘integration’ sensors in the configuration.yaml, however I confused myself as I also had similar “attempts” at these sensors in ‘helpers’, it is these helpers, that were making no sense, and I have deleted them… “problem solved”!
However I am still curious as to how to create a riemann sum sensor using a helper in the gui.

1 Like

In the UI go to devices and services > helpers > integral helper

1 Like

I am experiencing a similiar warning:

Entity sensor.solarmanager_monthly_revenue (<class ‘homeassistant.components.utility_meter.sensor.UtilityMeterSensor’>) is using state class ‘total_increasing’ which is impossible considering device class (‘monetary’) it is using; expected None or one of ‘total’; Please update your configuration if your entity is manually configured, otherwise create a bug report

I have the following helpers:

Their Unit is Swiss Francs and they all have a value:

Solarmanager Daily Revenue is a template based sensor which calculates the daily Solar Revenue based on Electricity Export, Import, different Electricity Prices per Time and Day.

The other Revenue Sensors are Utility Meters, each Value based on the one with the smaller Time Unit:

Monthly based on Daily with Reset Cycle every Month
Quarterly based on Monthly with Reset Cycle every Quarter of the Year
Yearly based on Quarter with Reset Cycle every Quarter of the Year
Overall based on Yearly with no Reset Cycle.

The error message says to change the State Classe Total or None, but cannot find the place, where I could do that change…

Any Idea?

Is it maybe a bug, as the error message suggest, since my entity is not manually configured…?!

Same Problem is described here without any solution…

There seems to be an open Bug: device class ('monetary') gives 'total_increasing' error · Issue #115692 · home-assistant/core · GitHub

Your entity is a template sensor manually configured by you.

If you created it through the UI, then go to settings → devices and services → helpers. Scroll to find your template sensor and click it. Then select the gear icon in the window that pops up, select “template options” and then set the state class to total

If you created it in YAML, add state_class: total to the definition.