argrento/huami-token

No 'auth_key'

Jaclong opened this issue · 4 comments

I have run script with method xiaomi (python huami_token.py --method xiaomi --bt_keys)
After paste the Mi account url (https://hm.xiaomi.com/watch.do?code=ALSG_CLOUDSRV_9DA32AAC0A9D5124CB92157C********)
This is the result. It looks like I have success log int but the script can't get the auth_key?

Paste URL after redirection here.
https://hm.xiaomi.com/watch.do?code=ALSG_CLOUDSRV_9DA32AAC0A9D5124CB92157C********
Token: ['ALSG_CLOUDSRV_9DA32AAC0A9D5124CB92157C********']
Logging in...
Logged in! User id: 3023231688
Getting linked wearables...
Traceback (most recent call last):
  File "huami_token.py", line 356, in <module>
    wearables = device.get_wearables()
  File "huami_token.py", line 190, in get_wearables
    raise ValueError("No 'auth_key' parameter in device data.")
ValueError: No 'auth_key' parameter in device data.

Device: Mi Band 6
Phone: Iphone 10s

Hi.
The auth_key is the bt auth key for a device. Do you have another devices linked to the your account?

Yes, I have the other device connect to my account, I think that is the problem. After unconnected the other device then rerun the script. I can get the auth_key. Thank you!

What was this mysterious device? I've never seen one without the auth_key field.

It’s Mi weight scale. I didn’t know that’s the reason. Maybe they change the data structure so that script can’t get the auth_key.