Skip to content

About

Get Mi Home devices token Windows/MacOS app.

Resources

Stars

1 star

Watchers

0 watching

Forks

 
 

Repository files navigation

Get Mi Home Devices Token App

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.

What's new in this fork

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 (trust is 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).

Install dependencies

npm i

Run

npm start

Then:

  1. Enter your Mi Home email and password.
  2. Choose your account region/server (e.g. Germany for Europe).
  3. Click Sign in.
  4. If a CAPTCHA appears, type the characters shown (case-sensitive).
  5. 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.

Build

The build output is created under the electron/output/ folder.

Windows

npm run win

Produces a portable Get token.exe (x64).

macOS

npm run mac

Produces a .dmg with both Intel (x64) and Apple Silicon (arm64) builds.

Troubleshooting

  • "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 with npm start.

Credits

Disclaimer

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).

License

ISC — see LICENSE. Inherited from the upstream project.

About

Get Mi Home devices token Windows/MacOS app.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages