Open twpol opened 1 year ago
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.
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
I'm looking into this - for the moment it should be safe to just ignore this
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
I just installed today and am getting the same error, Has the above PR been merged?
@HandyHat Hi, is there any progress with this PR being merged?
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:
Expected behaviour No warning from Home Assistant when using this integration
Screenshots
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.