Ok but how can you suggest me with that :
- type: entities
entities:
- entity: light.plafonnier
card_mod:
style: |
:host {
--card-mod-icon-color: {% if is_state('light.plafonnier', 'on') %} yellow {% else %} white {% endif %}
}
name: Plafonnier
- entity: light.lampe_buffet
card_mod:
style: |
:host {
--card-mod-icon-color: {% if is_state('light.lampe_buffet', 'on') %} yellow {% else %} white {% endif %}
}
name: Buffet
SebastianMtl:
--card-mod-icon-color
I do not know what it is - "--card-mod-icon-color"
, tried to search it here , it is in your posts only.
What do you want to achieve? Is it not covered by that post ?
petro
(Petro)
April 16, 2021, 3:27pm
1746
I replied to you on facebook and you ignored me⊠You need to use --paper-item-icon-color
.
I want to make cooler icon responsive compared to a entity state
E.g: if lampe_buffet is on , I want Yellow if not I want white icon color
If I use âpaper-item-icon-color , it doesnât work with conditions
petro
(Petro)
April 16, 2021, 3:29pm
1748
Yes, and itâs because youâre copying âpaper-item-icon-color from facebook! Like I said on facebook.
Type it out instead of copy/paste.
It is explained, please read again:
Iâve made it like this
- entity: light.lampe_bureau
card_mod:
style: |
:host {
--paper-item-icon-color: red
--paper-item-icon-active-color: green
}
name: Lampe bureau
Itâs Okay becaus I really donât understand
Sorry @petro I donât ignore you , I just forget
petro
(Petro)
April 16, 2021, 3:38pm
1752
You need to terminate each line
add ; at the end.
Solutions like this may be used by a simple âcopy/pasteâ. Otherwise the thread will be flooded by explaining the same things again & again. That was my intention - accumulate solutions in dedicated posts to avoid spamâŠ
I think I just understand,
because I type this
card_mod:
style: |
:host {
--paper-item-icon-color: red
--paper-item-icon-active-color: green
}
instead this:
style: |
:host {
--paper-item-icon-active-color: red;
--paper-item-icon-color: cyan;
}
If I remove card_mod itâs okay
Does
--paper-item-icon-active-color: red;
--paper-item-icon-color: cyan;
work for switch entities ?
because , if I apply this to switch , Itâs stays red even if âonâ
- type: entities
entities:
- entity: switch.pool_pump
style: |
:host {
--paper-item-icon-active-color: green;
--paper-item-icon-color: red;
}
I understand this, but I donât understand how to make this method with switch and condition.
Sorry but I new on this and I struggle a lot for understand
Ok. Wait a little, today will try to explain.
So, what you cannot do?
It is already explained in the post I gave you.
type: entities
state_color: true
entities:
- entity: switch.test_switch
name: Colored
style: |
:host {
--paper-item-icon-active-color: red;
--paper-item-icon-color: cyan;
}
And your code seems to be wrong - check indentation for the 1st line.
Itâs okay , I just forget to write state_color: true
Thanks @Ildar_Gabdullin