Its easier to copy and paste the code this way. I generally test my work prior to replying with a resolution.
Letās start with thisā¦
type: custom:mushroom-template-card
primary: Heizung
icon: mdi:fan
icon_color: |
{% if is_state('climate.heizung_dachflur','heat') %}
red
{% else %}
black
{% endif %}
entity: climate.heizung_dachflur
layout: vertical
picture: ''
card_mod:
style:
mushroom-shape-icon$: |
.shape {
--shape-color: none !important;
--icon-symbol-size: 50px;
top: 10px;
}
.: |
ha-card {
padding: 0px !important;
border: 1px solid white;
background: blue !important;
height: 83px !important;
zoom: 150%;
}
In general you donāt need to use zoom. You can control the size of the icon and font without zoom.
These control those two items.
--icon-symbol-size: 60px;
--card-primary-font-size: 20px;
Full Card code
type: custom:mushroom-template-card
primary: Heizung
icon: mdi:fan
icon_color: |
{% if is_state('climate.heizung_dachflur','heat') %}
red
{% else %}
black
{% endif %}
entity: climate.heizung_dachflur
layout: vertical
picture: ''
card_mod:
style:
mushroom-shape-icon$: |
.shape {
--shape-color: none !important;
--icon-symbol-size: 60px;
top:5px;
}
.: |
ha-card {
padding: 0px !important;
border: 1px solid white;
background: blue !important;
height: 83px !important;
--card-primary-font-size: 20px;
}
Many thanks!!!
And the Animation will be Planed, Like I did before?
I donāt know what you mean by Planed?
I missed this, do you still need assistance? .: |
was indented too farā¦make sure itās aligned with the m in mushroom.
Sorry,
I mean āPlacedā
There should be no issues with animation. If you have a problem just post the code with a description and Iāll take a look. Iāve worked on so many cards, I sometimes need a reminder
Heheh everything is good.
In my Post 335 there was an Animation also, nur in your corrected Code, this was Not Mentionedš
I just implemented Again and it worksā:partying_face:
No worries, you are busy and donāt have to replay at all. You always so kind helping us. I will check this tonight. Just curios, how I can make lines, which is going down from fan light flicker? @LiQuid_cOOled , I donāt know how to show my appreciation to you and @Ildar_Gabdullin, because of you guys , I learn a lot( still learning) and have a really good dashboard.
Iāll should have a solution this evening.
This should work for you
type: custom:stack-in-card
mode: vertical
card_mod:
style: |-
ha-card {
{% if states('light.living_fan') == 'on' %}
box-shadow: 0px 0px 5px 5px #CBC3E3 !important;
{% else %}
box-shadow: 5px 10px 5px -3px rgba(0,0,0,0.75);
{% endif %}
{% if is_state('light.living_fan', 'on') %}
background: rgba(255, 152, 0, 0.1) !important;
{% endif %}
}
cards:
- type: custom:mushroom-fan-card
entity: fan.living_fan
name: ' '
show_percentage_control: true
show_oscillate_control: true
tap_action:
action: toggle
hold_action:
action: none
double_tap_action:
action: none
icon: mdi:fan
icon_color: |
{{ '#00bcd4' if is_state(config.entity, 'on') else 'blue' }}
card_mod:
style:
mushroom-shape-icon$: |
.shape {
background: none !important;
}
.: |
ha-state-icon {
animation:
{% set pwr = states(config.entity) %}
{% set perc = state_attr(config.entity,'percentage')|int %}
{% set spd = 'rotation infinite linear' %}
{% if ( pwr == 'off') %} 0s {{spd}}
{% elif (perc <= 17 and pwr == 'on') %} 2.5s {{spd}}
{% elif (perc <= 34 and pwr == 'on') %} 2s {{spd}}
{% elif (perc <= 51 and pwr == 'on') %} 1.5s {{spd}}
{% elif (perc <= 67 and pwr == 'on') %} 1s {{spd}}
{% elif (perc <= 84 and pwr == 'on') %} .75s {{spd}}
{% elif (perc <= 100 and pwr == 'on') %} .5s {{spd}}
{% endif %};
}
@keyframes rotation {
0% {transform: rotate(0deg);}
100% {transform: rotate(360deg);} }
ha-card {
border: none;
background: none;
margin-left: -0px !important;
margin-right: 0px !important;
margin-bottom: 0px !important;
}
- type: custom:mushroom-light-card
entity: light.living_fan
name: ' '
icon: mdi:ceiling-fan-light
use_light_color: true
show_brightness_control: true
tap_action:
action: toggle
hold_action:
action: none
double_tap_action:
action: none
card_mod:
style:
mushroom-shape-icon$: |
.shape {
background: none !important;
}
.: |
ha-state-icon {
animation: {{ 'illumination 2s infinite' if is_state('light.living_fan', 'on') }};
}
@keyframes illumination {
0%, 100% { clip-path: inset(0 0 0 0); }
95% { clip-path: polygon(70% 0, 30% 0, 13% 15%, 0 40%, 0 72%, 30% 62%, 40% 72%, 60% 72%, 70% 63%, 100% 72%, 100% 40%, 87% 15%)};
}
Hi, Iām a very beginner. Now I am facing this problem:
I would like to change only the primary text color depending on the state of a motion detector.
Where am I going wrong? What do I do wrong? What should I do differently?
Here is my current code:
- type: custom:mushroom-template-card
primary: FĆ¼rdÅ
secondary: |-
{{states('sensor.furdo_d952_temperature') | float | round(1)}} Ā°C
{{states('sensor.furdo_d952_humidity') | float | round(1)}} %
icon: mdi:bathtub
multiline_secondary: true
icon_color: |-
{% if is_state('light.led_driver_furdoszoba','on') %}
orange
{% endif %}
{% if is_state('switch.wall_switch_mirror','on') %}
amber
{% endif %}
tap_action:
action: navigate
navigation_path: /dashboard-kezelfelulet/furd
card_mod:
style: |
:host {
{% set sensor_dws_state =
states('binary_sensor.dws_furdoszoba_contact') %}
{% set sensor_zone_state =
states('binary_sensor.zone_furdo_abl_open') %}
{% if sensor_dws_state == 'on' and sensor_zone_state == 'on' %}
--ha-card-box-shadow: 0 0 10px red;
{% elif sensor_dws_state == 'off' and sensor_zone_state == 'off' %}
--ha-card-box-shadow: none;
{% elif sensor_dws_state == 'on' and sensor_zone_state == 'off' %}
--ha-card-box-shadow: 0 0 10px orange;
{% else %}
--ha-card-box-shadow: 0 0 10px grey;
{% endif %}
}
.: |
ha-card {
{% set state=states('binary_sensor.motion_sensor_furdoszoba_occupancy') %}
{% if state=='off' %}
--primary-text-color: red
{% else %}
--primary-text-color: none
{% endif %}
}
The field names have changed for primary and secondary colors. This will get you started. You do not need to use :host {
. All of that code will work under ha-card:
I included one line to show that it worksā¦
ha-card {
--ha-card-box-shadow: 0 0 10px red;
--card-primary-color:
{{ 'red' if is_state('binary_sensor.motion_sensor_furdoszoba_occupancy', 'on') else 'grey' }}
}
Thank you very much!
Another suggestionā¦ your icon color template code does not require two ENDIFs
icon_color: |-
{% if is_state('light.led_driver_furdoszoba','on') %}
orange
{% elif is_state('switch.wall_switch_mirror','on') %}
amber
{% endif %}
Thanks for this suggestion too, I fixed it.
Thank you so much. Itās exactly what I was looking for.
I will compare my code and yours, to understand where I made a mistake. Still learning. TY
How can I get a card color change animation on click for Mushroom cards like in the case of a Tile card?
Like thisā¦
type: custom:mushroom-template-card
primary: Hover Color
secondary: example
icon: mdi:home
card_mod:
style: |
ha-card:hover {
background-color: rgba(0,255,0, 0.1);
}