Picture-elements /local/xxxx.png depends on sensor value

type: picture-elements
image: /local/ccc.png
elements:
  - type: image
    entity:sensor.xxx
    state_image:
      'over 5': /local/over5.png   # ?
      'below 5': /local/below5.png  # ?
      '>=': /local/xxxx.png    # ?
      '<': /local/xxxx.png   # ?
    style:
      top: 50%
      left: 50%
      width: 10%


What is your question?

I want the image to change depending on the sensor value

For example:
If the sensor.xxx value is over 5, display: /local/over5.png
If the sensor.xxx value is over 10, display: /local/over10.png
or
If the sensor.xxx value is below 5, display: /local/below5.png
or
If the value of sensor.xxx is between 5 and 10 / local / between5-10.png

Also please note where you have posted this is for questions related to ha-floorplan not picture elements.

1 Like

I believe you’ll need to create a template sensor that can return a set of states that are determined by the conditions you require.

Google Template Sensor.

This sensor will then be your sensor.xxx

2 Likes

I’ll put a plug in though. This is something you can easily do in ha-floorplan as it natively supports JavaScript!