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

Incorrect base URI for sub-providers #16

Open
Kelesis opened this issue Jul 9, 2022 · 7 comments
Open

Incorrect base URI for sub-providers #16

Kelesis opened this issue Jul 9, 2022 · 7 comments

Comments

@Kelesis
Copy link

Kelesis commented Jul 9, 2022

Since fews years Suez has begun (maybe by law) to delegate water distribution to local sub providers.
When this happens, everything works the same way, but the base URI might change according to the sub provider one.
If not doing so, a call to the API might result into the error message "Issue with yesterday data" or something so.

Looking at the code I see this issue has already been met by some users and the 2 following lines have been added to client.py
(line ~45)

   if self._provider == "Eau Olivet":
        BASE_URI = 'https://www.eau-olivet.fr'

Now for my special case, everything is working fine if we add the 2 new following lines

  if self._provider == "Whatever name I pass to -P option"
        BASE_URI = 'https://eaudubaslanguedoc.toutsurmoneau.fr'

So I think there are or there will be many other cases in the future so can we imagine the following addition ?
- Add a new command line option let's say "-b" (for base URI) and having the ability to directly override the default one
This way it could leave a chance for users in this case to use this wonderful project ;)

So in my case I could call pysuez -u '[email protected]' -p 'topsecretpassword' -b 'https://eaudubaslanguedoc.toutsurmoneau.fr'

=> And after that, add this new option to the home assistant Lovelace Sensor ^^' (Because yes .. this is my final goal ! :)

I'm sorry could have done un pull request myself, but my computer just died ... (to much coding I guess) and my work computer, which I use to write this, do not let me access github ...

Anyway have a nice day and thank you for this useful work
Stéphane

@ybizeul
Copy link
Contributor

ybizeul commented Dec 16, 2022

Same here, in Le Chesnay, www.seop.fr works the same way. I'll work on a PR and hopefully this can be integrated so Home Assistant plugin in my case can be updated as well

@laurent-martin
Copy link

You can try to use this other package:
https://pypi.org/project/toutsurmoneau/

It supports providing the url on command line.

@ybizeul
Copy link
Contributor

ybizeul commented Mar 6, 2023

Problem is projects like Home Assistant are still referring to the other project.
I've made this PR but the project seems to be dead #18

Setting the URL manually seems to be a user overhead and not necessary from what I gathered

@laurent-martin
Copy link

Yes ... I am aware of this...
(I use home assistant as well, and I think this module is basically mainly used by H.A. ..)
I try to figure out if Farid, the author still maintains this or not...
If not I have proposed to replace this module in H.A., but Frenck from H.A. is a little reluctant unless we are sure this module is no more maintained...
see home-assistant/core#88328

Also, I am preparing either a new integration, or improvement of "suez_water" that will have a proper configuration flow.

Note also that toutsurmoneau can automatically figure out the meter identifier... no need to fiddle with the web page source.

@ybizeul
Copy link
Contributor

ybizeul commented Mar 6, 2023

Excellent, if you can just add the follow redirect so we don't have to set the provider URL, that would be golden !
Looks like Frenck is in a good mood... I tried to weigh in and didn't have much success, he's waiting for your answer

@Kelesis
Copy link
Author

Kelesis commented Mar 6, 2023

Excellent news! I'm using HA as well and made a script to auto patch it each time an update is coming :'( 🐖
I was thinking about forking the original project but toutsurmoneau is just perfect!
Hope Frenck will be ok to use your module 🤞
Thank you for your work

@ooii
Copy link
Owner

ooii commented Oct 30, 2023

Guys,
I'm sorry for not responding to these issues. I was very busy with other stuff and, to be honest, the integration was not satisfactory for me, so I stopped using it (and looking to this repo). I got some complaints recently and decided to give a look and discovered all these issues.
I'll try to bring a new and better integration that takes into consideration all the issues and sub-providers, and I'll try to make it doable from the UI. Please, be patient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants