Blinkendes Badge-Icon

Shelly Plug S Smart Wifi Stecker
Shelly Plug S Smart Wifi Stecker
19,69 €

Wollt ihr eure Badges je nach Zustand “blinken” lassen?
Das geht mit folgendem Code und custom:bade-card

type: custom:badge-card
name: neu
badges:
  - entity: sensor.wz_temp
    card_mod:
      style: |
        @keyframes blinker { 50% { opacity: 0; } }
        :host {
          {% if states(config.entity)|int > 29 %}
          --label-badge-background-color: red;
          --label-badge-text-color: white;
          animation: blinker 2s linear infinite;
          font-weight: bold;
          text-shadow: 1px 1px #0005;
          {% elif states(config.entity)|int > 27 %}
          --label-badge-background-color: #FF9800;
          --label-badge-text-color: white;
          --label-badge-red: #FF9800;
          font-weight: bold;
          text-shadow: 1px 1px #0005;
          {% elif states(config.entity)|int > 18 %}
          --label-badge-background-color: green;
          --label-badge-text-color: white;
          --label-badge-red: green;
          font-weight: bold;
          text-shadow: 1px 1px #0005;
          {% else %}
          --label-badge-background-color: #039BE5;
          --label-badge-text-color: white;
          --label-badge-red: #039BE5;
          font-weight: bold;
          text-shadow: 1px 1px #0005;
          animation: blinker 2s linear infinite;
          {% endif %}
        }