Intégration Zendure (partie 1)

Bonjour,

Désolé si la question sors du cadre strict du topique mais cette intégration permet elle bien de piloter une solution Zendure Hyper 2000 + batterie seulement branchée sur secteur ? Mes panneaux solaires et onduleurs sont des Enphase.

Réponse simple et basique : Oui :slight_smile:

@Julien_Galliot Un petit message pour te dire que j’ai réussi à recopier/adapter ton partage de code, et je te garanti que pour moi c’est vraiment pas évident car pas encore très à l’aise avec l’outil !(le moindre . en trop ou en moins et c’est mort avec yaml :stuck_out_tongue_closed_eyes:) Donc je voulais te remercier vivement pour cette superbe programmation/automatisation que tu a faite pour nos hyper2000 zendure. C’est vraiment topissime, carrément mieux optimisé que l’originale. Ta réflexion sur les pertes de rendement est très pertinente et on y gagne au final. C’est tout à fait fonctionnel sur la version 1.0.25 de l’intégration de fireson. J’espère que tu nous dira ici aussi comment l’adapter aux éventuelles nouvelles versions de l’intégration, si fireson réussi à l’améliorer encore.
BRAVO. :clap: :+1:

Edit: C’est quoi la carte que tu a au dessus de l’état batterie, celle avec « sleeping » et la flèche vers la gauche ? Tu peux partager le code ?

Qui a « osé » tester la version pre1.0.29 qui fonctionnerait en local ?

J’ose pas … :slight_smile:

Super!

Bah de rien, j'ai pas inventé grand chose mais j'y ai passé un peu de temps c'est vrai, alors autant que ça puisse servir à d'autres. C'est ça la force de la communauté HA! :wink:

Pour l'instant ça marche très bien en 1.0.25, alors je suis pas près de changer pour l'instant. A moins qu'une version cloudless arrive, ça se serait top!

Celui-ci?
image

Il te faudra créer cette nouvelle entité "flux Zendure" :

  - name: Flux Batterie Zendure
    unique_id: "Zendure_flow"
    unit_of_measurement: "W"
    state: "{{ (states('sensor.hyper_2000_grid_input_power')|float) - (states('sensor.hyper_2000_output_home_power')|float) }}"

Ensuite voilà le code de la carte bubble :

type: custom:bubble-card
card_type: button
button_type: state
styles: |-
  :host {
    --color-negative: #ad2b2b; 
    --color-positive: #5F730B; 
    --color-neutral: #4D4D4D; 
    --color-zero-line: #FFFFFF; /* Trait central */
  }

  .bubble-button-card-container {
    position: relative;
    border-radius: 8px;
    height: 20px;
    overflow: hidden;
  }

  .bubble-button-card-container::before {
    content: '';
    position: absolute;
    top: 0;
    height: 100%;
    width: 2px;
    left: 50%;
    background: var(--color-zero-line);
    z-index: 2;
    transform: translateX(-50%);
  }
  /* Flèche : masquée pour -10 W */

  .bubble-button-card-container::after {
    content: '';
    position: absolute;
    top: 0;
    height: 100%;
    display: ${hass.states['sensor.shellyproem50_08f9e0e5bb78_em0_power'].state == -10 ? 'none' : 'block'};
    width: max(calc(${Math.abs(hass.states['sensor.shellyproem50_08f9e0e5bb78_em0_power'].state) / 1500 * 50}%),
               ${(""+Math.round(hass.states['sensor.shellyproem50_08f9e0e5bb78_em0_power'].state)).length * 10 + 20}px);
    left: ${hass.states['sensor.shellyproem50_08f9e0e5bb78_em0_power'].state < 0 
      ? 'calc(50% - max(calc(' + (Math.abs(hass.states['sensor.shellyproem50_08f9e0e5bb78_em0_power'].state) / 1500 * 50) + '%), ' + ((""+Math.round(hass.states['sensor.shellyproem50_08f9e0e5bb78_em0_power'].state)).length * 10 + 20) + 'px))'
      : '50%'};
    background: ${hass.states['sensor.shellyproem50_08f9e0e5bb78_em0_power'].state < 0 ? 'var(--color-negative)' : hass.states['sensor.shellyproem50_08f9e0e5bb78_em0_power'].state == 0 ? 'var(--color-neutral)' : 'var(--color-positive)'};
    z-index: 1;
    clip-path: ${hass.states['sensor.shellyproem50_08f9e0e5bb78_em0_power'].state < 0
      ? 'polygon(40% 0%, 40% 20%, 100% 20%, 100% 80%, 40% 80%, 40% 100%, 0% 50%)'
      : 'polygon(40% 0%, 40% 20%, 0 20%, 0 80%, 40% 80%, 40% 100%, 100% 50%)'};
  }

  ha-card::after {
    position: absolute;
    top: 50%;
    /* Pour une valeur négative (dont -7 W) texte est positionné à gauche du trait central */
    left: ${hass.states['sensor.shellyproem50_08f9e0e5bb78_em0_power'].state < 0
      ? 'calc(50% - max(calc(' + (Math.abs(hass.states['sensor.shellyproem50_08f9e0e5bb78_em0_power'].state) / 1500 * 50) + '%), ' + ((""+Math.round(hass.states['sensor.shellyproem50_08f9e0e5bb78_em0_power'].state)).length * 10 + 20) + 'px) / 2)'
      : 'calc(50% + max(calc(' + (Math.abs(hass.states['sensor.shellyproem50_08f9e0e5bb78_em0_power'].state) / 1500 * 50) + '%), ' + ((""+Math.round(hass.states['sensor.shellyproem50_08f9e0e5bb78_em0_power'].state)).length * 10 + 20) + 'px) / 2)'};
    transform: translate(-50%, -50%);
    padding: 2px 10px;
    border-radius: 25px;
    border: 0;
    color: #fff;
    content: "${Math.round(state)} W";
    background: none;
    text-align: center;
    display: block;
    z-index: 3;
  }

  card_mod:
  style: |
    ha-icon {
      color: {% if states('sensor.zen_flow') | float(0) < 0 %} var(--color-negative) 
             {% else %} var(--color-positive) {% endif %} !important;
    }

  .bubble-icon {
    color: #bf8d1a !important;
    
icon: mdi:lightning-bolt
name: Flux-batterie
sub_button:
  - show_state: true
    icon: mdi:state-machine
    state_background: false
    entity: sensor.hyper_2000_pack_state
card_layout: large
slider_live_update: true
show_state: false
show_attribute: false
show_last_changed: false
force_icon: false
grid_options:
  columns: 11
  rows: 1
scrolling_effect: false
show_icon: true
show_name: false
double_tap_action:
  action: more-info
hold_action:
  action: more-info
tap_action:
  action: navigate
  navigation_path: "#shelly"
entity: sensor.shellyproem50_08f9e0e5bb78_em0_power

Tes interfaces de gestion ont franchement trop la classe. Je suis vraiment pas bon en programmation, je ne sais que recopier de l’existant et le custom un peu sur ce que je comprends (ça j’y arrive)
Te serait-il possible de partager l’ensemble de tes visualization bubble dont tu as montré un screenshot il y a quelques jours? C’est ptet assez énorme et il faudrait peut-être mettre ça sur un repo github je sais pas?
En tous cas je comprendrais que non si c’est vraiment trop de boulot!

@Julien_Galliot j’ai oublié de te tag pour ma demande ci-dessus, première fois que je post ici après avoir trainé depuis des jours, j’ai pas encore les réflexes ^^’

C’est clair vu tous les warning je n’ose pas non plus

Salut. En fait la bubble card est tellement configurable que c'est clairement l'une des meilleures de home assistant.
Perso, chatgpt m'a énormément aidé et fait des codes pour bubble card en fonction de ce que je voulais comme résultat. Ensuite à force d'analyser les codes, je fini par comprendre et maintenant je suis presque capable de les faire à ma guise.
Si tu veux des détails sur telle ou telle carte je peux t'aider et partager mes codes, le mieux en message privé pour pas trop occuper ce sujet. J'en suis la, sur iPhone ça me fait pour l'instant un dashboard comme ça. Ou les couleurs changent en fonction de l'état...charge en vert et décharge ou consommation du réseau en orange ou rouge.

@Julien_Galliot désolé de t’embêter encore, mais comme j’aime comprendre les choses : dans l’automatisation, j’ai beau chercher, je ne vois pas la ou est donnée la consigne de ne charger que à 60% si solcast>8. Je vois bien le if de solcast supérieur à 8, mais je ne vois pas la consigne qui dit « ne charge qu’à 60% » ou sinon à 100%.

Salut, alors c’est n’est pas une consigne, je combine les triggers (avec leur id) avec des conditions pour changer le mode de l’hyper :

1er cas, scenario déclenché en heures super creuses (id = HSC) si batterie <60% :

      - conditions:
          - condition: trigger
            id:
              - HSC
          - condition: template
            value_template: "{{ states ('sensor.hyper_2000_electric_level')|int < 60 }}"
        sequence:

Qui déclenche la charge de l’hyper à 1200W

2ième cas, scenario déclenché en heures super creuses (id = HSC) si batterie >60% :

      - conditions:
          - condition: trigger
            id:
              - HSC
          - condition: template
            value_template: "{{ states ('sensor.hyper_2000_electric_level')|int >= 60 }}"
        sequence:

Qui met l’hyper en veille

3ième cas, scenario déclenché en heures creuses (id = HC) ou batterie pleine (id=FULL) ou batterie à 60% (id=MID) mais seulement SI la batterie est en mode « nuit » (heure creuses) :

      - conditions:
          - condition: trigger
            id:
              - HC
              - FULL
              - MID
          - condition: state
            state: Heures Creuses
            entity_id: input_select.mode_zendure
        sequence:

Qui met la batterie en veille si :

  • Trigger MID ET prévision solcast > 8kWh
  • Trigger FULL
  • Trigger HC

Et enfin le dernier cas si Heures Pleines (id = HP) :

      - conditions:
          - condition: trigger
            id:
              - HP
        sequence:

Qui relance le mode automatique.

Voilà j’espère que c’est plus clair.

A adapter bien sûr car moi j’ai 3 tarifs (HP, HC, HSP). Je charge en HSP uniquement. Je pense revoir légèrement ce code aujourd’hui, pour finalement laisser la batterie en mode automatique même en HSP lorsque qu’elle est bien chargée le soir et que les prévisions solcast pour le lendemain sont très bonnes (>10kWh) afin d’optimiser au maximum ma production.

Salut,

Je te renvoie au tuto de @yannweb qu’il vient de publier sur le forum sur ce sujet. Je me suis très fortement inspiré de son code pour le mien et je le remercie encore pour le partage :

https://forum.hacf.fr/t/tuto-design-zendure-bubble-card/60768

Tu devrais y trouver ton bonheur pour les cartes bubble complexes. Pour les cartes bubble basiques, il est assez simple de les créer/configurer directement avec l’IU.

Bon courage !

Désolé, je n'ai pas compris comment l'automatisation sait qu'elle doit arrêter la charge à 60%. Je dois être un peu nul j'avoue :shushing_face:.

En attendant voilà comment je commence à adapter le dashboard de tes automatisations. Perso j'ai inversé les couleurs de la flèche, car pour moi dans l'idée c'est tout ce qui sort de la maison c'est vert car c'est "gratuit" et tout ce qui rentre du réseau dans la maison c'est rouge (car je le paie) :wink:

Bonjour,
Tu es sur de ce calcul?
Pour moi il correspond du coup non plus au flux batterie mais au delta entre la prod et ce qui recharge.
C'est la valeur renvoyée vers la maison et non vers la batterie.

Ce qui est renvoyé à la batterie c'est plutot sensor.hyper_2000_output_pack_power.
Si je ne dit pas de bêtise

Il y a un trigger (id = MID) quand la batterie arrive à 60% :

Et chaque fois que ce trigger est activé, je vérifie si je suis en heure creuses pour déclencher des actions (sinon je fais rien) :

Ensuite je vérifie si la prévision solcat est supérieure à 8kWH :

Alors je coupe la charge (Input limit = 0).

L'essentiel est que tu t'y retrouves toi ! :wink: De mon côté je résonne flux batterie (remplir = vert / vider = rouge). Mais bravo pour ton dashboard c'est top!

Ca y est je comprends l’automatisme, mais purée faut déjà bien creuser et bien raisonner pour monter un tel truc ! :+1:

Bonjour,

Euh non je pense que c’est bon, « grid input power power » c’est l’entrée AC de l’hyper, et « home output power » c’est la sortie AC, donc le calcul fait bien « entrée AC - sortie AC ».

« Outut pack power » c’est la sortie DC de l’hyper vers la batterie. Si tu prend cette valeur tu négliges les pertes de conversion…

Quelle belle journée hier ! Du soleil, 100% d'autoconsommation, 85% d'autonomie...je ne pensais pas pouvoir atteindre ces chiffres :

Mais avec une installation solaire bien dimensionnée par rapport à mon besoin, une batterie correctement utilisée et un routeur qui finit le job (seulement 32Wh exportés!), les résultats sont là! :heart_eyes:

Alors j’essaie de faire un message privé mais je ne trouve pas vraiment comment faire…
En tous cas je veux bien que tu me partage tes codes pour l’interface que tu as montré car j’ai passé mon dimanche à essayer de programmer des bubble card avec des tutos et j’ai pas réussi grand chose… J’y arrive bien mieux en modifiant de l’existant.

Salut,

Voilà mon code.

Bon courage! :wink:

views:
  - type: sections
    max_columns: 4
    title: Energie
    path: new-solar
    layout:
      grid-template-columns: 300px 300px 300px 300px
    sections:
      - type: grid
        cards:
          - type: custom:bubble-card
            card_type: separator
            name: PV
            icon: mdi:solar-power-variant
            grid_options:
              columns: 12
              rows: 0.7
            styles: ''
            card_layout: large-2-rows
          - type: horizontal-stack
            cards:
              - type: custom:bubble-card
                show_state: true
                show_attribute: false
                show_last_changed: false
                force_icon: false
                sub_button: []
                show_icon: false
                scrolling_effect: false
                card_layout: large
                icon: ''
                name: Prévu Jour
                button_type: state
                styles: |-
                  .bubble-button-card-container {
                    border-radius: 32px 0 0 32px !important;
                  }
                attribute: friendly_name
                show_name: true
                card_type: button
                entity: sensor.solcast_pv_forecast_previsions_pour_aujourd_hui
              - type: custom:bubble-card
                show_state: true
                show_attribute: false
                show_last_changed: false
                force_icon: false
                sub_button: []
                show_icon: false
                scrolling_effect: false
                card_layout: large
                icon: ''
                name: ' Pic Jour'
                button_type: state
                styles: |-
                  .bubble-button-card-container {
                      border-radius: 0 0 0 0 !important;
                  }
                attribute: friendly_name
                show_name: true
                card_type: button
                entity: sensor.solcast_pv_forecast_previsions_du_pic_aujourd_hui
              - type: custom:bubble-card
                show_state: true
                show_attribute: false
                show_last_changed: false
                force_icon: false
                sub_button: []
                show_icon: false
                scrolling_effect: false
                card_layout: large
                icon: ''
                name: ' Restant Jour'
                button_type: state
                styles: |-
                  .bubble-button-card-container {
                      border-radius: 0 0 0 0 !important;
                  }
                attribute: friendly_name
                show_name: true
                card_type: button
                entity: >-
                  sensor.solcast_pv_forecast_previsions_de_production_restantes_aujourd_hui
              - type: custom:bubble-card
                show_state: true
                show_attribute: false
                show_last_changed: false
                force_icon: false
                sub_button: []
                show_icon: false
                scrolling_effect: false
                card_layout: large
                icon: ''
                name: Prévu Demain
                button_type: state
                styles: |-
                  .bubble-button-card-container {
                    border-radius: 0 32px 32px 0 !important;
                  }
                attribute: friendly_name
                show_name: true
                card_type: button
                entity: sensor.solcast_pv_forecast_previsions_pour_demain
            grid_options:
              columns: 12
              rows: 1
          - type: custom:bubble-card
            card_type: button
            button_type: state
            animated_icons: true
            entity: sensor.puissance_totale_pv
            styles: |-
              :host {
                  --color-ok: #bf8d1a;
                  --color-background: var(--bubble-button-main-background-color, var(--bubble-main-background-color, var(--background-color-2, var(--secondary-background-color))));
                  --color-notification-bubble: #bf8d1a;
                  --color-bar: var(--color-ok);
                  /* Calcul de la progress % prod max de 1800 W) */
                  --progress: ${Math.round((Number(state) < 1800 ? Number(state) : 1800) / 1800 * 100)}%;
              }
              ha-icon {
                background-image: url("/local/community/lovelace-meteofrance-weather-card/icons/${
                  hass.states['weather.forecast_maison'].state === 'clear-day' ? 'day.svg' :
                  hass.states['weather.forecast_maison'].state === 'clear-night' ? 'night.svg' :
                  hass.states['weather.forecast_maison'].state === 'partlycloudy' ? 'cloudy-day-3.svg' :
                  hass.states['weather.forecast_maison'].state === 'partly-cloudy-day' ? 'cloudy-day-3.svg' :
                  hass.states['weather.forecast_maison'].state === 'partly-cloudy-night' ? 'cloudy-night-3.svg' :
                  hass.states['weather.forecast_maison'].state === 'cloudy' ? 'cloudy.svg' :
                  hass.states['weather.forecast_maison'].state === 'fog' ? 'fog.svg' :
                  hass.states['weather.forecast_maison'].state === 'windy' ? 'windy.svg' :
                  hass.states['weather.forecast_maison'].state === 'windy-variant' ? 'windy-night.svg' :
                  hass.states['weather.forecast_maison'].state === 'hail' ? 'snowy-rainy.svg' :
                  hass.states['weather.forecast_maison'].state === 'lightning' ? 'thunder.svg' :
                  hass.states['weather.forecast_maison'].state === 'lightning-rainy' ? 'lightning-rainy.svg' :
                  hass.states['weather.forecast_maison'].state === 'rainy' ? 'rainy-5.svg' :  /* 🌧️ Pluvieux 
                  hass.states['weather.forecast_maison'].state === 'rainy-5' ? 'rainy-5.svg' :      /* 🌦️ Légère pluie */
                  hass.states['weather.forecast_maison'].state === 'rainy-6' ? 'rainy-6.svg' :      /* 🌧️ Pluie modérée */
                  hass.states['weather.forecast_maison'].state === 'rainy-7' ? 'rainy-7.svg' :      /* 🌧️🌧️ Pluie battante */
                  hass.states['weather.forecast_maison'].state === 'snowy' ? 'snowy-6.svg' :
                  hass.states['weather.forecast_maison'].state === 'snowy-rainy' ? 'snowy-rainy.svg' :
                  hass.states['weather.forecast_maison'].state === 'exceptional' ? 'lightning-rainy.svg' : 
                  'day.svg'
                }");
                  #background-size: contain;
                  background-size: calc(130%);
                  background-repeat: no-repeat;
                  background-position: center;
                  mask-image: none;
                  -webkit-mask-image: none;
                  width: 40px;
                  height: 40px;
                  opacity: 0.5!important;
              }
              .bubble-button-card-container {
                background: var(--color-background) !important;
                position: relative;
              }

              /* Barre de progression qui évolue en fonction de la prod */
              .bubble-button-card-container::before {
                content: "";
                position: absolute;
                left: 0;
                top: 0;
                height: 100%;
                width: var(--progress) !important;
                background: var(--color-bar) !important;
                z-index: 0;
              }

              /* Affichage de la production en W */


              /* Animation composite : rotation et pulsation */
              @keyframes rotatePulse {
                0% {
                  transform: rotate(0deg) scale(1);
                }
                50% {
                  transform: rotate(180deg) scale(1.1);
                }
                100% {
                  transform: rotate(360deg) scale(1);
                }
              }
            name: Production PV
            icon: >-
              url("/local/community/lovelace-meteofrance-weather-card/icons/day.svg");
            sub_button:
              - entity: sensor.solcast_pv_forecast_production_maintenant
                show_icon: false
                show_state: true
                state_background: false
                show_background: true
                show_name: true
                name: Prévu
              - icon: ''
                name: Surplus
                show_state: true
                show_icon: false
                show_name: true
                state_background: false
                entity: sensor.surplus_solaire
            card_layout: large
            grid_options:
              columns: 12
              rows: 1
          - type: custom:bubble-card
            card_type: separator
            name: Etats Batterie
            icon: mdi:home-battery-outline
            grid_options:
              columns: 12
              rows: 0.7
            styles: ''
            card_layout: large-2-rows
          - type: custom:bubble-card
            card_type: button
            button_type: state
            styles: |-
              :host {
                --color-negative: #ad2b2b; 
                --color-positive: #5F730B; 
                --color-neutral: #4D4D4D; 
                --color-zero-line: #FFFFFF; /* Trait central */
              }

              .bubble-button-card-container {
                position: relative;
                border-radius: 8px;
                height: 20px;
                overflow: hidden;
              }

              .bubble-button-card-container::before {
                content: '';
                position: absolute;
                top: 0;
                height: 100%;
                width: 2px;
                left: 50%;
                background: var(--color-zero-line);
                z-index: 2;
                transform: translateX(-50%);
              }
              /* Flèche : masquée pour -10 W */

              .bubble-button-card-container::after {
                content: '';
                position: absolute;
                top: 0;
                height: 100%;
                display: ${hass.states['sensor.shellyproem50_08f9e0e5bb78_em0_power'].state == -10 ? 'none' : 'block'};
                width: max(calc(${Math.abs(hass.states['sensor.shellyproem50_08f9e0e5bb78_em0_power'].state) / 1500 * 50}%),
                           ${(""+Math.round(hass.states['sensor.shellyproem50_08f9e0e5bb78_em0_power'].state)).length * 10 + 20}px);
                left: ${hass.states['sensor.shellyproem50_08f9e0e5bb78_em0_power'].state < 0 
                  ? 'calc(50% - max(calc(' + (Math.abs(hass.states['sensor.shellyproem50_08f9e0e5bb78_em0_power'].state) / 1500 * 50) + '%), ' + ((""+Math.round(hass.states['sensor.shellyproem50_08f9e0e5bb78_em0_power'].state)).length * 10 + 20) + 'px))'
                  : '50%'};
                background: ${hass.states['sensor.shellyproem50_08f9e0e5bb78_em0_power'].state < 0 ? 'var(--color-negative)' : hass.states['sensor.shellyproem50_08f9e0e5bb78_em0_power'].state == 0 ? 'var(--color-neutral)' : 'var(--color-positive)'};
                z-index: 1;
                clip-path: ${hass.states['sensor.shellyproem50_08f9e0e5bb78_em0_power'].state < 0
                  ? 'polygon(40% 0%, 40% 20%, 100% 20%, 100% 80%, 40% 80%, 40% 100%, 0% 50%)'
                  : 'polygon(40% 0%, 40% 20%, 0 20%, 0 80%, 40% 80%, 40% 100%, 100% 50%)'};
              }

              ha-card::after {
                position: absolute;
                top: 50%;
                /* Pour une valeur négative (dont -7 W) texte est positionné à gauche du trait central */
                left: ${hass.states['sensor.shellyproem50_08f9e0e5bb78_em0_power'].state < 0
                  ? 'calc(50% - max(calc(' + (Math.abs(hass.states['sensor.shellyproem50_08f9e0e5bb78_em0_power'].state) / 1500 * 50) + '%), ' + ((""+Math.round(hass.states['sensor.shellyproem50_08f9e0e5bb78_em0_power'].state)).length * 10 + 20) + 'px) / 2)'
                  : 'calc(50% + max(calc(' + (Math.abs(hass.states['sensor.shellyproem50_08f9e0e5bb78_em0_power'].state) / 1500 * 50) + '%), ' + ((""+Math.round(hass.states['sensor.shellyproem50_08f9e0e5bb78_em0_power'].state)).length * 10 + 20) + 'px) / 2)'};
                transform: translate(-50%, -50%);
                padding: 2px 10px;
                border-radius: 25px;
                border: 0;
                color: #fff;
                content: "${Math.round(state)} W";
                background: none;
                text-align: center;
                display: block;
                z-index: 3;
              }

              card_mod:
              style: |
                ha-icon {
                  color: {% if states('sensor.zen_flow') | float(0) < 0 %} var(--color-negative) 
                         {% else %} var(--color-positive) {% endif %} !important;
                }

              .bubble-icon {
                color: #bf8d1a !important;
                
            icon: mdi:lightning-bolt
            name: Flux-batterie
            sub_button:
              - show_state: true
                icon: mdi:state-machine
                state_background: false
                entity: sensor.hyper_2000_pack_state
            card_layout: large
            slider_live_update: true
            show_state: false
            show_attribute: false
            show_last_changed: false
            force_icon: false
            grid_options:
              columns: 11
              rows: 1
            scrolling_effect: false
            show_icon: true
            show_name: false
            double_tap_action:
              action: more-info
            hold_action:
              action: more-info
            tap_action:
              action: navigate
              navigation_path: '#shelly'
            entity: sensor.shellyproem50_08f9e0e5bb78_em0_power
          - type: custom:bubble-card
            card_type: button
            entity: sensor.hyper_2000_electric_level
            button_type: state
            styles: |-
              :host {
                  --color-ok-icon: #5e720b;
                  --color-warning-icon: #aa8422;
                  --color-alert-icon: #c44931;
                  --color-ok: #5F730B;
                  --color-warning: #aa8422;
                  --color-alert: #c44931;
                  --color-bar: ${ state > 40 ? 'var(--color-ok)' : state > 20 ? 'var(--color-warning)' : 'var(--color-alert)' };
                  --color-background: var(--bubble-button-main-background-color, var(--bubble-main-background-color, var(--background-color-2, var(--secondary-background-color))));
                  --color-notification-bubble: red;
              }

              ha-icon {
                color: ${ state > 40 ? 'var(--color-ok-icon)' : state > 10 ? 'var(--color-warning-icon)' : 'var(--color-alert-icon)' } !important;
                animation: ${ parseFloat(hass.states['sensor.flux_batterie_zendure'].state) === 0 || parseFloat(hass.states['sensor.flux_batterie_zendure'].state) === -10 
                              ? 'none' 
                              : parseFloat(hass.states['sensor.flux_batterie_zendure'].state) > 0 
                                ? 'batteryCharge 3s linear infinite' 
                                : 'batteryDischarge 3s linear infinite' };
                content: "${ parseFloat(state) <= 33 
                             ? 'mdi:battery-20' 
                             : parseFloat(state) <= 66 
                               ? 'mdi:battery-50' 
                               : 'mdi:battery-high' }";
              }

              .bubble-button-card-container {
                background: linear-gradient(
                  to right, 
                  var(--color-bar) 0%, 
                  var(--color-bar) ${Math.round(state)}%, 
                  var(--color-background) ${Math.round(state)}%,
                  var(--color-background) 100%
                ) !important;
              }

              ha-card::after {
                position: absolute;
                top: -10px;
                left: -10px;
                padding: 0 10px;
                border-radius: 999px;
                border: 0px solid black;
                color: #fff;
                content: "${Math.round(state) < 10 ? '!' : ''}";
                background: var(--color-notification-bubble);
                display: block;
              }

              /* Animation pour la charge de la batterie */
              @keyframes batteryCharge {
                0%, 80% { clip-path: inset(0 0 0 0); }
                10% { clip-path: polygon(0% 0%, 0% 100%, 34% 100%, 34% 24%, 67% 24%, 67% 84%, 34% 84%, 34% 100%, 100% 100%, 100% 0); }
                20% { clip-path: polygon(0% 0%, 0% 100%, 34% 100%, 34% 24%, 67% 24%, 67% 74%, 34% 74%, 34% 100%, 100% 100%, 100% 0); }
                30% { clip-path: polygon(0% 0%, 0% 100%, 34% 100%, 34% 24%, 67% 24%, 67% 64%, 34% 64%, 34% 100%, 100% 100%, 100% 0); }
                40% { clip-path: polygon(0% 0%, 0% 100%, 34% 100%, 34% 24%, 67% 24%, 67% 54%, 34% 54%, 34% 100%, 100% 100%, 100% 0); }
                50% { clip-path: polygon(0% 0%, 0% 100%, 34% 100%, 34% 24%, 67% 24%, 67% 44%, 34% 44%, 34% 100%, 100% 100%, 100% 0); }
                60% { clip-path: polygon(0% 0%, 0% 100%, 34% 100%, 34% 24%, 67% 24%, 67% 34%, 34% 34%, 34% 100%, 100% 100%, 100% 0); }
                70% { clip-path: polygon(0% 0%, 0% 100%, 34% 100%, 34% 24%, 67% 24%, 67% 24%, 34% 24%, 34% 100%, 100% 100%, 100% 0); }
              }
              /* Animation pour la décharge de la batterie */
              @keyframes batteryDischarge {
                0%, 80% { clip-path: inset(0 0 0 0); }
                70% { clip-path: polygon(100% 0%, 100% 100%, 66% 100%, 66% 24%, 33% 24%, 33% 84%, 66% 84%, 66% 100%, 0% 100%, 0% 0); }
                60% { clip-path: polygon(100% 0%, 100% 100%, 66% 100%, 66% 24%, 33% 24%, 33% 74%, 66% 74%, 66% 100%, 0% 100%, 0% 0); }
                50% { clip-path: polygon(100% 0%, 100% 100%, 66% 100%, 66% 24%, 33% 24%, 33% 64%, 66% 64%, 66% 100%, 0% 100%, 0% 0); }
                40% { clip-path: polygon(100% 0%, 100% 100%, 66% 100%, 66% 24%, 33% 24%, 33% 54%, 66% 54%, 66% 100%, 0% 100%, 0% 0); }
                30% { clip-path: polygon(100% 0%, 100% 100%, 66% 100%, 66% 24%, 33% 24%, 33% 44%, 66% 44%, 66% 100%, 0% 100%, 0% 0); }
                20% { clip-path: polygon(100% 0%, 100% 100%, 66% 100%, 66% 24%, 33% 24%, 33% 34%, 66% 34%, 66% 100%, 0% 100%, 0% 0); }
                10% { clip-path: polygon(100% 0%, 100% 100%, 66% 100%, 66% 24%, 33% 24%, 33% 24%, 66% 24%, 66% 100%, 0% 100%, 0% 0); }
              }
            icon: mdi:battery-high
            name: Etat Batterie
            sub_button:
              - state_background: false
                show_icon: false
                show_background: true
                show_state: true
                show_name: false
                show_last_changed: false
                visibility:
                  - condition: numeric_state
                    entity: sensor.flux_batterie_zendure
                    below: 0
                entity: sensor.hyper_2000_remain_out_time
              - show_state: true
                state_background: false
                show_background: true
                entity: sensor.hyper_2000_hyper_temperature
            card_layout: large
            grid_options:
              columns: 12
              rows: 1
          - type: custom:bubble-card
            card_type: button
            button_type: slider
            styles: |-
              .bubble-range-fill { 
                background: rgba(79, 69, 87, 1) !important;
                opacity: 1 !important;
              }
              .bubble-icon {
                color: #bf8d1a !important;
              }
            show_icon: true
            show_last_changed: false
            show_attribute: false
            force_icon: false
            show_state: true
            slider_live_update: false
            sub_button: []
            icon: mdi:battery-outline
            name: Limite Décharge
            grid_options:
              columns: 6
              rows: 1
            entity: number.hyper_2000_soc_minimum
          - type: custom:bubble-card
            card_type: button
            button_type: slider
            styles: |-
              .bubble-range-fill { 
                background: rgba(79, 69, 87, 1) !important;
                opacity: 1 !important;
              }
              .bubble-icon {
                color: #bf8d1a !important;
              }
            show_icon: true
            show_last_changed: false
            show_attribute: false
            force_icon: false
            show_state: true
            slider_live_update: false
            sub_button: []
            icon: mdi:battery-high
            name: Limite Charge
            grid_options:
              columns: 6
              rows: 1
            entity: number.hyper_2000_soc_maximum
          - type: custom:bubble-card
            card_type: select
            force_icon: false
            show_state: true
            show_last_changed: false
            icon: mdi:form-select
            name: Mode
            grid_options:
              columns: 6
              rows: 1
            styles: |-
              .bubble-icon {
                  color: #bf8d1a !important;
                }
            entity: input_select.mode_zendure
          - type: custom:bubble-card
            card_type: button
            button_type: state
            styles: |
              ha-card {
                --bubble-main-background-color: ${ state == "AC output mode" ? '#ad2b2b' : state == "AC input mode" ? '#5F730B' : '#4D4D4D' };
              }

              .bubble-icon {
                color: #bf8d1a !important;
            grid_options:
              columns: 6
              rows: 1
            sub_button:
              - entity: sensor.shellyproem50_08f9e0e5bb78_em0_power
                show_state: true
                show_icon: false
                state_background: false
            entity: select.hyper_2000_ac_mode
          - type: custom:bubble-card
            card_type: separator
            name: Charge
            icon: mdi:battery-arrow-up
            rows: 1
            grid_options:
              columns: 12
              rows: 0.7
            card_layout: large-2-rows
          - type: custom:bubble-card
            card_type: button
            styles: |
              .bubble-button-background {
                opacity: 1 !important;
                background-color: ${state === 'on' ? '#bf8d1a' : '#4f4557'} !important;
            show_state: true
            show_last_changed: false
            name: Charge Auto
            grid_options:
              columns: 6
              rows: 1
            icon: mdi:toggle-switch-off-outline
            tap_action:
              action: none
            button_action:
              tap_action:
                action: none
              hold_action:
                action: toggle
            entity: input_boolean.charge_auto_zendure
          - type: custom:bubble-card
            card_type: button
            button_type: state
            styles: |-
              :host {
                  --color-ok: #4f4557;
                  --color-background: var(--bubble-button-main-background-color, var(--bubble-main-background-color, var(--background-color-2, var(--secondary-background-color))));
                  --color-notification-bubble: #4f4557;
                  --color-bar: var(--color-ok);
                  /* Calcul de la progress % prod max de 1800 W) */
                  --progress: ${Math.round((Number(state) < 1200 ? Number(state) : 1200) / 1200 * 100)}%;
              }

              .bubble-button-card-container {
                background: var(--color-background) !important;
                position: relative;
              }

              /* Barre de progression qui évolue en fonction de la prod */
              .bubble-button-card-container::before {
                content: "";
                position: absolute;
                left: 0;
                top: 0;
                height: 100%;
                width: var(--progress) !important;
                background: var(--color-bar) !important;
                z-index: 0;
              }

              .bubble-icon {
                color: #bf8d1a !important;
              }


              /* Animation composite : rotation et pulsation */
              @keyframes rotatePulse {
                0% {
                  transform: rotate(0deg) scale(1);
                }
                50% {
                  transform: rotate(180deg) scale(1.1);
                }
                100% {
                  transform: rotate(360deg) scale(1);
                } 
              }
            name: Consigne Charge
            grid_options:
              columns: 6
              rows: 1
            show_state: true
            slider_live_update: true
            entity: number.hyper_2000_limit_input
          - type: custom:bubble-card
            card_type: button
            button_type: state
            styles: |
              :host {
                  --color-ok: #4f4557;
                  --color-background: var(--bubble-button-main-background-color, var(--bubble-main-background-color, var(--background-color-2, var(--secondary-background-color))));
                  --color-notification-bubble: #4f4557;
                  --color-bar: var(--color-ok);
                  /* Calcul de la progress % prod max de 1800 W) */
                  --progress: ${Math.round((Number(state) < 1200 ? Number(state) : 1200) / 1200 * 100)}%;
              }

              .bubble-button-card-container {
                background: var(--color-background) !important;
                position: relative;
              }

              /* Barre de progression qui évolue en fonction de la prod */
              .bubble-button-card-container::before {
                content: "";
                position: absolute;
                left: 0;
                top: 0;
                height: 100%;
                width: var(--progress) !important;
                background: var(--color-bar) !important;
                z-index: 0;
              }

              .bubble-icon {
                color: #bf8d1a !important;
              }


              /* Animation composite : rotation et pulsation */
              @keyframes rotatePulse {
                0% {
                  transform: rotate(0deg) scale(1);
                }
                50% {
                  transform: rotate(180deg) scale(1.1);
                }
                100% {
                  transform: rotate(360deg) scale(1);
                } 
              }
            show_state: true
            slider_live_update: true
            show_last_changed: false
            name: Seuil Mini Charge
            grid_options:
              columns: 6
              rows: 1
            entity: input_number.zendure_pmin_entree_ac
          - type: custom:bubble-card
            card_type: button
            button_type: state
            styles: |
              :host {
                  --color-ok: #4f4557;
                  --color-background: var(--bubble-button-main-background-color, var(--bubble-main-background-color, var(--background-color-2, var(--secondary-background-color))));
                  --color-notification-bubble: #4f4557;
                  --color-bar: var(--color-ok);
                  /* Calcul de la progress % prod max de 1800 W) */
                  --progress: ${Math.round((Number(state) < 1200 ? Number(state) : 1200) / 1200 * 100)}%;
              }

              .bubble-button-card-container {
                background: var(--color-background) !important;
                position: relative;
              }

              /* Barre de progression qui évolue en fonction de la prod */
              .bubble-button-card-container::before {
                content: "";
                position: absolute;
                left: 0;
                top: 0;
                height: 100%;
                width: var(--progress) !important;
                background: var(--color-bar) !important;
                z-index: 0;
              }

              .bubble-icon {
                color: #bf8d1a !important;
              }


              /* Animation composite : rotation et pulsation */
              @keyframes rotatePulse {
                0% {
                  transform: rotate(0deg) scale(1);
                }
                50% {
                  transform: rotate(180deg) scale(1.1);
                }
                100% {
                  transform: rotate(360deg) scale(1);
                } 
              } 
            show_state: true
            show_last_changed: false
            name: Seuil Maxi Charge
            grid_options:
              columns: 6
              rows: 1
            slider_live_update: true
            entity: input_number.zendure_pmax_entre_ac
          - type: custom:bubble-card
            card_type: button
            button_type: state
            styles: |-
              :host {
                  --color-ok: #4f4557;
                  --color-background: var(--bubble-button-main-background-color, var(--bubble-main-background-color, var(--background-color-2, var(--secondary-background-color))));
                  --color-notification-bubble: #4f4557;
                  --color-bar: var(--color-ok);
                  /* Calcul de la progress % prod max de 1800 W) */
                  --progress: ${Math.round((Number(state) < 500 ? Number(state) : 500) / 500 * 100)}%;
              }

              .bubble-button-card-container {
                background: var(--color-background) !important;
                position: relative;
              }

              /* Barre de progression qui évolue en fonction de la prod */
              .bubble-button-card-container::before {
                content: "";
                position: absolute;
                left: 0;
                top: 0;
                height: 100%;
                width: var(--progress) !important;
                background: var(--color-bar) !important;
                z-index: 0;
              }

              .bubble-icon {
                color: #bf8d1a !important;
              }


              /* Animation composite : rotation et pulsation */
              @keyframes rotatePulse {
                0% {
                  transform: rotate(0deg) scale(1);
                }
                50% {
                  transform: rotate(180deg) scale(1.1);
                }
                100% {
                  transform: rotate(360deg) scale(1);
                } 
              }
              }
            name: Seuil Surplus Solaire
            grid_options:
              columns: 6
              rows: 1
            show_state: true
            slider_live_update: true
            entity: input_number.zendure_seuil_surplus_solaire
            double_tap_action:
              action: more-info
            hold_action:
              action: more-info
          - type: custom:bubble-card
            card_type: separator
            name: Décharge
            icon: mdi:battery-arrow-down-outline
            rows: 1
            grid_options:
              columns: 12
              rows: 0.7
            card_layout: large-2-rows
          - type: custom:bubble-card
            card_type: button
            styles: |
              .bubble-button-background {
                opacity: 1 !important;
                background-color: ${state === 'on' ? '#bf8d1a' : '#4f4557'} !important;
            show_state: true
            show_last_changed: false
            name: Décharge Auto
            grid_options:
              columns: 6
              rows: 1
            icon: mdi:toggle-switch-off-outline
            tap_action:
              action: none
            button_action:
              tap_action:
                action: none
              hold_action:
                action: toggle
            entity: input_boolean.decharge_auto_zendure
          - type: custom:bubble-card
            card_type: button
            button_type: state
            styles: |
              :host {
                  --color-ok: #4f4557;
                  --color-background: var(--bubble-button-main-background-color, var(--bubble-main-background-color, var(--background-color-2, var(--secondary-background-color))));
                  --color-notification-bubble: #4f4557;
                  --color-bar: var(--color-ok);
                  /* Calcul de la progress % prod max de 1800 W) */
                  --progress: ${Math.round((Number(state) < 1200 ? Number(state) : 1200) / 1200 * 100)}%;
              }

              .bubble-button-card-container {
                background: var(--color-background) !important;
                position: relative;
              }

              /* Barre de progression qui évolue en fonction de la prod */
              .bubble-button-card-container::before {
                content: "";
                position: absolute;
                left: 0;
                top: 0;
                height: 100%;
                width: var(--progress) !important;
                background: var(--color-bar) !important;
                z-index: 0;
              }

              .bubble-icon {
                color: #bf8d1a !important;
              }


              /* Animation composite : rotation et pulsation */
              @keyframes rotatePulse {
                0% {
                  transform: rotate(0deg) scale(1);
                }
                50% {
                  transform: rotate(180deg) scale(1.1);
                }
                100% {
                  transform: rotate(360deg) scale(1);
                } 
              }
            name: Consigne Décharge
            grid_options:
              columns: 6
              rows: 1
            show_state: true
            slider_live_update: true
            sub_button: []
            entity: number.hyper_2000_limit_output
          - type: custom:bubble-card
            card_type: button
            button_type: state
            styles: |
              :host {
                  --color-ok: #4f4557;
                  --color-background: var(--bubble-button-main-background-color, var(--bubble-main-background-color, var(--background-color-2, var(--secondary-background-color))));
                  --color-notification-bubble: #4f4557;
                  --color-bar: var(--color-ok);
                  /* Calcul de la progress % prod max de 1800 W) */
                  --progress: ${Math.round((Number(state) < 1200 ? Number(state) : 1200) / 1200 * 100)}%;
              }

              .bubble-button-card-container {
                background: var(--color-background) !important;
                position: relative;
              }

              /* Barre de progression qui évolue en fonction de la prod */
              .bubble-button-card-container::before {
                content: "";
                position: absolute;
                left: 0;
                top: 0;
                height: 100%;
                width: var(--progress) !important;
                background: var(--color-bar) !important;
                z-index: 0;
              }

              .bubble-icon {
                color: #bf8d1a !important;
              }


              /* Animation composite : rotation et pulsation */
              @keyframes rotatePulse {
                0% {
                  transform: rotate(0deg) scale(1);
                }
                50% {
                  transform: rotate(180deg) scale(1.1);
                }
                100% {
                  transform: rotate(360deg) scale(1);
                } 
              }
            show_state: true
            slider_live_update: true
            show_last_changed: false
            name: Seuil Mini Décharge
            grid_options:
              columns: 6
              rows: 1
            entity: input_number.zendure_pmin_sortie_ac
            sub_button:
              - entity: sensor.rendement_theorique_sortie_hyper
                show_icon: false
                state_background: false
                show_state: true
                show_name: false
          - type: custom:bubble-card
            card_type: button
            button_type: state
            styles: |
              :host {
                  --color-ok: #4f4557;
                  --color-background: var(--bubble-button-main-background-color, var(--bubble-main-background-color, var(--background-color-2, var(--secondary-background-color))));
                  --color-notification-bubble: #4f4557;
                  --color-bar: var(--color-ok);
                  /* Calcul de la progress % prod max de 1800 W) */
                  --progress: ${Math.round((Number(state) < 1200 ? Number(state) : 1200) / 1200 * 100)}%;
              }

              .bubble-button-card-container {
                background: var(--color-background) !important;
                position: relative;
              }

              /* Barre de progression qui évolue en fonction de la prod */
              .bubble-button-card-container::before {
                content: "";
                position: absolute;
                left: 0;
                top: 0;
                height: 100%;
                width: var(--progress) !important;
                background: var(--color-bar) !important;
                z-index: 0;
              }

              .bubble-icon {
                color: #bf8d1a !important;
              }


              /* Animation composite : rotation et pulsation */
              @keyframes rotatePulse {
                0% {
                  transform: rotate(0deg) scale(1);
                }
                50% {
                  transform: rotate(180deg) scale(1.1);
                }
                100% {
                  transform: rotate(360deg) scale(1);
                } 
              }
            show_state: true
            slider_live_update: true
            show_last_changed: false
            name: Seuil Maxi Décharge
            grid_options:
              columns: 6
              rows: 1
            entity: input_number.zendure_pmax_sortie_ac