I am having trouble centering the green and red buttons (Mushroom cards). I would like the text āLED-Beleuchtungā, the red button, the green button, and the icon to be aligned on a horizontal line.
Another thing is the grid. I used a1, b1, c1, d1 for the colums, so the red button should be left, the green one should be right. But itās the oppositeā¦ Why?
I have a little question, and I think I will probably need to use card mod for this. Iām using the below fold-entity-row for this list of alarms, and what I would like to have is the āparentā alarm icon be highlighted (like the state_color option on an entities card) if any of the alarms below are enabled. Any suggestions how this might be done? Thanks.
Hoping someone can help me with this as I canāt find a solution.
Iāve made a picture-elements card for my car with and use a state-icon to show charging status, currently I have the icon green when charging and white when charging is complete, however I would like to have the icon blinking green when charging and solid green when complete.
Problem is I canāt work out how to make the icon blink based on state, my current code is below.
which is rather annoying too. I am not at all sure this will be fixed (there have been changes in the core cards, that might very well stay, and we need to adapt out card_mod settings for, simple as thatā¦)
anyways, consider this request to join in finding out
Also, these many āif ā¦ elseā¦ā may be replaced by
{% set STATE = states('sensor.xyz') -%}
{%- set mapper = {
'state_1':'red',
'state_2':'orange',
'state_3':'magenta',
'state_4':'blue',
'state_5':'green',
} -%}
{%- set COLOR = mapper[STATE] if STATE in mapper else 'yellow' -%}
color: {{COLOR}};
Unfortunately I still canāt find any way to have the state-icon blink with a particular state, also the change you suggested doesnāt work for me with this code.
card_mod:
style: |
:host {
--card-mod-icon-color:
{% set STATE = states('sensor.[[car]]_charging') -%}
{%- set mapper = {
'disconnected': var(--pink),
'no_power': var(--red),
'starting': var(--cyan),
'stopped': var(--orange),
'complete': var(--white),
} -%}
{%- set COLOR = mapper[STATE] if STATE in mapper else var(--green) -%}
color: {{COLOR}};
}
Yes @Mariusthvdb the above was a suggestion to simplify all the elifs in my original code, what I want is the icon to blink when the car state is āchargingā but be static in all other states.
the important thing is to decide if you want to set it global to the picture-elements card, or to a particular element inside the picture-elements card
Ildar has it all spelled out in that example (I wont copy it here, because you can find it above easily enough)
what you then do is first set the animation as a fixed animation.
final step is to template that based on the state. Which really is easy if the previous steps were successful
my suggestion would also be, to first do this outside the decluttering card, because that can be unreliable at times