Code yaml et répétition

Bonjjour à tous et meilleurs voeux pour cette nouvelle année,

voici un code yaml que j’utilise pour afficher mes température dans mon application mobile, c’est joli ou pas le problème n’est pas la.

type: horizontal-stack
cards:
  - type: custom:mushroom-entity-card
    entity: sensor.bureau_thermometre_temperature
    tap_action:
      action: more-info
    icon: mdi:desk
    name: Bureau
    primary_info: state
    secondary_info: name
    card_mod:
      style:
        mushroom-shape-icon$: |
          .shape {
            {# ========== CONFIGURATION ========== #}
            {% set temp = states('sensor.bureau_thermometre_temperature') | float(0) %}

            {# ------------------------------------------- #}
            {# TEMPÉRATURE → COULEUR + EFFETS              #}
            {# ------------------------------------------- #}

            {# VALEURS PAR DÉFAUT (seront remplacées selon les plages) #}
            {% set rgb = '0,140,255' %}
            {% set anim = 'temp-cold-breathe' %}
            {% set glow_anim = 'temp-cold-glow' %}
            {% set halo_anim = 'temp-cold-halo' %}
            {% set duration = 4.0 %}
            {% set intensity = 0.5 %}

            {# PLAGES DE TEMPÉRATURE / COULEURS #}
            {# Tu peux modifier les seuils de température ci-dessous si besoin #}

            {% if temp < 16 %}
              {# BLEU #}
              {% set rgb = '0,140,255' %}
              {% set anim = 'temp-cold-breathe' %}
              {% set glow_anim = 'temp-cold-glow' %}
              {% set halo_anim = 'temp-cold-halo' %}
              {% set duration = 4.4 %}
              {% set intensity = 0.4 %}

            {% elif temp < 18 %}
              {# JAUNE #}
              {% set rgb = '255,210,40' %}
              {% set anim = 'temp-cool-wave' %}
              {% set glow_anim = 'temp-cool-glow' %}
              {% set halo_anim = 'temp-cool-halo' %}
              {% set duration = 3.4 %}
              {% set intensity = 0.55 %}

            {% elif temp < 20 %}
              {# ORANGE #}
              {% set rgb = '255,150,40' %}
              {% set anim = 'temp-comfy-breathe' %}
              {% set glow_anim = 'temp-comfy-glow' %}
              {% set halo_anim = 'temp-comfy-halo' %}
              {% set duration = 3.0 %}
              {% set intensity = 0.6 %}

            {% elif temp < 22 %}
              {# ORANGE FONCÉ #}
              {% set rgb = '255,115,20' %}
              {% set anim = 'temp-warm-pulse' %}
              {% set glow_anim = 'temp-warm-glow' %}
              {% set halo_anim = 'temp-warm-halo' %}
              {% set duration = 2.4 %}
              {% set intensity = 0.8 %}

            {% else %}
              {# ROUGE #}
              {% set rgb = '255,40,40' %}
              {% set anim = 'temp-hot-shimmer' %}
              {% set glow_anim = 'temp-hot-glow' %}
              {% set halo_anim = 'temp-hot-halo' %}
              {% set duration = 2.0 %}
              {% set intensity = 1.0 %}
            {% endif %}

            {# Application des variables #}
            --temp-rgb: {{ rgb }};
            --temp-intensity: {{ intensity }};
            --shape-animation: {{ anim }} {{ duration }}s ease-in-out infinite;
            --temp-glow-animation: {{ glow_anim }} {{ (duration * 0.9) | round(2) }}s ease-in-out infinite;
            --temp-halo-animation: {{ halo_anim }} {{ (duration * 1.15) | round(2) }}s ease-in-out infinite;

            opacity: 1;

            /* Couleur de l'icône suit la température */
            --icon-color: rgba({{ rgb }}, 1) !important;
            --icon-color-disabled: rgba({{ rgb }}, 1) !important;
            
            /* CRUCIAL : Le fond prend la même couleur que l'icône avec transparence */
            --shape-color: rgba({{ rgb }}, 0.2) !important;

            /* 🔧 SUPPRIMER LE BLEU DU THÈME & RENDRE LE FOND NEUTRE */
            background: rgba({{ rgb }}, 0.1) !important;
            background-color: rgba({{ rgb }}, 0.1) !important;
            box-shadow: none !important;
            border: 1px solid rgba(255, 255, 255, 0.06) !important;

            position: relative;
            transform-origin: 50% 60%;
            animation: var(--shape-animation);
          }

          /* Couches de lueur */
          .shape::before,
          .shape::after {
            content: '';
            position: absolute;
            border-radius: inherit;
            pointer-events: none;
          }

          .shape::before {
            inset: -8px;
            animation: var(--temp-glow-animation);
          }

          .shape::after {
            inset: -22px;
            animation: var(--temp-halo-animation);
            mix-blend-mode: screen;
          }

          /* ========== FROID ========== */
          @keyframes temp-cold-breathe {
            0%   { transform: scale(0.96); }
            50%  { transform: scale(1.03); }
            100% { transform: scale(0.96); }
          }

          @keyframes temp-cold-glow {
            0% {
              box-shadow:
                0 0 20px 0 rgba(var(--temp-rgb), 0.6),
                0 0 34px 6 rgba(var(--temp-rgb), 0.55);
            }
            50% {
              box-shadow:
                0 0 30px 4 rgba(var(--temp-rgb), 0.95),
                0 0 50px 10px rgba(var(--temp-rgb), 0.85);
            }
            100% {
              box-shadow:
                0 0 20px 0 rgba(var(--temp-rgb), 0.6),
                0 0 34px 6 rgba(var(--temp-rgb), 0.55);
            }
          }

          @keyframes temp-cold-halo {
            0% {
              box-shadow:
                0 0 80px 20px rgba(var(--temp-rgb), 0.35),
                0 -20px 80px -14px rgba(220, 240, 255, 0.55);
            }
            50% {
              box-shadow:
                0 0 130px 36px rgba(var(--temp-rgb), 0.5),
                0 -34px 100px -8px rgba(240, 250, 255, 0.8);
            }
            100% {
              box-shadow:
                0 0 80px 20px rgba(var(--temp-rgb), 0.35),
                0 -20px 80px -14px rgba(220, 240, 255, 0.55);
            }
          }

          /* ========== FRAIS ========== */
          @keyframes temp-cool-wave {
            0%   { transform: translateX(0); }
            25%  { transform: translateX(-1px); }
            50%  { transform: translateX(1px) translateY(-1px); }
            75%  { transform: translateX(-1px); }
            100% { transform: translateX(0); }
          }

          @keyframes temp-cool-glow {
            0% {
              box-shadow:
                0 0 22px 0 rgba(var(--temp-rgb), 0.6),
                0 0 34px 4 rgba(var(--temp-rgb), 0.7);
            }
            50% {
              box-shadow:
                0 0 28px 2 rgba(var(--temp-rgb), 0.95),
                0 0 48px 12px rgba(var(--temp-rgb), 0.85);
            }
            100% {
              box-shadow:
                0 0 22px 0 rgba(var(--temp-rgb), 0.6),
                0 0 34px 4 rgba(var(--temp-rgb), 0.7);
            }
          }

          @keyframes temp-cool-halo {
            0% {
              box-shadow:
                0 0 90px 26px rgba(var(--temp-rgb), 0.35),
                0 18px 80px -12px rgba(0, 220, 255, 0.35);
            }
            50% {
              box-shadow:
                0 0 140px 42px rgba(var(--temp-rgb), 0.45),
                0 30px 110px -10px rgba(0, 255, 255, 0.5);
            }
            100% {
              box-shadow:
                0 0 90px 26px rgba(var(--temp-rgb), 0.35),
                0 18px 80px -12px rgba(0, 220, 255, 0.35);
            }
          }

          /* ========== CONFORTABLE ========== */
          @keyframes temp-comfy-breathe {
            0%   { transform: scale(0.98); }
            50%  { transform: scale(1.05); }
            100% { transform: scale(0.98); }
          }

          @keyframes temp-comfy-glow {
            50% {
              box-shadow:
                0 0 26px 4 rgba(var(--temp-rgb), 0.9),
                0 0 42px 10px rgba(var(--temp-rgb), 0.85);
            }
          }

          @keyframes temp-comfy-halo {
            50% {
              box-shadow:
                0 0 120px 40px rgba(var(--temp-rgb), 0.45),
                0 26px 80px -10px rgba(180,255,200,0.5);
            }
          }

          /* ========== CHAUD ========== */
          @keyframes temp-warm-pulse {
            0%   { transform: scale(1); }
            50%  { transform: scale(1.07); }
            100% { transform: scale(1); }
          }

          @keyframes temp-warm-glow {
            50% {
              box-shadow:
                0 0 30px 4 rgba(var(--temp-rgb), 0.95),
                0 0 54px 14px rgba(var(--temp-rgb), 0.9);
            }
          }

          @keyframes temp-warm-halo {
            50% {
              box-shadow:
                0 0 140px 48px rgba(var(--temp-rgb), 0.55),
                0 26px 100px -10px rgba(255,210,150,0.5);
            }
          }

          /* ========== TRÈS CHAUD ========== */
          @keyframes temp-hot-shimmer {
            0%   { transform: scale(1); filter: blur(0); }
            50%  { transform: scale(1.08); filter: blur(0.6px); }
            100% { transform: scale(1); filter: blur(0); }
          }

          @keyframes temp-hot-glow {
            50% {
              box-shadow:
                0 0 34px 6 rgba(var(--temp-rgb), 1),
                0 0 62px 14px rgba(var(--temp-rgb), 0.95);
            }
          }

          @keyframes temp-hot-halo {
            50% {
              box-shadow:
                0 0 160px 60px rgba(var(--temp-rgb), 0.6),
                0 34px 120px -12px rgba(255,150,100,0.6);
            }
          }
        .: |
          mushroom-shape-icon {
            --icon-size: 46px;
            display: flex;
            margin: 0 8px 0 -12px !important;
            padding: 0 !important;
          }
          ha-card {
            clip-path: inset(0 0 0 0 round var(--ha-card-border-radius, 14px));
            height: 56px !important;
            padding: 6px 10px !important;
            
            /* TAILLE DE POLICE & ESPACEMENT */
            --card-primary-font-size: 1.25rem !important;
            --card-secondary-font-size: 0.85rem !important;
            
            /* Augmente l'espace vertical entre primaire et secondaire */
            --card-primary-line-height: 1.1 !important;
          }
  - type: custom:mushroom-entity-card
    entity: sensor.cuisine_capteur_mouvement_air_temperature
    tap_action:
      action: more-info
    icon: mdi:chef-hat
    name: Cuisine
    primary_info: state
    secondary_info: name
    card_mod:
      style:
        mushroom-shape-icon$: |
          .shape {
            {# ========== CONFIGURATION ========== #}
            {% set temp = states('sensor.cuisine_capteur_mouvement_air_temperature') | float(0) %}

            {# ------------------------------------------- #}
            {# TEMPÉRATURE → COULEUR + EFFETS              #}
            {# ------------------------------------------- #}

            {# VALEURS PAR DÉFAUT (seront remplacées selon les plages) #}
            {% set rgb = '0,140,255' %}
            {% set anim = 'temp-cold-breathe' %}
            {% set glow_anim = 'temp-cold-glow' %}
            {% set halo_anim = 'temp-cold-halo' %}
            {% set duration = 4.0 %}
            {% set intensity = 0.5 %}

            {# PLAGES DE TEMPÉRATURE / COULEURS #}
            {# Tu peux modifier les seuils de température ci-dessous si besoin #}

            {% if temp < 16 %}
              {# BLEU #}
              {% set rgb = '0,140,255' %}
              {% set anim = 'temp-cold-breathe' %}
              {% set glow_anim = 'temp-cold-glow' %}
              {% set halo_anim = 'temp-cold-halo' %}
              {% set duration = 4.4 %}
              {% set intensity = 0.4 %}

            {% elif temp < 18 %}
              {# JAUNE #}
              {% set rgb = '255,210,40' %}
              {% set anim = 'temp-cool-wave' %}
              {% set glow_anim = 'temp-cool-glow' %}
              {% set halo_anim = 'temp-cool-halo' %}
              {% set duration = 3.4 %}
              {% set intensity = 0.55 %}

            {% elif temp < 20 %}
              {# ORANGE #}
              {% set rgb = '255,150,40' %}
              {% set anim = 'temp-comfy-breathe' %}
              {% set glow_anim = 'temp-comfy-glow' %}
              {% set halo_anim = 'temp-comfy-halo' %}
              {% set duration = 3.0 %}
              {% set intensity = 0.6 %}

            {% elif temp < 22 %}
              {# ORANGE FONCÉ #}
              {% set rgb = '255,115,20' %}
              {% set anim = 'temp-warm-pulse' %}
              {% set glow_anim = 'temp-warm-glow' %}
              {% set halo_anim = 'temp-warm-halo' %}
              {% set duration = 2.4 %}
              {% set intensity = 0.8 %}

            {% else %}
              {# ROUGE #}
              {% set rgb = '255,40,40' %}
              {% set anim = 'temp-hot-shimmer' %}
              {% set glow_anim = 'temp-hot-glow' %}
              {% set halo_anim = 'temp-hot-halo' %}
              {% set duration = 2.0 %}
              {% set intensity = 1.0 %}
            {% endif %}

            {# Application des variables #}
            --temp-rgb: {{ rgb }};
            --temp-intensity: {{ intensity }};
            --shape-animation: {{ anim }} {{ duration }}s ease-in-out infinite;
            --temp-glow-animation: {{ glow_anim }} {{ (duration * 0.9) | round(2) }}s ease-in-out infinite;
            --temp-halo-animation: {{ halo_anim }} {{ (duration * 1.15) | round(2) }}s ease-in-out infinite;

            opacity: 1;

            /* Couleur de l'icône suit la température */
            --icon-color: rgba({{ rgb }}, 1) !important;
            --icon-color-disabled: rgba({{ rgb }}, 1) !important;
            
            /* CRUCIAL : Le fond prend la même couleur que l'icône avec transparence */
            --shape-color: rgba({{ rgb }}, 0.2) !important;

            /* 🔧 SUPPRIMER LE BLEU DU THÈME & RENDRE LE FOND NEUTRE */
            background: rgba({{ rgb }}, 0.1) !important;
            background-color: rgba({{ rgb }}, 0.1) !important;
            box-shadow: none !important;
            border: 1px solid rgba(255, 255, 255, 0.06) !important;

            position: relative;
            transform-origin: 50% 60%;
            animation: var(--shape-animation);
          }

          /* Couches de lueur */
          .shape::before,
          .shape::after {
            content: '';
            position: absolute;
            border-radius: inherit;
            pointer-events: none;
          }

          .shape::before {
            inset: -8px;
            animation: var(--temp-glow-animation);
          }

          .shape::after {
            inset: -22px;
            animation: var(--temp-halo-animation);
            mix-blend-mode: screen;
          }

          /* ========== FROID ========== */
          @keyframes temp-cold-breathe {
            0%   { transform: scale(0.96); }
            50%  { transform: scale(1.03); }
            100% { transform: scale(0.96); }
          }

          @keyframes temp-cold-glow {
            0% {
              box-shadow:
                0 0 20px 0 rgba(var(--temp-rgb), 0.6),
                0 0 34px 6 rgba(var(--temp-rgb), 0.55);
            }
            50% {
              box-shadow:
                0 0 30px 4 rgba(var(--temp-rgb), 0.95),
                0 0 50px 10px rgba(var(--temp-rgb), 0.85);
            }
            100% {
              box-shadow:
                0 0 20px 0 rgba(var(--temp-rgb), 0.6),
                0 0 34px 6 rgba(var(--temp-rgb), 0.55);
            }
          }

          @keyframes temp-cold-halo {
            0% {
              box-shadow:
                0 0 80px 20px rgba(var(--temp-rgb), 0.35),
                0 -20px 80px -14px rgba(220, 240, 255, 0.55);
            }
            50% {
              box-shadow:
                0 0 130px 36px rgba(var(--temp-rgb), 0.5),
                0 -34px 100px -8px rgba(240, 250, 255, 0.8);
            }
            100% {
              box-shadow:
                0 0 80px 20px rgba(var(--temp-rgb), 0.35),
                0 -20px 80px -14px rgba(220, 240, 255, 0.55);
            }
          }

          /* ========== FRAIS ========== */
          @keyframes temp-cool-wave {
            0%   { transform: translateX(0); }
            25%  { transform: translateX(-1px); }
            50%  { transform: translateX(1px) translateY(-1px); }
            75%  { transform: translateX(-1px); }
            100% { transform: translateX(0); }
          }

          @keyframes temp-cool-glow {
            0% {
              box-shadow:
                0 0 22px 0 rgba(var(--temp-rgb), 0.6),
                0 0 34px 4 rgba(var(--temp-rgb), 0.7);
            }
            50% {
              box-shadow:
                0 0 28px 2 rgba(var(--temp-rgb), 0.95),
                0 0 48px 12px rgba(var(--temp-rgb), 0.85);
            }
            100% {
              box-shadow:
                0 0 22px 0 rgba(var(--temp-rgb), 0.6),
                0 0 34px 4 rgba(var(--temp-rgb), 0.7);
            }
          }

          @keyframes temp-cool-halo {
            0% {
              box-shadow:
                0 0 90px 26px rgba(var(--temp-rgb), 0.35),
                0 18px 80px -12px rgba(0, 220, 255, 0.35);
            }
            50% {
              box-shadow:
                0 0 140px 42px rgba(var(--temp-rgb), 0.45),
                0 30px 110px -10px rgba(0, 255, 255, 0.5);
            }
            100% {
              box-shadow:
                0 0 90px 26px rgba(var(--temp-rgb), 0.35),
                0 18px 80px -12px rgba(0, 220, 255, 0.35);
            }
          }

          /* ========== CONFORTABLE ========== */
          @keyframes temp-comfy-breathe {
            0%   { transform: scale(0.98); }
            50%  { transform: scale(1.05); }
            100% { transform: scale(0.98); }
          }

          @keyframes temp-comfy-glow {
            50% {
              box-shadow:
                0 0 26px 4 rgba(var(--temp-rgb), 0.9),
                0 0 42px 10px rgba(var(--temp-rgb), 0.85);
            }
          }

          @keyframes temp-comfy-halo {
            50% {
              box-shadow:
                0 0 120px 40px rgba(var(--temp-rgb), 0.45),
                0 26px 80px -10px rgba(180,255,200,0.5);
            }
          }

          /* ========== CHAUD ========== */
          @keyframes temp-warm-pulse {
            0%   { transform: scale(1); }
            50%  { transform: scale(1.07); }
            100% { transform: scale(1); }
          }

          @keyframes temp-warm-glow {
            50% {
              box-shadow:
                0 0 30px 4 rgba(var(--temp-rgb), 0.95),
                0 0 54px 14px rgba(var(--temp-rgb), 0.9);
            }
          }

          @keyframes temp-warm-halo {
            50% {
              box-shadow:
                0 0 140px 48px rgba(var(--temp-rgb), 0.55),
                0 26px 100px -10px rgba(255,210,150,0.5);
            }
          }

          /* ========== TRÈS CHAUD ========== */
          @keyframes temp-hot-shimmer {
            0%   { transform: scale(1); filter: blur(0); }
            50%  { transform: scale(1.08); filter: blur(0.6px); }
            100% { transform: scale(1); filter: blur(0); }
          }

          @keyframes temp-hot-glow {
            50% {
              box-shadow:
                0 0 34px 6 rgba(var(--temp-rgb), 1),
                0 0 62px 14px rgba(var(--temp-rgb), 0.95);
            }
          }

          @keyframes temp-hot-halo {
            50% {
              box-shadow:
                0 0 160px 60px rgba(var(--temp-rgb), 0.6),
                0 34px 120px -12px rgba(255,150,100,0.6);
            }
          }
        .: |
          mushroom-shape-icon {
            --icon-size: 46px;
            display: flex;
            margin: 0 8px 0 -12px !important;
            padding: 0 !important;
          }
          ha-card {
            clip-path: inset(0 0 0 0 round var(--ha-card-border-radius, 14px));
            height: 56px !important;
            padding: 6px 10px !important;
            
            /* TAILLE DE POLICE & ESPACEMENT */
            --card-primary-font-size: 1.25rem !important;
            --card-secondary-font-size: 0.85rem !important;
            
            /* Augmente l'espace vertical entre primaire et secondaire */
            --card-primary-line-height: 1.1 !important;
          }

Vous pouvez remarquer que je reproduis plusieurs fois les même séquence de code :

/* ========== FROID ========== */
@keyframes temp-cold-breathe { ... }
@keyframes temp-cold-glow { ... }
@keyframes temp-cold-halo { ... }

/* ========== FRAIS ========== */
@keyframes temp-cool-wave { ... }
@keyframes temp-cool-glow { ... }
@keyframes temp-cool-halo { ... }

/* ========== CONFORTABLE ========== */
@keyframes temp-comfy-breathe { ... }
@keyframes temp-comfy-glow { ... }
@keyframes temp-comfy-halo { ... }

/* ========== CHAUD ========== */
@keyframes temp-warm-pulse { ... }
@keyframes temp-warm-glow { ... }
@keyframes temp-warm-halo { ... }

/* ========== TRÈS CHAUD ========== */
@keyframes temp-hot-shimmer { ... }
@keyframes temp-hot-glow { ... }
@keyframes temp-hot-halo { ... }

Et j’en passe, il y a t’il un moyen d’éviter de reproduire ce code comme pour une css sur un site web par exemple.

Salut,

Tu peux passer par les cartes GitHub - brunosabot/streamline-card: Streamline your Lovelace configuration with with a card template system. par ex

Merci beaucoup, je vais regarder ca mais ca a l’ai pile poil ce que j’ai besoin

Salut j’ai suivi le tuto mais j’ai une erreur et je n’arrive pas trouver ou

Peux tu m’aider ?

Salut,

Si tu partages ce que tu as fait (code pour commencer) on doit pouvoir jeter un oeil

Hello,

à chaque fois que tu touches aux templates, il faut faire F5 idem pour toutes les cartes qui se basent dessus. Au cas où

cdt

Evidement suis bête

type: vertical-stack
cards:
  - type: conditional
    conditions: []
    card:
      type: custom:bubble-card
      card_type: separator
      name: Alertes Infrastructure
      icon: mdi:alert-circle
      sub_button:
        - tap_action:
            action: navigate
            navigation_path: "#config-alerte-serveur"
          icon: mdi:cog
        - icon: mdi:google-assistant
          tap_action:
            action: navigate
            navigation_path: "#analyse-gemini"
  - type: conditional
    conditions: []
    card:
      type: custom:streamline-card
      template: carte_serveur_standard
      variables:
        - server_id: pve1
        - server_name: PVE1
        - server_type: Hôte
        - server_ip: 192.168.1.20
        - server_icon: mdi:server
  - type: conditional
    conditions: []
    card:
      type: custom:streamline-card
      template: carte_serveur_standard
      variables:
        - server_id: pve2
        - server_name: PVE2
        - server_type: Hôte
        - server_ip: 192.168.1.22
        - server_icon: mdi:server
  - type: conditional
    conditions: []
    card:
      type: custom:streamline-card
      template: carte_serveur_standard
      variables:
        - server_id: pve3
        - server_name: PVE3
        - server_type: Hôte
        - server_ip: 192.168.1.23
        - server_icon: mdi:server
  - type: conditional
    conditions: []
    card:
      type: custom:streamline-card
      template: carte_serveur_docker
      variables:
        - server_id: vaultwarden
        - server_name: Vaultwarden
        - server_type: LXC 101
        - server_ip: 192.168.1.19
        - server_icon: mdi:shield-key
        - app_sensor: vaultwarden
        - app_name: Vaultwarden
        - backup_id: vaultwarden
        - lxc_id: lxc_101
  - type: conditional
    conditions: []
    card:
      type: custom:streamline-card
      template: carte_serveur_docker
      variables:
        - server_id: nodred
        - server_name: Node-RED
        - server_type: LXC 102
        - server_ip: 192.168.1.9
        - server_icon: mdi:connection
        - app_sensor: node_red
        - app_name: Node-RED
        - backup_id: node_red
        - lxc_id: lxc_102
  - type: conditional
    conditions: []
    card:
      type: custom:streamline-card
      template: carte_serveur_docker
      variables:
        - server_id: paperless_ngx
        - server_name: Paperless
        - server_type: LXC 103
        - server_ip: 192.168.1.13
        - server_icon: mdi:file-document-outline
        - app_sensor: paperless
        - app_name: Paperless
        - backup_id: paperless
        - lxc_id: lxc_103
  - type: conditional
    conditions: []
    card:
      type: custom:streamline-card
      template: carte_serveur_standard
      variables:
        - server_id: zerotrust
        - server_name: ZeroTrust
        - server_type: LXC 104
        - server_ip: 192.168.1.15
        - server_icon: mdi:shield-lock
  - type: conditional
    conditions: []
    card:
      type: custom:streamline-card
      template: carte_serveur_docker
      variables:
        - server_id: n8n
        - server_name: n8n
        - server_type: LXC 105
        - server_ip: 192.168.1.14
        - server_icon: mdi:atom-variant
        - app_sensor: n8n
        - app_name: n8n
        - backup_id: n8n
        - lxc_id: lxc_105
  - type: conditional
    conditions: []
    card:
      type: custom:streamline-card
      template: carte_serveur_docker
      variables:
        - server_id: mqtt
        - server_name: MQTT
        - server_type: LXC 106
        - server_ip: 192.168.1.10
        - server_icon: mdi:lan-connect
        - app_sensor: mosquitto
        - app_name: Mosquitto
        - backup_id: mqtt
        - lxc_id: lxc_106
  - type: conditional
    conditions: []
    card:
      type: custom:streamline-card
      template: carte_serveur_docker
      variables:
        - server_id: zigbee2mqtt
        - server_name: Zigbee2MQTT
        - server_type: LXC 207
        - server_ip: 192.168.1.16
        - server_icon: mdi:zigbee
        - app_sensor: zigbee2mqtt
        - app_name: Zigbee2MQTT
        - backup_id: zigbee2mqtt
        - lxc_id: lxc_207
  - type: custom:streamline-card
    template: example_tile
    variables: {}

j’ai remplacé le code exemple dans :

et celui ci est :

carte_serveur_docker:
  default:
    - server_icon: mdi:server
    - app_name: Application
  card:
    type: custom:stack-in-card
    mode: vertical
    card_mod:
      style: |
        ha-card {
          {% set unk = ['unknown','unavailable','none',''] %}
          {% set cpu = states('sensor.glance_[[server_id]]_utilisation_cpu')|float(0) %}
          {% set ram = states('sensor.glance_[[server_id]]_utilisation_de_la_memoire')|float(0) %}
          {% set disk = states('sensor.glance_[[server_id]]_utilisation_disque')|float(0) %}
          {% set maj = states('sensor.maj_[[server_id]]')|int(0) %}
          {% set maj_secu = states('sensor.maj_securite_[[server_id]]')|int(0) %}
          {% set reboot = is_state('binary_sensor.reboot_requis_[[server_id]]','on') %}
          {% set vloc = states('sensor.[[app_sensor]]_version_locale') %}
          {% set vumt = states('sensor.[[app_sensor]]_version_amont') %}
          {% set dloc = states('sensor.docker_version_[[server_id]]_locale') %}
          {% set dumt = states('sensor.docker_version_[[server_id]]_amont') %}
          {% set app_maj = (vloc not in unk) and (vumt not in unk) and (vloc != vumt) %}
          {% set docker_maj = (dloc not in unk) and (dumt not in unk) and (dloc != dumt) %}
          {% set ok_cfg = is_state('binary_sensor.config_backup_[[backup_id]]_ok','on') %}
          {% set exp = is_state('binary_sensor.sauvegarde_[[lxc_id]]_expiree','on') %}
          {% set critical = (cpu > 90) or (ram > 90) or (disk > 90) %}
          {% set backup_bad = (not ok_cfg) or exp %}
          {% set warning = (cpu > 80) or (ram > 80) or (disk > 80) %}
          {% set updates = (maj > 0) or (maj_secu > 0) or reboot or app_maj or docker_maj %}
          
          {% if critical or backup_bad %}
            border-left: 4px solid rgb(244, 67, 54) !important;
          {% elif warning or updates %}
            border-left: 4px solid rgb(255, 152, 0) !important;
          {% else %}
            border-left: 4px solid rgb(76, 175, 80) !important;
          {% endif %}
          
          overflow: hidden !important;
          padding: 0px !important;
          padding-top: 0px !important;
        }
        ha-card > div {
          padding: 0px !important;
          padding-top: 0px !important;
          margin-bottom: -8px !important;
        }
    cards:
      - type: custom:mushroom-entity-card
        entity: sensor.glance_[[server_id]]_utilisation_cpu
        name: "[[server_name]] ([[server_type]] - [[server_ip]])"
        icon: "[[server_icon]]"
        secondary_info: none
        tap_action:
          action: navigate
          navigation_path: "#serveur-[[server_id]]"
        card_mod:
          style:
            mushroom-shape-icon$: |
              .shape {
                {% set unk = ['unknown','unavailable','none',''] %}
                {% set cpu = states('sensor.glance_[[server_id]]_utilisation_cpu')|float(0) %}
                {% set ram = states('sensor.glance_[[server_id]]_utilisation_de_la_memoire')|float(0) %}
                {% set disk = states('sensor.glance_[[server_id]]_utilisation_disque')|float(0) %}
                {% set ok_cfg = is_state('binary_sensor.config_backup_[[backup_id]]_ok','on') %}
                {% set exp = is_state('binary_sensor.sauvegarde_[[lxc_id]]_expiree','on') %}
                {% set critical = (cpu > 90) or (ram > 90) or (disk > 90) %}
                {% set backup_bad = (not ok_cfg) or exp %}
                {% set warning = (cpu > 80) or (ram > 80) or (disk > 80) %}
                {% set vloc = states('sensor.[[app_sensor]]_version_locale') %}
                {% set vumt = states('sensor.[[app_sensor]]_version_amont') %}
                {% set dloc = states('sensor.docker_version_[[server_id]]_locale') %}
                {% set dumt = states('sensor.docker_version_[[server_id]]_amont') %}
                {% set app_maj = (vloc not in unk) and (vumt not in unk) and (vloc != vumt) %}
                {% set docker_maj = (dloc not in unk) and (dumt not in unk) and (dloc != dumt) %}
                {% set maj = states('sensor.maj_[[server_id]]')|int(0) %}
                {% set maj_secu = states('sensor.maj_securite_[[server_id]]')|int(0) %}
                {% set reboot = is_state('binary_sensor.reboot_requis_[[server_id]]','on') %}
                {% set updates = (maj > 0) or (maj_secu > 0) or reboot or app_maj or docker_maj %}
                
                {% if critical or backup_bad %}
                  --icon-color: rgb(244, 67, 54);
                  --shape-color: rgba(244, 67, 54, 0.2);
                  animation: flame-core 1.4s infinite;
                {% elif warning or updates %}
                  --icon-color: rgb(255, 152, 0);
                  --shape-color: rgba(255, 152, 0, 0.2);
                  animation: warning-glow 2s ease-in-out infinite;
                {% else %}
                  --icon-color: rgb(76, 175, 80);
                  --shape-color: rgba(76, 175, 80, 0.2);
                {% endif %}
                
                position: relative;
                transform-origin: 50% 75%;
              }
              .shape::before { content: ""; position: absolute; inset: -8px; border-radius: inherit; pointer-events: none; filter: blur(3px); {% set unk = ['unknown','unavailable','none',''] %} {% set cpu = states('sensor.glance_[[server_id]]_utilisation_cpu')|float(0) %} {% set ram = states('sensor.glance_[[server_id]]_utilisation_de_la_memoire')|float(0) %} {% set disk = states('sensor.glance_[[server_id]]_utilisation_disque')|float(0) %} {% set ok_cfg = is_state('binary_sensor.config_backup_[[backup_id]]_ok','on') %} {% set exp = is_state('binary_sensor.sauvegarde_[[lxc_id]]_expiree','on') %} {% set critical = (cpu > 90) or (ram > 90) or (disk > 90) %} {% set backup_bad = (not ok_cfg) or exp %} {% set warning = (cpu > 80) or (ram > 80) or (disk > 80) %} {% set vloc = states('sensor.[[app_sensor]]_version_locale') %} {% set vumt = states('sensor.[[app_sensor]]_version_amont') %} {% set dloc = states('sensor.docker_version_[[server_id]]_locale') %} {% set dumt = states('sensor.docker_version_[[server_id]]_amont') %} {% set app_maj = (vloc not in unk) and (vumt not in unk) and (vloc != vumt) %} {% set docker_maj = (dloc not in unk) and (dumt not in unk) and (dloc != dumt) %} {% set maj = states('sensor.maj_[[server_id]]')|int(0) %} {% set maj_secu = states('sensor.maj_securite_[[server_id]]')|int(0) %} {% set reboot = is_state('binary_sensor.reboot_requis_[[server_id]]','on') %} {% set updates = (maj > 0) or (maj_secu > 0) or reboot or app_maj or docker_maj %} {% if critical or backup_bad %} animation: flame-layers 1.8s infinite; {% elif warning or updates %} animation: warning-layers 2s ease-in-out infinite; {% endif %} }
              .shape::after { content: ""; position: absolute; inset: -8px; border-radius: inherit; pointer-events: none; filter: blur(3px); {% set unk = ['unknown','unavailable','none',''] %} {% set cpu = states('sensor.glance_[[server_id]]_utilisation_cpu')|float(0) %} {% set ram = states('sensor.glance_[[server_id]]_utilisation_de_la_memoire')|float(0) %} {% set disk = states('sensor.glance_[[server_id]]_utilisation_disque')|float(0) %} {% set ok_cfg = is_state('binary_sensor.config_backup_[[backup_id]]_ok','on') %} {% set exp = is_state('binary_sensor.sauvegarde_[[lxc_id]]_expiree','on') %} {% set critical = (cpu > 90) or (ram > 90) or (disk > 90) %} {% set backup_bad = (not ok_cfg) or exp %} {% if critical or backup_bad %} animation: ember-pulse 2.4s infinite; {% endif %} }
              @keyframes flame-core { 0% { transform: translateY(0) scale(1); filter: brightness(1.1) hue-rotate(0deg); } 12% { transform: translateY(-2px) scale(1.05); filter: brightness(1.4) hue-rotate(-10deg); } 25% { transform: translateY(1px) scale(0.98); filter: brightness(0.9) hue-rotate(8deg); } 40% { transform: translateY(-3px) scale(1.07); filter: brightness(1.5) hue-rotate(-18deg); } 55% { transform: translateY(0) scale(1.02); filter: brightness(1.2) hue-rotate(10deg); } 70% { transform: translateY(-1px) scale(1.04); filter: brightness(1.35) hue-rotate(-6deg); } 85% { transform: translateY(2px) scale(0.97); filter: brightness(0.95) hue-rotate(6deg); } 100% { transform: translateY(0) scale(1); filter: brightness(1.1) hue-rotate(0deg); } }
              @keyframes flame-layers { 0% { box-shadow: 0 0 14px 8px rgba(244, 67, 54, 0.8), 0 -12px 24px -6px rgba(255, 80, 0, 0.4); } 33% { box-shadow: 0 0 20px 10px rgba(244, 67, 54, 1), 0 -16px 30px -8px rgba(255, 60, 0, 0.5); } 66% { box-shadow: 0 0 18px 9px rgba(244, 67, 54, 0.9), 0 -8px 20px -6px rgba(255, 100, 0, 0.35); } 100% { box-shadow: 0 0 14px 8px rgba(244, 67, 54, 0.8), 0 -12px 24px -6px rgba(255, 80, 0, 0.4); } }
              @keyframes ember-pulse { 0% { box-shadow: 0 0 30px 10px rgba(244, 67, 54, 0.25), 0 0 60px 20px rgba(255, 40, 0, 0.15); } 50% { box-shadow: 0 0 50px 18px rgba(244, 67, 54, 0.5), 0 0 90px 35px rgba(255, 80, 0, 0.25); } 100% { box-shadow: 0 0 30px 10px rgba(244, 67, 54, 0.25), 0 0 60px 20px rgba(255, 40, 0, 0.15); } }
              @keyframes warning-glow { 0%, 100% { transform: scale(1); filter: brightness(1); } 50% { transform: scale(1.05); filter: brightness(1.3); } }
              @keyframes warning-layers { 0% { box-shadow: 0 0 10px 5px rgba(255, 152, 0, 0.6), 0 -8px 16px -4px rgba(255, 180, 0, 0.3); } 50% { box-shadow: 0 0 20px 10px rgba(255, 152, 0, 0.9), 0 -16px 28px -6px rgba(255, 180, 0, 0.5); } 100% { box-shadow: 0 0 10px 5px rgba(255, 152, 0, 0.6), 0 -8px 16px -4px rgba(255, 180, 0, 0.3); } }
            mushroom-badge-icon$: |
              .badge { background-color: rgb(33, 150, 243) !important; }
            .: |
              ha-card { clip-path: inset(0 0 0 0 round var(--ha-card-border-radius, 12px)); padding-bottom: 0px !important; margin-bottom: 0px !important; border: none !important; box-shadow: none !important; }
              mushroom-badge-icon { --main-color: rgb(33, 150, 243); }
              mushroom-state-info { margin-left: 17px !important; margin-top: -7px !important; }
      - type: custom:mushroom-template-card
        tap_action:
          action: navigate
          navigation_path: "#serveur-[[server_id]]"
        primary: ""
        secondary: >
          {% set unk = ['unknown','unavailable','none',''] %}
          {% set cpu = states('sensor.glance_[[server_id]]_utilisation_cpu')|float(0) %}
          {% set ram = states('sensor.glance_[[server_id]]_utilisation_de_la_memoire')|float(0) %}
          {% set disk = states('sensor.glance_[[server_id]]_utilisation_disque')|float(0) %}
          {% set maj = states('sensor.maj_[[server_id]]')|int(0) %}
          {% set maj_secu = states('sensor.maj_securite_[[server_id]]')|int(0) %}
          {% set reboot = is_state('binary_sensor.reboot_requis_[[server_id]]','on') %}
          {% set vloc = states('sensor.[[app_sensor]]_version_locale') %}
          {% set vumt = states('sensor.[[app_sensor]]_version_amont') %}
          {% set dloc = states('sensor.docker_version_[[server_id]]_locale') %}
          {% set dumt = states('sensor.docker_version_[[server_id]]_amont') %}
          {% set app_maj = (vloc not in unk) and (vumt not in unk) and (vloc != vumt) %}
          {% set docker_maj = (dloc not in unk) and (dumt not in unk) and (dloc != dumt) %}
          {% set ok_cfg = is_state('binary_sensor.config_backup_[[backup_id]]_ok','on') %}
          {% set exp = is_state('binary_sensor.sauvegarde_[[lxc_id]]_expiree','on') %}
          {% set problems = [] %}
          {% if cpu>90 %}{% set problems = problems + ['🚨 CPU critique (' + cpu|round(1)|string + '%)'] %}
          {% elif cpu>80 %}{% set problems = problems + ['⚠️ CPU élevé (' + cpu|round(1)|string + '%)'] %}{% endif %}
          {% if ram>90 %}{% set problems = problems + ['🚨 RAM critique (' + ram|round(0)|string + '%)'] %}
          {% elif ram>80 %}{% set problems = problems + ['⚠️ RAM élevée (' + ram|round(0)|string + '%)'] %}{% endif %}
          {% if disk>90 %}{% set problems = problems + ['🚨 Disque critique (' + disk|round(0)|string + '%)'] %}
          {% elif disk>80 %}{% set problems = problems + ['⚠️ Disque élevé (' + disk|round(0)|string + '%)'] %}{% endif %}
          {% if not ok_cfg %}{% set problems = problems + ['❌ Config backup KO'] %}{% endif %}
          {% if exp %}{% set problems = problems + ['❌ Backup expiré'] %}{% endif %}
          {% if reboot %}{% set problems = problems + ['🔄 Reboot requis'] %}{% endif %}
          {% if maj_secu > 0 %}{% set problems = problems + ['🛡️ ' + maj_secu|string + ' MAJ sécurité'] %}{% endif %}
          {% if maj > 0 %}{% set problems = problems + ['📦 ' + maj|string + ' MAJ système'] %}{% endif %}
          {% if app_maj %}{% set problems = problems + ['📦 MAJ [[app_name]] ' + vloc + ' → ' + vumt] %}{% endif %}
          {% if docker_maj %}{% set problems = problems + ['🐳 MAJ Docker ' + dloc + ' → ' + dumt] %}{% endif %}
          {{ problems|join(' · ') if problems else '✅ Aucun problème' }}
        multiline_secondary: true
        icon: ""
        badge_icon: mdi:docker
        badge_color: blue
        card_mod:
          style: |
            ha-card { box-shadow: none !important; border: none !important; background: transparent !important; padding-top: 0px !important; margin-top: -38px !important; padding-left: 58px !important; padding-right: 16px !important; padding-bottom: 0px !important; margin-bottom: 0px !important; }
            mushroom-badge-icon { display: none !important; }

carte_serveur_standard:
  default:
    - server_icon: mdi:server
  card:
    type: custom:stack-in-card
    mode: vertical
    card_mod:
      style: |
        ha-card {
          {% set cpu = states('sensor.glance_[[server_id]]_utilisation_cpu')|float(0) %}
          {% set ram = states('sensor.glance_[[server_id]]_utilisation_de_la_memoire')|float(0) %}
          {% set disk = states('sensor.glance_[[server_id]]_utilisation_disque')|float(0) %}
          {% set maj = states('sensor.maj_[[server_id]]')|int(0) %}
          {% set maj_secu = states('sensor.maj_securite_[[server_id]]')|int(0) %}
          {% set reboot = is_state('binary_sensor.reboot_requis_[[server_id]]','on') %}
          {% set critical = (cpu > 90) or (ram > 90) or (disk > 90) %}
          {% set warning = (cpu > 80) or (ram > 80) or (disk > 80) %}
          {% set updates = (maj > 0) or (maj_secu > 0) or reboot %}
          
          {% if critical %}
            border-left: 4px solid rgb(244, 67, 54) !important;
          {% elif warning or updates %}
            border-left: 4px solid rgb(255, 152, 0) !important;
          {% else %}
            border-left: 4px solid rgb(76, 175, 80) !important;
          {% endif %}
          
          overflow: hidden !important;
          padding: 0px !important;
          padding-top: 0px !important;
        }
        ha-card > div {
          padding: 0px !important;
          padding-top: 0px !important;
          margin-bottom: -8px !important;
        }
    cards:
      - type: custom:mushroom-entity-card
        entity: sensor.glance_[[server_id]]_utilisation_cpu
        name: "[[server_name]] ([[server_type]] - [[server_ip]])"
        icon: "[[server_icon]]"
        secondary_info: none
        tap_action:
          action: navigate
          navigation_path: "#serveur-[[server_id]]"
        card_mod:
          style:
            mushroom-shape-icon$: |
              .shape {
                {% set cpu = states('sensor.glance_[[server_id]]_utilisation_cpu')|float(0) %}
                {% set ram = states('sensor.glance_[[server_id]]_utilisation_de_la_memoire')|float(0) %}
                {% set disk = states('sensor.glance_[[server_id]]_utilisation_disque')|float(0) %}
                {% set critical = (cpu > 90) or (ram > 90) or (disk > 90) %}
                {% set warning = (cpu > 80) or (ram > 80) or (disk > 80) %}
                {% set maj = states('sensor.maj_[[server_id]]')|int(0) %}
                {% set maj_secu = states('sensor.maj_securite_[[server_id]]')|int(0) %}
                {% set reboot = is_state('binary_sensor.reboot_requis_[[server_id]]','on') %}
                {% set updates = (maj > 0) or (maj_secu > 0) or reboot %}
                
                {% if critical %}
                  --icon-color: rgb(244, 67, 54);
                  --shape-color: rgba(244, 67, 54, 0.2);
                  animation: flame-core 1.4s infinite;
                {% elif warning or updates %}
                  --icon-color: rgb(255, 152, 0);
                  --shape-color: rgba(255, 152, 0, 0.2);
                  animation: warning-glow 2s ease-in-out infinite;
                {% else %}
                  --icon-color: rgb(76, 175, 80);
                  --shape-color: rgba(76, 175, 80, 0.2);
                {% endif %}
                
                position: relative;
                transform-origin: 50% 75%;
              }

              .shape::before {
                content: "";
                position: absolute;
                inset: -8px;
                border-radius: inherit;
                pointer-events: none;
                filter: blur(3px);
                
                {% set cpu = states('sensor.glance_[[server_id]]_utilisation_cpu')|float(0) %}
                {% set ram = states('sensor.glance_[[server_id]]_utilisation_de_la_memoire')|float(0) %}
                {% set disk = states('sensor.glance_[[server_id]]_utilisation_disque')|float(0) %}
                {% set critical = (cpu > 90) or (ram > 90) or (disk > 90) %}
                {% set warning = (cpu > 80) or (ram > 80) or (disk > 80) %}
                {% set maj = states('sensor.maj_[[server_id]]')|int(0) %}
                {% set maj_secu = states('sensor.maj_securite_[[server_id]]')|int(0) %}
                {% set reboot = is_state('binary_sensor.reboot_requis_[[server_id]]','on') %}
                {% set updates = (maj > 0) or (maj_secu > 0) or reboot %}
                
                {% if critical %}
                  animation: flame-layers 1.8s infinite;
                {% elif warning or updates %}
                  animation: warning-layers 2s ease-in-out infinite;
                {% endif %}
              }

              .shape::after {
                content: "";
                position: absolute;
                inset: -8px;
                border-radius: inherit;
                pointer-events: none;
                filter: blur(3px);
                
                {% set cpu = states('sensor.glance_[[server_id]]_utilisation_cpu')|float(0) %}
                {% set ram = states('sensor.glance_[[server_id]]_utilisation_de_la_memoire')|float(0) %}
                {% set disk = states('sensor.glance_[[server_id]]_utilisation_disque')|float(0) %}
                {% set critical = (cpu > 90) or (ram > 90) or (disk > 90) %}
                
                {% if critical %}
                  animation: ember-pulse 2.4s infinite;
                {% endif %}
              }

              @keyframes flame-core { 0% { transform: translateY(0) scale(1); filter: brightness(1.1) hue-rotate(0deg); } 12% { transform: translateY(-2px) scale(1.05); filter: brightness(1.4) hue-rotate(-10deg); } 25% { transform: translateY(1px) scale(0.98); filter: brightness(0.9) hue-rotate(8deg); } 40% { transform: translateY(-3px) scale(1.07); filter: brightness(1.5) hue-rotate(-18deg); } 55% { transform: translateY(0) scale(1.02); filter: brightness(1.2) hue-rotate(10deg); } 70% { transform: translateY(-1px) scale(1.04); filter: brightness(1.35) hue-rotate(-6deg); } 85% { transform: translateY(2px) scale(0.97); filter: brightness(0.95) hue-rotate(6deg); } 100% { transform: translateY(0) scale(1); filter: brightness(1.1) hue-rotate(0deg); } }
              @keyframes flame-layers { 0% { box-shadow: 0 0 14px 8px rgba(244, 67, 54, 0.8), 0 -12px 24px -6px rgba(255, 80, 0, 0.4); } 33% { box-shadow: 0 0 20px 10px rgba(244, 67, 54, 1), 0 -16px 30px -8px rgba(255, 60, 0, 0.5); } 66% { box-shadow: 0 0 18px 9px rgba(244, 67, 54, 0.9), 0 -8px 20px -6px rgba(255, 100, 0, 0.35); } 100% { box-shadow: 0 0 14px 8px rgba(244, 67, 54, 0.8), 0 -12px 24px -6px rgba(255, 80, 0, 0.4); } }
              @keyframes ember-pulse { 0% { box-shadow: 0 0 30px 10px rgba(244, 67, 54, 0.25), 0 0 60px 20px rgba(255, 40, 0, 0.15); } 50% { box-shadow: 0 0 50px 18px rgba(244, 67, 54, 0.5), 0 0 90px 35px rgba(255, 80, 0, 0.25); } 100% { box-shadow: 0 0 30px 10px rgba(244, 67, 54, 0.25), 0 0 60px 20px rgba(255, 40, 0, 0.15); } }
              @keyframes warning-glow { 0%, 100% { transform: scale(1); filter: brightness(1); } 50% { transform: scale(1.05); filter: brightness(1.3); } }
              @keyframes warning-layers { 0% { box-shadow: 0 0 10px 5px rgba(255, 152, 0, 0.6), 0 -8px 16px -4px rgba(255, 180, 0, 0.3); } 50% { box-shadow: 0 0 20px 10px rgba(255, 152, 0, 0.9), 0 -16px 28px -6px rgba(255, 180, 0, 0.5); } 100% { box-shadow: 0 0 10px 5px rgba(255, 152, 0, 0.6), 0 -8px 16px -4px rgba(255, 180, 0, 0.3); } }
            .: |
              ha-card { clip-path: inset(0 0 0 0 round var(--ha-card-border-radius, 12px)); padding-bottom: 0px !important; margin-bottom: 0px !important; border: none !important; box-shadow: none !important; }
              mushroom-state-info { margin-left: 17px !important; margin-top: -7px !important; }
      - type: custom:mushroom-template-card
        tap_action:
          action: navigate
          navigation_path: "#serveur-[[server_id]]"
        primary: ""
        secondary: >
          {% set cpu = states('sensor.glance_[[server_id]]_utilisation_cpu')|float(0) %}
          {% set ram = states('sensor.glance_[[server_id]]_utilisation_de_la_memoire')|float(0) %}
          {% set disk = states('sensor.glance_[[server_id]]_utilisation_disque')|float(0) %}
          {% set maj = states('sensor.maj_[[server_id]]')|int(0) %}
          {% set maj_secu = states('sensor.maj_securite_[[server_id]]')|int(0) %}
          {% set reboot = is_state('binary_sensor.reboot_requis_[[server_id]]','on') %}
          {% set problems = [] %}
          {% if cpu>90 %}{% set problems = problems + ['🚨 CPU critique (' + cpu|round(1)|string + '%)'] %}
          {% elif cpu>80 %}{% set problems = problems + ['⚠️ CPU élevé (' + cpu|round(1)|string + '%)'] %}{% endif %}
          {% if ram>90 %}{% set problems = problems + ['🚨 RAM critique (' + ram|round(0)|string + '%)'] %}
          {% elif ram>80 %}{% set problems = problems + ['⚠️ RAM élevée (' + ram|round(0)|string + '%)'] %}{% endif %}
          {% if disk>90 %}{% set problems = problems + ['🚨 Disque critique (' + disk|round(0)|string + '%)'] %}
          {% elif disk>80 %}{% set problems = problems + ['⚠️ Disque élevé (' + disk|round(0)|string + '%)'] %}{% endif %}
          {% if reboot %}{% set problems = problems + ['🔄 Reboot requis'] %}{% endif %}
          {% if maj_secu > 0 %}{% set problems = problems + ['🛡️ ' + maj_secu|string + ' MAJ sécurité'] %}{% endif %}
          {% if maj > 0 %}{% set problems = problems + ['📦 ' + maj|string + ' MAJ dispo'] %}{% endif %}
          {{ problems|join(' · ') if problems else '✅ Aucun problème' }}
        multiline_secondary: true
        icon: ""
        card_mod:
          style: |
            ha-card { box-shadow: none !important; border: none !important; background: transparent !important; padding-top: 0px !important; margin-top: -38px !important; padding-left: 58px !important; padding-right: 16px !important; padding-bottom: 0px !important; margin-bottom: 0px !important; }

Oui j’ai fait aussi F5 et même redémarrer HA

Déjà c’est pas le bon nom : streamline_templates.yaml

On ne peut pas avoir plusieurs fichiers ?

non 1 seul fichier, et le nom est imposé (sinon il ne se charge pas)

Ok c est super ça fonctionne

1 « J'aime »