Picture Elements state_image problem

I have an entity switch.cyl2 which is either “on” or “off” and I want to display an open image when it is on and a closed image when it is off. My picture Element card works fine apart from this bit.

type: picture-elements
panel: true
image: /local/CentralHeating.png
elements:
...
...
  - type: state-label
    entity: sensor.study_temperature
    style:
      top: 74%
      left: 93%
      color: black
      font-size: 25px
  - type: image
    entity: switch.cyl2
    state_image:
      "on": /local/2portOpen.png
      "off": /local/2portClosed.png
    style:
      top: 50%
      left: 50%

I’m not getting anything at all and have splinters in my fingers from scratching my head. Any ideas?

I would say you are missing a “width: 100%” at the end !?

1 Like

@Frank_Beetz That’s the answer. Thank you…

1 Like