Picture-elements - state_image conditional on different entity?

Hi,

Not long ago started to get into the smart home game and I am working on my floorplan using the picture-elements card and its working just fine. I know I’m being picky but I want my floorplan that I made to have the right lighting. I am just wondering though is there a way I can have a different state_image based on the on/off state of another entity.
like:
state_image:
‘on’: /local/home-living_room_light.png - if entity: light.kitchen_light “off”
‘on’: /local/home-living_room_kitchen_light.png -if entity: light.kitchen_light “on”

type: picture-elements
image: /local/home-all_lights_off.png
elements:
  - type: image
    tap_action: null
    action: none
    entity: light.living_room_light
    style:
      top: 50%
      left: 50%
      width: 100%
    state_image:
        'on': /local/home-living_room_light.png
        'off': /local/home-trans.png
  - type: state-icon
    tap_action:
      action: toggle
    entity: light.kitchen_light
    style:
      top: 24%
      left: 52%
  - type: state-icon
    tap_action:
      action: toggle
    entity: light.living_room_light
    style:
      top: 60.8%
      left: 48.8%

or am I just not seeing another way to do it?

Thanks,

you can either use the templating card or conditional card. Conditinal card is built in and youll have 2 configurations of the same card, each with a different background image. Or template card will allow you to template the field you desire.

Thank you very much petro

Exactly what I was looking for too. However, I have one question. Let’s say that selection between two images depends on state of another light. After the selection has been made, if the state of the another light changes, will the original selection be made again? If it won’t the image will not be changed and wrong image is shown.

Who are you asking? And what are you asking about. Conditional cards or the Custom Lovelace Template card?

Myself. For those who understand, the answer is yes.

That’s a high bar when this is what people are trying to decipher.