Lux not reported anymore (using hue component by Rob Mark Cole)

Hi.

I’m on Home Assistant 0.71.0 . I have been using the great Hue component by Rob Mark Cole a while with success. But recently, maybe since 0.70 or 0.69.x (not sure), for lux value of the Hue motion sensor, i don’t see a value, but the string ‘lux’. I’m curious whether other people have this as well (or, whether they are on 0.71 with the Hue component and being reported actual lux values).

I’m using the code as specified on https://github.com/robmarkcole/Hue-sensors-HASS to (attempt to) read the lux value (amongst other values of the motion sensor, btw, those other values are still being read successfully … and, in the hue app, the sensor still reports an actual lux value).

Can you share the relevant code?
Note that there was a breaking change in 0.69 regarding light sensors:

The sensor unit lux has been replaced with lx for consistency. That covers the following sensor platforms: homematic, isy994, miflora, mysensors, tahoma, vera and template sensors. To add light sensors for the HomeKit component the device_class changed to illuminance. (@cdce8p - #14282) (sensor docs) (breaking change)

Thanks for the swift reply. I read about lux/lx change. I just changed the code as on Rob Mark’s page (trying to use the code formatting)

- platform: template
  sensors:

    living_room_light_level:
      friendly_name: 'Living room light level'
      value_template: '{{states.sensor.living_room_motion_sensor.attributes.lux}}'
      unit_of_measurement: lux

to

- platform: template
  sensors:

    living_room_light_level:
      friendly_name: 'Living room light level'
      value_template: '{{states.sensor.living_room_motion_sensor.attributes.lx}}'
      unit_of_measurement: lx

(so renamed lux to lx, and using my sensor names of course), and now i get values reported, so for now, i’m happy ;-).

1 Like