ha-oilfox icon indicating copy to clipboard operation
ha-oilfox copied to clipboard

possibly incorrect SensorDeviceClass.VOLUME_STORAGE

Open Psicrow925 opened this issue 4 months ago • 2 comments

hello and thank you very much for your integration and the work involved :)

unfortunately i have a problem with "usageCounterQuantity"

I have created helpers for daily, weekly, monthly and annual consumption. That's how it works for now. however, i get errors in the log for the helpers i have created, but i can't correct them because the helper receives its values from its output sensor.

here the logs

" Entity sensor.olverbrauch_taglich (<class 'homeassistant.components.utility_meter.sensor.UtilityMeterSensor'>) is using state class 'total_increasing' which is impossible considering device class ('volume_storage') it is using; expected None or one of 'measurement'; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+utility_meter%22 " " Entity sensor.olverbrauch_monatlich (<class 'homeassistant.components.utility_meter.sensor.UtilityMeterSensor'>) is using state class 'total_increasing' which is impossible considering device class ('volume_storage') it is using; expected None or one of 'measurement'; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+utility_meter%22 " " Entity sensor.olverbrauch_jahrlich (<class 'homeassistant.components.utility_meter.sensor.UtilityMeterSensor'>) is using state class 'total_increasing' which is impossible considering device class ('volume_storage') it is using; expected None or one of 'measurement'; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+utility_meter%22 " " Entity sensor.olverbrauch_wochentlich (<class 'homeassistant.components.utility_meter.sensor.UtilityMeterSensor'>) is using state class 'total_increasing' which is impossible considering device class ('volume_storage') it is using; expected None or one of 'measurement'; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+utility_meter%22 " i then looked at your code for the sensor and then read the HA documentation

"usageCounterQuantity": [ "usageCounterQuantity", UnitOfVolume.LITERS, "mdi:barrel-outline", "usageCounterQuantity", SensorDeviceClass.VOLUME_STORAGE, SensorStateClass.TOTAL_INCREASING, ],

is it possible that this sensor may have the wrong device class? Because in principle it is not a fuel gauge or anything like that, but a consumption indicator. so it should be a different device class?

maybe instead of “SensorDeviceClass.VOLUME_STORAGE” this should be the correct value “SensorDeviceClass.VOLUME”.

this from the ha documentation: SensorDeviceClass.VOLUME L, mL, gal, fl. oz., m³, ft³, CCF Generic volume, this device class should be used for sensors representing a consumption, for example the amount of fuel consumed by a vehicle.

Then the helper created should also work without a warning.

I hope this question is not too presumptuous, as i am not a programmer or anything. i was just trying to edit the warnings from the log and came across this question.

wish you a pleasant weekend

Psicrow925 avatar Oct 05 '24 14:10 Psicrow925