Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] No temperature field available #47

Closed
LudovicRousseau opened this issue Jan 25, 2022 · 3 comments
Closed

[Bug] No temperature field available #47

LudovicRousseau opened this issue Jan 25, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@LudovicRousseau
Copy link
Contributor

I use the sample code https://github.com/ssenart/PyGazpar#library and it works fine.
The only problem is that I do not get any "temperature_degC" field.

I get:

[{'time_period': '15/01/2022',
  'start_index_m3': 86.0,
  'end_index_m3': 87.0,
  'volume_m3': 0.0,
  'energy_kwh': 5.0,
  'converter_factor_kwh/m3': 11.18,
  'type': 'Mesuré',
  'timestamp': '2022-01-25T21:13:48.897760'},
 {'time_period': '16/01/2022',
  'start_index_m3': 87.0,
  'end_index_m3': 87.0,
  'volume_m3': 0.0,
  'energy_kwh': 4.0,
  'converter_factor_kwh/m3': 11.18,
  'type': 'Mesuré',
  'timestamp': '2022-01-25T21:13:48.897760'},
 {'time_period': '17/01/2022',
  'start_index_m3': 87.0,
  'end_index_m3': 87.0,
  'volume_m3': 0.0,
  'energy_kwh': 3.0,
  'converter_factor_kwh/m3': 11.18,
  'type': 'Mesuré',
  'timestamp': '2022-01-25T21:13:48.897760'},
 {'time_period': '18/01/2022',
  'volume_m3': 0.0,
  'energy_kwh': 0.0,
  'type': 'Absence de Données',
  'timestamp': '2022-01-25T21:13:48.897760'},
 {'time_period': '19/01/2022',
  'end_index_m3': 88.0,
  'volume_m3': 0.0,
  'energy_kwh': 4.0,
  'converter_factor_kwh/m3': 11.18,
  'type': 'Mesuré',
  'timestamp': '2022-01-25T21:13:48.897760'},
 {'time_period': '20/01/2022',
  'start_index_m3': 88.0,
  'end_index_m3': 88.0,
  'volume_m3': 0.0,
  'energy_kwh': 4.0,
  'converter_factor_kwh/m3': 11.18,
  'type': 'Mesuré',
  'timestamp': '2022-01-25T21:13:48.897760'},
 {'time_period': '21/01/2022',
  'start_index_m3': 88.0,
  'end_index_m3': 89.0,
  'volume_m3': 0.0,
  'energy_kwh': 4.0,
  'converter_factor_kwh/m3': 11.18,
  'type': 'Mesuré',
  'timestamp': '2022-01-25T21:13:48.897760'},
 {'time_period': '22/01/2022',
  'start_index_m3': 89.0,
  'end_index_m3': 89.0,
  'volume_m3': 0.0,
  'energy_kwh': 4.0,
  'converter_factor_kwh/m3': 11.18,
  'type': 'Mesuré',
  'timestamp': '2022-01-25T21:13:48.897760'},
 {'time_period': '23/01/2022',
  'start_index_m3': 89.0,
  'end_index_m3': 89.0,
  'volume_m3': 0.0,
  'energy_kwh': 3.0,
  'converter_factor_kwh/m3': 11.18,
  'type': 'Mesuré',
  'timestamp': '2022-01-25T21:13:48.897760'}]

I modified the code to comment the line os.remove(filename) and open the fetched .xlsx file in LibreOffice.
To my surprise the column 8 labelled "Température locale (°C)" has no temperature values in the .xlsx file.

If I login to https://monespace.grdf.fr/ using a web browser and download the data I get an .xlsx file with correct values for "Température locale (°C)".

Did I miss something?

@ssenart
Copy link
Owner

ssenart commented Jan 26, 2022

Indeed.

What I observe when downloading from GrDF web site:

  • Downloading the Excel file using the default date range permits to get the temperature filled correctly. For example, today, the default date range is 26/01/2019 - 26/01/2022, and I get the temperature.
  • Downloading the Excel file using a custom (shorter than default) date range does not permit to get the temperature at all. For example, the custom date range 26/12/2021 - 26/01/2022 returns no temperature at all.

It is not a bug from PyGazpar, but an issue with the temperature availability at the source depending on the query we perform.

I tested that if you set lastNDays=1000, you will get the temperature with PyGazpar.

@LudovicRousseau
Copy link
Contributor Author

I tried with lastNDays=1000 but I then get:
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: https://monespace.grdf.fr/api/e-conso/pce/consommation/informatives/telecharger?dateDebut=2019-05-02&dateFin=2022-01-26&frequence=Journalier&pceList%5B%5D=252xxxxxxxx

Maybe I do not have enough data for my Gazpar in my history at GrDF?

With lastNDays=500 I get the same result as with lastNDays=100 I tried initially: no temperature_degC field.

It is not really a problem for me. I do not need the temperature.

I propose you to document that the temperature_degC field may not always be present because of a bug/limitation/feature on GrDF side.

@ssenart
Copy link
Owner

ssenart commented Jan 27, 2022

Did you try using the date range that permits to get temperatures from GrDF site ?

Yes, I could document all GrDF limitations, but lastly, there's too many instabilities. Sometimes, it even not possible to get data at all. Sometimes, querying the service leads to "Internal Server Error" and next query is fine. Also,there may be several days without any data updates, and one day all the missing updates are coming up in 3 times during a day.

I suggest to keep this discussion opened until the problem is solved on their side. It will act as a documentation.

Thanks for your interests in this !

@ssenart ssenart added the bug Something isn't working label Dec 11, 2022
@ssenart ssenart changed the title No temperature field available [Bug] No temperature field available Dec 11, 2022
@ssenart ssenart mentioned this issue Dec 16, 2022
@ssenart ssenart closed this as completed Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants