argrento / huami-token

Script to obtain watch or band bluetooth token from Huami servers
MIT License
413 stars 94 forks source link

No 'auth_key' #40

Closed Jaclong closed 3 years ago

Jaclong commented 3 years ago

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

argrento commented 3 years ago

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

Jaclong commented 3 years ago

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!

argrento commented 3 years ago

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

Jaclong commented 3 years ago

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.