Lovelace image by lux

Hello, I don’t have any smart lights in the bathroom, but I would like Lovelace to see when the lights are on (as in the other rooms, see photo). I have an aqara motion detector where there is an illuminance lux sensor and when the lights in the bathroom are off then it looks 15lx and when the lights are on then it looks over 100lx. How do I view the status of bathroom lights or what is code? Below is the code for how the other rooms are.

  - type: image
    entity: light.valo_hall
    style:
      left: 50%
      top: 50%
      width: 100%
    state_image:
      'on': 'http://192.168.1.105:8123/local/lovelace/hall.png'
      'off': 'http://192.168.1.105:8123/local/lovelace/transparent.png'

Hi, you can create a template binary sensor which is on, when lightlevel is above some threshold and which is off, otherwise. Then you can use this binary_sensor in your floorplan, like light.valo_hall in your example.

Your binary sensor could look like this:

binary_sensor:
  - platform: template
    sensors:
      light_bathroom:
        friendly_name: Light Bathroom
        value_template: "{{'on' if states('sensor.lightlevel_bathroom')|int > 15 else 'off'}}"
1 Like

Thank you tobi-bo, works great!