HA-Animated-cards

Bonjour,

j’aimerai faire fonctionner HA-Animated-cards

Il me semble pourtant avoir installé tous les prérequis
Pourtant cela se semble pas fonctionner :frowning: l’icone ne bouge pas
image

type: custom:mushroom-entity-card
entity: light.xiaomi_smart_plug_bouton_d_alimentation
icon_color: yellow
primary_info: state
layout: default
fill_container: false
name: VMC
card_mod:
  style:
    mushroom-shape-icon$: |
      .shape {
        {# ========== USER CONFIG ========== #}
        {% set state_entity    = 'light.bedroom_lamp_local' %}
        {% set active_value    = 'on' %}

        {# ====== TRIGGER ====== #}
          {% set trigger_active = (states(state_entity) == active_value) %}

        {# ====== COLOR FROM ENTITY (rgb_color) ====== #}
        {% set rgb = state_attr(config.entity, 'rgb_color') %}
        {% if rgb is not none %}
          {% set r = (rgb[0] | int) %}
          {% set g = (rgb[1] | int) %}
          {% set b = (rgb[2] | int) %}
        {% else %}
          {# fallback if lamp has no rgb_color (ct-only, etc) #}
          {% set r = 255 %}
          {% set g = 240 %}
          {% set b = 200 %}
        {% endif %}

        {% if trigger_active %}
          --shape-animation: lamp-glow 1.4s ease-in-out infinite;
          opacity: 1;
        {% else %}
          --shape-animation: none;
          opacity: 0.5;
        {% endif %}
      }

      @keyframes lamp-glow {
        0% {
          filter: brightness(1);
          box-shadow: 0 0 6px 2px rgba({{ r }}, {{ g }}, {{ b }}, 0.6);
        }
        20% {
          filter: brightness(1.25);
          box-shadow: 0 0 14px 6px rgba({{ r }}, {{ g }}, {{ b }}, 0.9);
        }
        30% {
          filter: brightness(0.9);
          box-shadow: 0 0 3px 1px rgba({{ r }}, {{ g }}, {{ b }}, 0.4);
        }
        50% {
          filter: brightness(1.3);
          box-shadow: 0 0 16px 8px rgba({{ r }}, {{ g }}, {{ b }}, 1);
        }
        80% {
          filter: brightness(1.05);
          box-shadow: 0 0 8px 3px rgba({{ r }}, {{ g }}, {{ b }}, 0.7);
        }
        100% {
          filter: brightness(1);
          box-shadow: 0 0 6px 2px rgba({{ r }}, {{ g }}, {{ b }}, 0.6);
        }
      }
    .: |
      mushroom-shape-icon {
        --icon-size: 65px;
        display: flex;
        margin: -22px 0px 0px -22px !important;
      }
      ha-card {
        clip-path: inset(0 0 0 0 round var(--ha-card-border-radius, 12px));
      }

Bonjour,
ca fonctionne avec ton code :
popup1
Tu as installé card_mod ?
ou plutôt uix (le nouveau card_mod), pour être a jour.

merci pour ta réponse
il me semble oui

Tu as oublié de modifier la deuxième entité dans set state_entity =

{% set state_entity    = 'light.xiaomi_smart_plug_bouton_d_alimentation' %}

Merci
C’est ca de suivre betement un tuto vidéo..


Ca marche

1 « J'aime »

Par contre la taille des icones n’est pas terrible

Retouches au --icon-size dans ton code pour réduire la taille des icones.

1 « J'aime »

Merci à tous

Pense a mettre ton sujet en résolu

Ce sujet a été automatiquement fermé après 2 jours. Aucune réponse n’est permise dorénavant.