fdebrus / hayward-ha

10 stars 1 forks source link

logincredentials not working #1

Closed Hans1205 closed 4 months ago

Hans1205 commented 4 months ago

Although I can sign in to these websites:

the credentials do not work in the Aquarite integration.

Errormessage: "Unknown error occurred"

What am I doing wrong?

keteflips commented 4 months ago

Same problem here

fdebrus commented 4 months ago

Works for me, I've just deleted my pool and re-create without issue. When do you get "Unknown error occurred" right after inputing your credentials ? you do not get a screen selection for your pool ?

so before or after this screen ?

image

fdebrus commented 4 months ago

Try to revert to previous version see if it resolve your problem and keep me posted. the latest has some code that tries to managed the 401 (token expiration) but it's not working yet.

Current way of thinking is that you can't refresh the token as we do not know the clientid and clientsecret, best way forward is to trigger a re-login when token expire not a token refresh.

I need more time to code, given the holiday period is coming in my area, I will be away for 3 weeks.

Hans1205 commented 4 months ago

Works for me, I've just deleted my pool and re-create without issue. When do you get "Unknown error occurred" right after inputing your credentials ? you do not get a screen selection for your pool ?

so before or after this screen ?

image

I get this error directly after entering the credentials and before the Pool selection screen

Hans1205 commented 4 months ago

Try to revert to previous version see if it resolve your problem and keep me posted. the latest has some code that tries to managed the 401 (token expiration) but it's not working yet.

Current way of thinking is that you can't refresh the token as we do not know the clientid and clientsecret, best way forward is to trigger a re-login when token expire not a token refresh.

I need more time to code, given the holiday period is coming in my area, I will be away for 3 weeks.

I tried it just right now with 0.0.5.3 and it works ...

Thank you and have a nice holiday

fdebrus commented 4 months ago

Nice, it was the introduction of the code that manages the pool list for accounts having mutiple pools. I just fixed it in 0.0.5.3.

401 and token refresh is still not fixed, so the integration will stop accepting commands after 1hr (Token expiration time).

If someone wants to look at ? What I will try as time allow is to re-login when a command gets a 401

folke commented 4 months ago

The token refresh code doesn't work right now, since request_url is not defined here

As a result, my logs get spammed with this error, which quickly leads to my HA disk getting full (over 25GB of logging data).

I'll see if I can work on a fix.

Either way, thank you for making this component and enjoy your vacation!

fdebrus commented 4 months ago

Thank you, I focussed on the integration and entities for HA. signin and refresh need a full rework, it can be that there is some left over of retry on error, code that make no sense and can be removed.

I've limited knowledge on google API, but I trust we can't refresh token without proper clientid and secret, so re-login shall be the way forward. let's discuss it in the dedicated issue tracker https://github.com/fdebrus/hayward-ha/issues/3

I will close this one, as initial load of pool is resolved for now.