thanks @Ildar_Gabdullin ! , Sorry I missed your post, but you didnt tag me so I didnt recieve a ping.
this is almost getting there, but look how odd: everything changes but the icon in my setup:
If I can make it change, I’ll hope to make it happen based on state after that: ‘on’ - blue/spin, ‘off’- grey/no motion.
and its not my templates because copying your setup gives me:
this shows spinning:
state-badge {
animation: rotation 1s linear infinite, colorize 5s linear forwards 1;
}
no coloring though
conditional:
- type: custom:template-entity-row
entity: binary_sensor.vijverpompen
card_mod:
style:
div#wrapper: |
state-badge {
{% if is_state(config.entity,'on') %}
animation: rotation 1s linear infinite, colorize 5s linear forwards 1;
{% endif %}
}
@keyframes rotation {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
@keyframes colorize {
0% {
color: var(--text-color-off);
}
100% {
color: blue;
}
}
again: spinning works, no color (other than set on the binary itself)