lubeda / EsphoMaTrix

A simple DIY status display with an 8x32 RGB LED panel implemented with esphome.io and Home Assistant
MIT License
217 stars 23 forks source link

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

Closed TheGabeMan closed 1 year ago

TheGabeMan commented 1 year ago

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:

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 1 year ago

Updated the YAML. thanx