DimkaInc
(Dmitry)
February 9, 2021, 12:19pm
1
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' ;
}
tom_l
February 9, 2021, 12:46pm
2
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
DimkaInc
(Dmitry)
February 9, 2021, 12:58pm
3
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?
tom_l
February 9, 2021, 1:46pm
4
Do you have card mod installed?
DimkaInc
(Dmitry)
February 9, 2021, 3:33pm
5
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.
tom_l
February 9, 2021, 3:37pm
6
DimkaInc
(Dmitry)
February 9, 2021, 3:52pm
7
Does not work:
And --paper-item-icon-color also
tom_l
February 9, 2021, 4:12pm
8
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.
tom_l
February 9, 2021, 4:31pm
10
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.
DimkaInc
(Dmitry)
February 9, 2021, 4:54pm
11
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
tom_l
February 9, 2021, 6:34pm
13
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.
Lovelace Templates
I’ve gone and made a crazy card that allows you to pretty much template anything in Lovelace for your card configurations using any information available on the frontend; states, attributes, user, etc.
Want state/attribute-based icons? DONE!
Want dynamic stacks; vertical vs horizontal based on user? DONE!
Want OR conditionals? DONE!
The list is pretty much endless and I’m sure you all will come up with some crazy stuff. Be sure to share.
Go nuts! Enjoy!
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
DimkaInc
(Dmitry)
February 9, 2021, 6:40pm
14
Ok. How I’m correct install card mod?
Reinstall no chage. And:
tom_l
February 9, 2021, 6:43pm
15
Is the card mod resource correctly set up in the Configuration / Lovelace Dashboards / Resources menu?
DimkaInc
(Dmitry)
February 9, 2021, 6:48pm
16
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?
tom_l
February 9, 2021, 6:52pm
17
Yes I just told you where to look for that something.
I’m sorry I don’t know what this means.
DimkaInc
(Dmitry)
February 9, 2021, 6:53pm
18
Oh. Now it work. Thank you! After install iantrich/config-template-card All work correctly.
DimkaInc
(Dmitry)
February 9, 2021, 7:01pm
19
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.
drfinn15
(Finn)
July 7, 2021, 11:17pm
20
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