ooii / pySuez

Get your water consumption data from your Suez account (www.toutsurmoneau.fr)
Apache License 2.0
8 stars 12 forks source link

List of sub-providers (inputs needed) #26

Open ooii opened 8 months ago

ooii commented 8 months ago

Hi, Please use this issue to provide me with the list of sub-providers. To get yours, go to your Suez account. Once connected, you should see your dashboard. The URL should be something like https://www.toutsurmoneau.fr/mon-compte-en-ligne/tableau-de-bord. Please provide me with the first part of this url.

Up to now, I have the following:

Kelesis commented 8 months ago

Hi @ooii , maybe you should have a look at @ybizeul PR #18 which finally managed to resolve this problem without having to configure any sub provider base URL, just by allowing redirection during the POST resquest.

Thank you for your time

ooii commented 8 months ago

Thanks @Kelesis for pointing me to this PR, it's now merged. Can someone with another provider than toutsurmoneau test with the new pysuez library please?

ybizeul commented 7 months ago

I thought it’d never happen 😂 Thanks man for getting around to it. My internet is down for 10d now, I’ll give it a shot with SEOP (but it was working)

« Il a free, il a tout compris. »

ooii commented 7 months ago

Sorry but I'm really busy with other stuff (et la dernière mise à jour d'AppDaemon qui a tout cassé dans mon chauffage et qui me fait perdre ma soirée).

jiquem commented 7 months ago

Hello, In Orléans, once logged on on toutsurmoneau.fr, I am redirected to https://www.orleanaise-des-eaux.fr/mon-compte-en-ligne/tableau-de-bord

ooii commented 7 months ago

Can you test with the new library and report if it's working or not?

jiquem commented 7 months ago

It's not working. I've got this error message:

$python3 ./.local/bin/pysuez -u email@gmail.com -p 'password' -c counterID
list index out of range

With a wrong password:

$python3 ./.local/bin/pysuez -u email@gmail.com -p 'wrong_password' -c counterID
Issue with yesterday data

With a wrong counter ID:

$python3 ./.local/bin/pysuez -u email@gmail.com -p 'password' -c wrong_counterID
list index out of range
ooii commented 7 months ago

Hi, On my side, it's still working. Would you like to share your login/password with me to check what's going on?

jiquem commented 7 months ago

Hello How can I provide them to you ?

Kelesis commented 7 months ago

Hi @ooii , it's now working again in home assistant, which has been updated. No need for me to patch anymore after each update 🙂

But ... not everytime the script is being run and I know why : sometime the token itself contains special characters (we can think about it as utf-8 encoding inside utf-8 encoding)

We can fix that by changing one line : Change this line token = result.group(1) into this one token = result.group(1).encode().decode('unicode_escape')

I have been using this for one year now and it's working everytime. Sorry I can't propose MR since I don't have any computer around.


Also I found another issue, not so bothering, which I have not tried to fix in my patch (made from an Android Phone anyway 😅) When reaching each first day of a month, the logic to compute yesterday date is not always fixing the delay for data to be available .. so sometimes there is no data when begining a new month.

ybizeul commented 5 months ago

Seems to be working here, the only thing is that state_class: total_increasing is missing from the entity. Without it, the sensor cannot be added to energy dashboard.

https://github.com/home-assistant/core/issues/107858#issuecomment-1888862235