Guide to retrieve Xiaomi Roborock (and other) tokens!

Hi all, I have bought a Roborock S55 and I wanted to integrate it into Home Assistant. I have the European version and because of that I had no way of adding it to a Chinese server. If added to a Chinese server it will tell you to change the region first and re-pair it. I was actually a bit sceptical as I thought that changing region would render my other devices useless. Fortunately this is not the case.

So here is what to do when you want to add your roborock vacuum to HA.

Step1: Open the Mi Home app and change the region to your own (this is mandatory)

  • if you do not have a Mi Home account make one first!
    Step2: Add your Roborock Vacuum to the app (takes about 3 minutes)
    Step3: Log in with any Google account (you will need to download apps from the playstore)
    Step4: Download the Mi Home app from here (do not get the latest version)
    Step5: Download Total Commander from the Playstore
    Step6: Open the Mi Home app and log in with your credentials.
    Step7: Now go back to the homescreen and open Total Commander
    Step8: In the search bar enter SmartHome/logs/Plug_Devicemanager/
    If it doesn’t find anything just search for SmartHome and follow the path to the log file.
    Step9: Open the log and find a string named token:18472838578184732973729 (the numbers are random in this example)
    Step10: Copy the token and add it to your setup. You are now done!

It is easier if you only have 1 device listed on the European servers (as I think most users here have their Hubs setup in China Mainland). By switching to Europe it will list as the only device (unless you have added more on these servers).

Good luck, I hope this helps someone out as many guides are either very complicated or outdated!

1 Like

Just yesterday I used this process for xiaomi fan token:

It worked well as someone who does not own an android phone…

I think my method is probably easier as you only need the Android emulator (no sqlite required and no reading of database required).

I too did not have an Android device so I used bluestacks (memu and nox player will work as well) you do not need a rooted version! The token will be saved in plain text so any text editor on your android emulator will work (total commander has one built in).

But your guide does not differ very much from what I have posted here. I just wanted to share my method as I did it yesterday.

1 Like

Cool :slight_smile:
I wish I saw your method 1st before I did the process I saw on reddit - it would have saved me time.
I guess one of the advantages of using sqllite to query the DB is that you can work with multiple devices as they are differentiated by IP address.

True, but if I am correct the ip addresses are not displayed in the logs however the device name is. So it should be pretty easy. Trust me I have tried the hard way with unencrypted itunes backups etc. This was way much easier and faster haha.

Though the HA docs say any version after 5.4 will show the token in the logs in plain text. However many guides say the version that I have linked was actually a mistake by xiaomi (and thus the reason it is saved in plain text). Anyways, I used the older version just to be sure. Works great, my Roborock is rockin it in HA now :stuck_out_tongue:


I’m so extremely happy right now. Your guide worked like a charm unlike most of those I’ve found elsewhere. I had my vacuums on the Singapore server for some reason (most likely that’s were I gave up when I tried earlier). However now both work fine.

Exremely many happy thanks for this.

PS: For me, both IP-addresses and vacuum names were shown in the log.