Picture elements card -dynamic State Icon?

i m using the Picture elements card + State Icon - change icon/color on status

i set it up with my home right now but i wanna see the sate of my windows live withthe right icon? any idea to get it? thanks! (maybe share me the source code because i m a beginner ,thanks for your help!

hey i wanna have a similar issue: i wanna have the window shutter open if open and closed if closed:

i wanna have it if open: mdi:window-shutter-open else this: mdi:window-shutter

looks like right now:
type: state-icon
icon: mdi:window-shutter
title: Kabinett-rollo
entity: cover.kabinett_aktor_rollo
tap_action:
action: toggle
state_color: true
style:
left: 93%
top: 14%

Take a look at this thread

hey thanks for your quick response? what would be the solution at my case with a code? -i m a beginner -thanks a lot! :slight_smile:

i tried it like this:

icon: >
[[[
entity.state === “open” ? “mdi:window-shutter-open” : “mdi:window-shutter”
]]]

Most often the state icon should change automatically with the entity you are using.

Do you get different icons when using a simple card?

type: entities
entities:
  - cover.kabinett_aktor_rollo

hey thanks for your quick support do you mean like this?

Configuration error

  • Unknown type: entities
    image

is there not any simple solution to change the icon with the state?

i tried it like this but this doesent work:
type: picture-elements
elements:

  • type: state-icon
    entity: cover.kabinett_aktor_rollo
    title: Kabinett-rollo
    tap_action:
    action: toggle
    state_color: true
    icon: >
    [[[
    entity.state === “open” ? “mdi:window-shutter-open” : “mdi:window-shutter”
    ]]]
    style:
    left: 50%
    top: 50%

or do you mean like this:

one condition for open and one for closed?

type: state-icon
icon: mdi:window-shutter-auto
title: Kabinett-rollo
entity: cover.kabinett_aktor_rollo
tap_action:
action: toggle
state_color: true
style:
left: 93%
top: 14%
conditions:
- entity: cover.kabinett_aktor_rollo
state: closed

but error: Visual editor not supported

  • Key ‘conditions’ is not expected or not supported by the visual editor.

You can still edit your config using YAML.

No, I mean test adding your cover device to your dashboard simply using an entity card.

type: entity
entity: cover.kabinett_aktor_rollo

in addition please use back ticks to share your code

image

So you understand my view… this code will show the icon for curtains closed and open curtains when opened.

type: picture-elements
elements:
  - type: state-icon
    entity: cover.bed_curtains
    style:
      left: 30%
      top: 14%
image: https://demo.home-assistant.io/stub_config/floorplan.png


this device has two states: open and close :slight_smile:
“opening” also
image

image

and exactly this is i want also in my picture element card this icon with is switching :slight_smile: thanks a lot for your help to help a newbie! :slight_smile:

this is the source code:
features:

  • type: cover-open-close
    type: tile
    entity: cover.kabinett_aktor_rollo
    tap_action:
    action: toggle
    show_entity_picture: true
    vertical: false
    hide_state: false
    state_content: state

this worked also: