argrento/huami-token

Login fails with code 0106

JuergenKindler opened this issue · 2 comments

Somehow this does not work for me:

> python3 huami_token.py --method xiaomi --bt_keys
Getting access token with xiaomi login method...
Copy this URL to web-browser 

https://account.xiaomi.com/oauth2/authorize?skip_confirm=false&client_id=2882303761517383915&pt=0&scope=1+6000+16001+20000&redirect_uri=https%3A%2F%2Fhm.xiaomi.com%2Fwatch.do&_locale=en_US&response_type=code

and login to your Mi account.

Paste URL after redirection here.
https://hm.xiaomi.com/watch.do?code=ALSG_CLOUDSRV_....
Token: ['ALSG_CLOUDSRV_....']
Logging in...
Traceback (most recent call last):
  File "huami_token.py", line 248, in <module>
    device.login()
  File "huami_token.py", line 107, in login
    raise ValueError(f"Login error. Error: {login_result['error_code']}")
ValueError: Login error. Error: 0106

Sorry, this can be closed. Need to first pair the device in MiFit app ... then there is no error ...

Hi!
I should probably add more detailed error-description.