A cross-platform (Windows / macOS) desktop app to retrieve the tokens of the devices on your Xiaomi Mi Home account. Tokens are needed to control Xiaomi devices locally (e.g. with python-miio, Home Assistant, Homey, etc.).
This is a fork of Maxmudjon/Get_MiHome_devices_token by Payziyev Maxmudjon. It adds CAPTCHA and two-factor (2FA) login support so the app keeps working now that Xiaomi requires those challenges for many accounts. All credit for the original app goes to the upstream author.
Xiaomi now frequently challenges logins with a CAPTCHA and/or two-factor
verification (an email or SMS code). The original app failed with a generic
Login step 2 failed when that happened, because its login library can't answer
those challenges. This fork handles them:
- CAPTCHA — when Xiaomi asks for one, the image is shown right in the app and you type the code to continue.
- Two-factor (2FA) — when Xiaomi requires identity verification, the app
triggers the email/SMS code, prompts you for it, and completes the login
(
trustis set so Xiaomi may remember the device and skip this next time).
Both flows are implemented in micloud-login.js, which keeps
a cookie session across the whole login (the missing piece the original relied on
a library for).
npm inpm startThen:
- Enter your Mi Home email and password.
- Choose your account region/server (e.g. Germany for Europe).
- Click Sign in.
- If a CAPTCHA appears, type the characters shown (case-sensitive).
- If two-factor verification is required, enter the code Xiaomi sends to your email or phone.
Your devices then appear with their token, IP, MAC, model and region.
The build output is created under the electron/output/ folder.
npm run winProduces a portable Get token.exe (x64).
npm run macProduces a .dmg with both Intel (x64) and Apple Silicon (arm64) builds.
- "Login step 2 failed" / login won't complete — usually a CAPTCHA/2FA challenge. This fork handles them; make sure you're on this version. If Xiaomi shows an extra slider/human check (it occasionally does), log in once via the official Mi Home app on the same network, then retry here.
- Nothing happens after clicking Sign in — make sure dependencies are
installed (
npm i) and you launched withnpm start.
- Original app: Payziyev Maxmudjon — Get_MiHome_devices_token
- CAPTCHA + 2FA login flow references: PiotrMachowski/Xiaomi-cloud-tokens-extractor and al-one/hass-xiaomi-miot.
This is an unofficial tool and is not affiliated with, endorsed by, or sponsored by Xiaomi. "Xiaomi", "Mi", and "Mi Home" are trademarks of Xiaomi Inc. and their respective owners. Use it only with your own Xiaomi account to retrieve tokens for devices you own. It is provided "as is", without warranty of any kind (see the LICENSE).
ISC — see LICENSE. Inherited from the upstream project.