Icon color setting does not work. Why?

Hello!
on HA core-2021.2.2 from docker container, I try use custom color:

type: 'custom:auto-entities'
card:
  title: internet
  type: entities
filter:
  include:
    - entity_id: sensor.internet_ping

When I add style, as it is written in the use of auto-entities, the element immediately disappears. What am I doing wrong or which plugin needs to be installed additionally?

type: 'custom:auto-entities'
card:
  title: internet
  type: entities
filter:
  include:
    - entity_id: sensor.internet_ping
      style: |
        :host {
          --paper-item-icon-color: '#ff0000' ;
        }

style requires the use of one of Thomas’s other custom cards:

it is also applied at the card level not the row. So:

type: 'custom:auto-entities'
card:
  title: internet
  type: entities
  style: |
    :host {
        --paper-item-icon-color: '#ff0000' ;
    }
filter:
  include:
    - entity_id: sensor.internet_ping

There is no effect at all at the line level. Examining the html text, it can be seen that the --paper-item-icon-color is not filled from the parameter, but the default value is taken.

May be problem in docker container?

Do you have card mod installed?

Yes:

lovelace:
  mode: yaml
  resources:
    - url: /local/vacuum-card.js
      type: module
    - url: /local/community/lovelace-auto-entities/auto-entities.js
      type: js
    - url: /local/community/lovelace-card-mod/card-mod.js
      type: module

And HACS say: “Not loaded”. However, module files are present in the installation directories and no errors about the absence of a resource appear. I don’t know how to fix the HACS message. Reinstall don’t fix it.

Looks like I was wrong about the row styling. https://github.com/thomasloven/lovelace-card-mod#styling-entity-and-glance-cards

Does not work:
изображение
And --paper-item-icon-color also

Try a simple example to see if card mod is actually loaded:

type: entities
style: |
  ha-card {
    color: red;
  }
entities:
  - sensor.internet_ping

Should have red text for the sensor name.

Ok. No change:
изображение

That is not the config I wrote. Forget auto entities for a moment. Just use the entities card so we can check card mod is working. The example I gave above is known to work. Use it and only it in its entirety.

Custom state color is work:
изображение
Static color change generally works, but it is not possible to get dynamic change from state. That’s why I’m trying to use a plugin to get a dynamic color change.
изображение

1 Like

Picture elements cards support the use of css styles without card mod.

Entities cards require card mod.

This simple test shows that card mod is not installed correctly.

Also you can not use templates in Lovelace without installing one of the custom template cards. Do you have one installed?

The jinja template card has a large performance overhead. I would not recommend it.

The javascript template card is a better option.

But fix card mod first.

Until you can get this working, card mod is not installed correctly:

type: entities
style: |
  ha-card {
    color: red;
  }
entities:
  - sensor.internet_ping

Ok. How I’m correct install card mod?

Reinstall no chage. And:
изображение

Is the card mod resource correctly set up in the Configuration / Lovelace Dashboards / Resources menu?

I show it this: Icon color setting does not work. Why?

Perhaps you need to add something else to work correctly?
And, I check on a dynamic map. Can this affect the result?

Yes I just told you where to look for that something.

I’m sorry I don’t know what this means.

Oh. Now it work. Thank you! After install iantrich/config-template-card All work correctly.

It’s managed here: lovelace/dashboards
I am creating one custom ui-lovelace.yaml file and added an additional toolbar to the system interface for testing. This panel is dynamically populated by the system itself.

I am so thankful to you, you just made my whole day solving that problem for me. I am so happy to finally have a dynamic color change <3