[Solved] XiaoMi Air Purifier - no token found

I cannot found the token with the Air Purifier. The MiToolKit cannot extract it, and in miio2.db in the rooted android device the data of token is blank.
I wonder if anyone ever meets this problem

Update 2018.2.2
It is an recent Mi Home update that cause the problem.
In order to extract, the only way is to download the version before 5.0.29

Yes, see this thread:

Latest versions of MiHome removed the options to get the token via the app.

You can download MiHome 5.0.19 and get the token. Not too sure how much longer that will work.
Link and extra info here:

Yes, indeed. I’ve rolled back to an older version and the token is right there.

I’m sorry to dig up this post but unfortunately i have install the app version 5.0.29 but it no longer show any device or allows me to add then so they have “blocked” it on the server side.

So my question is, what now?

With the below command, you can find the token in the Pi

sudo su -s /bin/bash homeassistant
source /srv/homeassistant/bin/activate
mirobo discover

Sorry for the ignorance but doest this work on the hassion “distribution”?

From what i’ve read the docker has very limited capacity.

I am using the Hassbian and the command works well with it.
I am not sure with Hass.io

Well as I thought Hass.io doesn’t allow this command, however this has been a work im progress and I finally got out of the docker and was able to execute some commands that got me the token.

Since I asked for help and got it it’s also time to share the solution that got me the token as of 28 Feb 2018 with the latest app (even updated with an version that isn’t on the play store) and latest air purifier fw version:

SSH into your Hass.io device -> Just fallow this tutorial (https://home-assistant.io/developers/hassio/debugging/)

#Step 2:
after login with root execute this commands:

docker exec -it homeassistant pip3 install python-miio
docker exec -it homeassistant pip3 install construct

#Step 3:
just make sure you know where all the stuff is installed and execute:
find / -name construct
find / -name miio

#You chan check if everything is ok:
cat /usr/lib/python3.6/site-packages/miio/version.py
cat /usr/lib/python3.6/site-packages/construct/version.py

Then just do:
mirobo discover

#To acess the docker “file system” just execute
docker exec -it homeassistant /bin/bash

Thanks, just managed to retrieve my air purifier 2 token with your steps.

I downloaded some some tweaked Xiaomi Home apk for Android (from russian server, yeah, yeah, i know how that sounds :)) and it just show token when you go in specific device and into advanced settings. Token : XXXXXXXXXX.
Copy paste… that’s it.

1 Like

Thanks, awesome app! :sunglasses::sunglasses::sunglasses::sunglasses: