# Zendure - Plan énergétique - Modification via Home Assistant

**URL:** <https://forum.hacf.fr/t/zendure-plan-energetique-modification-via-home-assistant/48101>\
**Category:** Entraide Home Assistant\
**Tags:** mqtt, zigbee2mqtt\
**Created:** [Septembre 23, 2024, 6:05 UTC](https://forum.hacf.fr/t/zendure-plan-energetique-modification-via-home-assistant/48101 "2024-09-23T06:05:08Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![nicolas\_frances](https://forum.hacf.fr/user_avatar/forum.hacf.fr/nicolas_frances/32/78180_2.png) [@nicolas\_frances](https://forum.hacf.fr/u/nicolas_frances)\
**Post date:** [Septembre 23, 2024, 6:05 UTC](https://forum.hacf.fr/t/zendure-plan-energetique-modification-via-home-assistant/48101/1 "2024-09-23T06:05:08Z")

</div>

Bonjour,

## Mon problème

J’ai installé il y a quelques mois maintenant la solution Zendure avec Hyper 2000 et 4 batteries AB2000. Jusqu’à maintenant l’integration via MQTT me convenait tout à fait car mes batteries se chargeaient pendant la journée.

J’aimerais maintenant combiner deux modes énergétiques: Le soir, vers 22h si la charge des batteries est inférieure à 50%, j’active le mode «&nbsp;Attribution&nbsp;» jusqu’à 100% jusqu’à 6h ( Tempo ). S’il y a du soleil pendant la journée, j’aimerais changer vers le mode «&nbsp;Intelligent&nbsp;».

Je n’arrive malheureusement pas à retrouver dans MQTT le champ qui contient le mode. Est ce que quelqu’un sait ? Est-il possible de récrire sur Zendure avec l’API existante ?

## Ma configuration

* * *

[center]## System Information

| version | core-2024.9.2 |
| --- | --- |
| installation\_type | Home Assistant OS |
| dev | false |
| hassio | true |
| docker | true |
| user | root |
| virtualenv | false |
| python\_version | 3.12.4 |
| os\_name | Linux |
| os\_version | 6.6.31-haos-raspi |
| arch | aarch64 |
| timezone | Europe/Paris |
| config\_dir | /config |

> **Home Assistant Community Store**
>
> | GitHub API | ok |
> | --- | --- |
> | GitHub Content | ok |
> | GitHub Web | ok |
> | HACS Data | ok |
> | GitHub API Calls Remaining | 5000 |
> | Installed Version | 2.0.1 |
> | Stage | running |
> | Available Repositories | 1413 |
> | Downloaded Repositories | 27 |

> **Home Assistant Cloud**
>
> | logged\_in | true |
> | --- | --- |
> | subscription\_expiration | 4 mars 2025 à 01:00 |
> | relayer\_connected | true |
> | relayer\_region | eu-central-1 |
> | remote\_enabled | true |
> | remote\_connected | true |
> | alexa\_enabled | true |
> | google\_enabled | true |
> | remote\_server | eu-central-1-6.ui.nabu.casa |
> | certificate\_status | ready |
> | instance\_id | 394d05695ec44bfa88316b6d9599dda6 |
> | can\_reach\_cert\_server | ok |
> | can\_reach\_cloud\_auth | ok |
> | can\_reach\_cloud | ok |

> **Home Assistant Supervisor**
>
> | host\_os | Home Assistant OS 13.1 |
> | --- | --- |
> | update\_channel | stable |
> | supervisor\_version | supervisor-2024.09.1 |
> | agent\_version | 1.6.0 |
> | docker\_version | 26.1.4 |
> | disk\_total | 457.7 GB |
> | disk\_used | 12.9 GB |
> | healthy | true |
> | supported | true |
> | host\_connectivity | true |
> | supervisor\_connectivity | true |
> | ntp\_synchronized | true |
> | virtualization | |
> | board | rpi5-64 |
> | supervisor\_api | ok |
> | version\_api | ok |
> | installed\_addons | Advanced SSH & Web Terminal (19.0.0), Mosquitto broker (6.4.1), Zigbee2MQTT (1.40.1-1), Studio Code Server (5.15.0), SQLite Web (4.2.1), MQTT Explorer (browser-1.0.3), Spotify Connect (0.13.0) |

> **Dashboards**
>
> | dashboards | 4 |
> | --- | --- |
> | resources | 17 |
> | views | 7 |
> | mode | storage |

> **Recorder**
>
> | oldest\_recorder\_run | 18 septembre 2024 à 09:26 |
> | --- | --- |
> | current\_recorder\_run | 19 septembre 2024 à 15:49 |
> | estimated\_db\_size | 289.04 MiB |
> | database\_engine | sqlite |
> | database\_version | 3.45.3 |

[/center] \_\_\_

---

<div class="post-metadata">

**Author:** ![Pulpy-Luke](https://forum.hacf.fr/user_avatar/forum.hacf.fr/pulpy-luke/32/137426_2.png) [@Pulpy-Luke](https://forum.hacf.fr/u/Pulpy-Luke)\
**Post date:** [Septembre 23, 2024, 8:22 UTC](https://forum.hacf.fr/t/zendure-plan-energetique-modification-via-home-assistant/48101/2 "2024-09-23T08:22:20Z")

</div>

Salut,

A défaut de connaitre l’info, tuu peux parcourir les éléments MQTT à sa recherche avec MQTT explorer, qui existe sous forme d’addon

> **[Addon MQTT Explorer new Version](https://community.home-assistant.io/t/addon-mqtt-explorer-new-version/603739)**
>
> Addon MQTT Explorer new version Hello, I am the creator of the port of MQTT Explorer on NodeJS. So you can use it directly in the browser. Installation If you want to do add the repository manually, please follow the procedure highlighted in...

---

<div class="post-metadata">

**Author:** ![nicolas\_frances](https://forum.hacf.fr/user_avatar/forum.hacf.fr/nicolas_frances/32/78180_2.png) [@nicolas\_frances](https://forum.hacf.fr/u/nicolas_frances)\
**Post date:** [Septembre 23, 2024, 8:41 UTC](https://forum.hacf.fr/t/zendure-plan-energetique-modification-via-home-assistant/48101/3 "2024-09-23T08:41:28Z")

</div>

Bonjour Pulpy-Luke,

Merci pour ton retour.

Avant de solliciter le forum, j’ai fait une analyse avec MQTT-explorer. Impossible de trouver la moindre information.

Nicolas

---

<div class="post-metadata">

**Author:** ![Pulpy-Luke](https://forum.hacf.fr/user_avatar/forum.hacf.fr/pulpy-luke/32/137426_2.png) [@Pulpy-Luke](https://forum.hacf.fr/u/Pulpy-Luke)\
**Post date:** [Septembre 23, 2024, 8:44 UTC](https://forum.hacf.fr/t/zendure-plan-energetique-modification-via-home-assistant/48101/4 "2024-09-23T08:44:50Z")

</div>

OK,

Dans ce cas, sauf à ce que quelqu’un avec le même matériel que toi passe (et sache), ça risque d’être assez long.  
As-tu posé la question au SAV à tout hasard ?

---

<div class="post-metadata">

**Author:** ![nicolas\_frances](https://forum.hacf.fr/user_avatar/forum.hacf.fr/nicolas_frances/32/78180_2.png) [@nicolas\_frances](https://forum.hacf.fr/u/nicolas_frances)\
**Post date:** [Septembre 23, 2024, 9:04 UTC](https://forum.hacf.fr/t/zendure-plan-energetique-modification-via-home-assistant/48101/5 "2024-09-23T09:04:06Z")

</div>

Re,

oui j’ai parlé avec Zendure sur une nouvelle «&nbsp;feature&nbsp;» à ajouter dans l’application Zendure. Ils ont bien pris en compte ma demande mais ca ne serait pas de suite.

Je suis tout à fait conscient d’envoyer une bouteille à la mer mais je me suis dit que quelqu’un rencontrait peut être un besoin similaire.

Merci de ton retour.

Nicolas

---

<div class="post-metadata">

**Author:** ![olivr2s](https://forum.hacf.fr/user_avatar/forum.hacf.fr/olivr2s/32/73633_2.png) [@olivr2s](https://forum.hacf.fr/u/olivr2s)\
**Post date:** [Septembre 23, 2024, 10:25 UTC](https://forum.hacf.fr/t/zendure-plan-energetique-modification-via-home-assistant/48101/6 "2024-09-23T10:25:28Z")

</div>

Pour le moment, ce n'est pas accessible en MQTT.

> **[GitHub - Zendure/developer-device-data-report: Subscribe to device data for Zendure products. To...](https://github.com/Zendure/developer-device-data-report)**
>
> Subscribe to device data for Zendure products. To receive information from the device, Developers can obtain the same device information as the official App by subscribing to Zendure MQTT Broker

Il y a que 3 switch qui remontent

 ![image](https://forum.hacf.fr/uploads/default/original/3X/8/0/80623ee0cf63e8ff47c3f9c5e95f49c90852226d.png)

Nous attendons tous avec impatience que Zendure ajout le pilotage du plan énergétique et du mode intelligent via MQTT.

---

<div class="post-metadata">

**Author:** ![nicolas\_frances](https://forum.hacf.fr/user_avatar/forum.hacf.fr/nicolas_frances/32/78180_2.png) [@nicolas\_frances](https://forum.hacf.fr/u/nicolas_frances)\
**Post date:** [Septembre 23, 2024, 10:38 UTC](https://forum.hacf.fr/t/zendure-plan-energetique-modification-via-home-assistant/48101/7 "2024-09-23T10:38:57Z")

</div>

> [@olivr2s](#):
>
> ndure ajout le pilotage du plan énergétique et du mode intelligent via MQTT.

Bonjour Olivr2s,

Ok j’ai la même chose, il va donc falloir s’armer de patience.

Merci pour le retour.

Nicolas

---

<div class="post-metadata">

**Author:** ![roumano](https://forum.hacf.fr/letter_avatar_proxy/v4/letter/r/f14d63/32.png) [@roumano](https://forum.hacf.fr/u/roumano)\
**Post date:** [Septembre 23, 2024, 11:34 UTC](https://forum.hacf.fr/t/zendure-plan-energetique-modification-via-home-assistant/48101/8 "2024-09-23T11:34:24Z")

</div>

Bonjour,

J’ai pas ce matériel mais si ça sera disponible pour ton matériel, au besoin, voici comment j’ai crée mes automatisations qui vont dans ce sens :

- La veille d’une journée Tempo «&nbsp;Rouge&nbsp;» :  
une notification active un scheduler pour recharger la batterie (et défini a 60% le niveau de la batterie a atteindre, mais on peut le changer via une slider dans HA )

> **automatisation EDF Tarif Rouge Notification**
>
> ```auto
> alias: EDF Tarif Rouge Notification
> description: "Notification Alerte tempo : quand demain sera un tarifs rouge"
> trigger:
> - platform: state
> entity_id:
> - sensor.edf_tempo_tomorrow
> from: unknown
> to: ROUGE
> condition: []
> action:
> - data:
> message: TTS
> data:
> ttl: 0
> priority: high
> tts_text: Attention Demain EDF tarif Rouge
> action: notify.mobile_app_xxx
> - data:
> title: EDF tarif Rouge
> message: Attention Demain EDF tarif Rouge
> data:
> ttl: 0
> priority: high
> action: notify.mobile_app_xxx
> 
> - type: turn_on
> device_id: 61f41a9e351c76d19d5c30a7dbc7ef9e
> entity_id: a48f5d326bfb31c2efd2ee85362d94e4
> domain: switch
> - target:
> entity_id: number.battery_schedule_soc_limit
> data:
> value: "60"
> action: number.set_value
> mode: single
> 
> ```

- a 22H ou a tout moment entre 22h & 6h, si on change le % de la batterie à atteindre, on change la vitesse de rechargement de la batterie (via une limite en intensité vers le circuit «&nbsp;DC&nbsp;»)

> **automatisation Charge la plus douce possible, pour arriver a X% de charge de la batterie**
>
> ```auto
> alias: Battery - Limite charge de la batterie en heure creuse
> description: |
> Update number.battery_limit A value
> a 22h ou a chaque change de limit soc % entre 22h et 6
> trigger:
> - platform: time
> at: "22:00:00"
> - platform: state
> entity_id:
> - number.battery_schedule_soc_limit
> condition:
> - condition: state
> entity_id: switch.system_schedule_charge_hc
> state: "on"
> - condition: time
> after: "21:59:00"
> before: "05:59:00"
> action:
> - action: number.set_value
> metadata: {}
> data:
> value: >-
> {# En prend le plut petit entre demain 6h- moins maintenant ET 8h #}{%
> if (now()| as_local).hour >= 22 %}{% set temp = ((now().replace(hour=5,
> minute=59, second=0, microsecond=0) + timedelta(days=1)) -
> now()).seconds /3600 %}{% elif (now()|as_local).hour < 6 %}{% set temp =
> (now().replace(hour=5, minute=59, second=0, microsecond=0) -
> now()).seconds /3600 %}{% else %}{% set temp = 7.98 %}{% endif %} {% set
> value = ((states('number.battery_schedule_soc_limit')
> | float(default=0) - states('sensor.battery_soc') |
> float(default=0) ) / 100 * 15 / temp ) /
> states('sensor.battery_voltage') | float(default=0) * 1000 %}{%
> if value > 100 %}100{% elif value > 0 %}{{ value | round + 1 }}{% endif
> %}
> target:
> entity_id: number.battery_charge_limit
> mode: single
> 
> ```

- Si en Heure-creuse (hors veille d’un jour rouge), on a pas assez d’énergie dans la batterie pour passer la nuit, on recharge pas, mais on puisse sur le réseau pour le besoin de la maison (ça serait dommage de vider la batterie en Heure Creuse, puis de devoir utiliser le réseau en Heure Pleine car la batterie est vide) :

ps : a l’origine, ce qu’il y avait en condition était en trigger mais ça fessait beaucoup de check inutile a home assistant, …

> **automatisation Batterie Vide pour passer la nuit**
>
> ```auto
> alias: Batterie Vide pour passer la nuit
> description: >-
> postulat : besoin de 300wh la nuit
> 
> Si en Heure Creuse on a plus assez d’énergie pour passer la nuit, c'est mieux
> d'utiliser EDF pour la nuit (mais pas de recharger ) 
> trigger:
> - platform: time
> at: "22:00:00"
> - platform: time
> at: "23:00:00"
> - platform: time
> at: "00:00:00"
> - platform: time
> at: "01:00:00"
> - platform: time
> at: "02:00:00"
> - platform: time
> at: "03:00:00"
> - platform: time
> at: "04:00:00"
> - platform: time
> at: "05:00:00"
> condition:
> - alias: Si puissance requise pour passer la nuit est > puissance batterie restante
> condition: template
> value_template: >-
> {% if (now()| as_local).hour >= 22 or (now()|as_local).hour < 6 %}
> {% set duree = ( ( state_attr("sun.sun", "next_rising")| as_datetime | as_local ) + timedelta(hours=1) - now()).seconds /3600 %}
> {% else %}
> {% set duree = 0 %}
> {% endif %} {% if ( (duree * 0.3 ) + 0.5 ) | round(2) > ( (
> states('sensor.battery_soc') | float (default=0) -
> states('number.min_soc') | float (default=0) )* 14.5 /
> 100 ) | round (1) %} true {% else %} false {% endif %}
> action:
> - action: notify.mobile_app_sm_a346e
> metadata: {}
> data:
> title: Cerbo Schedule Charge HC minimal
> message: >-
> {% if (now()| as_local).hour >= 22 or (now()|as_local).hour < 6 %} {%
> set duree = ( ( state_attr("sun.sun", "next_rising")| as_datetime |
> as_local ) + timedelta(hours=1) - now()).seconds /3600 %} {% else %}  
> {% set duree = 0 %} {% endif %} duree restant pour passer la nuit : {{
> duree | round(2) }}h puissance requise : {{ ( (duree * 0.3 ) + 0.5 ) |
> round(2) }}Kwh batterie restante : {{ ( (
> states('sensor.battery_soc') | float (default=0) -
> states('number.min_soc') | float (default=0) )* 14.5 /
> 100 ) | round (1) }}Kwh
> - action: number.set_value
> metadata: {}
> data:
> value: "{{ states('number.min_soc') | int (default=0) +1 }}"
> target:
> entity_id: number.battery_schedule_2_soc_limit
> alias: Limit Schedule 2 limit SOC = Min SOC +1
> - action: number.set_value
> metadata: {}
> data:
> value: "1"
> target:
> entity_id: number.battery_charge_limit
> alias: >-
> mettre a 1A la vitesse de rechargement, pour pas recharge mais prendre d
> EDF pour ac-out
> - action: switch.turn_on
> data: {}
> target:
> entity_id: switch.system_schedule_2_activer
> - action: input_datetime.set_datetime
> data_template:
> entity_id: input_datetime.schedule_2_duree
> time: >
> {% if (now()| as_local).hour >= 22 or (now()|as_local).hour < 6 %} {%
> set duree = ( ( state_attr("sun.sun", "next_rising")| as_datetime |
> as_local ) + timedelta(hours=1) - now()).seconds /3600 %} {% else %}  
> {% set duree = 0 %} {% endif %} {% set dure = duree * 0.3 + 0.5 %} {%
> set requise = ( (duree * 0.3 ) + 0.5 ) | round(2) %} {% set restant = (
> ( states('sensor.battery_soc') | float (default=0) -
> states('number.min_soc') | float (default=0) )* 14.5 /
> 100 ) | round (1) %} {% if restant < requise %} {{ ( ( ( (requise -
> restant ) / 0.3 *3600 )+ 900 ) | int | as_datetime).time() }} {% else
> %} {{ ( ( 0 ) | int | as_datetime).time() }} {% endif %}
> alias: Defini Duree du Schedule 2
> - action: input_datetime.set_datetime
> data_template:
> entity_id: input_datetime.schedule_2_heure_de_demarrage
> time: >
> {{ (now().replace(second=0, microsecond=0) +
> timedelta(minutes=5)).strftime("%H:%M:%S") }}
> alias: Defini Start du Schedule 2
> mode: single
> 
> ```

ps: `14.5`, c’est la puissance de la batterie en Kwh (hardcoder dans les automatisations) , à changer suivant la configuration de chaque un.

ps2: j’ai une autre automatisation qui a 6h, reset la valeur de la limite en intensité vers le circuit DC et déactive le schedule mais elle est facile et n’a pas d’intérêt dans l’exemple ici.

---

<div class="post-metadata">

**Author:** ![nicolas\_frances](https://forum.hacf.fr/user_avatar/forum.hacf.fr/nicolas_frances/32/78180_2.png) [@nicolas\_frances](https://forum.hacf.fr/u/nicolas_frances)\
**Post date:** [Septembre 23, 2024, 12:48 UTC](https://forum.hacf.fr/t/zendure-plan-energetique-modification-via-home-assistant/48101/9 "2024-09-23T12:48:33Z")

</div>

Merci beaucoup Roumano.

J’utilisais ce même principe avec mes batteries EcoFlow. Je te remercie pour tout, je vais lire ton code il y a certainement des parties à réutiliser.

Merci encore.

Nicolas

---

<div class="post-metadata">

**Author:** ![Clem\_Combo\_CCS](https://forum.hacf.fr/user_avatar/forum.hacf.fr/clem_combo_ccs/32/37743_2.png) [@Clem\_Combo\_CCS](https://forum.hacf.fr/u/Clem_Combo_CCS)\
**Post date:** [Septembre 24, 2024, 6:25 UTC](https://forum.hacf.fr/t/zendure-plan-energetique-modification-via-home-assistant/48101/10 "2024-09-24T18:25:12Z")

</div>

Bonjour à tous, je jete un pavé dans la marre mais si il est possible de piloter en local via HA le Hyper et tous les produits Zendure. Cependant ca nécessite du développement sourcing + coding. Quelqu’un a réussi à piloter le switch pour le AC entre la recharge AC de la batterie et la décharge AC de la batterie ? Il ne me manque plus que cela pour avoir un pilotage complet

---

<div class="post-metadata">

**Author:** ![Clem\_Combo\_CCS](https://forum.hacf.fr/user_avatar/forum.hacf.fr/clem_combo_ccs/32/37743_2.png) [@Clem\_Combo\_CCS](https://forum.hacf.fr/u/Clem_Combo_CCS)\
**Post date:** [Septembre 24, 2024, 6:27 UTC](https://forum.hacf.fr/t/zendure-plan-energetique-modification-via-home-assistant/48101/11 "2024-09-24T18:27:16Z")

</div>

PS : quelqu’un sait à quoi servent les switch : «&nbsp;acSwitch&nbsp;», «&nbsp;masterSwitch&nbsp;» ?

---

<div class="post-metadata">

**Author:** ![olivr2s](https://forum.hacf.fr/user_avatar/forum.hacf.fr/olivr2s/32/73633_2.png) [@olivr2s](https://forum.hacf.fr/u/olivr2s)\
**Post date:** [Septembre 28, 2024, 8:59 UTC](https://forum.hacf.fr/t/zendure-plan-energetique-modification-via-home-assistant/48101/12 "2024-09-28T20:59:55Z")

</div>

J'ai trouvé une autre piste qui permet de récupérer via mqtt les sensor et switch pour le Hyper 2000 qui est celle-ci:

> **[GitHub - nograx/ioBroker.zendure-solarflow: An ioBroker adapter for Zendure SolarFlow devices](https://github.com/nograx/ioBroker.zendure-solarflow)**
>
> An ioBroker adapter for Zendure SolarFlow devices

ça utile IoBroker pour faire comme si on utilisait l'appli Android avec plus d'informations en retour et d'autres possibilité de pilotage.

Je viens tout juste de tester avec un Orange Pi PC+ qu'il me restait dans un coin, sur lequel j'ai installé un système Debian, puis IoBroker dessus.

> **[ioBroker | Open source smart home and building automation](https://www.iobroker.com/)**
>
> ioBroker connects devices, protocols and online services into one smart home: hundreds of adapters, free automation, your own visualisation.

Une fois IoBroker d'installé et fait les premières configurations de démarrage, il faut installer l'adaptateur MQTT

 ![image](https://forum.hacf.fr/uploads/default/original/3X/a/9/a977a15f7a74b2cb3bb565b9c2c4d8a46ef57a97.png)  
et le configurer comme l'exemple du Wiki du Github

> **[Home](https://github.com/nograx/ioBroker.zendure-solarflow/wiki/)**
>
> An ioBroker adapter for Zendure SolarFlow devices. Contribute to nograx/ioBroker.zendure-solarflow development by creating an account on GitHub.

Après on installe l'adaptateur Zendure

 ![image](https://forum.hacf.fr/uploads/default/original/3X/8/9/89fcc9bdb08c7fbff460852cccf633ead0319f11.png)  
et on le configure avec l'identifiant et mot de passe de son appli Zendure Android.  
Attention, la connexion au compte Zendure déconnecte celle de l'appli Android (1 seule connection à la fois). Pour pouvoir garder un accès sur son téléphone Android, il faut créer un autre compte Zendure et faire un partage à se second compte, puis utiliser le second compte sur son appli Android.

Si les 2 adaptateurs son bien configurés, on devrait avoir tout en vert dans le panneau de contrôle des instances.

 ![image](https://forum.hacf.fr/uploads/default/original/3X/e/d/ed4d334f8cdc49744251d4c3e4d2cd1b429d7e7e.png)

Pour vérifier que le MQTT de IoBroker diffuse bien, un petit tour dans MQTTExplorer.....

 ![image](https://forum.hacf.fr/uploads/default/original/3X/6/7/675525454f89a4f63d91fe0e7f768b8dddc1cd2c.png)  
Et il devrait il y avoir ça....  
 ![image](https://forum.hacf.fr/uploads/default/original/3X/9/c/9c571e005981e6dc4700aadb329cc469c12affca.png)

Par rapport à la méthode du MQTT du serveur EU de Zendure, les informations notamment de puissances s'actualisent beaucoup plus vite, et il y a plus d'informations et controls.

Pour pouvoir récupérer dans Home Assistant les infos MQTT de IoBroker, il faut ajouter dans Mosquitto un fichier de configuration pour MQTT externe et redémarrer Mosquitto.

 ![image](https://forum.hacf.fr/uploads/default/original/3X/5/d/5dfc4bf745a7e39d41308470fa1393425fa77ab7.png)

Si tout va bien (pas d'erreur dans les logs de Mosquitto, et connected au MQTT de IoBroker),  
Il va être possible de récupérer les informations de MQTT.  
Pour cela il faut rajouter dans la config yaml de mqtt les sensors et switch que l'on souhaite.

 ![image](https://forum.hacf.fr/uploads/default/original/3X/3/6/369a54c0c85050d3e75c14ca727d654587587b3b.png)

Pour avoir ça dans HA

 ![image](https://forum.hacf.fr/uploads/default/original/3X/d/2/d20d041306bd89e3a7904a93f7cc16ead3a36a20.png)

J'ai pas encore tout récupéré et testé, mais on peut changer la puissance de sortie à la demande, même sans désactiver le mode intelligent. Je dois tester encore le reste des control.

Sinon le dev de l'adaptateurs Zendure sur IoBroker à l'air assez actif, ce qui est bien pour la suite....

---

<div class="post-metadata">

**Author:** ![roumano](https://forum.hacf.fr/letter_avatar_proxy/v4/letter/r/f14d63/32.png) [@roumano](https://forum.hacf.fr/u/roumano)\
**Post date:** [Septembre 28, 2024, 10:48 UTC](https://forum.hacf.fr/t/zendure-plan-energetique-modification-via-home-assistant/48101/13 "2024-09-28T22:48:58Z")

</div>

Sur les partie que tu veut pouvoir interagir plus finement (dans certains cas), utilise select, ou le plus utile: number

```auto
  - name: "Schedule 2 Durée"
    unique_id: ...
    min: 0
    max: 86340
    step: 60
    mode: slider
    command_topic: "..."
    command_template: >
      {"value": {{ value }} }
    state_topic: "..."
    value_template: >
      {{value_json.value | round(0) }}

```

Si tu fait comme ça, tu peut interagir sur ton matériel via une action input\_datetime.set\_datetime ( ou number.set\_value )

```auto
  - action: number.set_value
    metadata: {}
    data:
      value: '{{ state_attr(''input_datetime.yyyyy'',''timestamp'')
        }}'
    target:
      entity_id: number.xxx

```

---

<div class="post-metadata">

**Author:** ![nicolas\_frances](https://forum.hacf.fr/user_avatar/forum.hacf.fr/nicolas_frances/32/78180_2.png) [@nicolas\_frances](https://forum.hacf.fr/u/nicolas_frances)\
**Post date:** [Septembre 29, 2024, 7:14 UTC](https://forum.hacf.fr/t/zendure-plan-energetique-modification-via-home-assistant/48101/14 "2024-09-29T07:14:30Z")

</div>

> [@olivr2s](#):
>
> yaml de mqtt les sensors et switch que l’on souhaite.

Un grand merci Olivr2s. Je vais tester tout ca ce jour, je vous ferais un retour et peut être un petit bout de doc pour permettre à d’autres d’en profiter.

---

<div class="post-metadata">

**Author:** ![olivr2s](https://forum.hacf.fr/user_avatar/forum.hacf.fr/olivr2s/32/73633_2.png) [@olivr2s](https://forum.hacf.fr/u/olivr2s)\
**Post date:** [Septembre 29, 2024, 7:50 UTC](https://forum.hacf.fr/t/zendure-plan-energetique-modification-via-home-assistant/48101/15 "2024-09-29T07:50:26Z")

</div>

Oui, c’est prévu d’utiliser select ou number pour optimiser les contrôles avec HA.  
C’est tout frais et il faut que je pose maintenant ce que je vais faire avec tout ça…

---

<div class="post-metadata">

**Author:** ![taschio](https://forum.hacf.fr/letter_avatar_proxy/v4/letter/t/5fc32e/32.png) [@taschio](https://forum.hacf.fr/u/taschio)\
**Post date:** [Septembre 30, 2024, 8:46 UTC](https://forum.hacf.fr/t/zendure-plan-energetique-modification-via-home-assistant/48101/16 "2024-09-30T08:46:18Z")

</div>

Merci, cela fonctionne parfaitement

---

<div class="post-metadata">

**Author:** ![MrWiwi](https://forum.hacf.fr/user_avatar/forum.hacf.fr/mrwiwi/32/81780_2.png) [@MrWiwi](https://forum.hacf.fr/u/MrWiwi)\
**Post date:** [Octobre 22, 2024, 4:37 UTC](https://forum.hacf.fr/t/zendure-plan-energetique-modification-via-home-assistant/48101/17 "2024-10-22T16:37:01Z")

</div>

Hello à tous, je me suis posé un peu sur le sujet en traduisant et m’inspirant du forum iobroker en allemand (Pas de lien possible j’ai du recréer un compte j’ai perdu mes accès github…, je suis Wiwi le dev original de tydom2mqtt 😉 )

Du coup toute l’automatisation se passe sur iobroker, ça permet de garder une gestion de l’énergie même si HA est down, ce que je trouve pas mal…

Un fichier de l’automatisation en cours ici, à importer sous bloky (dans l’instance javascript sous iobroker), il vous faut aussi créer une variable «&nbsp;PowerAvailable&nbsp;» dans les objets) :

Le premier if est pour charger la nuit pendant 2h ou jusqu’à 95% et ensuite c’est proche de l’option CT dans l’app Zendure, n’oubliez pas de retirer tout «&nbsp;plan&nbsp;» de gestion dans l’app.

```auto
<xml xmlns="https://developers.google.com/blockly/xml">
  <block type="on_ext" id="n._n/=eOXkf;Z1~fZ?bX" x="80" y="-192">
    <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation>
    <field name="CONDITION">ne</field>
    <field name="ACK_CONDITION"></field>
    <value name="OID0">
      <shadow type="field_oid" id="BFe.YK%XHc?YYHP6tf4O">
        <field name="oid">alias.0.shelly.0.SHEM-3#C8C9A316D6FC#1.Emeter1.Power</field>
      </shadow>
    </value>
    <statement name="STATEMENT">
      <block type="comment" id="-Lkh|F82sn.`Kii9s`[,">
        <field name="COMMENT">Calcul surplus</field>
        <next>
          <block type="update" id=".$@*H8c,!Y^K9MzHG;8F">
            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
            <field name="OID">0_userdata.0.ZendureControl.PowerAvailable</field>
            <field name="WITH_DELAY">FALSE</field>
            <value name="VALUE">
              <block type="math_arithmetic" id="p@Z^bs^Sa)GyFK!UvGur">
                <field name="OP">ADD</field>
                <value name="A">
                  <shadow type="math_number" id="=+EzH#q|HDP)r|mgQ;@e">
                    <field name="NUM">1</field>
                  </shadow>
                  <block type="math_arithmetic" id=":RDkpD4Nm~wv_L9e-lmS">
                    <field name="OP">MINUS</field>
                    <value name="A">
                      <shadow type="math_number" id="|6m-!pKH=)Bn646@gI.=">
                        <field name="NUM">0</field>
                      </shadow>
                    </value>
                    <value name="B">
                      <shadow type="math_number" id="|n97^C`9Q^U-#7dXwk^l">
                        <field name="NUM">1</field>
                      </shadow>
                      <block type="get_value" id="qbL=vtU@J*M$d{!].s?2">
                        <field name="ATTR">val</field>
                        <field name="OID">alias.0.shelly.0.SHEM-3#C8C9A316D6FC#1.Emeter1.Power</field>
                      </block>
                    </value>
                  </block>
                </value>
                <value name="B">
                  <shadow type="math_number" id="LoBc9oA}{xbY)akBMXqT">
                    <field name="NUM">1</field>
                  </shadow>
                  <block type="get_value" id="hWYJv*IU#APgk(DaJu1j">
                    <field name="ATTR">val</field>
                    <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.setInputLimit</field>
                  </block>
                </value>
              </block>
            </value>
            <next>
              <block type="controls_if" id=":P_7R|aB}i|:[Ahzw}hl" disabled="true">
                <mutation elseif="2"></mutation>
                <value name="IF0">
                  <block type="logic_multi_or" id="0^%063NM8C|]+|Y^,{{!">
                    <mutation xmlns="http://www.w3.org/1999/xhtml" items="2"></mutation>
                    <value name="OR0">
                      <block type="logic_compare" id=",^TRf$E_k[xsEb.)YTCS">
                        <field name="OP">EQ</field>
                        <value name="A">
                          <block type="get_value" id=",+s(g8G?}{3)=L0j6+*w">
                            <field name="ATTR">val</field>
                            <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.acMode</field>
                          </block>
                        </value>
                        <value name="B">
                          <block type="math_number" id=":57a.G0]hYfFcHh]w$GK">
                            <field name="NUM">0</field>
                          </block>
                        </value>
                      </block>
                    </value>
                    <value name="OR1">
                      <block type="logic_compare" id="akiZjd{}e*YX$g?teIDN">
                        <field name="OP">EQ</field>
                        <value name="A">
                          <block type="get_value" id="02^_7SC*sD]rktW6,?9S">
                            <field name="ATTR">val</field>
                            <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.packState</field>
                          </block>
                        </value>
                        <value name="B">
                          <block type="text" id="f;+VH`//l=JE5Wp#~6XW">
                            <field name="TEXT">Idle</field>
                          </block>
                        </value>
                      </block>
                    </value>
                  </block>
                </value>
                <statement name="DO0">
                  <block type="comment" id="~mzW+OY%ClEAq3{Q#GTT">
                    <field name="COMMENT">AC Idle mode</field>
                    <next>
                      <block type="update" id="hSi6dW6[m9V5s4Ta2|@8">
                        <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                        <field name="OID">0_userdata.0.ZendureControl.PowerAvailable</field>
                        <field name="WITH_DELAY">FALSE</field>
                        <value name="VALUE">
                          <block type="math_arithmetic" id="Tz`H|l5.ol,A.6)8x.Ix">
                            <field name="OP">MINUS</field>
                            <value name="A">
                              <shadow type="math_number" id="(RXch=MTLv_gDE,.aIV/">
                                <field name="NUM">0</field>
                              </shadow>
                            </value>
                            <value name="B">
                              <shadow type="math_number" id="|n97^C`9Q^U-#7dXwk^l">
                                <field name="NUM">1</field>
                              </shadow>
                              <block type="get_value" id="TGF?-~xB418},:X~4rmk">
                                <field name="ATTR">val</field>
                                <field name="OID">alias.0.shelly.0.SHEM-3#C8C9A316D6FC#1.Emeter1.Power</field>
                              </block>
                            </value>
                          </block>
                        </value>
                      </block>
                    </next>
                  </block>
                </statement>
                <value name="IF1">
                  <block type="logic_compare" id="ELe`lCY3d%EA3i:goOvq">
                    <field name="OP">EQ</field>
                    <value name="A">
                      <block type="get_value" id="8FbyiazgnwqKjS:4Q27K">
                        <field name="ATTR">val</field>
                        <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.acMode</field>
                      </block>
                    </value>
                    <value name="B">
                      <block type="math_number" id=")Vy^-]3=m2Xw1/#rjI34">
                        <field name="NUM">1</field>
                      </block>
                    </value>
                  </block>
                </value>
                <statement name="DO1">
                  <block type="comment" id="%kkT]|EoIrQPH3`gO;B2">
                    <field name="COMMENT">AC Input mode (Charge)</field>
                    <next>
                      <block type="update" id="4w)%$.)Tgm.u5fJN~4Zn">
                        <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                        <field name="OID">0_userdata.0.ZendureControl.PowerAvailable</field>
                        <field name="WITH_DELAY">FALSE</field>
                        <value name="VALUE">
                          <block type="math_arithmetic" id="q}o0P$0unF:*dXnoHPUz">
                            <field name="OP">ADD</field>
                            <value name="A">
                              <shadow type="math_number" id="=+EzH#q|HDP)r|mgQ;@e">
                                <field name="NUM">1</field>
                              </shadow>
                              <block type="math_arithmetic" id="(%P=|?I5bKRJ.Z_y6Gl]">
                                <field name="OP">MINUS</field>
                                <value name="A">
                                  <shadow type="math_number" id="3fVOX6ooAJ]QCDoXKb$R">
                                    <field name="NUM">0</field>
                                  </shadow>
                                </value>
                                <value name="B">
                                  <shadow type="math_number" id="|n97^C`9Q^U-#7dXwk^l">
                                    <field name="NUM">1</field>
                                  </shadow>
                                  <block type="get_value" id="@J~Xyn*j0ScVu=7.s2~J">
                                    <field name="ATTR">val</field>
                                    <field name="OID">alias.0.shelly.0.SHEM-3#C8C9A316D6FC#1.Emeter1.Power</field>
                                  </block>
                                </value>
                              </block>
                            </value>
                            <value name="B">
                              <shadow type="math_number" id="LoBc9oA}{xbY)akBMXqT">
                                <field name="NUM">1</field>
                              </shadow>
                              <block type="get_value" id="n?kBf=Hnx-En:reu149|">
                                <field name="ATTR">val</field>
                                <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.setInputLimit</field>
                              </block>
                            </value>
                          </block>
                        </value>
                      </block>
                    </next>
                  </block>
                </statement>
                <value name="IF2">
                  <block type="logic_compare" id="2x/F:GRm(^Mc.ZM=~aeE">
                    <field name="OP">EQ</field>
                    <value name="A">
                      <block type="get_value" id="t;+v1xqt;fd0@bXQ=i:U">
                        <field name="ATTR">val</field>
                        <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.acMode</field>
                      </block>
                    </value>
                    <value name="B">
                      <block type="math_number" id="q6X.(T-e%4QV0?y_ClvS">
                        <field name="NUM">2</field>
                      </block>
                    </value>
                  </block>
                </value>
                <statement name="DO2">
                  <block type="comment" id="Zx6fCj_MGvY)HljlUdXz">
                    <field name="COMMENT">AC Output mode (discharge)</field>
                    <next>
                      <block type="update" id="WT;3%6*a-q^;_^68z9v$">
                        <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                        <field name="OID">0_userdata.0.ZendureControl.PowerAvailable</field>
                        <field name="WITH_DELAY">FALSE</field>
                        <value name="VALUE">
                          <block type="math_arithmetic" id="2a}r{KOp9BxrXM|K+x/q">
                            <field name="OP">ADD</field>
                            <value name="A">
                              <shadow type="math_number" id="=+EzH#q|HDP)r|mgQ;@e">
                                <field name="NUM">1</field>
                              </shadow>
                              <block type="math_arithmetic" id="i@4n~/rNK]]:1^7/*`9T">
                                <field name="OP">MINUS</field>
                                <value name="A">
                                  <shadow type="math_number" id="]3+F;ke1!oP;}J8v}6Ht">
                                    <field name="NUM">0</field>
                                  </shadow>
                                </value>
                                <value name="B">
                                  <shadow type="math_number" id="|n97^C`9Q^U-#7dXwk^l">
                                    <field name="NUM">1</field>
                                  </shadow>
                                  <block type="get_value" id="w:)dxez2D;mW+S@XfJec">
                                    <field name="ATTR">val</field>
                                    <field name="OID">alias.0.shelly.0.SHEM-3#C8C9A316D6FC#1.Emeter1.Power</field>
                                  </block>
                                </value>
                              </block>
                            </value>
                            <value name="B">
                              <shadow type="math_number" id="LoBc9oA}{xbY)akBMXqT">
                                <field name="NUM">1</field>
                              </shadow>
                              <block type="get_value" id="Yb(fNd3Ls[HBq/EWsD#p">
                                <field name="ATTR">val</field>
                                <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.gridInputPower</field>
                              </block>
                            </value>
                          </block>
                        </value>
                      </block>
                    </next>
                  </block>
                </statement>
                <next>
                  <block type="controls_if" id="jB|cjHX2.!9Bvkr@Sy=H">
                    <mutation else="1"></mutation>
                    <comment pinned="false" h="80" w="160">Charge at night</comment>
                    <value name="IF0">
                      <block type="logic_multi_and" id="Fa@t{dcmVNo,gNQ8Z,1U">
                        <mutation xmlns="http://www.w3.org/1999/xhtml" items="3"></mutation>
                        <value name="AND0">
                          <block type="logic_compare" id="C=IAvN]t`Gs:U..{JtD|">
                            <field name="OP">EQ</field>
                            <value name="A">
                              <block type="get_value" id=":flu_TDd5HVu[(xn{FB:">
                                <field name="ATTR">val</field>
                                <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.electricLevel</field>
                              </block>
                            </value>
                            <value name="B">
                              <block type="get_value" id="INy%tL@wKNh!t/JRFkLk">
                                <field name="ATTR">val</field>
                                <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.minSoc</field>
                              </block>
                            </value>
                          </block>
                        </value>
                        <value name="AND1">
                          <block type="time_compare" id="EEbh$8bzw_}6:ww$x?0.">
                            <mutation xmlns="http://www.w3.org/1999/xhtml" end_time="false"></mutation>
                            <field name="OPTION">&gt;=</field>
                            <field name="START_TIME">03:30</field>
                          </block>
                        </value>
                        <value name="AND2">
                          <block type="time_compare" id="7FpsQon15/nqqXW#hyP)">
                            <mutation xmlns="http://www.w3.org/1999/xhtml" end_time="false"></mutation>
                            <field name="OPTION">&lt;=</field>
                            <field name="START_TIME">05:45</field>
                          </block>
                        </value>
                      </block>
                    </value>
                    <statement name="DO0">
                      <block type="control" id="L{R*%*V8A?=Ilu6e+/jX">
                        <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                        <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.setOutputLimit</field>
                        <field name="WITH_DELAY">FALSE</field>
                        <value name="VALUE">
                          <block type="math_number" id="zJ.Y7i3T(2[Qp=?i3g)7">
                            <field name="NUM">0</field>
                          </block>
                        </value>
                        <next>
                          <block type="control" id="D;M`iVP/}bjPM.eVe`$*">
                            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                            <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.setInputLimit</field>
                            <field name="WITH_DELAY">FALSE</field>
                            <value name="VALUE">
                              <block type="math_number" id="%8(uXlovQ-f#_!Nlw=Ye">
                                <field name="NUM">1200</field>
                              </block>
                            </value>
                            <next>
                              <block type="comment" id="zwvH%x{n.+%a/0%0@;gg">
                                <field name="COMMENT">Switch Mode AC to 1 (Charge the battery, import from house to battery)</field>
                                <next>
                                  <block type="controls_if" id="YT:~Jm7KXM/26^w8-hZF">
                                    <value name="IF0">
                                      <block type="logic_compare" id="?8Q}ssP|=mooq2fkM#]I">
                                        <field name="OP">NEQ</field>
                                        <value name="A">
                                          <block type="get_value" id="l^x}F}Ic#KIfDTtIX@+P">
                                            <field name="ATTR">val</field>
                                            <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.acMode</field>
                                          </block>
                                        </value>
                                        <value name="B">
                                          <block type="math_number" id="DWC(N)Gq`D!XMitwY8]F">
                                            <field name="NUM">1</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                    <statement name="DO0">
                                      <block type="control" id="pYrR3-%rFD;H?eYp.^Y*">
                                        <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                        <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.acMode</field>
                                        <field name="WITH_DELAY">FALSE</field>
                                        <value name="VALUE">
                                          <block type="math_number" id=")`[srlklDasHn#8dRq~L">
                                            <field name="NUM">1</field>
                                          </block>
                                        </value>
                                      </block>
                                    </statement>
                                  </block>
                                </next>
                              </block>
                            </next>
                          </block>
                        </next>
                      </block>
                    </statement>
                    <statement name="ELSE">
                      <block type="controls_if" id="ceVh]OqX#F59jQX=_A82">
                        <mutation elseif="1"></mutation>
                        <value name="IF0">
                          <block type="logic_multi_and" id="%!0.^@e~9C*^t=2?`~SD">
                            <mutation xmlns="http://www.w3.org/1999/xhtml" items="2"></mutation>
                            <value name="AND0">
                              <block type="logic_compare" id="3J57ER~UTsa1]IB008kw">
                                <field name="OP">EQ</field>
                                <value name="A">
                                  <block type="logic_compare" id="7=-OLc-i%RlH!#?%7|6Z">
                                    <field name="OP">GT</field>
                                    <value name="A">
                                      <block type="get_value" id="E[8j+u,*c|%_M@T-U;}@">
                                        <field name="ATTR">val</field>
                                        <field name="OID">alias.0.shelly.0.SHEM-3#C8C9A316D6FC#1.Emeter1.Power</field>
                                      </block>
                                    </value>
                                    <value name="B">
                                      <block type="math_number" id="LB?HhKYNYRsU4n.r#%?:">
                                        <field name="NUM">10</field>
                                      </block>
                                    </value>
                                  </block>
                                </value>
                                <value name="B">
                                  <block type="logic_boolean" id="a}kd)V:|%JI0*UOje:dN">
                                    <field name="BOOL">TRUE</field>
                                  </block>
                                </value>
                              </block>
                            </value>
                            <value name="AND1">
                              <block type="logic_compare" id="{^l6PG=~A^Pk1?RN!Pj=">
                                <field name="OP">EQ</field>
                                <value name="A">
                                  <block type="logic_compare" id="hi]@P[WR.1XDYrEa2L1H">
                                    <field name="OP">GT</field>
                                    <value name="A">
                                      <block type="get_value" id="5OG^!C?7Qm2u!~0d7@9h">
                                        <field name="ATTR">val</field>
                                        <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.electricLevel</field>
                                      </block>
                                    </value>
                                    <value name="B">
                                      <block type="get_value" id="xni+zl}^6pJx;QRt;tJ$">
                                        <field name="ATTR">val</field>
                                        <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.minSoc</field>
                                      </block>
                                    </value>
                                  </block>
                                </value>
                                <value name="B">
                                  <block type="logic_boolean" id="/w|?*R!VzYZ_vK;ws0t^">
                                    <field name="BOOL">TRUE</field>
                                  </block>
                                </value>
                              </block>
                            </value>
                          </block>
                        </value>
                        <statement name="DO0">
                          <block type="comment" id="K5DDxom?`tOS%L_%zZ:(">
                            <field name="COMMENT">The house is importing power from the grid</field>
                            <next>
                              <block type="comment" id="*OmZxLQ02d/-/$Stjw*b">
                                <field name="COMMENT">Start discharging the battery when PV is lower</field>
                                <next>
                                  <block type="comment" id="#sGXaA}7FOlrqJ_f`nXC">
                                    <field name="COMMENT">Start discharging the battery the surplus is -20W.</field>
                                    <next>
                                      <block type="comment" id="BTTPMWm/de,d7~Ti|/I:">
                                        <field name="COMMENT">Calculation of the power surplus</field>
                                        <next>
                                          <block type="update" id="fce@-pMl:1kZ%lAb1IM5">
                                            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                            <field name="OID">0_userdata.0.ZendureControl.PowerAvailable</field>
                                            <field name="WITH_DELAY">FALSE</field>
                                            <value name="VALUE">
                                              <block type="math_arithmetic" id=",=I/6z]|3NAu8ylXEr|)">
                                                <field name="OP">ADD</field>
                                                <value name="A">
                                                  <shadow type="math_number" id="=+EzH#q|HDP)r|mgQ;@e">
                                                    <field name="NUM">1</field>
                                                  </shadow>
                                                  <block type="math_arithmetic" id=";D#iA~8Yj630O($CMi?N">
                                                    <field name="OP">MINUS</field>
                                                    <value name="A">
                                                      <shadow type="math_number" id=";f|).sI:pOi1s(r$G`8b">
                                                        <field name="NUM">0</field>
                                                      </shadow>
                                                    </value>
                                                    <value name="B">
                                                      <shadow type="math_number" id="|n97^C`9Q^U-#7dXwk^l">
                                                        <field name="NUM">1</field>
                                                      </shadow>
                                                      <block type="get_value" id="XmrX=:RmGSQt*7n%!~|o">
                                                        <field name="ATTR">val</field>
                                                        <field name="OID">alias.0.shelly.0.SHEM-3#C8C9A316D6FC#1.Emeter1.Power</field>
                                                      </block>
                                                    </value>
                                                  </block>
                                                </value>
                                                <value name="B">
                                                  <shadow type="math_number" id="LoBc9oA}{xbY)akBMXqT">
                                                    <field name="NUM">1</field>
                                                  </shadow>
                                                  <block type="get_value" id="hm2nF$NvSUz9w[Ph*f/d">
                                                    <field name="ATTR">val</field>
                                                    <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.setInputLimit</field>
                                                  </block>
                                                </value>
                                              </block>
                                            </value>
                                            <next>
                                              <block type="control" id="=o2{GPV4w=:]aci4|vY?">
                                                <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.setOutputLimit</field>
                                                <field name="WITH_DELAY">FALSE</field>
                                                <value name="VALUE">
                                                  <block type="convert_tonumber" id="Rj3Uaj4{~c;!x!eGEeXD">
                                                    <value name="VALUE">
                                                      <block type="math_constrain" id="7~D[JsL|_N~VeFwt`pE`">
                                                        <value name="VALUE">
                                                          <shadow type="math_number" id="(9UIPj)LKTV=|#F^uD,q">
                                                            <field name="NUM">50</field>
                                                          </shadow>
                                                          <block type="math_arithmetic" id="TvZBnp(B!y!/Hr[yexE9">
                                                            <field name="OP">ADD</field>
                                                            <value name="A">
                                                              <shadow type="math_number" id="l(:X{x7E+4zu10Q|5@!j">
                                                                <field name="NUM">1</field>
                                                              </shadow>
                                                              <block type="math_round" id="_)86b/RxGH%v7o10%~/M">
                                                                <field name="OP">ROUNDUP</field>
                                                                <value name="NUM">
                                                                  <shadow type="math_number" id="gyY9z7s?_CrnAoD0q10E">
                                                                    <field name="NUM">3.1</field>
                                                                  </shadow>
                                                                  <block type="get_value" id="SQT#4`Dl*V==lu[7Mku8">
                                                                    <field name="ATTR">val</field>
                                                                    <field name="OID">alias.0.shelly.0.SHEM-3#C8C9A316D6FC#1.Emeter1.Power</field>
                                                                  </block>
                                                                </value>
                                                              </block>
                                                            </value>
                                                            <value name="B">
                                                              <shadow type="math_number" id="ejRA-VP8RdO[Iz7W6[$B">
                                                                <field name="NUM">1</field>
                                                              </shadow>
                                                              <block type="get_value" id="!9ne=tscadHC,quP|dlU">
                                                                <field name="ATTR">val</field>
                                                                <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.packInputPower</field>
                                                              </block>
                                                            </value>
                                                          </block>
                                                        </value>
                                                        <value name="LOW">
                                                          <shadow type="math_number" id="k$b@7b)3I?3u8R,%^no(">
                                                            <field name="NUM">0</field>
                                                          </shadow>
                                                        </value>
                                                        <value name="HIGH">
                                                          <shadow type="math_number" id="x8}*eX!Nsg$Dq)p(Q9S_">
                                                            <field name="NUM">1200</field>
                                                          </shadow>
                                                        </value>
                                                      </block>
                                                    </value>
                                                  </block>
                                                </value>
                                                <next>
                                                  <block type="control" id="O*;k.`?nQqdF;AGd[Yjl">
                                                    <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                    <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.setInputLimit</field>
                                                    <field name="WITH_DELAY">FALSE</field>
                                                    <value name="VALUE">
                                                      <block type="math_number" id="0$zTn8u`[.f`wpK+*xUS">
                                                        <field name="NUM">0</field>
                                                      </block>
                                                    </value>
                                                    <next>
                                                      <block type="comment" id="-~_5VyBb;ylrRC)CVgRk">
                                                        <field name="COMMENT">Switch Mode AC to 2 (Discharge the battery to house)</field>
                                                        <next>
                                                          <block type="controls_if" id="Qz5c%hJbta[0TsYo42G)">
                                                            <value name="IF0">
                                                              <block type="logic_compare" id="Iyp`,~@V86|af4mY^[k6">
                                                                <field name="OP">NEQ</field>
                                                                <value name="A">
                                                                  <block type="get_value" id="Le+Q8Dtj[2q|fSs;jaVB">
                                                                    <field name="ATTR">val</field>
                                                                    <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.acMode</field>
                                                                  </block>
                                                                </value>
                                                                <value name="B">
                                                                  <block type="math_number" id="c4c`K=AB02Qy7;CIS;C2">
                                                                    <field name="NUM">2</field>
                                                                  </block>
                                                                </value>
                                                              </block>
                                                            </value>
                                                            <statement name="DO0">
                                                              <block type="control" id="[xw_(|,6{QxRl3l}OU|e">
                                                                <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.acMode</field>
                                                                <field name="WITH_DELAY">FALSE</field>
                                                                <value name="VALUE">
                                                                  <block type="math_number" id="For~)Qm/@`puW%Y=Lwfo">
                                                                    <field name="NUM">2</field>
                                                                  </block>
                                                                </value>
                                                              </block>
                                                            </statement>
                                                          </block>
                                                        </next>
                                                      </block>
                                                    </next>
                                                  </block>
                                                </next>
                                              </block>
                                            </next>
                                          </block>
                                        </next>
                                      </block>
                                    </next>
                                  </block>
                                </next>
                              </block>
                            </next>
                          </block>
                        </statement>
                        <value name="IF1">
                          <block type="logic_compare" id="Y$yYtw;D=([~?KRGZ[s(">
                            <field name="OP">EQ</field>
                            <value name="A">
                              <block type="logic_compare" id="2;sQaVnUey[9GSjt*Bv]">
                                <field name="OP">LT</field>
                                <value name="A">
                                  <block type="get_value" id=",nDugIZd,#;bA7?-_vS~">
                                    <field name="ATTR">val</field>
                                    <field name="OID">alias.0.shelly.0.SHEM-3#C8C9A316D6FC#1.Emeter1.Power</field>
                                  </block>
                                </value>
                                <value name="B">
                                  <block type="math_number" id=".H-dr:8Nhv|Ei|VV4b8.">
                                    <field name="NUM">-40</field>
                                  </block>
                                </value>
                              </block>
                            </value>
                            <value name="B">
                              <block type="logic_boolean" id="BJVl}ai*P{@r:(=X1z,-">
                                <field name="BOOL">TRUE</field>
                              </block>
                            </value>
                          </block>
                        </value>
                        <statement name="DO1">
                          <block type="comment" id="G9P2tg|9szmpM|qUeCL{">
                            <field name="COMMENT">The house is producting too much</field>
                            <next>
                              <block type="comment" id="/@qBjbc!3z8~W#5,%$[_">
                                <field name="COMMENT">Calculation of the power surplus</field>
                                <next>
                                  <block type="update" id="F|]m4r4](W#[I.ng@TV.">
                                    <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                    <field name="OID">0_userdata.0.ZendureControl.PowerAvailable</field>
                                    <field name="WITH_DELAY">FALSE</field>
                                    <value name="VALUE">
                                      <block type="math_arithmetic" id="r[=XTMA%cnbIn^Pee0fl">
                                        <field name="OP">ADD</field>
                                        <value name="A">
                                          <shadow type="math_number" id="=+EzH#q|HDP)r|mgQ;@e">
                                            <field name="NUM">1</field>
                                          </shadow>
                                          <block type="math_arithmetic" id="}zN=Zw6/H0n=h[qE7/4A">
                                            <field name="OP">MINUS</field>
                                            <value name="A">
                                              <shadow type="math_number" id="$SPNl@SIOfLS#XuJim?X">
                                                <field name="NUM">0</field>
                                              </shadow>
                                            </value>
                                            <value name="B">
                                              <shadow type="math_number" id="|n97^C`9Q^U-#7dXwk^l">
                                                <field name="NUM">1</field>
                                              </shadow>
                                              <block type="get_value" id="A~X6.C[D;6{m0OUoaQNn">
                                                <field name="ATTR">val</field>
                                                <field name="OID">alias.0.shelly.0.SHEM-3#C8C9A316D6FC#1.Emeter1.Power</field>
                                              </block>
                                            </value>
                                          </block>
                                        </value>
                                        <value name="B">
                                          <shadow type="math_number" id="LoBc9oA}{xbY)akBMXqT">
                                            <field name="NUM">1</field>
                                          </shadow>
                                          <block type="get_value" id="VI*:6et}%oHfeYDXTXC3">
                                            <field name="ATTR">val</field>
                                            <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.gridInputPower</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                    <next>
                                      <block type="comment" id="?C:dB}qv6J|If!(XDnSL">
                                        <field name="COMMENT">Change input limit to the Power we can consume - 40w to have some buffer</field>
                                        <next>
                                          <block type="control" id="8ES?0+H.?*6WB)Db,A95" disabled="true">
                                            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                            <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.setInputLimit</field>
                                            <field name="WITH_DELAY">FALSE</field>
                                            <value name="VALUE">
                                              <block type="convert_tonumber" id="a#?Rc,ig.mU;stV[6|y+">
                                                <value name="VALUE">
                                                  <block type="math_arithmetic" id="7f2rA,rq(G(~e~r-2~^Z">
                                                    <field name="OP">MINUS</field>
                                                    <value name="A">
                                                      <shadow type="math_number" id="ecZ@g`|]9L~62{9uVOi`">
                                                        <field name="NUM">1</field>
                                                      </shadow>
                                                      <block type="math_round" id="5wqtClm)6p{$Z494]D^1">
                                                        <field name="OP">ROUND</field>
                                                        <value name="NUM">
                                                          <shadow type="math_number" id="gyY9z7s?_CrnAoD0q10E">
                                                            <field name="NUM">3.1</field>
                                                          </shadow>
                                                          <block type="get_value" id="@[g^nLwrxmwdO31{d5@x">
                                                            <field name="ATTR">val</field>
                                                            <field name="OID">0_userdata.0.ZendureControl.PowerAvailable</field>
                                                          </block>
                                                        </value>
                                                      </block>
                                                    </value>
                                                    <value name="B">
                                                      <shadow type="math_number" id="TrR3-E94Fn#4%z?Z,8V4">
                                                        <field name="NUM">50</field>
                                                      </shadow>
                                                    </value>
                                                  </block>
                                                </value>
                                              </block>
                                            </value>
                                            <next>
                                              <block type="control" id="lG=w=%Mt=EE)AWSwDDfI">
                                                <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.setInputLimit</field>
                                                <field name="WITH_DELAY">FALSE</field>
                                                <value name="VALUE">
                                                  <block type="convert_tonumber" id="/edP|/%tG$6rB?UV9~#(">
                                                    <value name="VALUE">
                                                      <block type="math_constrain" id="N@(}(9=%fUuo:LKcxxP+">
                                                        <value name="VALUE">
                                                          <shadow type="math_number" id="(9UIPj)LKTV=|#F^uD,q">
                                                            <field name="NUM">50</field>
                                                          </shadow>
                                                          <block type="math_arithmetic" id="6HZ~l.GRi9WQ.:9C}MuF">
                                                            <field name="OP">MINUS</field>
                                                            <value name="A">
                                                              <shadow type="math_number" id="l(:X{x7E+4zu10Q|5@!j">
                                                                <field name="NUM">1</field>
                                                              </shadow>
                                                              <block type="math_round" id="iTwn_EU)!aIEeVKGFg?C">
                                                                <field name="OP">ROUNDDOWN</field>
                                                                <value name="NUM">
                                                                  <shadow type="math_number" id="gyY9z7s?_CrnAoD0q10E">
                                                                    <field name="NUM">3.1</field>
                                                                  </shadow>
                                                                  <block type="get_value" id=",M}iF=|4Scd+SYiq)aWg">
                                                                    <field name="ATTR">val</field>
                                                                    <field name="OID">0_userdata.0.ZendureControl.PowerAvailable</field>
                                                                  </block>
                                                                </value>
                                                              </block>
                                                            </value>
                                                            <value name="B">
                                                              <shadow type="math_number" id="ejRA-VP8RdO[Iz7W6[$B">
                                                                <field name="NUM">40</field>
                                                              </shadow>
                                                            </value>
                                                          </block>
                                                        </value>
                                                        <value name="LOW">
                                                          <shadow type="math_number" id=";i#uI}{rB+`e3tFfmxD9">
                                                            <field name="NUM">0</field>
                                                          </shadow>
                                                        </value>
                                                        <value name="HIGH">
                                                          <shadow type="math_number" id=".F,g6Vp9M@m5!*lW[w,t">
                                                            <field name="NUM">1240</field>
                                                          </shadow>
                                                        </value>
                                                      </block>
                                                    </value>
                                                  </block>
                                                </value>
                                                <next>
                                                  <block type="control" id="34Fj3#mI1//FSf%/AZQ[">
                                                    <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                    <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.setOutputLimit</field>
                                                    <field name="WITH_DELAY">FALSE</field>
                                                    <value name="VALUE">
                                                      <block type="math_number" id="da,ap^iQ:!:vioc[Iavx">
                                                        <field name="NUM">0</field>
                                                      </block>
                                                    </value>
                                                    <next>
                                                      <block type="comment" id="s=CQ}cD.(eCDDHEYMwJ=">
                                                        <field name="COMMENT">Switch Mode AC to 1 (Charge the battery, import from house to battery)</field>
                                                        <next>
                                                          <block type="controls_if" id="zWBpv/M^Z*Hl~{|0SIgB">
                                                            <value name="IF0">
                                                              <block type="logic_compare" id="Sp-N#3rJE0=_+ju?F}MQ">
                                                                <field name="OP">NEQ</field>
                                                                <value name="A">
                                                                  <block type="get_value" id="9_3;D0BxXX1C:7q/A-vl">
                                                                    <field name="ATTR">val</field>
                                                                    <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.acMode</field>
                                                                  </block>
                                                                </value>
                                                                <value name="B">
                                                                  <block type="math_number" id="`4-mf4jVB+^zhcwu$L=F">
                                                                    <field name="NUM">1</field>
                                                                  </block>
                                                                </value>
                                                              </block>
                                                            </value>
                                                            <statement name="DO0">
                                                              <block type="control" id="eY$rZNZ)?/teNH{=I/SD">
                                                                <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.acMode</field>
                                                                <field name="WITH_DELAY">FALSE</field>
                                                                <value name="VALUE">
                                                                  <block type="math_number" id="KNdgbs3@6zr`7-z^3[Wa">
                                                                    <field name="NUM">1</field>
                                                                  </block>
                                                                </value>
                                                              </block>
                                                            </statement>
                                                          </block>
                                                        </next>
                                                      </block>
                                                    </next>
                                                  </block>
                                                </next>
                                              </block>
                                            </next>
                                          </block>
                                        </next>
                                      </block>
                                    </next>
                                  </block>
                                </next>
                              </block>
                            </next>
                          </block>
                        </statement>
                      </block>
                    </statement>
                  </block>
                </next>
              </block>
            </next>
          </block>
        </next>
      </block>
    </statement>
  </block>
  <block type="logic_compare" id="o#RD;!-E_QzT*GA5`VsB" x="274" y="202">
    <field name="OP">NEQ</field>
    <value name="A">
      <block type="get_value" id="N!0b2d0tYmPOf)Ns)L3T">
        <field name="ATTR">val</field>
        <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.acMode</field>
      </block>
    </value>
    <value name="B">
      <block type="math_number" id="hSj*yRQ?aB_Oh@aS}n5n">
        <field name="NUM">1</field>
      </block>
    </value>
  </block>
  <block type="math_number" id="GES,ju|GwFK@si2!WNFW" x="616" y="429">
    <field name="NUM">50</field>
  </block>
  <block type="logic_compare" id="ed49_,`_-D#j|oMjn~F*" x="862" y="463">
    <field name="OP">EQ</field>
    <value name="A">
      <block type="logic_compare" id="Y?w)Lq|I4sM~c~Rv)8,E">
        <field name="OP">LT</field>
        <value name="A">
          <block type="get_value" id="Muelu(c~OXl$XM~ej8AL">
            <field name="ATTR">val</field>
            <field name="OID">0_userdata.0.ZendureControl.PowerAvailable</field>
          </block>
        </value>
        <value name="B">
          <block type="math_number" id="peDLLzc7@$@xupw,4?sK">
            <field name="NUM">-40</field>
          </block>
        </value>
      </block>
    </value>
    <value name="B">
      <block type="logic_boolean" id="tw]lrF5_HzIg1y_p]rS*">
        <field name="BOOL">TRUE</field>
      </block>
    </value>
  </block>
  <block type="logic_compare" id="G_4D1.-E}b39`tK,`p@h" x="713" y="763">
    <field name="OP">EQ</field>
    <value name="A">
      <block type="logic_compare" id=")4oG(hBh|woVdp?U$Z/J">
        <field name="OP">GTE</field>
        <value name="A">
          <block type="get_value" id="b#SXNQu8zasH2]DmJ/+O">
            <field name="ATTR">val</field>
            <field name="OID">0_userdata.0.ZendureControl.PowerAvailable</field>
          </block>
        </value>
        <value name="B">
          <block type="math_number" id="xy[}^j;9IX?1xZaDWLP2">
            <field name="NUM">25</field>
          </block>
        </value>
      </block>
    </value>
    <value name="B">
      <block type="logic_boolean" id="^Xvl!s^SoM`S_|8(_eNe">
        <field name="BOOL">TRUE</field>
      </block>
    </value>
  </block>
</xml>

```

---

<div class="post-metadata">

**Author:** ![MrWiwi](https://forum.hacf.fr/user_avatar/forum.hacf.fr/mrwiwi/32/81780_2.png) [@MrWiwi](https://forum.hacf.fr/u/MrWiwi)\
**Post date:** [Octobre 22, 2024, 6:45 UTC](https://forum.hacf.fr/t/zendure-plan-energetique-modification-via-home-assistant/48101/19 "2024-10-22T18:45:43Z")

</div>

MAJ :

```auto
<xml xmlns="https://developers.google.com/blockly/xml">
  <variables>
    <variable id="d~`a^V(o5b@:FZMlk-8X">HomePower</variable>
  </variables>
  <block type="controls_if" id=":P_7R|aB}i|:[Ahzw}hl" disabled="true" x="813" y="-537">
    <mutation elseif="2"></mutation>
    <value name="IF0">
      <block type="logic_multi_or" id="0^%063NM8C|]+|Y^,{{!">
        <mutation xmlns="http://www.w3.org/1999/xhtml" items="2"></mutation>
        <value name="OR0">
          <block type="logic_compare" id=",^TRf$E_k[xsEb.)YTCS">
            <field name="OP">EQ</field>
            <value name="A">
              <block type="get_value" id=",+s(g8G?}{3)=L0j6+*w">
                <field name="ATTR">val</field>
                <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.acMode</field>
              </block>
            </value>
            <value name="B">
              <block type="math_number" id=":57a.G0]hYfFcHh]w$GK">
                <field name="NUM">0</field>
              </block>
            </value>
          </block>
        </value>
        <value name="OR1">
          <block type="logic_compare" id="akiZjd{}e*YX$g?teIDN">
            <field name="OP">EQ</field>
            <value name="A">
              <block type="get_value" id="02^_7SC*sD]rktW6,?9S">
                <field name="ATTR">val</field>
                <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.packState</field>
              </block>
            </value>
            <value name="B">
              <block type="text" id="f;+VH`//l=JE5Wp#~6XW">
                <field name="TEXT">Idle</field>
              </block>
            </value>
          </block>
        </value>
      </block>
    </value>
    <statement name="DO0">
      <block type="comment" id="~mzW+OY%ClEAq3{Q#GTT">
        <field name="COMMENT">AC Idle mode</field>
        <next>
          <block type="update" id="hSi6dW6[m9V5s4Ta2|@8">
            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
            <field name="OID">0_userdata.0.ZendureControl.PowerAvailable</field>
            <field name="WITH_DELAY">FALSE</field>
            <value name="VALUE">
              <block type="math_arithmetic" id="Tz`H|l5.ol,A.6)8x.Ix">
                <field name="OP">MINUS</field>
                <value name="A">
                  <shadow type="math_number" id="(RXch=MTLv_gDE,.aIV/">
                    <field name="NUM">0</field>
                  </shadow>
                </value>
                <value name="B">
                  <shadow type="math_number" id="|n97^C`9Q^U-#7dXwk^l">
                    <field name="NUM">1</field>
                  </shadow>
                  <block type="get_value" id="TGF?-~xB418},:X~4rmk">
                    <field name="ATTR">val</field>
                    <field name="OID">alias.0.shelly.0.SHEM-3#C8C9A316D6FC#1.Emeter1.Power</field>
                  </block>
                </value>
              </block>
            </value>
          </block>
        </next>
      </block>
    </statement>
    <value name="IF1">
      <block type="logic_compare" id="ELe`lCY3d%EA3i:goOvq">
        <field name="OP">EQ</field>
        <value name="A">
          <block type="get_value" id="8FbyiazgnwqKjS:4Q27K">
            <field name="ATTR">val</field>
            <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.acMode</field>
          </block>
        </value>
        <value name="B">
          <block type="math_number" id=")Vy^-]3=m2Xw1/#rjI34">
            <field name="NUM">1</field>
          </block>
        </value>
      </block>
    </value>
    <statement name="DO1">
      <block type="comment" id="%kkT]|EoIrQPH3`gO;B2">
        <field name="COMMENT">AC Input mode (Charge)</field>
        <next>
          <block type="update" id="4w)%$.)Tgm.u5fJN~4Zn">
            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
            <field name="OID">0_userdata.0.ZendureControl.PowerAvailable</field>
            <field name="WITH_DELAY">FALSE</field>
            <value name="VALUE">
              <block type="math_arithmetic" id="q}o0P$0unF:*dXnoHPUz">
                <field name="OP">ADD</field>
                <value name="A">
                  <shadow type="math_number" id="=+EzH#q|HDP)r|mgQ;@e">
                    <field name="NUM">1</field>
                  </shadow>
                  <block type="math_arithmetic" id="(%P=|?I5bKRJ.Z_y6Gl]">
                    <field name="OP">MINUS</field>
                    <value name="A">
                      <shadow type="math_number" id="3fVOX6ooAJ]QCDoXKb$R">
                        <field name="NUM">0</field>
                      </shadow>
                    </value>
                    <value name="B">
                      <shadow type="math_number" id="|n97^C`9Q^U-#7dXwk^l">
                        <field name="NUM">1</field>
                      </shadow>
                      <block type="get_value" id="@J~Xyn*j0ScVu=7.s2~J">
                        <field name="ATTR">val</field>
                        <field name="OID">alias.0.shelly.0.SHEM-3#C8C9A316D6FC#1.Emeter1.Power</field>
                      </block>
                    </value>
                  </block>
                </value>
                <value name="B">
                  <shadow type="math_number" id="LoBc9oA}{xbY)akBMXqT">
                    <field name="NUM">1</field>
                  </shadow>
                  <block type="get_value" id="n?kBf=Hnx-En:reu149|">
                    <field name="ATTR">val</field>
                    <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.setInputLimit</field>
                  </block>
                </value>
              </block>
            </value>
          </block>
        </next>
      </block>
    </statement>
    <value name="IF2">
      <block type="logic_compare" id="2x/F:GRm(^Mc.ZM=~aeE">
        <field name="OP">EQ</field>
        <value name="A">
          <block type="get_value" id="t;+v1xqt;fd0@bXQ=i:U">
            <field name="ATTR">val</field>
            <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.acMode</field>
          </block>
        </value>
        <value name="B">
          <block type="math_number" id="q6X.(T-e%4QV0?y_ClvS">
            <field name="NUM">2</field>
          </block>
        </value>
      </block>
    </value>
    <statement name="DO2">
      <block type="comment" id="Zx6fCj_MGvY)HljlUdXz">
        <field name="COMMENT">AC Output mode (discharge)</field>
        <next>
          <block type="update" id="WT;3%6*a-q^;_^68z9v$">
            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
            <field name="OID">0_userdata.0.ZendureControl.PowerAvailable</field>
            <field name="WITH_DELAY">FALSE</field>
            <value name="VALUE">
              <block type="math_arithmetic" id="2a}r{KOp9BxrXM|K+x/q">
                <field name="OP">ADD</field>
                <value name="A">
                  <shadow type="math_number" id="=+EzH#q|HDP)r|mgQ;@e">
                    <field name="NUM">1</field>
                  </shadow>
                  <block type="math_arithmetic" id="i@4n~/rNK]]:1^7/*`9T">
                    <field name="OP">MINUS</field>
                    <value name="A">
                      <shadow type="math_number" id="]3+F;ke1!oP;}J8v}6Ht">
                        <field name="NUM">0</field>
                      </shadow>
                    </value>
                    <value name="B">
                      <shadow type="math_number" id="|n97^C`9Q^U-#7dXwk^l">
                        <field name="NUM">1</field>
                      </shadow>
                      <block type="get_value" id="w:)dxez2D;mW+S@XfJec">
                        <field name="ATTR">val</field>
                        <field name="OID">alias.0.shelly.0.SHEM-3#C8C9A316D6FC#1.Emeter1.Power</field>
                      </block>
                    </value>
                  </block>
                </value>
                <value name="B">
                  <shadow type="math_number" id="LoBc9oA}{xbY)akBMXqT">
                    <field name="NUM">1</field>
                  </shadow>
                  <block type="get_value" id="Yb(fNd3Ls[HBq/EWsD#p">
                    <field name="ATTR">val</field>
                    <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.gridInputPower</field>
                  </block>
                </value>
              </block>
            </value>
          </block>
        </next>
      </block>
    </statement>
  </block>
  <block type="on_ext" id="n._n/=eOXkf;Z1~fZ?bX" x="-212" y="-387">
    <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation>
    <field name="CONDITION">ne</field>
    <field name="ACK_CONDITION"></field>
    <value name="OID0">
      <shadow type="field_oid" id="BFe.YK%XHc?YYHP6tf4O">
        <field name="oid">alias.0.shelly.0.SHEM-3#C8C9A316D6FC#1.Emeter1.Power</field>
      </shadow>
    </value>
    <statement name="STATEMENT">
      <block type="comment" id="{,Q;lXwNE#b.|HL2[A37">
        <field name="COMMENT">Set HomePower var to your grid power sensor</field>
        <next>
          <block type="variables_set" id="uS;EaIyDhtulBrHnTWwk">
            <field name="VAR" id="d~`a^V(o5b@:FZMlk-8X">HomePower</field>
            <value name="VALUE">
              <block type="get_value" id="n/fuHN0L$Oi3dSf_2ej%">
                <field name="ATTR">val</field>
                <field name="OID">alias.0.shelly.0.SHEM-3#C8C9A316D6FC#1.Emeter1.Power</field>
              </block>
            </value>
            <next>
              <block type="comment" id="-Lkh|F82sn.`Kii9s`[,">
                <field name="COMMENT">Calcul surplus</field>
                <next>
                  <block type="update" id=".$@*H8c,!Y^K9MzHG;8F">
                    <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                    <field name="OID">0_userdata.0.ZendureControl.PowerBudget</field>
                    <field name="WITH_DELAY">FALSE</field>
                    <value name="VALUE">
                      <block type="math_arithmetic" id=":RDkpD4Nm~wv_L9e-lmS">
                        <field name="OP">MINUS</field>
                        <value name="A">
                          <shadow type="math_number" id="|6m-!pKH=)Bn646@gI.=">
                            <field name="NUM">0</field>
                          </shadow>
                        </value>
                        <value name="B">
                          <shadow type="math_number" id="|n97^C`9Q^U-#7dXwk^l">
                            <field name="NUM">1</field>
                          </shadow>
                          <block type="variables_get" id="n9kRcDS6(}7ZtI#}w/,$">
                            <field name="VAR" id="d~`a^V(o5b@:FZMlk-8X">HomePower</field>
                          </block>
                        </value>
                      </block>
                    </value>
                    <next>
                      <block type="comment" id="#M|qr_!P3$T#~|sYh@O_">
                        <field name="COMMENT">Negative Budget is consommation</field>
                        <next>
                          <block type="controls_if" id="jB|cjHX2.!9Bvkr@Sy=H">
                            <mutation else="1"></mutation>
                            <comment pinned="false" h="80" w="160">Charge at night</comment>
                            <value name="IF0">
                              <block type="logic_multi_and" id="Fa@t{dcmVNo,gNQ8Z,1U">
                                <mutation xmlns="http://www.w3.org/1999/xhtml" items="3"></mutation>
                                <value name="AND0">
                                  <block type="logic_compare" id="C=IAvN]t`Gs:U..{JtD|">
                                    <field name="OP">LTE</field>
                                    <value name="A">
                                      <block type="get_value" id=":flu_TDd5HVu[(xn{FB:">
                                        <field name="ATTR">val</field>
                                        <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.electricLevel</field>
                                      </block>
                                    </value>
                                    <value name="B">
                                      <block type="get_value" id="INy%tL@wKNh!t/JRFkLk">
                                        <field name="ATTR">val</field>
                                        <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.minSoc</field>
                                      </block>
                                    </value>
                                  </block>
                                </value>
                                <value name="AND1">
                                  <block type="time_compare" id="EEbh$8bzw_}6:ww$x?0.">
                                    <mutation xmlns="http://www.w3.org/1999/xhtml" end_time="false"></mutation>
                                    <field name="OPTION">&gt;=</field>
                                    <field name="START_TIME">03:30</field>
                                  </block>
                                </value>
                                <value name="AND2">
                                  <block type="time_compare" id="7FpsQon15/nqqXW#hyP)">
                                    <mutation xmlns="http://www.w3.org/1999/xhtml" end_time="false"></mutation>
                                    <field name="OPTION">&lt;=</field>
                                    <field name="START_TIME">05:45</field>
                                  </block>
                                </value>
                              </block>
                            </value>
                            <statement name="DO0">
                              <block type="control" id="L{R*%*V8A?=Ilu6e+/jX">
                                <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.setOutputLimit</field>
                                <field name="WITH_DELAY">FALSE</field>
                                <value name="VALUE">
                                  <block type="math_number" id="zJ.Y7i3T(2[Qp=?i3g)7">
                                    <field name="NUM">0</field>
                                  </block>
                                </value>
                                <next>
                                  <block type="control" id="D;M`iVP/}bjPM.eVe`$*">
                                    <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                    <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.setInputLimit</field>
                                    <field name="WITH_DELAY">FALSE</field>
                                    <value name="VALUE">
                                      <block type="math_number" id="%8(uXlovQ-f#_!Nlw=Ye">
                                        <field name="NUM">1200</field>
                                      </block>
                                    </value>
                                    <next>
                                      <block type="comment" id="zwvH%x{n.+%a/0%0@;gg">
                                        <field name="COMMENT">Switch Mode AC to 1 (Charge the battery, import from house to battery)</field>
                                        <next>
                                          <block type="controls_if" id="YT:~Jm7KXM/26^w8-hZF">
                                            <value name="IF0">
                                              <block type="logic_compare" id="?8Q}ssP|=mooq2fkM#]I">
                                                <field name="OP">NEQ</field>
                                                <value name="A">
                                                  <block type="get_value" id="l^x}F}Ic#KIfDTtIX@+P">
                                                    <field name="ATTR">val</field>
                                                    <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.acMode</field>
                                                  </block>
                                                </value>
                                                <value name="B">
                                                  <block type="math_number" id="DWC(N)Gq`D!XMitwY8]F">
                                                    <field name="NUM">1</field>
                                                  </block>
                                                </value>
                                              </block>
                                            </value>
                                            <statement name="DO0">
                                              <block type="control" id="pYrR3-%rFD;H?eYp.^Y*">
                                                <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.acMode</field>
                                                <field name="WITH_DELAY">FALSE</field>
                                                <value name="VALUE">
                                                  <block type="math_number" id=")`[srlklDasHn#8dRq~L">
                                                    <field name="NUM">1</field>
                                                  </block>
                                                </value>
                                              </block>
                                            </statement>
                                          </block>
                                        </next>
                                      </block>
                                    </next>
                                  </block>
                                </next>
                              </block>
                            </statement>
                            <statement name="ELSE">
                              <block type="controls_if" id="ceVh]OqX#F59jQX=_A82">
                                <mutation elseif="1"></mutation>
                                <value name="IF0">
                                  <block type="logic_multi_and" id="%!0.^@e~9C*^t=2?`~SD">
                                    <mutation xmlns="http://www.w3.org/1999/xhtml" items="2"></mutation>
                                    <value name="AND0">
                                      <block type="logic_compare" id="Y?w)Lq|I4sM~c~Rv)8,E">
                                        <field name="OP">LT</field>
                                        <value name="A">
                                          <block type="get_value" id="Muelu(c~OXl$XM~ej8AL">
                                            <field name="ATTR">val</field>
                                            <field name="OID">0_userdata.0.ZendureControl.PowerBudget</field>
                                          </block>
                                        </value>
                                        <value name="B">
                                          <block type="math_number" id="peDLLzc7@$@xupw,4?sK">
                                            <field name="NUM">-20</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                    <value name="AND1">
                                      <block type="logic_compare" id="{^l6PG=~A^Pk1?RN!Pj=">
                                        <field name="OP">EQ</field>
                                        <value name="A">
                                          <block type="logic_compare" id="hi]@P[WR.1XDYrEa2L1H">
                                            <field name="OP">GT</field>
                                            <value name="A">
                                              <block type="get_value" id="5OG^!C?7Qm2u!~0d7@9h">
                                                <field name="ATTR">val</field>
                                                <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.electricLevel</field>
                                              </block>
                                            </value>
                                            <value name="B">
                                              <block type="get_value" id="xni+zl}^6pJx;QRt;tJ$">
                                                <field name="ATTR">val</field>
                                                <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.minSoc</field>
                                              </block>
                                            </value>
                                          </block>
                                        </value>
                                        <value name="B">
                                          <block type="logic_boolean" id="/w|?*R!VzYZ_vK;ws0t^">
                                            <field name="BOOL">TRUE</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                  </block>
                                </value>
                                <statement name="DO0">
                                  <block type="comment" id="K5DDxom?`tOS%L_%zZ:(">
                                    <field name="COMMENT">The house is importing power from the grid</field>
                                    <next>
                                      <block type="comment" id="BTTPMWm/de,d7~Ti|/I:">
                                        <field name="COMMENT">Calculation of the power surplus</field>
                                        <next>
                                          <block type="update" id="fce@-pMl:1kZ%lAb1IM5">
                                            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                            <field name="OID">0_userdata.0.ZendureControl.PowerBudget</field>
                                            <field name="WITH_DELAY">FALSE</field>
                                            <value name="VALUE">
                                              <block type="math_arithmetic" id=";D#iA~8Yj630O($CMi?N">
                                                <field name="OP">MINUS</field>
                                                <value name="A">
                                                  <shadow type="math_number" id=";f|).sI:pOi1s(r$G`8b">
                                                    <field name="NUM">0</field>
                                                  </shadow>
                                                </value>
                                                <value name="B">
                                                  <shadow type="math_number" id="|n97^C`9Q^U-#7dXwk^l">
                                                    <field name="NUM">1</field>
                                                  </shadow>
                                                  <block type="variables_get" id="9VNFho]IXc(ch{UwZal{">
                                                    <field name="VAR" id="d~`a^V(o5b@:FZMlk-8X">HomePower</field>
                                                  </block>
                                                </value>
                                              </block>
                                            </value>
                                            <next>
                                              <block type="control" id="=o2{GPV4w=:]aci4|vY?">
                                                <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.setOutputLimit</field>
                                                <field name="WITH_DELAY">FALSE</field>
                                                <value name="VALUE">
                                                  <block type="convert_tonumber" id="Rj3Uaj4{~c;!x!eGEeXD">
                                                    <value name="VALUE">
                                                      <block type="math_constrain" id="7~D[JsL|_N~VeFwt`pE`">
                                                        <value name="VALUE">
                                                          <shadow type="math_number" id="(9UIPj)LKTV=|#F^uD,q">
                                                            <field name="NUM">50</field>
                                                          </shadow>
                                                          <block type="math_arithmetic" id="TvZBnp(B!y!/Hr[yexE9">
                                                            <field name="OP">ADD</field>
                                                            <value name="A">
                                                              <shadow type="math_number" id="l(:X{x7E+4zu10Q|5@!j">
                                                                <field name="NUM">1</field>
                                                              </shadow>
                                                              <block type="math_round" id="_)86b/RxGH%v7o10%~/M">
                                                                <field name="OP">ROUNDUP</field>
                                                                <value name="NUM">
                                                                  <shadow type="math_number" id="gyY9z7s?_CrnAoD0q10E">
                                                                    <field name="NUM">3.1</field>
                                                                  </shadow>
                                                                  <block type="variables_get" id="+HCVJjC7:+J!7medG(L^">
                                                                    <field name="VAR" id="d~`a^V(o5b@:FZMlk-8X">HomePower</field>
                                                                  </block>
                                                                </value>
                                                              </block>
                                                            </value>
                                                            <value name="B">
                                                              <shadow type="math_number" id="ejRA-VP8RdO[Iz7W6[$B">
                                                                <field name="NUM">1</field>
                                                              </shadow>
                                                              <block type="get_value" id="!9ne=tscadHC,quP|dlU">
                                                                <field name="ATTR">val</field>
                                                                <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.packInputPower</field>
                                                              </block>
                                                            </value>
                                                          </block>
                                                        </value>
                                                        <value name="LOW">
                                                          <shadow type="math_number" id="k$b@7b)3I?3u8R,%^no(">
                                                            <field name="NUM">0</field>
                                                          </shadow>
                                                        </value>
                                                        <value name="HIGH">
                                                          <shadow type="math_number" id="x8}*eX!Nsg$Dq)p(Q9S_">
                                                            <field name="NUM">1200</field>
                                                          </shadow>
                                                        </value>
                                                      </block>
                                                    </value>
                                                  </block>
                                                </value>
                                                <next>
                                                  <block type="control" id="O*;k.`?nQqdF;AGd[Yjl">
                                                    <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                    <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.setInputLimit</field>
                                                    <field name="WITH_DELAY">FALSE</field>
                                                    <value name="VALUE">
                                                      <block type="math_number" id="0$zTn8u`[.f`wpK+*xUS">
                                                        <field name="NUM">0</field>
                                                      </block>
                                                    </value>
                                                    <next>
                                                      <block type="comment" id="-~_5VyBb;ylrRC)CVgRk">
                                                        <field name="COMMENT">Switch Mode AC to 2 (Discharge the battery to house)</field>
                                                        <next>
                                                          <block type="controls_if" id="Qz5c%hJbta[0TsYo42G)">
                                                            <value name="IF0">
                                                              <block type="logic_compare" id="Iyp`,~@V86|af4mY^[k6">
                                                                <field name="OP">NEQ</field>
                                                                <value name="A">
                                                                  <block type="get_value" id="Le+Q8Dtj[2q|fSs;jaVB">
                                                                    <field name="ATTR">val</field>
                                                                    <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.acMode</field>
                                                                  </block>
                                                                </value>
                                                                <value name="B">
                                                                  <block type="math_number" id="c4c`K=AB02Qy7;CIS;C2">
                                                                    <field name="NUM">2</field>
                                                                  </block>
                                                                </value>
                                                              </block>
                                                            </value>
                                                            <statement name="DO0">
                                                              <block type="control" id="[xw_(|,6{QxRl3l}OU|e">
                                                                <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.acMode</field>
                                                                <field name="WITH_DELAY">FALSE</field>
                                                                <value name="VALUE">
                                                                  <block type="math_number" id="For~)Qm/@`puW%Y=Lwfo">
                                                                    <field name="NUM">2</field>
                                                                  </block>
                                                                </value>
                                                              </block>
                                                            </statement>
                                                          </block>
                                                        </next>
                                                      </block>
                                                    </next>
                                                  </block>
                                                </next>
                                              </block>
                                            </next>
                                          </block>
                                        </next>
                                      </block>
                                    </next>
                                  </block>
                                </statement>
                                <value name="IF1">
                                  <block type="logic_compare" id="G_4D1.-E}b39`tK,`p@h">
                                    <field name="OP">EQ</field>
                                    <value name="A">
                                      <block type="logic_compare" id=")4oG(hBh|woVdp?U$Z/J">
                                        <field name="OP">GT</field>
                                        <value name="A">
                                          <block type="get_value" id="b#SXNQu8zasH2]DmJ/+O">
                                            <field name="ATTR">val</field>
                                            <field name="OID">0_userdata.0.ZendureControl.PowerBudget</field>
                                          </block>
                                        </value>
                                        <value name="B">
                                          <block type="math_number" id="xy[}^j;9IX?1xZaDWLP2">
                                            <field name="NUM">25</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                    <value name="B">
                                      <block type="logic_boolean" id="^Xvl!s^SoM`S_|8(_eNe">
                                        <field name="BOOL">TRUE</field>
                                      </block>
                                    </value>
                                  </block>
                                </value>
                                <statement name="DO1">
                                  <block type="comment" id="G9P2tg|9szmpM|qUeCL{">
                                    <field name="COMMENT">The house is producting too much</field>
                                    <next>
                                      <block type="comment" id="/@qBjbc!3z8~W#5,%$[_">
                                        <field name="COMMENT">Calculation of the power surplus</field>
                                        <next>
                                          <block type="update" id="F|]m4r4](W#[I.ng@TV.">
                                            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                            <field name="OID">0_userdata.0.ZendureControl.PowerBudget</field>
                                            <field name="WITH_DELAY">FALSE</field>
                                            <value name="VALUE">
                                              <block type="math_arithmetic" id="r[=XTMA%cnbIn^Pee0fl">
                                                <field name="OP">ADD</field>
                                                <value name="A">
                                                  <shadow type="math_number" id="=+EzH#q|HDP)r|mgQ;@e">
                                                    <field name="NUM">1</field>
                                                  </shadow>
                                                  <block type="math_arithmetic" id="}zN=Zw6/H0n=h[qE7/4A">
                                                    <field name="OP">MINUS</field>
                                                    <value name="A">
                                                      <shadow type="math_number" id="$SPNl@SIOfLS#XuJim?X">
                                                        <field name="NUM">0</field>
                                                      </shadow>
                                                    </value>
                                                    <value name="B">
                                                      <shadow type="math_number" id="|n97^C`9Q^U-#7dXwk^l">
                                                        <field name="NUM">1</field>
                                                      </shadow>
                                                      <block type="variables_get" id="yW/OPB2|0n0|P^,$ChgD">
                                                        <field name="VAR" id="d~`a^V(o5b@:FZMlk-8X">HomePower</field>
                                                      </block>
                                                    </value>
                                                  </block>
                                                </value>
                                                <value name="B">
                                                  <shadow type="math_number" id="LoBc9oA}{xbY)akBMXqT">
                                                    <field name="NUM">1</field>
                                                  </shadow>
                                                  <block type="get_value" id="VI*:6et}%oHfeYDXTXC3">
                                                    <field name="ATTR">val</field>
                                                    <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.gridInputPower</field>
                                                  </block>
                                                </value>
                                              </block>
                                            </value>
                                            <next>
                                              <block type="comment" id="?C:dB}qv6J|If!(XDnSL">
                                                <field name="COMMENT">Change input limit to the Power we can consume - 40w to have some buffer</field>
                                                <next>
                                                  <block type="control" id="lG=w=%Mt=EE)AWSwDDfI">
                                                    <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                    <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.setInputLimit</field>
                                                    <field name="WITH_DELAY">FALSE</field>
                                                    <value name="VALUE">
                                                      <block type="convert_tonumber" id="/edP|/%tG$6rB?UV9~#(">
                                                        <value name="VALUE">
                                                          <block type="math_constrain" id="N@(}(9=%fUuo:LKcxxP+">
                                                            <value name="VALUE">
                                                              <shadow type="math_number" id="(9UIPj)LKTV=|#F^uD,q">
                                                                <field name="NUM">50</field>
                                                              </shadow>
                                                              <block type="math_arithmetic" id="6HZ~l.GRi9WQ.:9C}MuF">
                                                                <field name="OP">MINUS</field>
                                                                <value name="A">
                                                                  <shadow type="math_number" id="l(:X{x7E+4zu10Q|5@!j">
                                                                    <field name="NUM">1</field>
                                                                  </shadow>
                                                                  <block type="math_round" id="iTwn_EU)!aIEeVKGFg?C">
                                                                    <field name="OP">ROUNDDOWN</field>
                                                                    <value name="NUM">
                                                                      <shadow type="math_number" id="gyY9z7s?_CrnAoD0q10E">
                                                                        <field name="NUM">3.1</field>
                                                                      </shadow>
                                                                      <block type="get_value" id=",M}iF=|4Scd+SYiq)aWg">
                                                                        <field name="ATTR">val</field>
                                                                        <field name="OID">0_userdata.0.ZendureControl.PowerBudget</field>
                                                                      </block>
                                                                    </value>
                                                                  </block>
                                                                </value>
                                                                <value name="B">
                                                                  <shadow type="math_number" id="ejRA-VP8RdO[Iz7W6[$B">
                                                                    <field name="NUM">40</field>
                                                                  </shadow>
                                                                </value>
                                                              </block>
                                                            </value>
                                                            <value name="LOW">
                                                              <shadow type="math_number" id=";i#uI}{rB+`e3tFfmxD9">
                                                                <field name="NUM">0</field>
                                                              </shadow>
                                                            </value>
                                                            <value name="HIGH">
                                                              <shadow type="math_number" id=".F,g6Vp9M@m5!*lW[w,t">
                                                                <field name="NUM">1240</field>
                                                              </shadow>
                                                            </value>
                                                          </block>
                                                        </value>
                                                      </block>
                                                    </value>
                                                    <next>
                                                      <block type="control" id="34Fj3#mI1//FSf%/AZQ[">
                                                        <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                        <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.setOutputLimit</field>
                                                        <field name="WITH_DELAY">FALSE</field>
                                                        <value name="VALUE">
                                                          <block type="math_number" id="da,ap^iQ:!:vioc[Iavx">
                                                            <field name="NUM">0</field>
                                                          </block>
                                                        </value>
                                                        <next>
                                                          <block type="comment" id="s=CQ}cD.(eCDDHEYMwJ=">
                                                            <field name="COMMENT">Switch Mode AC to 1 (Charge the battery, import from house to battery)</field>
                                                            <next>
                                                              <block type="controls_if" id="zWBpv/M^Z*Hl~{|0SIgB">
                                                                <value name="IF0">
                                                                  <block type="logic_compare" id="Sp-N#3rJE0=_+ju?F}MQ">
                                                                    <field name="OP">NEQ</field>
                                                                    <value name="A">
                                                                      <block type="get_value" id="9_3;D0BxXX1C:7q/A-vl">
                                                                        <field name="ATTR">val</field>
                                                                        <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.acMode</field>
                                                                      </block>
                                                                    </value>
                                                                    <value name="B">
                                                                      <block type="math_number" id="`4-mf4jVB+^zhcwu$L=F">
                                                                        <field name="NUM">1</field>
                                                                      </block>
                                                                    </value>
                                                                  </block>
                                                                </value>
                                                                <statement name="DO0">
                                                                  <block type="control" id="eY$rZNZ)?/teNH{=I/SD">
                                                                    <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                    <field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.acMode</field>
                                                                    <field name="WITH_DELAY">FALSE</field>
                                                                    <value name="VALUE">
                                                                      <block type="math_number" id="KNdgbs3@6zr`7-z^3[Wa">
                                                                        <field name="NUM">1</field>
                                                                      </block>
                                                                    </value>
                                                                  </block>
                                                                </statement>
                                                              </block>
                                                            </next>
                                                          </block>
                                                        </next>
                                                      </block>
                                                    </next>
                                                  </block>
                                                </next>
                                              </block>
                                            </next>
                                          </block>
                                        </next>
                                      </block>
                                    </next>
                                  </block>
                                </statement>
                              </block>
                            </statement>
                          </block>
                        </next>
                      </block>
                    </next>
                  </block>
                </next>
              </block>
            </next>
          </block>
        </next>
      </block>
    </statement>
  </block>
</xml>

```

---

<div class="post-metadata">

**Author:** ![Titi007](https://forum.hacf.fr/letter_avatar_proxy/v4/letter/t/8c91f0/32.png) [@Titi007](https://forum.hacf.fr/u/Titi007)\
**Post date:** [Octobre 28, 2024, 5:14 UTC](https://forum.hacf.fr/t/zendure-plan-energetique-modification-via-home-assistant/48101/20 "2024-10-28T17:14:27Z")

</div>

> [@MrWiwi](#):
>
> PowerAvailable

merci pour tes scripts mais j’ai l’impression qu’il faut changer les topics (tu as laissé les tiens) !  
et pas encore compris ce langage 😅

---

<div class="post-metadata">

**Author:** ![Julien\_Galliot](https://forum.hacf.fr/user_avatar/forum.hacf.fr/julien_galliot/32/34676_2.png) [@Julien\_Galliot](https://forum.hacf.fr/u/Julien_Galliot)\
**Post date:** [Octobre 31, 2024, 12:25 UTC](https://forum.hacf.fr/t/zendure-plan-energetique-modification-via-home-assistant/48101/21 "2024-10-31T12:25:41Z")

</div>

Bonjour, très intéressé par ce sujet. Je viens de connecter mon hyper 2000 à HA via la méthode IoBroker, ça marche nickel (merci pour les informations). Mais j’aimerais également pourvoir contrôler la charge/décharge de l’hyper dans HA, je pense que c’est possible via la commande mqtt «&nbsp;acMode&nbsp;» et en jouant sur les limites d’entrée/sortie AC. Mais est-ce qu’il est possible d’écrire dans la commande «&nbsp;acmode&nbsp;» directement depuis HA? Je vois que certains y arrivent via des scripts (mais en dehors de HA) mais bien trop compliqué pour moi et je souhaite tout gérer depuis HA. J’ai un routeur ARSUN que je gère également dans HA et je veux pouvoir gérer la coactivité routeur/batterie. Quelqu’un a-t-il la solution pour écrire dans ce control mqtt «&nbsp;acMode&nbsp;» (1=charge ; 2=décharge) ?

[Page suivante](https://forum.hacf.fr/t/zendure-plan-energetique-modification-via-home-assistant/48101.md?page=2)
