Replying to myself but just wanted to update that Iāve managed to make my intended cards work, and want to leave them here so people can just adapt them for themselves if needed:
Note that those cards are still kind of a āmessā but were more of a test to see what I could / couldnāt do, and what worked and what didnāt. So whatās there, works. Just replace what you need / understand itās construction.
- Room Card, with background following the state, chips css so you can template them with animations and so on.
Most of this work is from @rhysb both for the animations and the room card itself. And for the amazing help of @Mattia2399
type: custom:stack-in-card
cards:
- type: custom:mushroom-template-card
entity: input_boolean.room_kitchen
primary: Cozinha
secondary: >-
{{ states('sensor.temp_kitchen') | round(1) }}Ā°C | {{
states('sensor.humd_kitchen') | round(0) }}%
icon: mdi:fridge-outline
icon_color: >
{{ '#%02x%02x%02x' % state_attr('light.lightstrip_kitchen_light',
'rgb_color') if states('light.lightstrip_kitchen_light') == 'on' else
'disabled' }}
fill_container: true
layout: horizontal
multiline_secondary: false
tap_action:
action: navigate
navigation_path: cozinha
hold_action:
action: call-service
service: light.turn_off
data:
transition: 3
target:
area_id: kitchen
double_tap_action:
action: toggle
card_mod:
style: |
:host([dark-mode]) {
background: rgba(var(--rgb-primary-background-color), 0.2);
}
:host {
background: rgba(var(--rgb-primary-text-color), 0.025);
--mush-icon-size: 80px;
height: 65px;
margin-left: -18px !important;
}
- type: custom:mushroom-chips-card
chips:
- type: conditional
conditions:
- entity: input_boolean.vacuum_kitchen
state: 'on'
chip:
type: template
icon: |-
{% if states('input_boolean.vacuum_kitchen') == 'on' %}
mdi:robot-vacuum
{% elif states('input_boolean.vacuum_kitchen') == 'on' and
states('vacuum.robot_cleaner') == 'returning' %}
mdi:robot-vacuum
{% endif %}
icon_color: |-
{% if states('input_boolean.vacuum_kitchen') == 'on' and
states('vacuum.robot_cleaner') == 'cleaning' %}
pink
{% elif states('input_boolean.vacuum_kitchen') == 'on' and
states('vacuum.robot_cleaner') == 'returning' %}
disabled
{% endif %}
tap_action:
action: none
hold_action:
action: none
content_info: none
- type: conditional
conditions:
- entity: input_boolean.vacuum_kitchen
state: 'on'
chip:
type: template
icon: |-
{% if states('input_boolean.vacuum_kitchen') == 'on' %}
mdi:robot-vacuum
{% elif states('input_boolean.vacuum_kitchen') == 'on' and
states('vacuum.robot_cleaner') == 'returning' %}
mdi:robot-vacuum
{% endif %}
icon_color: |-
{% if states('input_boolean.vacuum_kitchen') == 'on' and
states('vacuum.robot_cleaner') == 'cleaning' %}
pink
{% elif states('input_boolean.vacuum_kitchen') == 'on' and
states('vacuum.robot_cleaner') == 'returning' %}
disabled
{% endif %}
tap_action:
action: none
hold_action:
action: none
content_info: none
- type: conditional
conditions:
- entity: input_boolean.vacuum_kitchen
state: 'on'
chip:
type: template
icon: >-
{% if states('input_boolean.vacuum_kitchen') == 'on' %}
mdi:robot-vacuum
{% elif states('input_boolean.test_martwin') == 'on' and
states('input_boolean.room_bedroom') == 'on' %}
mdi:robot-vacuum
{% endif %}
icon_color: >-
{% if states('input_boolean.vacuum_kitchen') == 'on' and
states('vacuum.robot_cleaner') == 'cleaning' %}
pink
{% elif states('input_boolean.test_martwin') == 'on' and
states('input_boolean.room_bedroom') == 'on' %}
disabled
{% endif %}
tap_action:
action: none
hold_action:
action: none
content_info: none
alignment: end
card_mod:
style:
mushroom-conditional-chip:nth-child(1):
mushroom-template-chip$: |
ha-icon {
animation: shake 400ms ease-in-out infinite;' if is_state('binary_sensor.input_asciugatrice', 'on') }}
transform-origin: 50% 58%;
clip-path: polygon(0 0, 0 100%, 35% 100%, 34% 68%, 60% 41%, 71% 56%, 65% 74%, 47% 79%, 32% 69%, 35% 100%, 100% 100%, 100% 0);
}
@keyframes shake {
0%, 100% { transform: rotate(4deg); }
50% { transform: rotate(-4deg); }
}
@keyframes drum {
50% { clip-path: polygon(0 0, 0 100%, 35% 100%, 36% 74%, 31% 43%, 61% 40%, 71% 69%, 62% 78%, 36% 73%, 35% 100%, 100% 100%, 100% 0); }
}
mushroom-conditional-chip:nth-child(2):
mushroom-template-chip$: |
ha-icon {
animation: shake 400ms ease-in-out infinite;' if is_state('binary_sensor.input_asciugatrice', 'on') }}
transform-origin: 50% 58%;
clip-path: polygon(0 0, 0 100%, 35% 100%, 34% 68%, 60% 41%, 71% 56%, 65% 74%, 47% 79%, 32% 69%, 35% 100%, 100% 100%, 100% 0);
}
@keyframes shake {
0%, 100% { transform: translate(0, 0) rotate(0); }
20% { transform: translate(0.4px, -0.4px) rotate(-4deg); }
40% { transform: translate(-0.4px, 0.4px) rotate(4deg); }
60% { transform: translate(0.4px, 0.4px) rotate(-4deg); }
80% { transform: translate(-0.4px, -0.4px) rotate(4deg); }
}
mushroom-conditional-chip:nth-child(3):
mushroom-template-chip$: |
ha-icon {
animation: shake 400ms ease-in-out infinite;' if is_state('binary_sensor.input_asciugatrice', 'on') }}
transform-origin: 50% 58%;
clip-path: polygon(0 0, 0 100%, 35% 100%, 34% 68%, 60% 41%, 71% 56%, 65% 74%, 47% 79%, 32% 69%, 35% 100%, 100% 100%, 100% 0);
}
@keyframes shake {
0%, 100% { transform: translate(0, 0) rotate(0); }
20% { transform: translate(0.4px, -0.4px) rotate(-4deg); }
40% { transform: translate(-0.4px, 0.4px) rotate(4deg); }
60% { transform: translate(0.4px, 0.4px) rotate(-4deg); }
80% { transform: translate(-0.4px, -0.4px) rotate(4deg); }
}
card_mod:
style: |
ha-card {
height: 100px;
{% if is_state('light.lightstrip_kitchen_light', 'on') %}
background: rgba({{ (state_attr('light.lightstrip_kitchen_light', 'rgb_color') | join(',')) }},0.1)
{% elif is_state('light.candeeiro_cozinha', 'on') %}
background: rgba(245, 192, 47, 0.1);
{% endif %}
}
As a plus, Iāve also managed to create a entity card that has an animated icon, background with states and so on. If you thing this is what you were looking for, get it here:
type: custom:mushroom-entity-card
entity: input_boolean.season_autumn
icon_color: deep-orange
icon: ''
fill_container: false
layout: vertical
tap_action:
action: toggle
name: Autumn
card_mod:
style:
mushroom-shape-icon$: |
{% if is_state('input_boolean.season_autumn', 'on') %}
ha-icon {
--icon-animation: wave 6s ease infinite;
}
@keyframes wave {
50% { transform: rotatey(180deg); --icon-color: rgb(var(--rgb-brown)); }
}
.shape {
--shape-animation: color 6s ease infinite;
}
@keyframes color {
50% { --shape-color: rgba(var(--rgb-brown), 0.2); }
}
}
{% endif %}
.: |
:host {
background: var(--card-background-color);
border-radius: var(--ha-card-border-radius);
}
ha-card {
{% if is_state('input_boolean.season_autumn', 'on') %}
background: rgb(240, 163, 10, 0.05)
{% endif %}
}
For the RGBs, if you think you need anywhere to get them, get them here: