maorcc / citymind_water_meter

Home Assistant Integration with cp.city-mind.com, an Israeli water meters reading service
Apache License 2.0
41 stars 2 forks source link

New website #28

Closed eyalcha closed 2 years ago

eyalcha commented 2 years ago

Is the change in Arad website(read your meter pro) has influence on this integration?

https://rym-pro.com/#/

elad-bar commented 2 years ago

Working for me

eyalcha commented 2 years ago

@elad-bar yes, I have tried it and it also works for me, but maybe it is because the old website is still up (https://cp.city-mind.com/Login.aspx).

שימו לב: היישומון הקודם ימשיך לעבוד עד לתאריך 31.12.2022

nitaybz commented 2 years ago

I can't use the integration because I'm a new user that can only login to their newer website, I don't have account on the old website and I believe this integration works on the old website...

@eyalcha is your previous integration support the new website?

nitaybz commented 2 years ago

I just investigated on their website and it seems pretty much straight forward... you have one simple call for login: https://api.city-mind.com/consumer/login with body: {"email":"user@gmail.com","pw":"password","deviceId":"anything_can_be_here"}

this retrieves a token that you can use in any other call later on (doesn't seem to have expiration date)

example call for daily consumption: https://api-ctm.city-mind.com/consumption/daily/lastbillingCycle/%20%20%20%201625/2022-09-10/2022-10-11

you need to add the token from the login call and add is as a "x-access-token" header.

hope it will help to speed things up :) Thanks

elad-bar commented 2 years ago

@nitaybz thanks for the details, I will try working during the weekend, I didn't manage to register to their platform, hope that by the weekend it will work for me, saw that they have changed the code to be a real web API so hopefully we will be able to integrate the component much better than what we have right now

elad-bar commented 2 years ago

I have fully reviewed the API, It has potential for many features on top of what available today like multiple meters, define and read alerts

Will start working on it later today or tomorrow.

GalKar83 commented 2 years ago

@elad-bar It seems as if you register through the new website (rym-pro.com) and you don't have a user for the old website the username & password isn't recognized. Is there any chance you make the required adjustments for the new website?

elad-bar commented 2 years ago

thanks, as I wrote before I have mapped all the API (and also reintegrate the API), it's only because I managed to login, the only thing left to do is:

hope that by end of the day i'll have new release working with the new API

thanks

elad-bar commented 2 years ago

integration almost ready, need to check and fix the update alerts (already read them and have select, but update is not working yet)

image

elad-bar commented 2 years ago

integration is in PR: https://github.com/maorcc/citymind_water_meter/pull/29

GalKar83 commented 2 years ago

@elad-bar Thanks for updating the integration, I can confirm it works for me now. However I tried to use the recommended Lovelace Mini Graph Card and it seems as if I don't get any information from the suggested URL ('https://cp.city-mind.com/Default.aspx') even after adding the water meter serial number. Is there any chance there is a new URL that will work for me?

elad-bar commented 2 years ago

Not sure i understand the question, site you have mentioned is the deprecated one, in v2 we are not using it anymore

GalKar83 commented 2 years ago

In the documentation you mentioned the recommended option to add Mini graph card and you added the script needed for it to work. However, the URL weblink still pointing to the old website and therefore I'm not getting the graphs. I'm guessing that by changing the weblink it can work and wonder what's the proper URL address.

elad-bar commented 2 years ago

Ah... right, we need to update the documentation

GalKar83 commented 2 years ago

@elad-bar Can you please share the right URL in the meantime?

elad-bar commented 2 years ago

Available in the first post

GalKar83 commented 2 years ago

If you mean: https://rym-pro.com/#/

Then it's not working for the Mini Graph Card.

elad-bar commented 2 years ago

Do you mean:

- type: weblink
    url: 'https://cp.city-mind.com/Default.aspx
GalKar83 commented 2 years ago

Yes Screenshot 2022-10-18 090019

elad-bar commented 2 years ago

v2.0.2 released

Updated documentation and better failed login error handling

Breaking Change - v1 to v2

Version 1.x of integration created to support cp.city-mind.com portal, this portal is end of life set to 31/12/2022.

Version 2.x of integration is to support the new portal of Read Your Meter Pro, Please note that if credentials for 2 portals are different and requires registration, Please follow the prerequisites section below to make sure the integration will work for you.

If your city is not supported by new Read Your Meter Pro portal, you can keep using v1.x of integration up until the previous portal is EOL.

elad-bar commented 2 years ago

Yes Screenshot 2022-10-18 090019

if you meant for the errors in card, that's not related to the URL, that's because the name of the entities changed, you need to find them and update accordingly, the card was not created by us, it's just an example how to use it.

As for the URL, just replace it and it will redirect to the new portal.

GalKar83 commented 2 years ago

Indeed the (Read)ing (in the entity name) made the difference. Thanks, working as expected:-)

elad-bar commented 2 years ago

Indeed the (Read)ing (in the entity name) made the difference. Thanks, working as expected:-)

great, thanks for the update :)

elad-bar commented 2 years ago

can we close this issue? will create later this evening a thread in home-assistant forum, we can also have a discord channel if you would like, just let me know what you prefer

GalKar83 commented 2 years ago

Yes, you can close the issue. Many thanks for you support and effort.

elad-bar commented 2 years ago

thanks!

nitaybz commented 2 years ago

Thank you very much :)