Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 106189

Glance Card Icon Not Showing with Conditional Template

$
0
0

Hi everyone,

I’m having a strange issue with a glance card where the icon disappears as soon as I add any kind of conditional template to the icon property. The icon in the card will just disappear. As long as the icon is static, then yes.

Here’s my simplified glance card configuration:

type: glance
entities:

- entity: light.living_room_light
    name: Living Room Light
    show_state: true
    icon: >-
      {% if is_state(‘light.living_room_light’, ‘on’) %}
        mdi:lightbulb-on-outline
      {% else %}
        mdi:lightbulb-outline
      {% endif %}

As soon as I put in the if statement, the icon just dissappears. There’s no error whatsoever.

I also tried something simpler:

type: glance
entities:

- entity: light.living_room_light
    name: Living Room Light
    show_state: true
    icon: >-
      {% if true %}
        mdi:lightbulb-on-outline
      {% endif %}

But it also doesn’t work.

Any idea how I can change the icon of a glance card based on the state of another entity?

Thanks!

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 106189

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>