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.

I have the same issue. I used the UI to create a Utility Meter. Same errors.

I suggest you fix those errors by using the solutions described in this thread.

I didn’t find a solution that applied to my case. For instance, I did not create a Template Helper I created a Utility Meter Helper. I did not create the utility meter with yaml, I used the Utility Meter option in Helpers. No big deal, I can live with the warnings.

Are you getting the same error as the title of the thread?

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

If so,

If not, what error are you getting?

I have the same situation as you. Created a Utility Meter Helper through the UI and get the exact same warnings.

The common mistake is confusing power with energy. Creating a utility meter from a power sensor is nonsensical, hence the warnings.

That would be like creating a utility meter to accumulate readings from a temperature sensor. While HA does have the capability of adding them up and spitting out a value, that value doesn’t make any sense in any logical context.

If you don’t have an energy sensor to reference as an input to your utility meter entity, you need to use an integral helper to convert your power entity to an energy entity.

I’ve read the documentation again, and I would argue the mistake is not confusing power with energy, but rather confusing the utility meter to sum the power to energy. Time is an element in the utility meter too, since it periodically resets.
Considering the utility meter doesn’t do this limits its use, but as you say an integral helper will do.

Utility meter not sum each value, it determines the increments (and for certain sensors also the decrements) of the value. Basically it determines the difference of the value at the start of the cycle and at the end of it. Thinking of it as a sum is what makes it seem like an integral, which it is not.

Yes, you’re right. I shouldn’t be responding to this while I’m focused on something else.

1 Like