LD2410c Light Sensor: Why does it not have a unit of measurement?

the codes I’ve seen to configure a ld2410c light sensor doesn’t have a unit of measurement, and Home Assistant keeps asking me to set one. Should I set it to lx (lux) or is there a reason there is no unit?

code used is:

number:
  - platform: ld2410
    light_threshold:
      name: Light Threshold

sensor:
  - platform: ld2410
    light:
      name: Light Level

There’s no unit because it doesn’t have unit. It’s just a value 0-255.
You can give it any unit you like.
unit_of_measurement: "my_unit"
You can try to convert/calibrate it to lux with sensor filters.

could you give me an example of how to write it?

sensor:
  - platform: ld2410
    light:
      name: Light Level
      id: lightlevel
      unit_of_measurement: "MyLux"
      filters:
        - calibrate_linear:
            - 85 -> 0 #esphome doc states it gives ~85 on full darkness
            - 255 -> 25000 # find a conversion that gives you output you are happy with
1 Like

thank you very much!

You need to adjust the numbers comparing output to some known lux-values.