GAZPAR/GRDF - MetersToHA compatible exigence CAPTCHA

Et les traces? Horodatage autour de l’événement? Si le données GRDF n’ont pas évolués, le sensor n’évolue pas.

effectivement pas de donnée depuis le 04 novembre…
A voir dans la journée

2023-11-05 12:55:49,693 : -- :  Previous 1319 m3 135.0 kWh 2023-11-04 06:00:00+01:00 from None
2023-11-05 12:55:49,693 : WW :  No new data, no update
2023-11-05 12:55:49,693 : OK :  Finished on success, cleaning up
2023-11-05 12:55:49,795 : OK : Close Browser 
2023-11-05 12:55:49,803 : OK : Close Display 

Comment fais tu pour ajouter en kWh? Car j’ai uniquement le sensor en m3 qui est pris dans énergie

Quand je fais « Ajouter une source de gaz » il y a le choix - pour rester compatible avec l’intégration que j’utilisais avant, j’ai choisi gas_consumption_kwh, mais il y a aussi une entité avec le numéro de mon PCE que je peux choisir.

Je recommande aussi un redémarrage de l’addon - je viens de constater qu’il y avait un bogue avec le comptage en cas de redémarrage de HA.

Ok alors moi j’ai uniquement le sensor générer en m3 pas en kWh dans énergie. Pourtant les 2 sont présent dans entité

Dans les états sous outils de développement, y-a-t-il bien des attributs « similaires »:

oui

Normalement les conditions sont réunis pour l’ajouter au tableau d’Energie. Maintenant qu’il y a qqs jours de récupération de données, est-ce que cela change?

Non je ne vois que ces 2 sensors

D’après le « pourquoi mon entité n’est-elle pas répertorié » les attributs remplissent les conditions. Mais comme il s’agit de statistiques, peut-être qu’une configuration exclut ces valeurs des statistiques?

Aussi, y-a-t-il qqchse à réparer selon HA?

Visiblement tout va bien :frowning:

Les entités créés par MetersToHA contiennent gas ou grdf.

Ils contiennent grdf

Désolé, ce n’était pas une question, mais une observaton car la recherche est pour « gaz », et ce n’st pas le résultat de MetersToHA - gas_… et grdf_… le sont.

Bonjour,

Merci pour ton addon bien pratique, j’aurais besoin d’une aide sur le sujet.
J’ai bien des données qui remontent mais je pense que je dois faire une automatisation une fois par jour « call_grdf », non ? pour avoir les données qui remonte le tableau de bord énergie avec le sensor « grdf 14397829193618 kwh ».

Merci d’avance,
Bonne journée,

