Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HA warning: Entity is using state class 'total_increasing' which is impossible considering device class ('monetary') it is using #304

Open
twpol opened this issue Feb 2, 2023 · 6 comments · May be fixed by #340
Labels
bug Something isn't working

Comments

@twpol
Copy link

twpol commented Feb 2, 2023

Describe the bug
Since upgrading Home Assistant to 2023.2, it now logs this warning about both "cost today" sensors

To Reproduce
Steps to reproduce the behaviour:

  1. Run Home Assistant 2023.2
  2. Use this integration (Hildebrand Glow (DCC))
  3. Go to Settings > System > Logs
  4. See warning

Expected behaviour
No warning from Home Assistant when using this integration

Screenshots

Logger: homeassistant.components.sensor
Source: components/sensor/__init__.py:503
Integration: Sensor (documentation, issues)
First occurred: 1 February 2023 at 21:17:53 (2 occurrences)
Last logged: 1 February 2023 at 21:17:53

Entity sensor.electric_cost_today (<class 'custom_components.hildebrandglow_dcc.sensor.Cost'>) is using state class 'total_increasing' which is impossible considering device class ('monetary') it is using; Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author.
Entity sensor.gas_cost_today (<class 'custom_components.hildebrandglow_dcc.sensor.Cost'>) is using state class 'total_increasing' which is impossible considering device class ('monetary') it is using; Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author.

Version
Hildebrand Glow (DCC) Integration v1.0.3
Home Assistant 2023.2.0
Supervisor 2023.01.1
Operating System 9.5
Frontend 20230201.0 - latest

Debug log
Does not seem relevant here

Additional context
Add any other context about the problem here.

@twpol twpol added the bug Something isn't working label Feb 2, 2023
@MadGodNerevar
Copy link

i would like to mention that i got a similar issue

Logger: homeassistant.components.sensor
Source: components/sensor/init.py:503
Integration: Sensor (documentation, issues)
First occurred: 17:37:02 (1 occurrences)
Last logged: 17:37:02

Entity sensor.dcc_sourced_smart_electricity_meter_cost_today (<class 'custom_components.hildebrandglow_dcc.sensor.Cost'>) is using state class 'total_increasing' which is impossible considering device class ('monetary') it is using; Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author.

@Scoff123
Copy link

Scoff123 commented Feb 2, 2023

Yes also seeing this as soon as I updated to Home Assistant 2023.2:

Entity sensor.electric_cost_today (<class 'custom_components.hildebrandglow_dcc.sensor.Cost'>) is using state class 'total_increasing' which is impossible considering device class ('monetary') it is using

@HandyHat
Copy link
Owner

HandyHat commented Feb 2, 2023

I'm looking into this - for the moment it should be safe to just ignore this

@rupisaini
Copy link

rupisaini commented May 4, 2023

I manage to fix the warning my changing

    _attr_state_class = SensorStateClass.TOTAL_INCREASING

to

    _attr_state_class = SensorStateClass.TOTAL

Code where I changed it

class Cost(SensorEntity):
    """Sensor usage for daily cost."""

    _attr_device_class = SensorDeviceClass.MONETARY
    _attr_has_entity_name = True
    _attr_name = "Cost (today)"
    _attr_native_unit_of_measurement = "GBP"
    _attr_state_class = SensorStateClass.TOTAL
    _attr_state_class = SensorStateClass.TOTAL
    _attr_last_reset = None # setting this value when we get reading

@cannfoddr
Copy link

I just installed today and am getting the same error, Has the above PR been merged?

@Scoff123
Copy link

Scoff123 commented Jan 5, 2024

@HandyHat Hi, is there any progress with this PR being merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants