Interrogation API Solarman et récupération données (onduleur SOFAR SOLAR)

Merci pour l’info je regarde ça demain.:slight_smile:

La nouvelle fonction a bien trouvé ton onduleur ?

Bonne soirée aussi

Non je l’ai testé alors que la clé wifi n’est plus connectée, je retente demain et te ferais un retour.

voici le log :

0000|[2023-10-19 21:27:02][INFO] : ---------------------------------------------------------------
0001|[2023-10-19 21:27:02][INFO] : ------------------Démarrage recherche réseau-------------------
0002|[2023-10-19 21:27:02][DEBUG] : lancement programme : nice -n 19 /usr/bin/python3 /var/www/html/plugins/solarman/ressources/scanner.py --loglevel debug
0003|[2023-10-19 21:27:02][INFO] : -----------------------Recherche terminée----------------------

En effet si la clé est déconnectée ça va moins bien marcher :grin:

Bonjour, c’est OK l’onduleur est bien détecté avec ip locale, Adresse Mac et SN Clé wifi :wink:

J’ai écris à SOFAR pour leur demander le protocole ModBus de mon onduleur j’espère qu’ils répondront :slight_smile:
Bonne journée.

J’ai récupéré les fichiers yaml sur un développement pour home assistant alors à part pour le fichier qui concerne mon onduleur je ne sais pas s’ils sont bien adaptés. J’ai prévu de pouvoir les faire évoluer et dans une prochaine version d’en créer

Je pense que celui ci serait le mieux pour toi. Si tu le mets est ce que tu pourrais envoyer tous les logs possibles stp.

Ps: Tu as bien paramétré le cron pour récupérer les données toutes les minutes?

Bonjour,

Je vais re essayer celui-ci et t’envoie les log.

Oui j’ai bien réglé le CRON à toutes les minutes.

J’ai récupérer la doc de chez SOFAR j’ai l’impression que les adresses sont différentes sur mon modèle, je vais m’y plonger pour essayer de trouver les adresses.
SOFAR Modbus User Guide 2023-07-23.pdf (268,7 Ko), ils m’ont également adressé un fichier excel ci-joint converti en pdf
SOFAR HYD-3PH and SOFAR -G3 Modbus Protocol 2021-10-14_INTERNAL.pdf (454,5 Ko)

Voici le LOG, il y a en effet un PB
usage: solarman.py [-h] [–apikey APIKEY] [–loglevel LOGLEVEL]
[–callback CALLBACK] [–cyclesommeil CYCLESOMMEIL]
[–cycle CYCLE] [–nameonduleur NAMEONDULEUR]
[–configonduleur CONFIGONDULEUR] [–idonduleur IDONDULEUR]
[–ipclewifi IPCLEWIFI] [–portclewifi PORTCLEWIFI]
[–serialclewifi SERIALCLEWIFI] [–mbslaveid MBSLAVEID]
solarman.py: error: unrecognized arguments: 3000TL-G3 3000TL-G3

0237|[2023-10-21 12:52:23][INFO] : ---------------------------------------------------------------
0238|[2023-10-21 12:52:23][INFO] : Démarrage Interrogation Onduleur SOFAR 3000TL-G3
0239|[2023-10-21 12:52:23][DEBUG] : Exécution du service : nice -n 19 /usr/bin/python3 /var/www/html/plugins/solarman/ressources/solarman.py --apikey ************** --loglevel debug --callback http://127.0.0.1:80/plugins/solarman/core/php/jeeSolarman.php --cyclesommeil 0.5 --cycle 0.3 --nameonduleur SOFAR 3000TL-G3 --configonduleur sofar_KTL_X_G3.yaml --idonduleur 692 --ipclewifi 192.168.. --portclewifi 8899 --serialclewifi *********** --mbslaveid 1
0240|[2023-10-21 12:52:23][INFO] : [SOLARMAN] OK
0241|[2023-10-21 12:52:23][INFO] : ---------------------------------------------------------------
0242|[2023-10-21 12:52:37][DEBUG] : fichier conf onduleur : sofar_KTL_X_G3.yaml Id Onduleur à modifier : 692
0243|[2023-10-21 12:52:37][DEBUG] : récupération des infos item : PV1 Power logicalId: 1414
0244|[2023-10-21 12:52:37][DEBUG] : commande existante remise à l’état initial si besoin : PV1 Power registre : 1414
0245|[2023-10-21 12:52:37][DEBUG] : récupération des infos item : PV2 Power logicalId: 1417
0246|[2023-10-21 12:52:37][DEBUG] : commande existante remise à l’état initial si besoin : PV2 Power registre : 1417
0247|[2023-10-21 12:52:37][DEBUG] : récupération des infos item : PV1 Voltage logicalId: 1412
0248|[2023-10-21 12:52:37][DEBUG] : commande existante remise à l’état initial si besoin : PV1 Voltage registre : 1412
0249|[2023-10-21 12:52:37][DEBUG] : récupération des infos item : PV2 Voltage logicalId: 1415
0250|[2023-10-21 12:52:37][DEBUG] : commande existante remise à l’état initial si besoin : PV2 Voltage registre : 1415
0251|[2023-10-21 12:52:37][DEBUG] : récupération des infos item : PV1 Current logicalId: 1413
0252|[2023-10-21 12:52:37][DEBUG] : commande existante remise à l’état initial si besoin : PV1 Current registre : 1413
0253|[2023-10-21 12:52:37][DEBUG] : récupération des infos item : PV2 Current logicalId: 1416
0254|[2023-10-21 12:52:37][DEBUG] : commande existante remise à l’état initial si besoin : PV2 Current registre : 1416
0255|[2023-10-21 12:52:37][DEBUG] : récupération des infos item : Inverter status logicalId: 1028
0256|[2023-10-21 12:52:37][DEBUG] : commande existante remise à l’état initial si besoin : Inverter status registre : 1028
0257|[2023-10-21 12:52:37][DEBUG] : récupération des infos item : Ambient temperature 1 logicalId: 1048
0258|[2023-10-21 12:52:37][DEBUG] : commande existante remise à l’état initial si besoin : Ambient temperature 1 registre : 1048
0259|[2023-10-21 12:52:37][DEBUG] : récupération des infos item : Module temperature 1 logicalId: 1056
0260|[2023-10-21 12:52:37][DEBUG] : commande existante remise à l’état initial si besoin : Module temperature 1 registre : 1056
0261|[2023-10-21 12:52:37][DEBUG] : récupération des infos item : Radiator temperature 1 logicalId: 1050
0262|[2023-10-21 12:52:37][DEBUG] : commande existante remise à l’état initial si besoin : Radiator temperature 1 registre : 1050
0263|[2023-10-21 12:52:37][DEBUG] : récupération des infos item : Insulation Resistance logicalId: 1067
0264|[2023-10-21 12:52:37][DEBUG] : commande existante remise à l’état initial si besoin : Insulation Resistance registre : 1067
0265|[2023-10-21 12:52:37][DEBUG] : récupération des infos item : Frequency Grid logicalId: 1156
0266|[2023-10-21 12:52:37][DEBUG] : commande existante remise à l’état initial si besoin : Frequency Grid registre : 1156
0267|[2023-10-21 12:52:37][DEBUG] : récupération des infos item : Total Active Power Output logicalId: 1157
0268|[2023-10-21 12:52:37][DEBUG] : commande existante remise à l’état initial si besoin : Total Active Power Output registre : 1157
0269|[2023-10-21 12:52:37][DEBUG] : récupération des infos item : Grid Voltage L1 logicalId: 1165
0270|[2023-10-21 12:52:37][DEBUG] : commande existante remise à l’état initial si besoin : Grid Voltage L1 registre : 1165
0271|[2023-10-21 12:52:37][DEBUG] : récupération des infos item : Grid Current L1 logicalId: 1166
0272|[2023-10-21 12:52:37][DEBUG] : commande existante remise à l’état initial si besoin : Grid Current L1 registre : 1166
0273|[2023-10-21 12:52:37][DEBUG] : récupération des infos item : Grid Voltage L2 logicalId: 1176
0274|[2023-10-21 12:52:37][DEBUG] : commande existante remise à l’état initial si besoin : Grid Voltage L2 registre : 1176
0275|[2023-10-21 12:52:37][DEBUG] : récupération des infos item : Grid Current L2 logicalId: 1177
0276|[2023-10-21 12:52:37][DEBUG] : commande existante remise à l’état initial si besoin : Grid Current L2 registre : 1177
0277|[2023-10-21 12:52:37][DEBUG] : récupération des infos item : Grid Voltage L3 logicalId: 1187
0278|[2023-10-21 12:52:37][DEBUG] : commande existante remise à l’état initial si besoin : Grid Voltage L3 registre : 1187
0279|[2023-10-21 12:52:37][DEBUG] : récupération des infos item : Grid Current L3 logicalId: 1188
0280|[2023-10-21 12:52:37][DEBUG] : commande existante remise à l’état initial si besoin : Grid Current L3 registre : 1188
0281|[2023-10-21 12:52:37][DEBUG] : récupération des infos item : PV Generation today logicalId: 1669
0282|[2023-10-21 12:52:37][DEBUG] : commande existante remise à l’état initial si besoin : PV Generation today registre : 1669
0283|[2023-10-21 12:52:37][DEBUG] : récupération des infos item : PV Generation total logicalId: 1671
0284|[2023-10-21 12:52:37][DEBUG] : commande existante remise à l’état initial si besoin : PV Generation total registre : 1671
0285|[2023-10-21 12:52:37][DEBUG] : récupération des infos item : Load consumption today logicalId: 1673
0286|[2023-10-21 12:52:37][DEBUG] : commande existante remise à l’état initial si besoin : Load consumption today registre : 1673
0287|[2023-10-21 12:52:37][DEBUG] : récupération des infos item : Load consumption total logicalId: 1675
0288|[2023-10-21 12:52:37][DEBUG] : commande existante remise à l’état initial si besoin : Load consumption total registre : 1675
0289|[2023-10-21 12:52:37][DEBUG] : récupération des infos item : Alert logicalId: 1029
0290|[2023-10-21 12:52:37][DEBUG] : commande existante remise à l’état initial si besoin : Alert registre : 1029
0291|[2023-10-21 12:52:37][DEBUG] : récupération des infos item : Fault 1 logicalId: 1029
0292|[2023-10-21 12:52:37][ERROR] : Attention, erreur sur la commande Fault 1 : [MySQL] Error code : 23000 (1062). Duplicate entry ‹ 692-Fault 1 › for key ‹ unique › : UPDATE cmd SET id = :id, logicalId = :logicalId, generic_type = :generic_type, eqType = :eqType, name = :name, order = :order, type = :type, subType = :subType, eqLogic_id = :eqLogic_id, isHistorized = :isHistorized, unite = :unite, configuration = :configuration, template = :template, display = :display, value = :value, isVisible = :isVisible, alert = :alert WHERE id = :id
0293|[2023-10-21 12:52:37][DEBUG] : récupération des infos item : Fault 2 logicalId: 1030
0294|[2023-10-21 12:52:37][DEBUG] : commande existante remise à l’état initial si besoin : Fault 2 registre : 1030

c’est bizarre on dirait un mélange entre interrogation et raz des commandes

Si j’ai bien compris le duplicate entry c’est un mauvais id de commande et l’on se retrouve avec 2 commandes avec le même label mais je ne sais pas ou cela se situe dans le code…

Tu peux supprimer et recréer ensuite ça devrait nettoyer

Bonsoir,

J’ai tout supprimé et recommencé voici le log que j’obtient, si tu as une idée je suis preneur car la je sèche…

0000|[2023-10-23 19:07:54]INFO : Init request module v2.31.0
0001|[2023-10-23 19:07:54]INFO : Solarman ------ debut recup donnees de l onduleur : 699
0002|[2023-10-23 19:07:54]INFO : SOLARMAN------ Apikey : xxxxxxxxxxxxxxxxxxxxx
0003|[2023-10-23 19:07:54]INFO : SOLARMAN------ Log level : debug
0004|[2023-10-23 19:07:54]INFO : SOLARMAN------ Callback : http://127.0.0.1:80/plugins/solarman/core/php/jeeSolarman.php
0005|[2023-10-23 19:07:54]INFO : SOLARMAN------ Cycle Sommeil : 0.5
0006|[2023-10-23 19:07:54]INFO : SOLARMAN------ Cycle : 0.3
0007|[2023-10-23 19:07:54]INFO : SOLARMAN------ Onduleur : Onduleur
0008|[2023-10-23 19:07:54]INFO : SOLARMAN------ Fichier de config : sofar_KTL_X_G3.yaml
0009|[2023-10-23 19:07:54]INFO : SOLARMAN------ Id de l equipement : 699
0010|[2023-10-23 19:07:54]INFO : SOLARMAN------ Adresse IP de la cle wifi : 192.168.xx.xx
0011|[2023-10-23 19:07:54]INFO : SOLARMAN------ Port de la cle wifi : 8899
0012|[2023-10-23 19:07:54]INFO : SOLARMAN------ Numero de serie de la cle wifi File : xxxxxxxxxxxx
0013|[2023-10-23 19:07:54]INFO : SOLARMAN------ Id modbus de l onduleur : 1
0014|[2023-10-23 19:07:54]DEBUG : Starting new HTTP connection (1): 127.0.0.1:80
0015|[2023-10-23 19:07:54]DEBUG : http://127.0.0.1:80 « GET /plugins/solarman/core/php/jeeSolarman.php?apikey=xxxxxxxxxxxxx HTTP/1.1 » 200 0
0016|[2023-10-23 19:07:55]DEBUG : Starting to query for [4] ranges…
0017|[2023-10-23 19:07:55]DEBUG : Querying [1028 - 1070]…
0018|[2023-10-23 19:07:55]INFO : Connecting to solarman data logger 192.168.xx.xx:8899
0019|[2023-10-23 19:07:55]DEBUG : Socket setup completed…
0020|[2023-10-23 19:07:55]DEBUG : SENT:
0021|[2023-10-23 19:08:10]WARNING : Querying [1028 - 1070] failed with exception [Empty: ]
0022|[2023-10-23 19:08:10]INFO : Disconnecting from solarman data logger 192.168.xx.xx:8899
0023|[2023-10-23 19:08:10]WARNING : Querying [1028 - 1070] failed, [1] retry attempts left
0024|[2023-10-23 19:08:10]INFO : Connecting to solarman data logger 192.168.xx.xx:8899
0025|[2023-10-23 19:08:10]DEBUG : Socket setup completed…
0026|[2023-10-23 19:08:10]DEBUG : SENT:

