Floorplan with formula

Hello everyone, i’m trying to set brightness value of my xiaomi lamp as value of an image opacity.

This is a semplified version of my code

type: picture-elements
image: /local/my_floorplan.png
elements:
  - type: image
    image: /local/lights/my_image.png
    style:
      top: 50%
      left: 70%
      width: 100%
      opacity: '{{ (states["light.mibedsidelamp2_4458"].attributes.brightness / 255 | float) | round(2) }}'

i tried to remove “round” and/or “float”

even something like “opacity: ‘{{ 0.1 + 0.1 }}’” doesn’t work0. The value seems stuck at 1

opacity: 0.1 works

what am I doing wrong?
Thank you

I use the Color-lite-card for this.

Greetings

1 Like