Hello, is it possible to have a custom background ?
I tried without success. In the meantime, I put an icon that has 3 colors. The ideal is to remove the icon to have the background of the card in the color like the icon.
THANKS
type: custom:mushroom-chips-card
chips:
- type: template
icon: |-
{% set tempo = states('sensor.rte_tempo_couleur_actuelle') %}
{% if tempo == 'Bleu' %} mdi:flash
{% elif tempo == 'Blanc' %} mdi:flash-outline
{% elif tempo == 'Rouge' %} mdi:flash
{% endif %}
content: >-
Ce jour
{% set tempo = states('sensor.rte_tempo_couleur_actuelle')%}
{% if tempo == 'Bleu' %} Bleu
{{states('input_number.prix_achat_hc_bleu')}} |
{{states('input_number.prix_achat_hp_bleu')}}
{% elif tempo == 'Blanc' %} Blanc
{{states('input_number.prix_achat_hc_blanc')}} |
{{states('input_number.prix_achat_hp_blanc')}}
{% elif tempo =='Rouge' %} Rouge
{{states('input_number.prix_achat_hc_rouge')}} |
{{states('input_number.prix_achat_hp_rouge')}}
{% endif %}
entity: sensor.rte_tempo_couleur_actuelle
icon_color: |-
{% set tempo = states('sensor.rte_tempo_couleur_actuelle') %}
{% if tempo == 'Bleu' %} blue
{% elif tempo == 'Blanc' %} primary_color
{% elif tempo == 'Rouge' %} red
{% else %} yellow
{% endif %}
- type: template
entity: sensor.rte_tempo_prochaine_couleur
content: >-
Demain
{% set tempo = states('sensor.rte_tempo_prochaine_couleur')%}
{% if tempo == 'Bleu' %} Bleu
{{states('input_number.prix_achat_hc_bleu')}} |
{{states('input_number.prix_achat_hp_bleu')}}
{% elif tempo == 'Blanc' %} Blanc
{{states('input_number.prix_achat_hc_blanc')}} |
{{states('input_number.prix_achat_hp_blanc')}}
{% elif tempo =='Rouge' %} Rouge
{{states('input_number.prix_achat_hc_rouge')}} |
{{states('input_number.prix_achat_hp_rouge')}}
{% endif %}
icon: |-
{% set tempo = states('sensor.rte_tempo_prochaine_couleur') %}
{% if tempo == 'Bleu' %} mdi:flash
{% elif tempo == 'Blanc' %} mdi:flash-outline
{% elif tempo == 'Rouge' %} mdi:flash
{% endif %}
icon_color: |-
{% set tempo = states('sensor.rte_tempo_prochaine_couleur') %}
{% if tempo == 'Bleu' %} blue
{% elif tempo == 'Blanc' %} primary_color
{% elif tempo == 'Rouge' %} red
{% else %} yellow
{% endif %}
alignment: justify
Iām not restricted to this specific color. I just had a look which colors are defined and tried to use a standard one. And this is working with custom:mushroom-cover-card (see example below) but by whatever reason not for the custom:mushroom-template-card. This I do not understandā¦
The alternative solution would be to use custom:mushroom-entity-card but I do not get the code working for the specific icon AND the removal of the background. I feel I have a syntax error but do not know where
This is working finally, many thanks!! Just for others and to have it complete for similar use cases where I need to use the template-cardā¦ with below code it is working with standard color (example below with --error-color) for the custom:mushroom-entity-card but not for the custom:mushroom-template-card. Is this because of a mistake with me or a lack of implementation at the custom:mushroom-template-card?
Dashboard (above custom:mushroom-entity-card with proper color, below custom:mushroom-template-card with wrong color)
Cant get aminated icons to work copy and pasted and just see icon not moving.
anyone have this problem. so confued as i have card-mod installed and working
as im using it for sytling on layout and but cant get any of the animated icons going
just scroll up in this topic from the bottom a bit and you can see that i have linked to updated animations many times. its likely you are using old ones.
if that is not the case, please post your code so we can actually help.
saying var(--error-color) is not something it knows. you will need to tell it the color you want to use unless you are going to use card mod like your entity card example. so like this:
also to note, i would recommend almost never doing what you have done here:
i understand the temptation, but doing this leads to inconsistent application of the color when the card is loaded. just have the full entry in each if section like i have done above.