question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

--card-mod-icon-color does not work

See original GitHub issue

My Home Assistant version: 0.XX.X core-2022.3.5 supervisor-2022.03.5 Home Assistant OS 7.5

My lovelace configuration method (GUI or yaml): yaml

What I am doing: trying to get icons to switch color like it used to work with the last version of home assistant also did a cache browsing delete didnt work

also doesnt work in Chrome or Edge both need refresh to work

What I expected to happen: the icon should change color when you toggle the switch

What happened instead:

click the toggle switch it doesnt change color anymore… worked in the last version of the plugin or Home assistant i cant remember hit refresh then it shows the new color…

  - entity: sensor.b_hot_water_tank_state
    name: Hot Water Tank
    icon: mdi:water
    secondary_info: last-updated
    card_mod: null
    style: |
      :host {
      --card-mod-icon-color: 
      {% if states(config.entity) == 'on' %} 
        yellow
      {% elif states(config.entity) == 'off' %}
        red
      {% else %}
        blue
      {% endif %}
      ;
      } 

# End of code

Error messages from the browser console:

dont know how to get that


By putting an X in the boxes ([]) below, I indicate that I:

  • Understand that this is a channel for reporting bugs, not a support forum (https://community.home-assistant.io/).

  • Have made sure I am using the latest version of the plugin.

  • Have followed the troubleshooting steps of the “Common Problems” section of https://github.com/thomasloven/hass-config/wiki/Lovelace-Plugins.

  • Understand that leaving one or more boxes unticked or failure to follow the template above may increase the time required to handle my bug-report, or cause it to be closed without further action.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:24 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
comet424commented, Jun 2, 2022

sorry couldnt help ya ):

1reaction
thomaslovencommented, May 30, 2022

Should be fixed now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Card-mod-icon broken in 3.1.5 · Issue #206 - GitHub
These vars work fine with a button card (also see the example with a light entity above) - if the entity is NOT...
Read more >
Struggling with card_mod not changing icon colour / color ...
I'm not sure where I'm going wrong of if this is a bug. Using this code: type: entity entity: ... --card-mod-icon-color does not...
Read more >
Changing icon colors with HACS card-mod : r/homeassistant
There is no obvious way to have the icon color be conditional with this mod based on my very quick look at it....
Read more >
Home Assistant: Advanced garage door alert
E.g. in my case there a possible scenario that the light is already on when the garage door has notified as open, then...
Read more >
HomeAssistant | Carson Fenimore's Blog
This is actually a nice feature – and works so long as you always publish the config before sending the value. It was...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found