lubeda/EsphoMaTrix

sensor.ulanzi_illuminance is using native unit of measurement 'lx' which is not a valid unit for the device class ('voltage')

Closed this issue · 1 comments

Not sure if introduced with HA 2023.6.1 (coming from 2023.5.4) since I didn't check the logs before, but I noticed the following error message:

Entity sensor.ulanzi_illuminance (<class 'homeassistant.components.esphome.sensor.EsphomeSensor'>) is using native unit of measurement 'lx' which is not a valid unit for the device class ('voltage') it is using; expected one of ['V', 'mV'];

In my yaml I have this:

- platform: adc id: light_sensor name: "$devicename Illuminance" pin: $ldr_pin update_interval: 10s attenuation: auto unit_of_measurement: lx accuracy_decimals: 0 filters: - lambda: |- return (x / 10000.0) * 2000000.0 - 15 ;

I have now added the following line below unit_of_measurement:
device_class: illuminance

This seems to fix the error in the logs.

lubeda commented

Updated the YAML. thanx