yo-han / Home-Assistant-Carelink

Unofficial Home Assistant Carelink Component
MIT License
19 stars 8 forks source link

Login error #55

Closed arnoakavdb closed 3 months ago

arnoakavdb commented 4 months ago

Hello, I did the last update yesterday and it break my integration.I try to reconnect with no luck ,I try also to go back to the last update from 2023 I'm always facing login error from now.i don't know if Medtronic change something to connect but for me it doesn't work anymore.

arnoakavdb commented 4 months ago

i've just see that i can't downgrade to old version , if i select version from 2013 it will download the version of 2014

yo-han commented 4 months ago

I do not see any issues on my end. From what version did you update? In the last version stuff changed a lot. If you're upgrading from an older version you maybe need to logout and in again with the new session token option. If not, maybe you can add a some entries from the logs?

arnoakavdb commented 4 months ago

I come from the last version of 2023 with the access token already, everything was fine and after update and reboot my integration was in error so I try to delete it and recreate it but I'm always facing login error.if I uninstall with hacs and try to reinstall it directly install 2024 instead of the one I select(2013).when I go back home I'll enable log and share them here

sedy89 commented 4 months ago

I am currently checking a few things. There might be an issue with the refresh token process where it fails to create the very first new token. I also think that I know which lines are causing this problem. But I will check it locally for a while before I create another PR, since I don't want to break your setup (again). Hopefully it will be stable afterwards

sedy89 commented 4 months ago

Hello, I did the last update yesterday and it break my integration.I try to reconnect with no luck ,I try also to go back to the last update from 2023 I'm always facing login error from now.i don't know if Medtronic change something to connect but for me it doesn't work anymore.

just to clarify... are you able to setup the integration again with a new and valid token and it is running for a while? otherwise we are talking about different things..

arnoakavdb commented 4 months ago

I was able to login once with version 2013 with my first token and it worked for days.after update it break my integration and I delete it ,I rerun the login page to have new token and I try to recreate integration with this one with no luck(I try 2 times with different token)

sedy89 commented 4 months ago

I was able to login once with version 2013 with my first token and it worked for days.after update it break my integration and I delete it ,I rerun the login page to have new token and I try to recreate integration with this one with no luck(I try 2 times with different token)

the only differences between those versions are the handling of the patient if it was not provided during the setup (maybe try without providing it) and some sensors were updated that threw an error in the log during setup with the latest HA. Have you tried to update HA? If that doesn't help, maybe the logs will show something...

arnoakavdb commented 4 months ago

Everything is up to date and the only thing that I put on the connection screen was the country : be and the token. I'll retry home with the log enable

arnoakavdb commented 4 months ago

error there is the screenshots of log and error message

sedy89 commented 4 months ago

are you using a follower account or the patient account itself?

arnoakavdb commented 4 months ago

are you using a follower account or the patient account itself?

A patient account ( my wife account)

sedy89 commented 4 months ago

That is your issue. The integration was searching for patients, which you would have, if you would have used a follower account. Since you are using the patient's account directly, you don't have any patients. I have weakened the part in the code, so you should be able to use the patients account again in the next release (if yo-han merges my changes), but you should consider to create your own follower account. The refreshing mechanism will logout the patient's account from other apps. Therefore, it is recommended to use a dedicated account for this integration.

arnoakavdb commented 4 months ago

I understand now why but it was great working with the earlier version so I wasn't thinking about that

sedy89 commented 4 months ago

I just created a Pull Request. I successfully tested the changes with my daughter's patient account. But I would still recommend to create another account - a patient can have up 5 follower.

arnoakavdb commented 4 months ago

I just created a Pull Request. I successfully tested the changes with my daughter's patient account. But I would still recommend to create another account - a patient can have up 5 follower.

I just create the account to follow my wofe, I'll give a try thanks for all

yo-han commented 4 months ago

The PR is merged. I did not have time to test it but the changes seem very sensible.

The new version can be downloaded.

arnoakavdb commented 4 months ago

Thanks for all,it work with the follower account 🙏