chises / ha-oilfox

HomeAssistant Sensor for Oilfox
29 stars 4 forks source link

possibly incorrect SensorDeviceClass.VOLUME_STORAGE #69

Open Psicrow925 opened 1 week ago

Psicrow925 commented 1 week ago

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

chises commented 1 week ago

Hello @Psicrow925 Thanks for your report. I will check this tomorrow and Monday, but I think you are right. :) I will provide a new version of feedback on Monday!

chises commented 1 week ago

Hello @Psicrow925, sorry for the late response. I think you are right. I will test this some minutes and create a beta release. Please test the release if your issue is fixed. The Beta version will be available this evening!

Edit: new Beta Version available: https://github.com/chises/ha-oilfox/releases/tag/v.1.2.2-beta Update: @Psicrow925 can you check if that beta version fits your needs?:)

Psicrow925 commented 5 days ago

Hello and thank you for your reply.

I have only now had time to test the whole thing.

Apparently the change to your sensor works.

My old helpers still showed this warning, but newly created helpers do not have the problem. so i had to fiddle around a bit to create new helpers and transfer the stats, then delete the old helpers, but now everything seems to be working fine, even without warnings in the log.

thank you very much for your great work.

This can now be closed.