Carte mushroom à modifier

C’est surprenant, car sur cette carte animation pour le ventilateur cuisine fonctionne

Merci pour ton retour . Peux-tu partager ton code de ta carte cuisine ?

Je t’ai simplifié le code:

(TV,FA et LV son les puissances pour la télé, le frigo américain et le lave vaisselle).

Le chip animé pour la Vmc et le chip normal pour la lumière

type: custom:vertical-stack-in-card
cards:
  - type: custom:mushroom-template-card
    entity: light.cuisine
    icon: |
      {% if is_state(entity, 'on') %}
        mdi:toggle-switch
      {% elif is_state(entity, 'off') %}  
        mdi:toggle-switch-off       
      {% else %}  
        mdi:alert
      {% endif %}
    icon_color: |-
      {% if is_state(entity, 'on') %} 
       orange
      {% elif is_state(entity, 'off') %} 
       grey
      {% else %}
       grey
      {% endif %}    
    primary: CUISINE
    secondary: |-
      TV : {{ states('sensor.plug_zb_016_power') |round (0) }} W |
      FA : {{ states('sensor.plug_zb_008_power') |round (0) }} W |
      LV : {{ states('sensor.plug_zb_009_power') |round (0) }} W
    layout: horizontal
    tap_action:
      action: toggle
    badge_icon: |
      {% if is_state('binary_sensor.detecteur_fume', 'on') %}
        mdi:smoke-detector-variant-alert
      {% elif is_state('binary_sensor.detecteur_fume', 'off') %}  
        mdi:smoke-detector-variant       
      {% else %}  
        mdi:alert
      {% endif %}
    badge_color: |
      {% if is_state('binary_sensor.detecteur_fume', 'on') %}
        red
      {% elif is_state('binary_sensor.detecteur_fume', 'off') %}  
        blue
      {% else %}  
        orange
      {% endif %}
    card_mod:
      style: null
  - type: custom:mushroom-chips-card
    chips:
      - type: template
        entity: switch.vmc_pv_gv
        icon: |
          {% if is_state(entity, 'on') %} 
           mdi:fan
          {% elif is_state(entity, 'off') %} 
           mdi:fan
          {% else %}
           mdi:alert              
          {% endif %}                                               
        icon_color: |-
          {% if is_state(entity, 'on') %} 
           green
          {% elif is_state(entity, 'off') %} 
           blue
          {% else %}
           red               
          {% endif %}
        tap_action:
          action: toggle
        hold_action:
          action: more-info
        card_mod:
          style: |
            {% if is_state('switch.vmc_pv_gv','on') %}
             ha-card { animation: spin 2s linear infinite; }
             @keyframes blink { 50% {opacity: 0;} }
            {% elif is_state('switch.vmc_pv_gv','off') %}
             ha-card { animation: spin 5s linear infinite; }
             @keyframes blink { 50% {opacity: 0;} }
            {%- endif %}               
      - type: template
        entity: light.cuisine
        icon: |-
          {% if is_state(entity, 'on') %} 
           mdi:track-light
          {% elif is_state(entity, 'off') %} 
           mdi:track-light-off
          {% else %}
           mdi:alert
          {% endif %}
        icon_color: |-
          {% if is_state(entity, 'on') %} 
           orange
          {% elif is_state(entity, 'off') %} 
           grey
          {% else %}
           red
          {% endif %}
        tap_action:
          action: toggle
        hold_action:
          action: more-info
    alignment: end
    card_mod:
      style: |
        ha-card {
          padding-top: 0px;
          margin-top: -8px;
          padding-bottom: 8px;
          padding-left: 8px;
          padding-right: 8px;
         }
card_mod:
  style: |
    ha-card {
      margin: 10px;
      background: var(--mantle2);
    }

Merci à toi , je suis parvenu à faire ce que je souhaitais !

Sur cette carte, divers « chips » apparaissent suivant l’état de certaines entités . La « chip » fan est animé.

image

Le code de la carte ci-après :

type: custom:vertical-stack-in-card
cards:
  - type: horizontal-stack
    cards:
      - type: custom:mushroom-template-card
        icon: mdi:home-thermometer-outline
        icon_color: |
          grey
        primary: "{{states(entity)}} °C"
        secondary: "{{ states('input_number.ecart_temp_vs_hier')}} °C"
        layout: horizontal
        tap_action:
          action: more-info
        double_tap_action:
          action: none
        hold_action:
          action: none
        badge_icon: |
          {% if states('input_number.ecart_temp_vs_hier') | float > 0 %}
          mdi:arrow-up-circle
          {% else %}
          mdi:arrow-down-circle
          {% endif %}
        badge_color: |
          {% if states('input_number.ecart_temp_vs_hier') | float > 0 %}
          red
          {% else %}
          blue
          {% endif %}
        entity: sensor.temp_ext_nord_temperature
    card_mod:
      style: null
  - type: custom:mushroom-chips-card
    chips:
      - type: template
        entity: sensor.panasonic_heat_pump_main_threeway_valve_state
        icon: mdi:water
        icon_color: |-
          {% if is_state(entity, 'Tank') %}
            red
          {% else %}
            grey
          {% endif %}
        tap_action:
          action: navigate
          navigation_path: /dashboard-thermostat/PAC Ctrl Zones_ECS
        double_tap_action:
          action: none
        hold_action:
          action: none
      - type: template
        entity: input_boolean.debut_cycle_lave_linge
        icon: mdi:washing-machine
        icon_color: |-
          {% if is_state(entity, 'on') %}
            red
          {% elif is_state(entity, 'off') %}
            grey
          {% endif %}
        tap_action:
          action: navigate
          navigation_path: /lovelace/Lave Linge
      - type: template
        entity: switch.pompe_piscine_2
        icon: mdi:pool
        icon_color: |-
          {% if is_state(entity, 'on') %}
            red
          {% elif is_state(entity, 'off') %}
            grey
          {% endif %}
        tap_action:
          action: navigate
          navigation_path: /lovelace/piscine
      - type: template
        entity: input_boolean.on_time_hp
        icon: |
          {% if is_state(entity, 'on') %} 
           mdi:fan
          {% elif is_state(entity, 'off') %} 
           mdi:fan
          {% else %}
           mdi:alert              
          {% endif %}                                               
        icon_color: |-
          {% if is_state(entity, 'on') %} 
           red
          {% else %}
           grey               
          {% endif %}
        card_mod:
          style: |
            {% if is_state('input_boolean.on_time_hp','on') %}
             ha-card { animation: spin 2s linear infinite; }
            {%- endif %}               
        tap_action:
          action: navigate
          navigation_path: /dashboard-thermostat/PAC Ctrl Zones_ECS
        double_tap_action:
          action: none
        hold_action:
          action: none
      - type: template
        entity: sensor.myenergi_zappi_22722432_plug_status
        icon: |-
          {% if is_state(entity, 'Charging') %} 
           mdi:car-electric
          {% else %}
           mdi:car-electric
          {% endif %}
        icon_color: |-
          {% if is_state(entity, 'Charging') %} 
           red
          {% else %}
           grey
          {% endif %}
        tap_action:
          action: navigate
          navigation_path: /dashboard-temp/zappi
        hold_action:
          action: more-info
    alignment: end
    card_mod:
      style: |
        ha-card {
          padding-top: 0px;
          margin-top: -46px;
          padding-bottom: 8px;
          padding-left: 8px;
          padding-right: 8px;
         }

1 « J'aime »

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