Quite a few things wrong with this so ill try and be detailed and list each bit seperately. And please dont take this as criticism, in fact i love how you have asked your question. Very detailed.
-
I dont see what the stack in card is doing at all? Is there any need for it? You dont have multiple cards that you want to look like they are 1 card which is what the stack in card is used for.
-
There have been changes to the structure of the mushroom card CSS since the animations by rhysb, i updated the code for each here:
Mushroom Cards - Build a beautiful dashboard easily 🍄 - #7717 by dimitri.landerloos
-
You have some references that either refer to some card additions that i dont know about or that dont exist, each is listed in the below code block but i have added a comment with # in front:
#Not something that you can declare in mushroom cards.
entity_status: ''
#Not something you can declare in mushroom cards.
friendly_name: input_select.microwave_status
#I think you are wanting to put this is the 'secondary:' of the mushroom cards instead. Not a value template.
value_template: |-
{% if is_state('input_select.microwave_status', 'running') -%}
running
{%- else -%}
off
{%- endif %}
#Tap action exists, but i dont think Dropdown is an option. Unless you have something installed that i dont know about.
tap_action:
action: Dropdown
- Card mod, style, etc (everything under card mod) is not indented properly. This is why it says null next to it. There need to be a tab space or 2 spaces between each line. So like this:
card_mod:
style:
something$: |
something else {
test: 0px;
}
- Your animation isnt being played because what you have below is not a proper template:
animation: cook 1s linear infinite;' if is_state('input_select.microwave_status','running');
No. 1 you are missing a starting '
. No.2 a template needs to start and end with either {{ 'something' if something }}
or:
{% if something %}
something
{% endif %}
I prefer the second variety, i find it easier to read. Also keep in mind that the if statement will be case sensitive. You currently have a mix of if is_state ‘running’ and ‘Running’ one will be true one will be false.
So all in all your fixed code should look something like this:
type: custom:mushroom-template-card
entity: input_select.microwave_status
icon: mdi:microwave
secondary: |-
{% if is_state('input_select.microwave_status', 'running') -%}
Running
{%- else -%}
Off
{%- endif %}
icon_color: |-
{% if is_state('input_select.microwave_status','running') -%}
amber
{%- else -%}
red
{%- endif %}
layout: vertical
primary: microwave
card_mod:
style: |
ha-state-icon:before {
content: "";
position: absolute;
width: 25%;
height: 25%;
margin: 10%;
{% if is_state('input_select.microwave_status','running') %}
animation: cook 1s linear infinite;
{% endif %}
}
@keyframes cook {
0%, 100% { background: linear-gradient(90deg, white 0%, transparent 50%, transparent 100%); }
33% { background: linear-gradient(90deg, transparent 0%, white 50%, transparent 100%); }
66% { background: linear-gradient(90deg, transparent 0%, transparent 50%, white 100%); }
}