Suez Water integration reporting problem

Bonjour,
J’ai la même erreur que @rachid596, en ayant récupéré le counter_id comme indiqué dans la doc.
Le suivi par jour est bien activé sur le site toutsurmoneau.

@Jo_Gasquette, pour récupérer le counter_id, il faut aller sur la page de suivi de ta consommation sur le site toutsurmoneau, puis faire clic droit, afficher le code source. Ensuite recherche sur mdata, tu devrais trouver quelque chose comme :
url: '/mon-compte-en-ligne/statMData' + '/123456789'
Le counter_id est 123456789

Salut, désolé pour le retard.
Non je n’ai pas le suivi heure par heure mais plutôt jour par jour.

Grâce à @mims455 j’ai réussi à avoir mon conter id mais toujours la même erreur.

Merci beaucoup pour votre aide

Merci
J ai maintenant bien le counter id
Est ce que l Username est bien la dresse email de connexion ?

Hier, le site ne marchait pas mais aujourd’hui si.
Le problème vient (au moins) de la librairie pysuez. Il faut que je m’en occupe. Désolé pour ce soucis. Je vous tiens au courant dès que c’est réglé.

Je me suis trompé, je n’ai pas le suivi heure par heure non plus mais seulement jour par jour.

Oui.

Merci beaucoup. Je

Hi everyone,
I have done pretty much the same thing than dede34, setting up the configuration.yaml file with

  - platform: suez_water
    username: !secret suez_username
    password: !secret suez_password
    counter_id: !secret suez_counter_id

However the error I got is a bit different :slight_smile:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 178, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/suez_water/sensor.py", line 39, in setup_platform
    if not client.check_credentials():
  File "/usr/local/lib/python3.7/site-packages/pysuez/client.py", line 192, in check_credentials
    self._get_token()
  File "/usr/local/lib/python3.7/site-packages/pysuez/client.py", line 55, in _get_token
    self._token = result.group(1)
AttributeError: 'NoneType' object has no attribute 'group' 

well, it is maybe Suez API that is not responding, I am not sure…
the thing is also that I can not access my data on my toutsurmoneau account on the website:

Aucune consommation n’a été enregistrée sur cette période.
Pour information, les données télérelevées ne sont disponibles qu’à partir du mois suivant l’emménagement.

I am pretty sure I could access these data before
Any guesses?

It happens that Suez API does not respond but the problem currently is because of pysuez, the library responsible of fetching data used by the integration. I’ll be trying to fix the issue in the next couple of days.

The issue has been fixed in the library. I’m updating the integration then I’ll make a PR. Hope to have it in the next 0.113 release.

1 Like

Sorry, I left for vacation before fixing that :slight_smile:
Hope to have it soon.

Edit: The PR has been submitted and is waiting for approval. Maybe next 0.114 release or 0.115.
Edit: Pull request successfully merged and closed. Maybe in 0.114.3

Great, thanks for the fix ! It looks like it has not been released yet, (v.0.114.3), I will check the next one.

Not in .4 neither :slight_smile:

@radar, is it the change?

Yes absolutely :slight_smile:
But I had to update the library (a very minor update) too.

0.115, I confirm it is fixed.

Does anyone have a custom lovelace card for this sensor :slight_smile: ?

Yes, thanks :slight_smile:

I don’t. Actually, data is updated once a day or even the day after or 2 days after. For instance, you gather today data from 2 or 3 days ago. With the consumption of d-1 (or d-2 or d-3), you also grab the history as attributes. And I can’t know how to use the attributes to populate database of previous days. I think we should write directly into the database but I’m not sure this is appropriate.

Hi Everyone, I have Suez water in NY USA. is there any way to use this integration to track my water usage? It looks like the URL is different but im guessing the API calls would be similar: https://www.mysuezwater.com/user/login

Thank you for the great work!

Could you please paste the source code of the login page?

Sure: <!DOCTYPE html><!-- saved from url=(0038)https://www.mysuezwater.com/user/logi - Pastebin.com

Hi @ElPepo,

Thanks for that. Actually, the urls are different, so the integration cannot work as it is.
I need a working account (login/password) just to check if the same code may work or not, with no guarantee. Also, I’m a little bit busy currently so I can’t spend a lot of time on it.

Hello,

Sorry to dig this issue out but I’m having a problem getting the integration to work, I’m getting the same error as some of the guys above have mentioned, here the error in the logs:

Source: components/suez_water/sensor.py:77
Integration: Capteur (documentation, issues)
First occurred: 23:02:34 (1 occurrences)
Last logged: 23:02:34

suez_water: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 431, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 684, in async_device_update
    await task
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/suez_water/sensor.py", line 113, in update
    self._fetch_data()
  File "/usr/src/homeassistant/homeassistant/components/suez_water/sensor.py", line 77, in _fetch_data
    self.client.update()
  File "/usr/local/lib/python3.9/site-packages/pysuez/client.py", line 234, in update
    self._fetch_data()
  File "/usr/local/lib/python3.9/site-packages/pysuez/client.py", line 111, in _fetch_data
    self.state = int(float(data.json()[int(
IndexError: list index out of range

I’m running HA latest version on a raspberry pi 4

Not sure what I’m doing wrong here, so would appreciate if anyone could shed some light that could lead me to solve this.

Thanks