EnedisGateway2MQTT

Hello,

Pour information, certain le savent déjà mais je suis en train de bosser sur une passerelle « enedisgateway2mqtt » qui devrait permettre de pallier à bcp de problème que rencontre l’intégration myEnedis de @saniho suite à divers limitation de Home Assistant.

ATTENTION, la stack est encore en cours de dev et en BETA, il est possible que vous rencontriez encore quelques bug, merci de me les signaler afin que je les fix au fur et à mesure

J’embarque dans la stack une base de donnée de type SQLite, qui me permet de stocker la totalité des données afin de réduire drastiquement le nombre de demande au API Enedis.
Et également évité de ce retrouvé avec des messages d’erreur à chaque reboot de HA :confused:

enedisgateway2mqtt est un service docker qui va parser automatiquement les API d’Enedis (via ma passerelle https://enedisgateway.tech/) pour récupéré toutes votre consommations sur :

  • 3 ans d’historique en mode Daily
  • 2 ans d’historique en mode Detail

Et publier toutes les informations dans votre broker MQTT.

Ce que vous trouverez dans MQTT :

  • Une floppée de topic (environ 600) avec toutes les informations que je récupère des API
  • Si l’auto-discovery est activé, il vous publiera également une 20 de sensors avec divers infos qui seront automatiquement accessible sur HA
  • Et cerise sur le gateau, j’ai crée un sensor au format de l’excellente card myEnedis de @saniho

Exemple :

image

Bref, vous trouverez toutes les informations nécessaires ICI :slight_smile:

L’addons HassOS est disponible ICI
(Merci à @foXaCe qui as fait la demande sur le forum officiel)

8 « J'aime »

Hello, merci, je vais essayer cela.
C’est possible de l’ajouter sous docker de mon nas syno (sous DSM 7), et publier cela sur mon broker MQTT intégré au HA de mon RPI4?
Et si oui, comment je configure l’addon ( token, pdl,…) sous le docker de mon syno?
Désolé je ne maîtrise pas hyper bien docker, mqtt,… tout tourne sur mon RPI4.

EDIT: bon, eh bien la messe est dite, impossible de l’installer sous docker de mon syno :pensive:

Pas de contre indication à le faire tourner sous ton Syno.

Pour publier dans ton broker MQTT intégrée sur HA, il faut juste voir si ton MQTT est ouvert à l’extérieur de HA (je connais pas HassOS).
Si oui, idem tu peut publier directement dans ton broker sous HA.

impossible de demarrer l’addon sous mon docker Syno. Je peux l’installer, mais il ne veut pas se lancer

Et niveau log tu as quoi ?
Si le conteneur ne boot pas, c’est que tu as probablement une erreur critique qui l’empêche de boot.

DSM 7 tourne comme une horloge ainsi que mes autres instances docker. Ton docker ne veut pas démarrer, je regarde les logs pour voir.

Je ne dit pas le contraire et ne remet pas en question ton DSM 7 :smiley:
Si le conteneur stop il y a forcement une raison, et elle est probablement dans les logs du conteneur.

Les logs:

m4dm4rtig4n-enedisgateway2mqtt1
date	stream	content
2021-10-19 13:25:44	stdout	AttributeError: partially initialized module 'function' has no attribute 'log' (most likely due to a circular import)
2021-10-19 13:25:44	stdout	    f.log("Environement variable 'ACCESS_TOKEN' is mandatory")
2021-10-19 13:25:44	stdout	  File "/app/main.py", line 29, in <module>
2021-10-19 13:25:44	stdout	    import main
2021-10-19 13:25:44	stdout	  File "/app/function.py", line 6, in <module>
2021-10-19 13:25:44	stdout	  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
2021-10-19 13:25:44	stdout	  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
2021-10-19 13:25:44	stdout	  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
2021-10-19 13:25:44	stdout	  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
2021-10-19 13:25:44	stdout	  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
2021-10-19 13:25:44	stdout	  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
2021-10-19 13:25:44	stdout	    return _bootstrap._gcd_import(name[level:], package, level)
2021-10-19 13:25:44	stdout	  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
2021-10-19 13:25:44	stdout	    f = import_module("function")
2021-10-19 13:25:44	stdout	  File "/app/main.py", line 12, in <module>
2021-10-19 13:25:44	stdout	Traceback (most recent call last):
2021-10-19 13:22:29	stdout	AttributeError: partially initialized module 'function' has no attribute 'log' (most likely due to a circular import)
2021-10-19 13:22:29	stdout	    f.log("Environement variable 'ACCESS_TOKEN' is mandatory")
2021-10-19 13:22:29	stdout	  File "/app/main.py", line 29, in <module>
2021-10-19 13:22:29	stdout	    import main
2021-10-19 13:22:29	stdout	  File "/app/function.py", line 6, in <module>
2021-10-19 13:22:29	stdout	  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
2021-10-19 13:22:29	stdout	  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
2021-10-19 13:22:29	stdout	  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
2021-10-19 13:22:29	stdout	  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
2021-10-19 13:22:29	stdout	  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
2021-10-19 13:22:29	stdout	  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
2021-10-19 13:22:29	stdout	    return _bootstrap._gcd_import(name[level:], package, level)
2021-10-19 13:22:29	stdout	  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
2021-10-19 13:22:29	stdout	    f = import_module("function")
2021-10-19 13:22:29	stdout	  File "/app/main.py", line 12, in <module>
2021-10-19 13:22:29	stdout	Traceback (most recent call last):
2021-10-19 13:22:26	stdout	AttributeError: partially initialized module 'function' has no attribute 'log' (most likely due to a circular import)
2021-10-19 13:22:26	stdout	    f.log("Environement variable 'ACCESS_TOKEN' is mandatory")
2021-10-19 13:22:26	stdout	  File "/app/main.py", line 29, in <module>
2021-10-19 13:22:26	stdout	    import main
2021-10-19 13:22:26	stdout	  File "/app/function.py", line 6, in <module>
2021-10-19 13:22:26	stdout	  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
2021-10-19 13:22:26	stdout	  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
2021-10-19 13:22:26	stdout	  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
2021-10-19 13:22:26	stdout	  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
2021-10-19 13:22:26	stdout	  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
2021-10-19 13:22:26	stdout	  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
2021-10-19 13:22:26	stdout	    return _bootstrap._gcd_import(name[level:], package, level)
2021-10-19 13:22:26	stdout	  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
2021-10-19 13:22:26	stdout	    f = import_module("function")
2021-10-19 13:22:26	stdout	  File "/app/main.py", line 12, in <module>
2021-10-19 13:22:26	stdout	Traceback (most recent call last):
2021-10-19 13:22:23	stdout	AttributeError: partially initialized module 'function' has no attribute 'log' (most likely due to a circular import)
2021-10-19 13:22:23	stdout	    f.log("Environement variable 'ACCESS_TOKEN' is mandatory")
2021-10-19 13:22:23	stdout	  File "/app/main.py", line 29, in <module>
2021-10-19 13:22:23	stdout	    import main
2021-10-19 13:22:23	stdout	  File "/app/function.py", line 6, in <module>
2021-10-19 13:22:23	stdout	  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
2021-10-19 13:22:23	stdout	  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
2021-10-19 13:22:23	stdout	  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
2021-10-19 13:22:23	stdout	  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
2021-10-19 13:22:23	stdout	  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
2021-10-19 13:22:23	stdout	  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
2021-10-19 13:22:23	stdout	    return _bootstrap._gcd_import(name[level:], package, level)
2021-10-19 13:22:23	stdout	  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
2021-10-19 13:22:23	stdout	    f = import_module("function")
2021-10-19 13:22:23	stdout	  File "/app/main.py", line 12, in <module>
2021-10-19 13:22:23	stdout	Traceback (most recent call last):
2021-10-19 13:22:20	stdout	AttributeError: partially initialized module 'function' has no attribute 'log' (most likely due to a circular import)
2021-10-19 13:22:20	stdout	    f.log("Environement variable 'ACCESS_TOKEN' is mandatory")
2021-10-19 13:22:20	stdout	  File "/app/main.py", line 29, in <module>
2021-10-19 13:22:20	stdout	    import main
2021-10-19 13:22:20	stdout	  File "/app/function.py", line 6, in <module>
2021-10-19 13:22:20	stdout	  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
2021-10-19 13:22:20	stdout	  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
2021-10-19 13:22:20	stdout	  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
2021-10-19 13:22:20	stdout	  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
2021-10-19 13:22:20	stdout	  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
2021-10-19 13:22:20	stdout	  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
2021-10-19 13:22:20	stdout	    return _bootstrap._gcd_import(name[level:], package, level)
2021-10-19 13:22:20	stdout	  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
2021-10-19 13:22:20	stdout	    f = import_module("function")
2021-10-19 13:22:20	stdout	  File "/app/main.py", line 12, in <module>
2021-10-19 13:22:20	stdout	Traceback (most recent call last):
2021-10-19 06:49:01	stdout	AttributeError: partially initialized module 'function' has no attribute 'log' (most likely due to a circular import)
2021-10-19 06:49:01	stdout	    f.log("Environement variable 'ACCESS_TOKEN' is mandatory")
2021-10-19 06:49:01	stdout	  File "/app/main.py", line 29, in <module>
2021-10-19 06:49:01	stdout	    import main
2021-10-19 06:49:01	stdout	  File "/app/function.py", line 6, in <module>
2021-10-19 06:49:01	stdout	  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
2021-10-19 06:49:01	stdout	  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
2021-10-19 06:49:01	stdout	  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
2021-10-19 06:49:01	stdout	  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
2021-10-19 06:49:01	stdout	  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
2021-10-19 06:49:01	stdout	  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
2021-10-19 06:49:01	stdout	    return _bootstrap._gcd_import(name[level:], package, level)
2021-10-19 06:49:01	stdout	  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
2021-10-19 06:49:01	stdout	    f = import_module("function")
2021-10-19 06:49:01	stdout	  File "/app/main.py", line 12, in <module>
2021-10-19 06:49:01	stdout	Traceback (most recent call last):
2021-10-19 06:48:58	stdout	AttributeError: partially initialized module 'function' has no attribute 'log' (most likely due to a circular import)
2021-10-19 06:48:58	stdout	    f.log("Environement variable 'ACCESS_TOKEN' is mandatory")
2021-10-19 06:48:58	stdout	  File "/app/main.py", line 29, in <module>
2021-10-19 06:48:58	stdout	    import main
2021-10-19 06:48:58	stdout	  File "/app/function.py", line 6, in <module>
2021-10-19 06:48:58	stdout	  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
2021-10-19 06:48:58	stdout	  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
2021-10-19 06:48:58	stdout	  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
2021-10-19 06:48:58	stdout	  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
2021-10-19 06:48:58	stdout	  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
2021-10-19 06:48:58	stdout	  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
2021-10-19 06:48:58	stdout	    return _bootstrap._gcd_import(name[level:], package, level)
2021-10-19 06:48:58	stdout	  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
2021-10-19 06:48:58	stdout	    f = import_module("function")
2021-10-19 06:48:58	stdout	  File "/app/main.py", line 12, in <module>
2021-10-19 06:48:58	stdout	Traceback (most recent call last):
2021-10-19 06:48:55	stdout	AttributeError: partially initialized module 'function' has no attribute 'log' (most likely due to a circular import)
2021-10-19 06:48:55	stdout	    f.log("Environement variable 'ACCESS_TOKEN' is mandatory")
2021-10-19 06:48:55	stdout	  File "/app/main.py", line 29, in <module>
2021-10-19 06:48:55	stdout	    import main
2021-10-19 06:48:55	stdout	  File "/app/function.py", line 6, in <module>
2021-10-19 06:48:55	stdout	  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
2021-10-19 06:48:55	stdout	  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
2021-10-19 06:48:55	stdout	  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
2021-10-19 06:48:55	stdout	  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
2021-10-19 06:48:55	stdout	  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
2021-10-19 06:48:55	stdout	  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
2021-10-19 06:48:55	stdout	    return _bootstrap._gcd_import(name[level:], package, level)
2021-10-19 06:48:55	stdout	  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
2021-10-19 06:48:55	stdout	    f = import_module("function")
2021-10-19 06:48:55	stdout	  File "/app/main.py", line 12, in <module>
2021-10-19 06:48:55	stdout	Traceback (most recent call last):
2021-10-19 06:48:52	stdout	AttributeError: partially initialized module 'function' has no attribute 'log' (most likely due to a circular import)
2021-10-19 06:48:52	stdout	    f.log("Environement variable 'ACCESS_TOKEN' is mandatory")
2021-10-19 06:48:52	stdout	  File "/app/main.py", line 29, in <module>
2021-10-19 06:48:52	stdout	    import main
2021-10-19 06:48:52	stdout	  File "/app/function.py", line 6, in <module>
2021-10-19 06:48:52	stdout	  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
2021-10-19 06:48:52	stdout	  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
2021-10-19 06:48:52	stdout	  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
2021-10-19 06:48:52	stdout	  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
2021-10-19 06:48:52	stdout	  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
2021-10-19 06:48:52	stdout	  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
2021-10-19 06:48:52	stdout	    return _bootstrap._gcd_import(name[level:], package, level)
2021-10-19 06:48:52	stdout	  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
2021-10-19 06:48:52	stdout	    f = import_module("function")
2021-10-19 06:48:52	stdout	  File "/app/main.py", line 12, in <module>
2021-10-19 06:48:52	stdout	Traceback (most recent call last):
2021-10-19 06:48:48	stdout	AttributeError: partially initialized module 'function' has no attribute 'log' (most likely due to a circular import)
2021-10-19 06:48:48	stdout	    f.log("Environement variable 'ACCESS_TOKEN' is mandatory")
2021-10-19 06:48:48	stdout	  File "/app/main.py", line 29, in <module>
2021-10-19 06:48:48	stdout	    import main
2021-10-19 06:48:48	stdout	  File "/app/function.py", line 6, in <module>
2021-10-19 06:48:48	stdout	  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
2021-10-19 06:48:48	stdout	  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
2021-10-19 06:48:48	stdout	  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
2021-10-19 06:48:48	stdout	  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
2021-10-19 06:48:48	stdout	  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
2021-10-19 06:48:48	stdout	  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
2021-10-19 06:48:48	stdout	    return _bootstrap._gcd_import(name[level:], package, level)
2021-10-19 06:48:48	stdout	  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
2021-10-19 06:48:48	stdout	    f = import_module("function")
2021-10-19 06:48:48	stdout	  File "/app/main.py", line 12, in <module>
2021-10-19 06:48:48	stdout	Traceback (most recent call last):
2021-10-19 06:48:45	stdout	AttributeError: partially initialized module 'function' has no attribute 'log' (most likely due to a circular import)
2021-10-19 06:48:45	stdout	    f.log("Environement variable 'ACCESS_TOKEN' is mandatory")
2021-10-19 06:48:45	stdout	  File "/app/main.py", line 29, in <module>
2021-10-19 06:48:45	stdout	    import main
2021-10-19 06:48:45	stdout	  File "/app/function.py", line 6, in <module>
2021-10-19 06:48:45	stdout	  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
2021-10-19 06:48:45	stdout	  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
2021-10-19 06:48:45	stdout	  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
2021-10-19 06:48:45	stdout	  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
2021-10-19 06:48:45	stdout	  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
2021-10-19 06:48:45	stdout	  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
2021-10-19 06:48:45	stdout	    return _bootstrap._gcd_import(name[level:], package, level)
2021-10-19 06:48:45	stdout	  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
2021-10-19 06:48:45	stdout	    f = import_module("function")
2021-10-19 06:48:45	stdout	  File "/app/main.py", line 12, in <module>
2021-10-19 06:48:45	stdout	Traceback (most recent call last):

Tu peut m’envoyer tes variables d’env stp ?
(Sans les token + pdl bien sur)

J’ai un bug que je vais fix qui fait que l’erreur n’est pas très clair, mais pour moi c’est à cause du fait que tu n’a rien set en variable d’environnement.
=> GitHub - m4dm4rtig4n/enedisgateway2mqtt

Oui, je n’ai pas rentré de variable.
Ou faut il le faire avant, pendant , après l’installation de l’addon sur Docker? entre nous, la procédure d’install n’est pas super clair :wink:

Je ne l’ai pas spécifier dans la doc dans le sens où c’est du fonctionnement pur docker.
Mais j’essayerais d’etre plus precis :wink:

ah oui, effectivement, cela n’allait pas marcher.

Bonjour je suis intéressé pour tester mais je n’arrive pas à ajouter l’add-on dans HA, y-a-t-il une manip particulière? Merci bien.

Tu ne le trouvera pas dans les Addon, pour l’instant ça s’installe en standalone sur Docker.

J’essaie d’utiliser l’outil aussi, il semble se connecter à la gateway ainsi que au broker mais je n’arrive pas à retrouver d’infos dans HA

Tu as un tuto pour l’installer de cette manière sur un RPI, stp?

Est-ce que tu as bien renseigner toutes les variables d’environnement ?
Check les log du conteneur.

Si tu as docker sur ton RPI, il suffit de lancer le docker-compose dispo dans le ReadMe.
Pour renseigner les informations, j’ai un peu tt détailler également sur le ReadMe :

version: "3.9"
services:
  enedisgateway2mqtt:
    image: m4dm4rtig4n/enedisgateway2mqtt:latest
    restart: unless-stopped
    volumes:
        - mydata:/data
    environment:
      ACCESS_TOKEN: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
      PDL: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
      MQTT_HOST: ""
      MQTT_PORT: "1883"
      MQTT_PREFIX: "enedis_gateway"
      MQTT_CLIENT_ID: "enedis_gateway"
      MQTT_USERNAME: 'enedis_gateway_username'
      MQTT_PASSWORD: 'enedis_gateway_password'
      RETAIN: "True"
      QOS: 0
      GET_CONSUMPTION: "True"
      GET_PRODUCTION: "False"
      HA_AUTODISCOVERY: "False"
      HA_AUTODISCOVERY_PREFIX: 'homeassistant'
      CYCLE: 86400
      OFFPEAK_HOURS: ""
      CONSUMPTION_PRICE_BASE: 0
      CONSUMPTION_PRICE_HC: 0
      CONSUMPTION_PRICE_HP: 0 
      REFRESH_CONTRACT: "False" 
      REFRESH_ADDRESSES: "False"  
      WIPE_CACHE: "False"   
      DEBUG: "False"   
      CARD_MYENEDIS: "False"   
      CURRENT_PLAN: "BASE"   
    logging:
      options:
        max-size: "10m"
        max-file: "3"
volumes:
  mydata:   

Bonjour,

Je veux bien un coup de main également, j’ai bien paramétré l’ensemble des ENV mais il ne veut pas fonctionner.

En mode debug :

- INFO : Get contract :
 - INFO : => Query Cache
 - DEBUG : MQTT Send : enedis_gateway/XXXXXXXXXXXXXX/contract/error => 0
 - DEBUG : MQTT Send : enedis_gateway/XXXXXXXXXXXXXX/customer_id => -XXXXXXXX
 - DEBUG : MQTT Send : enedis_gateway/XXXXXXXXXXXXXX/contract/usage_point_id => XXXXXXXXXXXXXX
 - DEBUG : MQTT Send : enedis_gateway/XXXXXXXXXXXXXX/contract/usage_point_status => com
 - DEBUG : MQTT Send : enedis_gateway/XXXXXXXXXXXXXX/contract/meter_type => AMM
 - DEBUG : MQTT Send : enedis_gateway/XXXXXXXXXXXXXX/contract/segment => C5
 - DEBUG : MQTT Send : enedis_gateway/XXXXXXXXXXXXXX/offpeak_hours/0/start =>
Traceback (most recent call last):
File "/app/main.py", line 560, in <module>

File "/app/main.py", line 355, in run
contract = cont.getContract(client, con, cur)
File "/app/contract.py", line 101, in getContract
f.publish(client, f"{pdl}/offpeak_hours/{index}/stop", str(oh.split('-')[1]))
IndexError: list index out of range

Tu pourrais m’envoyer ton PDL et ton token en privée si ca ne te dérange pas afin que je reproduise chez moi ?
Tu as probablement un cas que je ne gérée pas correctement.

Rien n’est formaliser en retour des API Enedis, ce n’est pas forcement facile pour prendre en compte tt les cas :smiley: