iantrich / config-template-card

đź“ť Templatable Lovelace Configurations
MIT License
425 stars 55 forks source link

State-icon how to show unavailability of an entity? #142

Closed pillemats closed 3 weeks ago

pillemats commented 3 weeks ago

hi

i am using my floorplan with the config-template-card

is it possible to show the icon in another color, f.e. in red if the entity is not available? maybe it is possible to change the icon if windows open, closed and unavailable

here is my config:

- type: state-icon
  entity: binary_sensor.fenster_vorne_buro
  icon: mdi:window-closed-variant
  style:
    left: 44%
    top: 95.5%
    '--iron-icon-stroke-color': '#999'
    border-radius: 100%
    text-align: center
    background-color: rgba(255, 255, 255, 0)
Bildschirmfoto 2024-06-20 um 13 24 00

it always looks the same, whether it is available or not

if it is available and the window is opened color changed to yellow (is it also possible to change the color?, myabe green, or something else)

thanks

ildar170975 commented 3 weeks ago
  1. This is a neither a bug report nor a feature request. This is a question. Please ask questions in a dedicated HA Community thread: https://community.home-assistant.io/t/100-templatable-lovelace-configurations/105241
  2. Since you need to colorize a state-icon element inside a picture-elements card dependently on some entities’ states - then a better option could be using a card-mod in combination with the native style option - https://community.home-assistant.io/t/styling-elements-in-picture-elements-card-a-small-tutorial/315252/13. Definitely config-template-card can be used as well - but this could be not a better choice.

Closing the issue. Please continue this discussion in any of threads mentioned - dependently of your choice.