{"id":45679672,"url":"https://github.com/argrento/huami-token","last_synced_at":"2026-02-24T14:01:06.470Z","repository":{"id":43004181,"uuid":"266748167","full_name":"argrento/huami-token","owner":"argrento","description":"Script to obtain watch or band bluetooth token from Huami servers. Mirrored from https://codeberg.org/argrento/huami-token","archived":false,"fork":false,"pushed_at":"2026-02-08T13:30:34.000Z","size":154,"stargazers_count":432,"open_issues_count":28,"forks_count":97,"subscribers_count":20,"default_branch":"new-api-fix","last_synced_at":"2026-02-08T19:43:11.235Z","etag":null,"topics":["amazfit","gadgetbridge","hacktoberfest","huami","python","reverse-engineering","xiaomi"],"latest_commit_sha":null,"homepage":"https://codeberg.org/argrento/huami-token","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/argrento.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-05-25T10:15:48.000Z","updated_at":"2026-02-08T13:30:37.000Z","dependencies_parsed_at":"2023-01-20T05:03:31.278Z","dependency_job_id":"94c1bbe5-170c-4479-bc29-aa724000e4dc","html_url":"https://github.com/argrento/huami-token","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/argrento/huami-token","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/argrento%2Fhuami-token","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/argrento%2Fhuami-token/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/argrento%2Fhuami-token/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/argrento%2Fhuami-token/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/argrento","download_url":"https://codeload.github.com/argrento/huami-token/tar.gz/refs/heads/new-api-fix","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/argrento%2Fhuami-token/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29785300,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-24T10:45:18.109Z","status":"ssl_error","status_checked_at":"2026-02-24T10:45:09.911Z","response_time":75,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amazfit","gadgetbridge","hacktoberfest","huami","python","reverse-engineering","xiaomi"],"created_at":"2026-02-24T14:00:36.977Z","updated_at":"2026-02-24T14:01:06.448Z","avatar_url":"https://github.com/argrento.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Huami-token is now hosted on [codeberg.org](https://codeberg.org/argrento/huami-token/).\n\n\u003ca href=\"https://codeberg.org/argrento/huami-token/\"\u003e\n    \u003cimg alt=\"Get it on Codeberg\" src=\"https://get-it-on.codeberg.org/get-it-on-white-on-black.png\" height=\"60\"\u003e\n\u003c/a\u003e\n\n\n# Huami-token\n\n[![status-badge](https://ci.codeberg.org/api/badges/argrento/huami-token/status.svg)](https://ci.codeberg.org/argrento/huami-token)\n\nScript to obtain watch or band bluetooth access token from Zepp (Amazfit) or Xiaomi Mi Fitness servers.\n\n## About\n\nTo use new versions of Amazfit and Xiaomi watches and bands with Gadgetbridge you need special unique key.\nRead more here: https://gadgetbridge.org/basics/pairing/huami-xiaomi-server/.\n\n## Community\n\nIf you would like to get in touch\n* Matrix: [`#huami-token:matrix.org`](https://matrix.to/#/#huami-token:matrix.org)\n\n## Installation\n\n### From PyPI (currently outdated)\n\n```bash\npip install huami-token\n```\n\n### From source\n\n1. Ensure that you can login in the Zepp App with e-mail and password. If not, create new Amazfit account\nwith e-mail and password.\n2. Pair, sync and update your watch with Zepp App. Your pairing key will be stored on\nHuami servers.\n3. Install `uv`: https://docs.astral.sh/uv/getting-started/installation/\n4. Clone this repo and `cd` into it.\n5. Install the package: `uv pip install -e \".[dev]\"`\n\n## Usage\n\nAfter installation, the `huami-token` command is available:\n\n```\nusage: huami-token [-h] -m {amazfit,xiaomi} [-e EMAIL] [-p PASSWORD] [-b] [-g] [-n]\n\nObtain Bluetooth Auth key from Amazfit (Zepp) or Xiaomi Mi Fitness.\n\noptions:\n  -h, --help            show this help message and exit\n  -m {amazfit,xiaomi}, --method {amazfit,xiaomi}\n                        Login method. Chose Amazfit for Zepp.\n  -e EMAIL, --email EMAIL\n                        Account e-mail address\n  -p PASSWORD, --password PASSWORD\n                        Account Password\n  -b, --bt_keys         Get bluetooth tokens of paired devices\n  -g, --gps             Download GPS files (AGPS_ALM, AGPSZIP, LLE, etc.)\n  -n, --no_logout       Do not logout, keep active session and display app token and access token\n```\n\nYou can also run directly via `python main.py` if you prefer not to install.\n\n## Logging in with Amazfit account\n\nRun with your credentials:\n\n```bash\nhuami-token --method amazfit --email your_email@example.com --password your_password --bt_keys\n```\n\nSample output:\n```\n2025-11-14 18:41:43.316 | INFO     | huami_token.zepp:login:67 - Logging in...\n2025-11-14 18:41:44.268 | INFO     | huami_token.zepp:_get_refresh_and_access_tokens:120 - Received access and refresh tokens successfully\n2025-11-14 18:41:45.217 | INFO     | huami_token.zepp:login:70 - Logged in! User id: 1234567890\n2025-11-14 18:41:45.217 | INFO     | huami_token.zepp:get_devices:187 - Getting linked devices...\nDevice 0:\n  MAC: AB:CD:EF:12:34:56, Active: Yes\n  Key: 0xa3c10e34e5c14637eea6b9efc06106\n2025-11-14 18:41:46.400 | INFO     | huami_token.zepp:logout:178 - Logged out.\n\nLogged out.\n```\n\nHere the `Key` is the unique pairing key for your watch. The `Active` tab shows whether a device is\nactive or not.\n\n## Logging in with Xiaomi account\n\n```bash\nhuami-token --method xiaomi --email your_email@example.com --password your_password --bt_keys\n```\n\nSample output:\n```\n2025-11-14 18:41:43.316 | INFO     | huami_token.xiaomi:login:81 - Logging in to Xiaomi...\n2025-11-14 18:41:44.268 | INFO     | huami_token.xiaomi:login:85 - Logged in! User id: 1234567890\nDevice 0: Amazfit Band 7\n  MAC: AB:CD:EF:12:34:56\n  Key: 0xa3c10e34e5c14637eea6b9efc06106\n\nLogged in successfully.\nuser_id=1234567890\n```\n\nNote: GPS download (`--gps`) is not yet supported for Xiaomi accounts.\n\n## AGPS\n\nThis script can download AGPS files (requires login):\n\n```bash\nhuami-token --method amazfit --email your_email@example.com --password your_password --gps\n```\n\nThe following files are downloaded:\n* AGPS_ALM -- `cep_1week.zip`\n* AGPSZIP -- `cep_7days.zip`\n* LLE -- `lle_1week.zip`\n* AGPS -- `cep_pak.bin`\n* EPO -- `EPO.ZIP`\n* LTO -- LTO data file\n\n## Development\n\n```bash\nuv pip install -e \".[dev]\"\n\n# Run tests\npytest -m \"not integration\"\n\n# Lint\nruff check .\n\n# Type check\nmypy huami_token/\n\n# Build wheel\nuv build\n```\n\n## Dependencies\n\n* Python \u003e= 3.10\n* requests\n* loguru\n* pycryptodome\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fargrento%2Fhuami-token","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fargrento%2Fhuami-token","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fargrento%2Fhuami-token/lists"}