I need help with some Mushroom cards, I want to be able to change color on the lamp slider bar, i have tried some variants of code but without any luck, i think my problem is that i using different syntaxes??? new to coding btw, any tips? ![]()
type: custom:mushroom-light-card
entity: light.koket
fill_container: false
show_color_control: false
show_color_temp_control: false
show_brightness_control: true
secondary_info: none
use_light_color: false
icon_color: light-grey
primary_info: name
icon: mdi:ceiling-light
name: " "
card_mod:
style: >
{% set hour = now().hour %} {% set month = now().month %} {% set is_on =
is_state(config.entity, 'on') %} {% set month_color = '#5F5F55' %}
{% if month >= 1 and month <= 3 %}
{% set month_color = '#3ac5a4' %}
{% elif month >= 4 and month <= 6 %}
{% set month_color = '#37c876' %}
{% elif month >= 7 and month <= 8 %}
{% set month_color = '#07d049' %}
{% elif month >= 9 and month <= 10 %}
{% set month_color = '#de8121' %}
{% elif month >= 11 and month <= 12 %}
{% set month_color = '#b1d2f1' %}
{% endif %}
{% if is_on %}
ha-state-icon {
animation: wobbling 0.8s linear infinite alternate;
color: {{ month_color }}99 !important;
}
{% else %}
ha-state-icon {
color: #495a59;
}
{% endif %}
@keyframes wobbling {
0% {transform: rotate(-5deg);}
100% {transform: rotate(5deg);}
}
{% set background_color = 'transparent' if hour >= 6 and hour < 20 else
'#181915' %}
ha-card {
background-color: {{ background_color }};
border: 2px solid {{ month_color }};
transition: background-color 2s, border-color 2s;
}