Comme ça je ne vois pas, l’onduleur ne renvoie rien on dirait. Sur mon téléphone j’ai un peu de mal à voir ce qui peut se passer. Ça peu attendre la semaine prochaine ?

oui bien sur pas d’urgence c’est déjà très sympa de ta part de regarder :wink:

Ca y est cela fonctionne.

L’erreur venait du nom de l’équipement : il ne supporte pas les espaces, ni un nom trop long…

Merci je vais tester cela par rapport à mon script :slight_smile:

J’ai l’impression que le refresh ne fonctionne pas malgré le réglage CRON à * * * *

J’ai ce LOG:

[2023-10-24 18:04:28]DEBUG : [POLL] Socket closed. Reader thread exiting.
[2023-10-24 18:04:28]DEBUG : Auto-Reconnect enabled. Trying to establish a new connection
[2023-10-24 18:04:28]DEBUG : Auto-Reconnect successful.

Ah oui j’ai eu le coup aussi. Je vais voir pour remédier à ça

C’est dans le log python?

Oui c’est dans le LOG Python le rafraichissement ne fonctionne pas… :thinking:

0265|[2023-10-24 19:02:58]DEBUG : [POLL] Socket closed. Reader thread exiting.
0266|[2023-10-24 19:02:58]DEBUG : Auto-Reconnect enabled. Trying to establish a new connection
0267|[2023-10-24 19:02:58]DEBUG : Auto-Reconnect successful.
0268|[2023-10-24 19:03:34]DEBUG : [POLL] Socket closed. Reader thread exiting.
0269|[2023-10-24 19:03:34]DEBUG : Auto-Reconnect enabled. Trying to establish a new connection
0270|[2023-10-24 19:03:34]DEBUG : Auto-Reconnect successful.
0271|[2023-10-24 19:04:51]DEBUG : [POLL] Socket closed. Reader thread exiting.
0272|[2023-10-24 19:04:51]DEBUG : Auto-Reconnect enabled. Trying to establish a new connection
0273|[2023-10-24 19:04:51]DEBUG : Auto-Reconnect successful.
0274|[2023-10-24 19:07:58]DEBUG : [POLL] Socket closed. Reader thread exiting.
0275|[2023-10-24 19:07:58]DEBUG : Auto-Reconnect enabled. Trying to establish a new connection
0276|[2023-10-24 19:07:58]DEBUG : Auto-Reconnect successful.
0277|[2023-10-24 19:08:34]DEBUG : [POLL] Socket closed. Reader thread exiting.
0278|[2023-10-24 19:08:34]DEBUG : Auto-Reconnect enabled. Trying to establish a new connection
0279|[2023-10-24 19:08:34]DEBUG : Auto-Reconnect successful.
0280|[2023-10-24 19:09:51]DEBUG : [POLL] Socket closed. Reader thread exiting.
0281|[2023-10-24 19:09:51]DEBUG : Auto-Reconnect enabled. Trying to establish a new connection
0282|[2023-10-24 19:09:51]DEBUG : Auto-Reconnect successful.