Voici les informations de mon installation, installation du addon en local mais peut-être mal fait par contre: (j’avais fait un « conf.json » dans celui-ci au départ mais j’ai eu des soucis ! pourtant j’avais l’impression qu’il en fallait un en suivant le github:

image

2023-11-09 15:16:38,289 : OK : Using /usr/bin/python3 Version 3.11.6Loading configuration file : /m2h_config.json 
2023-11-09 15:16:38,291 : -- :  Start loading configuration
2023-11-09 15:16:38,292 : OK : "veolia" = "False" 
2023-11-09 15:16:38,293 : OK : "veolia_login" = "None" 
2023-11-09 15:16:38,293 : OK : "veolia_password" = "None" 
2023-11-09 15:16:38,294 : OK : "veolia_contract" = "None" 
2023-11-09 15:16:38,294 : OK : "grdf" = "True" 
2023-11-09 15:16:38,294 : OK : "grdf_login" = "hennebelle.melanie@laposte.net" 
2023-11-09 15:16:38,295 : OK : "grdf_password" = "****************" 
2023-11-09 15:16:38,295 : OK : "grdf_pce" = "14397829193618" 
2023-11-09 15:16:38,296 : OK : "screenshot" = "True" 
2023-11-09 15:16:38,296 : OK : "skip_download" = "False" 
2023-11-09 15:16:38,296 : OK : "keep_output" = "True" 
2023-11-09 15:16:38,297 : WW :  "geckodriver" not found in config file, using default value
2023-11-09 15:16:38,297 : OK : "geckodriver" = "/MetersToHA/apps/meters_to_ha/geckodriver" 
2023-11-09 15:16:38,297 : WW :  "firefox" not found in config file, using default value
2023-11-09 15:16:38,298 : OK : "firefox" = "/MetersToHA/apps/meters_to_ha/firefox" 
2023-11-09 15:16:38,298 : WW :  "chromium" not found in config file, using default value
2023-11-09 15:16:38,299 : OK : "chromium" = "/usr/bin/chromium" 
2023-11-09 15:16:38,299 : WW :  "chromedriver" not found in config file, using default value
2023-11-09 15:16:38,299 : OK : "chromedriver" = "/usr/bin/chromedriver" 
2023-11-09 15:16:38,300 : OK : "chrome_version" = "None" 
2023-11-09 15:16:38,300 : OK : "timeout" = "30" 
2023-11-09 15:16:38,300 : OK : "download_folder" = "/config/MetersToHa/" 
2023-11-09 15:16:38,301 : OK : "logs_folder" = "/config/MetersToHa/" 
2023-11-09 15:16:38,301 : OK : "2captcha_token" = "None" 
2023-11-09 15:16:38,301 : OK : "capmonster_token" = "None" 
2023-11-09 15:16:38,302 : OK : "captchaai_token" = "********************************" 
2023-11-09 15:16:38,302 : OK : "log_level" = "info" 
2023-11-09 15:16:38,302 : OK : End loading configuration 
2023-11-09 15:16:38,303 : -- :  Start Loading Home Assistant configuration
2023-11-09 15:16:38,303 : OK : "ha_server" = "http://homeassistant.local:8123" 
2023-11-09 15:16:38,304 : OK : "ha_token" = "***************************************************************************************************************************************************************************************" 
2023-11-09 15:16:38,304 : OK : "veolia_contract" = "None" 
2023-11-09 15:16:38,304 : OK : "timeout" = "30" 
2023-11-09 15:16:38,305 : OK : "insecure" = "False" 
2023-11-09 15:16:38,305 : OK : "state_file" = "/config/MetersToHa/meters2ha_state.json" 
2023-11-09 15:16:38,305 : OK : End loading Home Assistant configuration 
2023-11-09 15:16:38,306 : ~~ :  Check availability of "geckodriver"+"firefox" or "chromedriver"+"chromium"
2023-11-09 15:16:38,306 : OK :  Found chromium binary
2023-11-09 15:16:38,324 : OK : Check Home Assistant connectivity 
2023-11-09 15:16:38,325 : -- : Try starting Chromium. Add nix root user options.
2023-11-09 15:16:42,133 : OK : Start virtual display (Chromium). 
2023-11-09 15:16:42,133 : ~~ :  LOG LEVEL info:20:20 None
2023-11-09 15:16:58,037 : OK : Start the browser 
2023-11-09 15:16:58,037 : OK :  
2023-11-09 15:17:06,202 : OK : Waiting for cookie popup 
2023-11-09 15:17:06,861 : OK : Click on deny 
2023-11-09 15:17:07,953 : OK : Connexion au site GRDF 
2023-11-09 15:17:10,259 : OK : Waiting for Password 
2023-11-09 15:17:11,053 : OK : Waiting for Email 
2023-11-09 15:17:12,945 : OK : Type Email 
2023-11-09 15:17:13,201 : OK : Type Password 
2023-11-09 15:17:13,233 : ~~ : Proceed with captcha resolution. Captchaai https://ocr.captchaai.com/in.php?key=9beb12e1278215689b9ec2fcfba0cbd0&method=userrecaptcha&googlekey=6LfNHKgZAAAAALUFRFc4mNHjau8gl4INB4bsyHy1&pageurl=https%3A%2F%2Flogin.monespace.grdf.fr%3A443&from=151169
2023-11-09 15:17:13,692 : ~~ :  Captchaai Service response OK|1297695026
2023-11-09 15:17:13,692 : ~~ :  Wait 20s for Captchaai
2023-11-09 15:17:33,894 : ~~ :  Captchaai Service response CAPCHA_NOT_READY
2023-11-09 15:17:33,895 : ~~ :  Wait 10s for Captchaai
2023-11-09 15:17:45,085 : ~~ :  Captchaai Service response CAPCHA_NOT_READY
2023-11-09 15:17:45,085 : ~~ :  Wait 10s for Captchaai
2023-11-09 15:17:56,289 : ~~ :  Captchaai Service response CAPCHA_NOT_READY
2023-11-09 15:17:56,289 : ~~ :  Wait 10s for Captchaai
2023-11-09 15:18:07,482 : ~~ :  Captchaai Service response CAPCHA_NOT_READY
2023-11-09 15:18:07,487 : ~~ :  Wait 10s for Captchaai
2023-11-09 15:18:18,689 : ~~ :  Captchaai Service response CAPCHA_NOT_READY
2023-11-09 15:18:18,689 : ~~ :  Wait 10s for Captchaai
2023-11-09 15:18:29,877 : ~~ :  Captchaai Service response CAPCHA_NOT_READY
2023-11-09 15:18:29,878 : ~~ :  Wait 10s for Captchaai
2023-11-09 15:18:40,071 : ~~ :  Captchaai Service response OK|03AFcWeA7V9qN4mD-d9DwB5ToJNgjHnxQCrK-4zddw8cnl8P5ZjW4-2y3TNDnrc10pIY9KJJjZvCBNIo7-HwfVb2UjONVMnZyR7UXJ0K8fHtdcqHsBE824x4w_kTv9osoyayyAPWgeFfLpRNNKrM_n7TktWDLSCfAiwTFA2TN4IGXpXPyJvV0XoehPO8cUzC-VEvkPANNlSYefVL2XRsJ73VfZW0T2vyIBU37ZJT_qa2WP8ZirlTWCMln56dcopQJ1boctsXZiwbZ8bYbkU1hqN6K4JzrtTQbENkdEgReeLjka-CQe15COlRpeRGQ5y-mryU8frGTWQNQ4PGQXY442RgAQ12dMVVNPLu2CtDSR6DGVHGYnqB-mVvTXaoAn5UjV3GITTtgGtuDCgkNoL3mgmNEpMCJxMlcuFkZSHb1CrIoQM0bGYsdmUmqiG8x_0ctjylfnLORfS51WlqqXH5J8TwGUt1MMrBxjIHRRwtTAuYpnthjR7_cPZJpVPWCZ4m-ppqmA4cyng82fP09xj9EhBi_piWaC4EbpOpNLVKA3gqMu36VHa-OHXtzdy9I050Laxt2CoJJ4dsn6t9A8z4GjsCShHCdxNMOsBD2EYVuYrWwMObNx1Y2vV4N58FBCq_I-SUrdekaBluWcP3G07eEgH3FLrs8sOcKfmQ
2023-11-09 15:18:42,447 : OK : Automatic resolution succeeded. Grab & Save '/config/MetersToHa/screen_before_connection.png'. Wait for Button xpath://input[@value='Connexion']. 
2023-11-09 15:18:42,453 : ~~ : Wait before clicking (1.9s). 
2023-11-09 15:18:45,045 : OK : Click on connexion 
2023-11-09 15:18:56,821 : -- : End of wait after connexion. Get Data URL https://monespace.grdf.fr/api/e-conso/pce/consommation/informatives?dateDebut=2023-10-26&dateFin=2023-11-09&pceList[]=14397829193618Get Data Content. Writing '/config/MetersToHa/historique_gazpar.json'. Parsing JSON file.
2023-11-09 15:18:57,037 : -- :  From sensor.grdf_14397829193618_kwh: None
2023-11-09 15:18:57,046 : -- :  From sensor.gas_consumption_kwh: None
2023-11-09 15:18:57,062 : -- :  Previous None m3 None kWh 2023-11-02 14:18:56.828819+00:00 from None
2023-11-09 15:18:57,063 : -- :  New Total 0kWh (+0)
2023-11-09 15:18:57,063 : -- :  New Total 1kWh (+1)
2023-11-09 15:18:57,063 : -- :  New Total 2kWh (+1)
2023-11-09 15:18:57,063 : -- :  New Total 2kWh (+0)
2023-11-09 15:18:57,063 : -- :  New Total 39kWh (+37)
2023-11-09 15:18:57,063 : -- :  New Total 73kWh (+34)
2023-11-09 15:18:57,077 : -- : update value is 2023-11-08T06:00:00+01:00: 2689 m³ - 73 kWh - 34 kWh {'entity_id': 'sensor.gas_consumption_m3', 'state': '2689', 'attributes': {'date_time': '2023-11-08T06:00:00+01:00', 'unit_of_measurement': 'm³', 'device_class': 'gas', 'state_class': 'total_increasing', 'last_check': '2023-11-09T14:18:56.828767+00:00'}, 'last_changed': '2023-11-09T14:18:57.070195+00:00', 'last_updated': '2023-11-09T14:18:57.070195+00:00', 'context': {'id': '01HET76K5EEZF037NKTA4NN028', 'parent_id': None, 'user_id': '4953eaa3f5b94bc5a95e81912476a32f'}}
2023-11-09 15:18:57,090 : -- :  {'entity_id': 'sensor.grdf_14397829193618_m3', 'state': '2689', 'attributes': {'date_time': '2023-11-08T06:00:00+01:00', 'unit_of_measurement': 'm³', 'device_class': 'gas', 'state_class': 'total_increasing', 'last_check': '2023-11-09T14:18:56.828767+00:00'}, 'last_changed': '2023-11-09T14:18:57.085427+00:00', 'last_updated': '2023-11-09T14:18:57.085427+00:00', 'context': {'id': '01HET76K5XH07EBS9DYHT8QCRQ', 'parent_id': None, 'user_id': '4953eaa3f5b94bc5a95e81912476a32f'}}
2023-11-09 15:18:57,106 : -- :  {'entity_id': 'sensor.gas_daily_kwh', 'state': '34', 'attributes': {'date_time': '2023-11-08T06:00:00+01:00', 'unit_of_measurement': 'kWh', 'device_class': 'energy', 'state_class': 'measurement', 'last_check': '2023-11-09T14:18:56.828767+00:00'}, 'last_changed': '2023-11-09T14:18:57.097170+00:00', 'last_updated': '2023-11-09T14:18:57.097170+00:00', 'context': {'id': '01HET76K69AFX4QWAHS6B3FDVT', 'parent_id': None, 'user_id': '4953eaa3f5b94bc5a95e81912476a32f'}}
2023-11-09 15:18:57,119 : -- :  {'entity_id': 'sensor.grdf_14397829193618_daily_kwh', 'state': '34', 'attributes': {'date_time': '2023-11-08T06:00:00+01:00', 'unit_of_measurement': 'kWh', 'device_class': 'energy', 'state_class': 'measurement', 'last_check': '2023-11-09T14:18:56.828767+00:00'}, 'last_changed': '2023-11-09T14:18:57.115238+00:00', 'last_updated': '2023-11-09T14:18:57.115238+00:00', 'context': {'id': '01HET76K6VGXQB5QGDGGT0DMDJ', 'parent_id': None, 'user_id': '4953eaa3f5b94bc5a95e81912476a32f'}}
2023-11-09 15:18:57,131 : Get_state_file /config/MetersToHa/meters2ha_state.json {'grdf': {'state': 73, 'attributes': {'date_time': '2023-11-08T06:00:00+01:00', 'unit_of_measurement': 'kWh', 'device_class': 'energy', 'state_class': 'total_increasing', 'last_check': '2023-11-09T14:18:56.828767+00:00'}, 'm3': 2689}}
2023-11-09 15:18:57,132 : -- :  {'entity_id': 'sensor.gas_consumption_kwh', 'state': '73', 'attributes': {'date_time': '2023-11-08T06:00:00+01:00', 'unit_of_measurement': 'kWh', 'device_class': 'energy', 'state_class': 'total_increasing', 'last_check': '2023-11-09T14:18:56.828767+00:00'}, 'last_changed': '2023-11-09T14:18:57.126633+00:00', 'last_updated': '2023-11-09T14:18:57.126633+00:00', 'context': {'id': '01HET76K76QWF6P9PJGP2XH8RA', 'parent_id': None, 'user_id': '4953eaa3f5b94bc5a95e81912476a32f'}}
2023-11-09 15:18:57,145 : -- :  {'entity_id': 'sensor.grdf_14397829193618_kwh', 'state': '73', 'attributes': {'date_time': '2023-11-08T06:00:00+01:00', 'unit_of_measurement': 'kWh', 'device_class': 'energy', 'state_class': 'total_increasing', 'last_check': '2023-11-09T14:18:56.828767+00:00'}, 'last_changed': '2023-11-09T14:18:57.141759+00:00', 'last_updated': '2023-11-09T14:18:57.141759+00:00', 'context': {'id': '01HET76K7NB34AF7SXX6M38A9T', 'parent_id': None, 'user_id': '4953eaa3f5b94bc5a95e81912476a32f'}}
2023-11-09 15:18:57,146 : OK :  
2023-11-09 15:18:57,146 : OK :  Finished on success, cleaning up
2023-11-09 15:18:57,295 : OK : Close Browser 
2023-11-09 15:18:57,301 : OK : Close Display 
2023-11-09 15:19:12,099 : OK : Using /usr/bin/python3 Version 3.11.6Loading configuration file : /m2h_config.json 
2023-11-09 15:19:12,101 : -- :  Start loading configuration
2023-11-09 15:19:12,102 : OK : "veolia" = "False" 
2023-11-09 15:19:12,102 : OK : "veolia_login" = "None" 
2023-11-09 15:19:12,103 : OK : "veolia_password" = "None" 
2023-11-09 15:19:12,103 : OK : "veolia_contract" = "None" 
2023-11-09 15:19:12,104 : OK : "grdf" = "True" 
2023-11-09 15:19:12,104 : OK : "grdf_login" = "hennebelle.melanie@laposte.net" 
2023-11-09 15:19:12,104 : OK : "grdf_password" = "****************" 
2023-11-09 15:19:12,105 : OK : "grdf_pce" = "14397829193618" 
2023-11-09 15:19:12,105 : OK : "screenshot" = "True" 
2023-11-09 15:19:12,105 : OK : "skip_download" = "False" 
2023-11-09 15:19:12,106 : OK : "keep_output" = "True" 
2023-11-09 15:19:12,106 : WW :  "geckodriver" not found in config file, using default value
2023-11-09 15:19:12,106 : OK : "geckodriver" = "/MetersToHA/apps/meters_to_ha/geckodriver" 
2023-11-09 15:19:12,106 : WW :  "firefox" not found in config file, using default value
2023-11-09 15:19:12,106 : OK : "firefox" = "/MetersToHA/apps/meters_to_ha/firefox" 
2023-11-09 15:19:12,107 : WW :  "chromium" not found in config file, using default value
2023-11-09 15:19:12,107 : OK : "chromium" = "/usr/bin/chromium" 
2023-11-09 15:19:12,107 : WW :  "chromedriver" not found in config file, using default value
2023-11-09 15:19:12,107 : OK : "chromedriver" = "/usr/bin/chromedriver" 
2023-11-09 15:19:12,107 : OK : "chrome_version" = "None" 
2023-11-09 15:19:12,108 : OK : "timeout" = "30" 
2023-11-09 15:19:12,108 : OK : "download_folder" = "/config/MetersToHa/" 
2023-11-09 15:19:12,108 : OK : "logs_folder" = "/config/MetersToHa/" 
2023-11-09 15:19:12,108 : OK : "2captcha_token" = "None" 
2023-11-09 15:19:12,108 : OK : "capmonster_token" = "None" 
2023-11-09 15:19:12,109 : OK : "captchaai_token" = "********************************" 
2023-11-09 15:19:12,109 : OK : "log_level" = "info" 
2023-11-09 15:19:12,109 : OK : End loading configuration 
2023-11-09 15:19:12,109 : -- :  Start Loading Home Assistant configuration
2023-11-09 15:19:12,110 : OK : "ha_server" = "http://homeassistant.local:8123" 
2023-11-09 15:19:12,110 : OK : "ha_token" = "***************************************************************************************************************************************************************************************" 
2023-11-09 15:19:12,110 : OK : "veolia_contract" = "None" 
2023-11-09 15:19:12,110 : OK : "timeout" = "30" 
2023-11-09 15:19:12,110 : OK : "insecure" = "False" 
2023-11-09 15:19:12,111 : OK : "state_file" = "/config/MetersToHa/meters2ha_state.json" 
2023-11-09 15:19:12,111 : OK : End loading Home Assistant configuration 
2023-11-09 15:19:12,111 : ~~ :  Check availability of "geckodriver"+"firefox" or "chromedriver"+"chromium"
2023-11-09 15:19:12,111 : OK :  Found chromium binary
2023-11-09 15:19:12,142 : OK : Check Home Assistant connectivity 
2023-11-09 15:19:12,142 : -- : Try starting Chromium. Add nix root user options.
2023-11-09 15:19:15,359 : OK : Start virtual display (Chromium). 
2023-11-09 15:19:15,359 : ~~ :  LOG LEVEL info:20:20 None
2023-11-09 15:19:17,369 : OK : Start the browser 
2023-11-09 15:19:17,369 : OK :  
2023-11-09 15:19:24,198 : OK : Waiting for cookie popup 
2023-11-09 15:19:25,331 : OK : Click on deny 
2023-11-09 15:19:26,306 : OK : Connexion au site GRDF 
2023-11-09 15:19:29,392 : OK : Waiting for Password 
2023-11-09 15:19:30,387 : OK : Waiting for Email 
2023-11-09 15:19:31,939 : OK : Type Email 
2023-11-09 15:19:32,565 : OK : Type Password 
2023-11-09 15:19:32,607 : ~~ : Proceed with captcha resolution. Captchaai https://ocr.captchaai.com/in.php?key=9beb12e1278215689b9ec2fcfba0cbd0&method=userrecaptcha&googlekey=6LfNHKgZAAAAALUFRFc4mNHjau8gl4INB4bsyHy1&pageurl=https%3A%2F%2Flogin.monespace.grdf.fr%3A443&from=151169
2023-11-09 15:19:32,877 : ~~ :  Captchaai Service response OK|1297703283
2023-11-09 15:19:32,878 : ~~ :  Wait 20s for Captchaai
2023-11-09 15:19:53,044 : ~~ :  Captchaai Service response CAPCHA_NOT_READY
2023-11-09 15:19:53,049 : ~~ :  Wait 10s for Captchaai
2023-11-09 15:20:04,242 : ~~ :  Captchaai Service response CAPCHA_NOT_READY
2023-11-09 15:20:04,243 : ~~ :  Wait 10s for Captchaai
2023-11-09 15:20:15,448 : ~~ :  Captchaai Service response CAPCHA_NOT_READY
2023-11-09 15:20:15,448 : ~~ :  Wait 10s for Captchaai
2023-11-09 15:20:26,641 : ~~ :  Captchaai Service response CAPCHA_NOT_READY
2023-11-09 15:20:26,641 : ~~ :  Wait 10s for Captchaai
2023-11-09 15:20:36,835 : ~~ :  Captchaai Service response OK|03AFcWeA725fYzAQ0-DBKg3yuo2160kmAQ4BTi0hZSSvEGB-KCoArLAL7XgQnk5m-Eje3NtcELyHRxFCKZ4TDqvVN1IzzC3RNcs3BOHmr2bX0S1Rf-hXuPgIob4B_cuC-_a6yojp5CcuOtiuMvScc23qwo50zzAdydlrdNIn0udlp2aBcAJEa-BmKoy_K-FC3eoq8ONZp4FTh0YxURQ7-IImFJJUMSXyJTHefkun3HDFgL-Pog5SLzbP5bT6p4hEk1xy-0RMtYCNclpdDbJVmuM52SFEyMeqm7CVwQ6lYg5NoecjiC9aFnVQ4lP6x9k6sSL1orAbyZgpPNqKcYJSrKXjPTyJ4IgnitgwN1UYtW0O63j8MrXbdYZx-IckWizUiuYpso0FDYPyJhLRzWEb4BB9jYFbO8yBwAwzFj-DZ8gB1WhScfRS2r75yhoZGXgnqAanVioC2W8l4JvIlql1CWbStsuQ3bf0dzKt8MpW5U3FWGppeNfc1pQwEaDiyPFisLvsuKKKe5pxDfvEGWbB2vsd8A6sOTqQ5OhuzNWlsRkNOgynhdFKvZKx4KXkD3apa1LNLTGzfQZu_AuK5ALwaNQRgMWoGlr1YyZmizEmGgu83KkmkIfsa8QJNhfWpyykKwVM8K6ggYB0LRpVyFU8D_D3p_z3mtiX5PvA
2023-11-09 15:20:39,162 : OK : Automatic resolution succeeded. Grab & Save '/config/MetersToHa/screen_before_connection.png'. Wait for Button xpath://input[@value='Connexion']. 
2023-11-09 15:20:39,162 : ~~ : Wait before clicking (1.5s). 
2023-11-09 15:20:41,220 : OK : Click on connexion 
2023-11-09 15:20:53,295 : -- : End of wait after connexion. Get Data URL https://monespace.grdf.fr/api/e-conso/pce/consommation/informatives?dateDebut=2023-10-26&dateFin=2023-11-09&pceList[]=14397829193618Get Data Content. Writing '/config/MetersToHa/historique_gazpar.json'. Parsing JSON file.
2023-11-09 15:20:53,502 : -- :  From sensor.grdf_14397829193618_kwh: {'entity_id': 'sensor.grdf_14397829193618_kwh', 'state': '73', 'attributes': {'date_time': '2023-11-08T06:00:00+01:00', 'unit_of_measurement': 'kWh', 'device_class': 'energy', 'state_class': 'total_increasing', 'last_check': '2023-11-09T14:18:56.828767+00:00'}, 'last_changed': '2023-11-09T14:18:57.141759+00:00', 'last_updated': '2023-11-09T14:18:57.141759+00:00', 'context': {'id': '01HET76K7NB34AF7SXX6M38A9T', 'parent_id': None, 'user_id': '4953eaa3f5b94bc5a95e81912476a32f'}}
2023-11-09 15:20:53,511 : -- :  Previous date (m3) 2023-11-08 06:00:00+01:00
2023-11-09 15:20:53,512 : -- :  Previous 2689.0 m3 73.0 kWh 2023-11-08 06:00:00+01:00 from sensor.grdf_14397829193618_m3
2023-11-09 15:20:53,512 : WW :  No new data, no update
2023-11-09 15:20:53,512 : Get_state_file /config/MetersToHa/meters2ha_state.json {'grdf': {'entity_id': 'sensor.grdf_14397829193618_kwh', 'state': '73', 'attributes': {'date_time': '2023-11-08T06:00:00+01:00', 'unit_of_measurement': 'kWh', 'device_class': 'energy', 'state_class': 'total_increasing', 'last_check': '2023-11-09T14:18:56.828767+00:00'}, 'last_changed': '2023-11-09T14:18:57.141759+00:00', 'last_updated': '2023-11-09T14:18:57.141759+00:00', 'context': {'id': '01HET76K7NB34AF7SXX6M38A9T', 'parent_id': None, 'user_id': '4953eaa3f5b94bc5a95e81912476a32f'}, 'm3': 2689.0}}
2023-11-09 15:20:53,514 : OK :  Finished on success, cleaning up
2023-11-09 15:20:53,683 : OK : Close Browser 
2023-11-09 15:20:53,692 : OK : Close Display 
DISPLAY:''
EVENT CONF:grdf:call_grdf
=== Generated script '/execEvent.sh': ==========
#!/bin/bash
{
  TARGET_OPT=""
  [[ "$1" == "call_veolia" ]] && TARGET_OPT=--veolia
    [[ "$1" == "call_grdf" ]] && TARGET_OPT=--grdf
    
  [[ "$TARGET_OPT" == "" ]] && ( echo "Unrecognized event '$1'" ; exit 1 )
  date
  echo "python3  MetersToHA/apps/meters_to_ha/meters_to_ha.py  -l /config/MetersToHa --screenshot --keep-output -c \"/m2h_config.json\" $TARGET_OPT -r"
  python3  MetersToHA/apps/meters_to_ha/meters_to_ha.py  -l /config/MetersToHa --screenshot --keep-output -c "/m2h_config.json" $TARGET_OPT -r
  # Copy chrome logs
  for i in ~/.config/*/chrome_debug.log ; do
    [[ -r "$i" ]] || continue
    SUBDIR="/config/MetersToHa/$(basename "$(dirname "$i")")"
    mkdir -p "${SUBDIR}"
    cp -p "$i" "${SUBDIR}"
  done
  echo "Done $(date)"
} >> "/config/MetersToHa/m2h_exec.log" 2>&1
=== End of Generated script '/execEvent.sh': ===
Test access to Home Assistant API (should show '{"message":"API running."}')
{"message":"API running."}
"./haevent2exec.py" --config-json "/m2h_config.json" --external-program "/execEvent.sh" --log-level="info"  call_veolia call_grdf```

Tout à fait. Pour le reste la trace me semble réussi.

Pour l’automatisation, il y a un exemple dans le README qui fait 2 appels en fin de journée - le deuxième appel ne fera rien si le premier en a obtenu des récentes:

alias: Appel GRDF
description: ''
trigger:
  - platform: time_pattern
    hours: '21'
    minutes: '1'
    seconds: '0'
  - platform: time_pattern
    hours: '23'
    minutes: '1'
    seconds: '0'
condition:
  - condition: template
    value_template: >-
      {{
      (as_timestamp(now())-as_timestamp(states.sensor.gas_consumption_kwh.last_updated|default('1970-01-01')))
      > 17*3600 }}
action:
  - delay: '{{ range(0, 55*60+1) | random }}'
    alias: Avec un délai variable pour ne pas charger le serveur tous en même temps.
  - event: call_grdf
    event_data: {}
mode: single

Merci pour ton retour, j’avais vu l’exemple mais il parle pour « Daemon » que je n’ai pas très bien ça servait… Mais du coup je reprend ça pour faire l’automatisation.

Une petite question par contre, j’ai fait l’appel « call_grdf » aujourd’hui qui donne du coup une information de 34 kwh à 15h aujourd’hui mais la donnée était de mardi 7 novembre du coup pas le bon jour comment fait-on ? J’ai loupé un truc ?

Oui excuse moi j’ai fait la manip trop vite…
voici le bon résultat


Et je viens de trouver! en faite j’avais ajouter le sensor en m3 et après on ne peux pas ajouter en KWH donc j’ai supprimé le sensor en M3 et j’ai pu ajouter celui en Kwh!

Super! J’avais compris que le kWh n’apparaissait pas dans la liste et comme j’avais tout dans ma liste (même avec le kWh déjà choisi), je ne pensais pas que c’était le pb.

Je pense qu’il faut réorganiser la documentation. Je n’ai pas spécialement le temps pour cela en ce moment - mais je suis ouvert aux propositions si qqn veut en faire.

A la base HA ne permet pas d’importer des données historiques.

Il y a des évolutions qui ont été proposés pour le permettre mais qui nécessitent encore un peu de travail pour généraliser cela et aussi le tester plus:

Bonjour tout le monde.
Merci pour le dev effectué.
Je viens d’installer l’add-on directement sous HA (je n’ai installé que ça).
J’ai aussi créer l’automatisme pour l’appel GRDF.
Et maintenant, je bloque pour mettre la config grdf.
Le module est bien fonctionnel mais il me met un token inconnu :


et j’ai bien l’API running

Je ne trouve pas dans quel répertoire mettre le fichier config.json
Ou est-ce que je me suis gourré ? :slight_smile: