PyLoxone: Device_class missing on sensors
As Home Assistant is more and more pressing for the sensors to have correctly set the device_class and unit, it would be great to try to get back to this issue. Not sure how other people but I have HA log filled with hundreds of warnings like:
2023-02-20 12:11:10.788 WARNING (MainThread) [homeassistant.components.sensor] Sensor sensor.teplota_garaz has device class None, state class None and unit °C thus indicating it has a numeric value; however, it has the non-numeric value: unknown (<class 'str'>); Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author.
I have seen some discussion about it in https://github.com/JoDehli/PyLoxone/issues/60, but it ended without any results.
What about creating table with units and maybe also some categories from which it would deduce the device_class? Sure it won’t be bullet proof but better to have more than 90% entities with correct class and fix few misfires than having to manually add device class to hundreds of entities. What do you think @JoDehli cc @Juxz
I also have this error:
2023-02-20 12:11:16.849 WARNING (MainThread) [homeassistant.components.sensor] Entity fan.ovladani_vetrani_temperature (<class 'custom_components.loxone.sensor.Loxonesensor'>) is using native unit of measurement '°' which is not a valid unit for the device class ('temperature') it is using; expected one of ['K', '°C', '°F']; Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author.
Is that from the “Room Ventilation Controller”? It has no temperature visible in the UI, but in Loxone config I see I am sending value 13°C from the sensor to it’s input, but next to that input I see 13°, so this might be Loxone bug.
Also it seemingly has a device class set correctly. So the integration is adding device class to some entities already?
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 29 (16 by maintainers)
@johny-mnemonic You are right. I changed it. I also removed the humidity because it is not always humidity when % is the unit.
Can you provide a detail info how you setup one of the sensors which has the error in the log? But really detailed because I have to implement the same way that I get the same messages.