Coder Social home page Coder Social logo

home-assistant-gazpar's Introduction

Home Assistant GrDF Gazpar

$\text{\color{green}{!!! This library is working again. CAPTCHA has been removed !!!}}$

GrDF Gazpar integration permits to integrate in Home Assistant all your gas consumption data.

From version 1.2.0, it is compatible with Lovelace Garpar Card.

Lovelace Garpar Card

GrDF Gazpar custom component is using PyGazpar library to retrieve GrDF data.

Installation

Method 1 : HACS (recommended)

Follow the steps described below to add GrDF Gazpar integration with HACS:

  1. From HACS (Home Assistant Community Store), open the upper left menu and select Custom repositories option to add the new repo.

  2. Add the address https://github.com/ssenart/home-assistant-gazpar with the category Integration, and click ADD. The new corresponding repo appears in the repo list.

  3. Select this repo (this integration description is displayed in a window) and click on INSTALL THIS REPOSITORY button on the lower right of this window.

  4. Keep the last version and click the button INSTALL on the lower right.

  5. Do click on RELOAD button for completion! The integration is now ready. It remains the configuration.

Method 2 : Manual

Copy the gazpar directory in HA config/custom_components/gazpar directory.

Configuration

Add to your Home Assistant configuration.yaml:

sensor:
- platform: 'gazpar'
  name: 'gazpar'
  username: '***'
  password: '***'
  pce_identifier: 'xxxxxxxxx'
  tmpdir: '/tmp'
  scan_interval: '08:00:00'

'name' is the sensor name (only available from version 1.3.5-alpha.1). Its default value is 'gazpar'.

Do not use special characters in your password.

Ensure that tmpdir already exists before starting HA. It is used to store the downloaded Excel files from GrDF.

If using multiple accounts, you can specify them with the following syntax:

sensor:
- platform: 'gazpar'
  name: 'mygazpar'
  username: '***'
  password: '***'
  pce_identifier: 'xxxxxxxxx'
  tmpdir: '/tmp'
  scan_interval: '08:00:00'

- platform: 'gazpar'
  name: 'othergazpar'
  username: '***'
  password: '***'
  pce_identifier: 'xxxxxxxxx'
  tmpdir: '/tmp'
  scan_interval: '08:00:00'  

Restart your HA application. In HA development panel, you should see the new Gazpar entity 'sensor.gazpar' with its corresponding attributes:

  • sensor.gazpar:
attribution: Data provided by GrDF
username: [email protected]
pce: 123456789
unit_of_measurement: kWh
friendly_name: Gazpar
icon: mdi:fire
device_class: energy
state_class: total_increasing
errorMessages:
hourly: 
daily: 
- time_period: 07/10/2022
  start_index_m3: 15714
  end_index_m3: 15716
  volume_m3: 2
  energy_kwh: 21
  converter_factor_kwh/m3: 11.27
  type: Mesuré
  timestamp: '2022-10-09T20:59:12.356210'
- time_period: 06/10/2022
  start_index_m3: 15713
  end_index_m3: 15714
  volume_m3: 2
  energy_kwh: 17
  converter_factor_kwh/m3: 11.27
  type: Mesuré
  timestamp: '2022-10-09T20:59:12.356210'
...

weekly: 
- time_period: Du 03/10/2022 au 09/10/2022
  volume_m3: 9
  energy_kwh: 87
  timestamp: '2022-10-09T20:59:13.391911'
- time_period: Du 26/09/2022 au 02/10/2022
  volume_m3: 11
  energy_kwh: 132
  timestamp: '2022-10-09T20:59:13.391911'
...

monthly: 
- time_period: 'Octobre 2022 '
  volume_m3: 12
  energy_kwh: 119
  timestamp: '2022-10-09T20:59:14.447149'
- time_period: 'Septembre 2022 '
  volume_m3: 34
  energy_kwh: 409
  timestamp: '2022-10-09T20:59:14.447149'
...

yearly: 
- time_period: '2022'
  energy_kwh: 11958
  volume_m3: 1078
- time_period: '2021'
  energy_kwh: 23148
  volume_m3: 2099
- time_period: '2020'
  energy_kwh: 21160
  volume_m3: 1904

...

Home Assistant Energy module integration

You probably want to integrate GrDF data into the Home Assistant Energy module.

Dashboard

In Home Assistant energy configuration panel, you can set directly the sensor 'sensor.gazpar' in the gas consumption section.

I prefer using an alias for all my sensors so I keep control on the sensor naming. For that, I define a template and use the template sensor.gas_energy to configure the dashboard.

- sensor:
  - name: gas_energy
    unit_of_measurement: 'kWh'      
    state: >
      {{ states('sensor.gazpar') }}
    icon: mdi:fire
    device_class: energy
    state_class: total_increasing

For those who prefer to use the volume data instead of the energy (kWh) data, the following template can also be used:

- sensor:
  - name: gas_volume
    unit_of_measurement: ''
    state: >
      {{ state_attr('sensor.gazpar', 'daily')[0]['start_index_m3'] + state_attr('sensor.gazpar', 'daily')[0]['volume_
m3']}}
    icon: mdi:fire
    device_class: gas
    state_class: total_increasing

home-assistant-gazpar's People

Contributors

philippemezzadri avatar ssenart avatar vebryn avatar yoransys avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

home-assistant-gazpar's Issues

HTTP Error 500

I tried to make the integration worked but I face an issue :

'''
Logger: pygazpar.client
Source: /usr/local/lib/python3.10/site-packages/pygazpar/client.py:131
First occurred: 11:41:39 PM (1 occurrences)
Last logged: 11:41:39 PM

An unexpected error occured while updating the data
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/pygazpar/client.py", line 97, in __updateLiveMode
self.__login(session)
File "/usr/local/lib/python3.10/site-packages/pygazpar/client.py", line 143, in __login
response.raise_for_status()
File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: for url: https://login.monespace.grdf.fr/sofit-account-api/api/v1/auth

'''

I checked my username and password and it's all correct. The gazpar cyprieng integration worked well with the same username and password and I just used them to login to their website.

Error 404

Hi , the integration can't download the data.
The log:
Version
1.3.1
Username
[email protected]
Pce
.................
ErrorMessages
Failed to query PyGazpar library for frequency=daily. The exception has been raised: Traceback (most recent call last): File "/config/custom_components/gazpar/sensor.py", line 147, in update_gazpar_data client.update() File "/usr/local/lib/python3.10/site-packages/pygazpar/client.py", line 54, in update self.__updateLiveMode() File "/usr/local/lib/python3.10/site-packages/pygazpar/client.py", line 114, in __updateLiveMode self.__downloadFile(session, downloadUrl, self.__tmpDirectory) File "/usr/local/lib/python3.10/site-packages/pygazpar/client.py", line 167, in __downloadFile response.raise_for_status() File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://monespace.grdf.fr/api/e-conso/pce/consommation/informatives/telecharger?dateDebut=2019-11-21&dateFin=2022-11-20&frequence=Journalier&pceList%5B%5D=152531988682 , Failed to query PyGazpar library for frequency=weekly. The exception has been raised: Traceback (most recent call last): File "/config/custom_components/gazpar/sensor.py", line 147, in update_gazpar_data client.update() File "/usr/local/lib/python3.10/site-packages/pygazpar/client.py", line 54, in update self.__updateLiveMode() File "/usr/local/lib/python3.10/site-packages/pygazpar/client.py", line 114, in __updateLiveMode self.__downloadFile(session, downloadUrl, self.__tmpDirectory) File "/usr/local/lib/python3.10/site-packages/pygazpar/client.py", line 167, in __downloadFile response.raise_for_status() File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://monespace.grdf.fr/api/e-conso/pce/consommation/informatives/telecharger?dateDebut=2019-11-21&dateFin=2022-11-20&frequence=Hebdomadaire&pceList%5B%5D=152531988682 , Failed to query PyGazpar library for frequency=monthly. The exception has been raised: Traceback (most recent call last): File "/config/custom_components/gazpar/sensor.py", line 147, in update_gazpar_data client.update() File "/usr/local/lib/python3.10/site-packages/pygazpar/client.py", line 54, in update self.__updateLiveMode() File "/usr/local/lib/python3.10/site-packages/pygazpar/client.py", line 114, in __updateLiveMode self.__downloadFile(session, downloadUrl, self.__tmpDirectory) File "/usr/local/lib/python3.10/site-packages/pygazpar/client.py", line 167, in __downloadFile response.raise_for_status() File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://monespace.grdf.fr/api/e-conso/pce/consommation/informatives/telecharger?dateDebut=2019-11-21&dateFin=2022-11-20&frequence=Mensuel&pceList%5B%5D=152531988682
Hourly
Daily
Weekly
Monthly
Yearly

I see in the log the PCE number it is not the one I enter in configuration. Why?

Pat

Can't restart HA after installing Gazpar

Hi,
I install the module.
I modify my sensor configuration to add GRDF account.
I try to restart HA with this message :
The system cannot restart because the configuration is not valid: Platform error sensor.gazpar - Integration 'gazpar' not found.

HA version 2022.11.4

I uninstall the module. I remove all gazpar files and directory via ssh. And i have the same error.

Thanks per advance.

Component not working at HASS start - TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

Hello,

I just tried the component. It is a fresh install, it is the first time I try it. My hass version is 2022.12.1

The component is not loaded and I see the entries below in my log file:

Logger: homeassistant.loader
Source: custom_components/gazpar/util.py:26 
Integration: gazpar ([documentation](https://github.com/ssenart/home-assistant-gazpar), [issues](https://github.com/ssenart/ha-custom_components/issues)) 
First occurred: 15:34:02 (6 occurrences) 
Last logged: 15:39:21

Unexpected exception importing platform custom_components.gazpar.sensor
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/loader.py", line 728, in get_platform
    cache[full_name] = self._import_platform(platform_name)
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/loader.py", line 745, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/home/homeassistant/.homeassistant/custom_components/gazpar/sensor.py", line 13, in <module>
    from custom_components.gazpar.util import Util
  File "/home/homeassistant/.homeassistant/custom_components/gazpar/util.py", line 22, in <module>
    class Util:
  File "/home/homeassistant/.homeassistant/custom_components/gazpar/util.py", line 26, in Util
    def toState(pygazparData: dict[str, list[dict[str, Any]]]) -> float | None:
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

Any idea? Thank you

Besoin aide pour installation.

Bonjour.
Je débute dans la domotique et dans Home Assistant.
J'ai bien installé le module gazpar. Mais après je ne sais pas ce qu'il faut faire.
Je ne m'y retrouve pas dans l'aide fourni sur la page du code.
Je suis désolé de vous embêter.
Merci pour votre aide.

import manuel

Bonjour, serait il possible d'importer manuellement le fichier xls dans Home Assistant ?

ca ne me dérangerait pas de faire ça une fois par semaine en attendant la solution du captcha qui bloque !!

d'avance merci

Configuration validation hangs indefinitely

As soon as i add the gazpar platform in my configuration.yaml like the example (with my id of course), and I check configuration before restart, the check runs indefinitely.

Integration and restart via HACS is OK.
I am stucked in configuration steps, any idea what i missed ?

Erreur lors de la création de la configuration

Bravo pour ton développement. Je suis complètement nouveau sur HA et j'essaie de mettre en place cette intégration qui m'intéresse beaucoup.
Quand j'ajoute le bloc dans le fichier yaml, j'obtiens cette erreur :

Invalid config for [sensor.gazpar]: [name] is an invalid option for [sensor.gazpar]. Check: sensor.gazpar->name. (See ?, line ?).

J'ai dû faire une fausse manip mais je ne vois pas ce qui ne va pas

[Feature] TotalEnergies

Great job here !
Unfortunately, I'm a Totalenergies customer. I have access to my gas consumption threw the dedicated app, but I want to integrate it in Home Assistant.
Do you think it's possible to add a TotalEnergies connection to your project ?

Données de base bien reçues, mais aucune actualisation

Bonjour,
J'ai installé le module dans HACS, et la première synchronisation s'est bien faite. Mais depuis je ne reçoit plus de mise à jour.

Voila l'erreur que j'ai dans mes logs :

2024-05-11 15:13:00.329 ERROR (SyncWorker_6) [pygazpar.datasource] An error occurred while loading data. Retry in 3 seconds.
2024-05-11 15:13:06.589 ERROR (SyncWorker_6) [pygazpar.datasource] An error occurred while loading data. Retry in 3 seconds.
2024-05-11 15:13:13.894 WARNING (SyncWorker_6) [py.warnings] /usr/local/lib/python3.12/site-packages/pygazpar/datasource.py:469: UserWarning: Boolean Series key will be reindexed to match DataFrame index.
df = pd.concat([df[(df["count"] >= 7)], df.tail(1)[df["count"] < 7]])
2024-05-11 15:13:13.927 WARNING (SyncWorker_6) [py.warnings] /usr/local/lib/python3.12/site-packages/pygazpar/datasource.py:497: UserWarning: Boolean Series key will be reindexed to match DataFrame index.
df = pd.concat([df[(df["count"] >= 28)], df.tail(1)[df["count"] < 28]])
2024-05-11 15:13:13.951 WARNING (SyncWorker_6) [py.warnings] /usr/local/lib/python3.12/site-packages/pygazpar/datasource.py:528: UserWarning: Boolean Series key will be reindexed to match DataFrame index.
df = pd.concat([df[(df["count"] >= 360)], df.tail(1)[df["count"] < 360]])

Et voila ma configuration du sensor :

sensor:
  - platform: 'gazpar'
    name: 'gazpar'
    username: '[email protected]'
    password: 'passwordwithoutspecialcharacters'
    pce_identifier: '11111111111111'
    tmpdir: '/tmp'
    scan_interval: '08:00:00'

Je fait tourner HAOS sur un Pi5 avec l'intégration Gazpar mise via HACS en version 1.3.5

Merci pour votre aide

[Bug] gas_energy not showing in the energy dashboard

Only gas_volume is available in gaz energy dashboard

image

Logs shows :

Logger: homeassistant.components.sensor
Source: custom_components/gazpar/util.py:28
Integration: Capteur (documentation, issues)
First occurred: 23:07:27 (2 occurrences)
Last logged: 23:07:27

Error adding entities for domain sensor with platform gazpar
Error while setting up gazpar platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 789, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 583, in _async_write_ha_state
    state = self._stringify_state(available)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 551, in _stringify_state
    if (state := self.state) is None:
  File "/config/custom_components/gazpar/sensor.py", line 257, in state
    return Util.toState(self._dataByFrequency)
  File "/config/custom_components/gazpar/util.py", line 28, in toState
    dailyData = pygazparData[FrequencyStr.DAILY]
KeyError: <FrequencyStr.DAILY: 'daily'>

valeurs depuis utility meter erronées

Bonjour
Merci pour le travail effectué !! Je rencontre un soucis en créant des utility meter pour suivre la conso de gaz en kwh.
En effet quand je créé un utility meter ("gaz_in_kwh_daily" par exemple) que j'utilise sur un graph (apexchard-card ou minigraph-card) il m'affiche une valeur incohérente (6000 Kwh) pourtant sensor.gazpar est bien renseigné
Je précise que j'aimerais utiliser votre intégration en parallèle d'une autre intégration (avec branchement direct sur mon compteur gazpar) qui me fourni les données en m3
Merci

Sensor for m³ of gaz used

First of kudos for the project, it's exactly what I was looking for !

I was looking for the volume of gaz used, and found some comments in other issues about it, and I see that the following code

- sensor:
  - name: gas_volume
    unit_of_measurement: ''
    state: >
      {{ state_attr('sensor.gazpar', 'daily')[0]['start_index_m3'] + state_attr('sensor.gazpar', 'daily')[0]['volume_
m3']}}
    icon: mdi:fire
    device_class: gas
    state_class: total_increasing

has been removed from the README, is that because it's not recommended or because it's not working ?

Could the custom_component create a sensor without further configuration producing both a kWh sensor and a gaz volume sensor ?

Lack of precision

Hi,
I don't know whever it is a real issue but the precision of the energy meter in HA seems to be rounded at 1m^3
Consequently, I only have "peaks" few days a month. For instance in this caption, on august, a single peak equal to 11.9 kW since corresponding to 1m^3.
https://zupimages.net/up/22/34/qsrf.png

For the same period, When connected to the erdf website and accessing my own consumption, we clearly observe more precise values with dayly measurements with rounded at 1kWh (one more digit approximatively)

https://zupimages.net/up/22/34/oagj.png

So the question is : why is the gazpar HA integration less precise ?

[Bug] Error logged while HA is initializing

2022-11-26 11:03:37 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform gazpar
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 619, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 810, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 533, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 571, in _async_write_ha_state
state = self._stringify_state(available)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 539, in _stringify_state
if (state := self.state) is None:
File "/config/custom_components/gazpar/sensor.py", line 257, in state
return Util.toState(self._dataByFrequency)
File "/config/custom_components/gazpar/util.py", line 28, in toState
dailyData = pygazparData[FrequencyStr.DAILY]

No data

since the update I have no more data feedback and this error.
I have uninstalled and reinstalled the repository but nothing changes.

Do you know where this can come from?
Capture d'écran_20221201_204033

CAPTCHA WARNING !!!

Since this morning, CAPTCHA capture is required.

I don't know any workaround for that.

Lovelace card

Thank you for such a great integration!

Would be so cool to have a lovelace card similar to what has been done on Linky electricity consumption. What do you think?

Unit issue : Wh instead of kWh

The main sensor gazpar states a unit as kWh but displays values over 100,000.00 which is definitely Wh. I compared by going into the GRDF website and indeed gazpar is collecting Wh.
Screenshot_2022-12-15-08-45-17-24_c3a231c25ed346e59462e84656a70e50

gazpar still working with HA udate 2022.11.3?

Hi,

first of all, thanks a lot for this integration. I had integrated this into my HA setup two weeks ago, and it worked fine until some days ago. The sensor.gazpar just disappeared - latest available gas data in the energy board was as of 14/11/22.

I than reinstalled the gazpar integration with then new 1.1.6 update some some minutes ago but again, HA is not showing the sensor.gazpar. I even added the ', which apparently are required now for the config file (which you updated in the latest readme file).

As I don't know, where to look elsewhere, I was wonderting if there have been any changes in HA 2022.11.3 (which I updated also some days ago), which may stop gazpar to work?

I'm greatful for any hints to make it working again.

thanks in advance !

[Issue] Energy Dashboard - Unit error - Regression in HA 2022.11

Just to says i have a unit error in energy panel configration :
Unité de mesure inattendue
Les entités suivantes n'ont pas les unités de mesure attendues (Wh, kWh, MWh ou GJ pour un capteur d'énergie ; m³ ou ft³ pour un capteur de gaz) :
sensor.gazpar (kWh)

Je n'arrive pas à télecharger mes données depuis le site de GRDF, error dans les logs

Bonjour,
je viens d'installer le plugin dans mon home assistant tournant sur docker.

j'ai ajouté le repo dans HACS

j'ai ajouté le code suivant dans mon fichier de config :

sensor:
- platform: 'gazpar'
  username: 'djf********com'
  password: 'Q******g'
  pce_identifier: '121 *** *** *** 91'
  tmpdir: '/tmp'
  scan_interval: '08:00:00'

J'ai créé un dossier /tmp a la racine de mon conteneur pour stocker les csv téléchargés, mais j'ai toujours la même erreur apres redémarrage :

2023-01-17 17:15:45.923 ERROR (SyncWorker_3) [pygazpar.client] An unexpected error occured while loading the data
Traceback (most recent call last):
File "/config/.local/lib/python3.10/site-packages/pygazpar/client.py", line 52, in loadDateRange
res = self.__dataSource.load(pceIdentifier, startDate, endDate, frequencies)
File "/config/.local/lib/python3.10/site-packages/pygazpar/datasource.py", line 57, in load
self._login(session, self.__username, self.__password)
File "/config/.local/lib/python3.10/site-packages/pygazpar/datasource.py", line 92, in _login
raise Exception(loginData["error"])
Exception: UNKNOWN_LOGIN
2023-01-17 17:15:45.929 ERROR (SyncWorker_3) [pygazpar.client] An unexpected error occured while loading the data
Traceback (most recent call last):
File "/config/.local/lib/python3.10/site-packages/pygazpar/client.py", line 39, in loadSince
res = self.loadDateRange(pceIdentifier, startDate, endDate, frequencies)
File "/config/.local/lib/python3.10/site-packages/pygazpar/client.py", line 52, in loadDateRange
res = self.__dataSource.load(pceIdentifier, startDate, endDate, frequencies)
File "/config/.local/lib/python3.10/site-packages/pygazpar/datasource.py", line 57, in load
self._login(session, self.__username, self.__password)
File "/config/.local/lib/python3.10/site-packages/pygazpar/datasource.py", line 92, in _login
raise Exception(loginData["error"])
Exception: UNKNOWN_LOGIN
2023-01-17 17:15:45.935 ERROR (SyncWorker_3) [custom_components.gazpar.sensor] Failed to query PyGazpar library. The exception has been raised: 0

Merci pour ton aide et ton code ;)

404 Client error

Hello,

Tout d'abord merci d'avoir ouvert ce projet et de continuer à le maintenir! En essayant de le configurer j'ai du mal à comprendre le message d'erreur suivant. Et tout particulièrement pourquoi le script tente d'accéder à https://monespace.grdf.fr/api/e-conso/pce/consommation/informatives/telecharger?dateDebut=2019-11-14&dateFin=2022-11-13&frequence=Journalier&pceList%5B%5D=492027451523 alors que 492027451523 ne correspond pas à mon PCE renseigné dans pce_identifier du sensor.

Pourriez vous m'aider à diagnostiquer d'où peut venir l'erreur?

Merci d'avance

 Failed to query PyGazpar library for frequency=daily. The exception has been raised: Traceback (most recent call last):
  File "/config/custom_components/gazpar/sensor.py", line 147, in update_gazpar_data
    client.update()
  File "/usr/local/lib/python3.10/site-packages/pygazpar/client.py", line 58, in update
    self.__updateLiveMode()
  File "/usr/local/lib/python3.10/site-packages/pygazpar/client.py", line 118, in __updateLiveMode
    self.__downloadFile(session, downloadUrl, self.__tmpDirectory)
  File "/usr/local/lib/python3.10/site-packages/pygazpar/client.py", line 158, in __downloadFile
    response.raise_for_status()
  File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://monespace.grdf.fr/api/e-conso/pce/consommation/informatives/telecharger?dateDebut=2019-11-14&dateFin=2022-11-13&frequence=Journalier&pceList%5B%5D=492027451523
, Failed to query PyGazpar library for frequency=weekly. The exception has been raised: Traceback (most recent call last):
  File "/config/custom_components/gazpar/sensor.py", line 147, in update_gazpar_data
    client.update()
  File "/usr/local/lib/python3.10/site-packages/pygazpar/client.py", line 58, in update
    self.__updateLiveMode()
  File "/usr/local/lib/python3.10/site-packages/pygazpar/client.py", line 118, in __updateLiveMode
    self.__downloadFile(session, downloadUrl, self.__tmpDirectory)
  File "/usr/local/lib/python3.10/site-packages/pygazpar/client.py", line 158, in __downloadFile
    response.raise_for_status()
  File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://monespace.grdf.fr/api/e-conso/pce/consommation/informatives/telecharger?dateDebut=2019-11-14&dateFin=2022-11-13&frequence=Hebdomadaire&pceList%5B%5D=492027451523
, Failed to query PyGazpar library for frequency=monthly. The exception has been raised: Traceback (most recent call last):
  File "/config/custom_components/gazpar/sensor.py", line 147, in update_gazpar_data
    client.update()
  File "/usr/local/lib/python3.10/site-packages/pygazpar/client.py", line 58, in update
    self.__updateLiveMode()
  File "/usr/local/lib/python3.10/site-packages/pygazpar/client.py", line 118, in __updateLiveMode
    self.__downloadFile(session, downloadUrl, self.__tmpDirectory)
  File "/usr/local/lib/python3.10/site-packages/pygazpar/client.py", line 158, in __downloadFile
    response.raise_for_status()
  File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://monespace.grdf.fr/api/e-conso/pce/consommation/informatives/telecharger?dateDebut=2019-11-14&dateFin=2022-11-13&frequence=Mensuel&pceList%5B%5D=492027451523

revoir la déclaration du scan_interval

Hello,

Les données horaires ne sont pas supportées. Le scan_interval a-t'il un intérêt à être positionné manuelement par l'utilisateur ?

Nous pourrions positionner une valeur en dur à 1 journée de sorte à ne poller l'api qu'une fois par jour.

Des avis ?

Merci

Energy dashboard

Hi :-)
First of all, thanks again for this great custom component, it is very useful and I see great potential in it.
I tried to integrate the gas consumption using gas_energy but it stays to zero even though the state of this sensor is not equal to zero. When I try with total_gas_energy, it says that this is not a statistics sensor. Any clue on how to solve it?
Also, I don't know if it's easy, but the enedis custom component has included everything and it automatically generates a sensor for the energy dashboard. Just saying, of course ;-)

Date prise en compte sur le dashboard

Bonjour,

Tout d'abord merci pour ce composant, super utile !
Je me posais la question de savoir s'il était possible dans le dashboard d'Energie de HomeAssistant de respecter la date associée aux valeurs.
Il y a en effet un délai entre les données renvoyées par Grdf et la date du jour. Cette date est bien prise en compte dans la carte custom, mais dans le tableau de bord Energie HomeAssistant, celui-ci semble penser que la dernière valeur est la valeur du jour (alors qu'elle peut dater de 2 ou 3 jours en fonction de Grdf).

required key 'platform' not provided on the cumulative sensor

Bonjour,

Je viens d'installer l'intégration et elle fonctionne très bien. Mon soucis est dans le senseur cumulatif. J'ai mis celui précisé dans la documentations :

- name: gas_energy
    unit_of_measurement: 'kWh'      
    state: >
      {{ states('sensor.gazpar') }}
    icon: mdi:fire
    device_class: energy
    state_class: total_increasing

Mais à son chargement, je reçoit l'erreur required key 'platform' not provided

Merci pour votre aide

Price tag

Would be great to have the cost related to the gaz consumption. Is there a way to do it?

L'intégration ne fonctionne pas

Hello,

J'ai effectué l'installation de l'intégration via HACS comme proposé et malgré ma configuration :

#gazpar
  - platform: gazpar
    username: !secret gazpar.username
    password: !secret gazpar.password
    pce_identifier: !secret gazpar.pce
    tmpdir: /tmp
    scan_interval: 08:00:00

J'ai cette erreur :

Failed to query PyGazpar library. The exception has been raised: 0

J'ai essayé de retélécharger l'intégration mais rien ne change après un redémarrage.
Une idée ?

Import historical data?

Hi,

Is there a way to import all historical data from grdf website to home assistant?

Regards,

[Feature] Renseigner plusieurs PCE

Bonjour, tout d'abord merci pour votre travail, j'ai enfin un sensor qui me remonte correctement les informations et les affiche de fort belle manière. Je n'ai rencontré aucun bug, je voulais juste savoir s'il était possible de suivre plusieurs PCE, j'aimerai aussi surveiller la consommation de gaz de ma fille étudiante :).
Merci encore pour ce super boulot

Problème 404 d'URL

bonjour,

Le plugin ne fonctionne pas.
L'url semble erronée. Elle drait être :
https://monespace.grdf.fr/api/e-conso/pce/consommation/informatives?dateDebut=-------

Cette erreur provient d'une intégration personnalisée

Logger: custom_components.gazpar.sensor
Source: custom_components/gazpar/sensor.py:154
Integration: gazpar (documentation, issues)
First occurred: 12:10:36 (1 occurrences)
Last logged: 12:10:36

Failed to query PyGazpar library with exception : Traceback (most recent call last): File "/config/custom_components/gazpar/sensor.py", line 142, in update_gazpar_data client.update() File "/usr/local/lib/python3.9/site-packages/pygazpar/client.py", line 57, in update self.__updateLiveMode() File "/usr/local/lib/python3.9/site-packages/pygazpar/client.py", line 115, in __updateLiveMode self.__downloadFile(session, downloadUrl, self.__tmpDirectory) File "/usr/local/lib/python3.9/site-packages/pygazpar/client.py", line 155, in __downloadFile response.raise_for_status() File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 960, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://monespace.grdf.fr/api/e-conso/pce/consommation/informatives/telecharger?dateDebut=2022-06-01&dateFin=2022-07-01&frequence=Journalier&pceList%5B%5D=xxxxxxxxxxxxxx

Gazpar integration Home Asssitant Issue.

Hi all

When i add custom parameter to configuration.yaml in order to activate sensor for gazpar integration, i have an error when i wanted to restart home assistant, hoem assitant refuse to reboot because config file is not OK.

configuration.yaml add:

sensor:

  • platform: 'gazpar'
    name: 'gazpar'
    username: !secret gazpar.username
    password: !secret gazpar.password
    pce_identifier: '193XXXXXXXX'
    tmpdir: '/tmp'
    scan_interval: '08:00:00'

Logger: homeassistant.components.hassio
Source: components/hassio/init.py:518
Integration: Home Assistant Supervisor (documentation, issues)
First occurred: 13:37:01 (1 occurrences)
Last logged: 13:37:01

The system cannot restart because the configuration is not valid: Invalid config for [sensor.gazpar]: [name] is an invalid option for [sensor.gazpar]. Check: sensor.gazpar->name. (See ?, line ?).

information about my config:

Home Assistant 2022.12.8
Supervisor 2022.12.1
Operating System 9.4
Interface utilisateur : 20221213.1 - latest

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.