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)
    https://android-apk.org/com.xiaomi.smarthome/43397902-mi-home/
    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!

Edit: if you do not own an Android device like me, use an emulator like Bluestacks on your pc.

6 Likes

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:

2 Likes

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.

Thanks. This has come in handy a few times already!

Thanks, this helped me retrieving the token of my S5 Max. Is it possible to use the Roborock App after this?

Yes, you can use this to add the vacuum to your HA instance. As long as you don’t root it you can use the official app. However if you want to get the most out of it I will suggest trying to root it with Valetudo. You will not be able to use the official app anymore if you do that, however you will not lose any functionality, and as an added bonus you can have live maps in Home Assistant!

1 Like

Thanks for the information, I will give this a look. But maybe you misunderstood me. I want to use the Roborock App instead of Mi Home App. If I add the cleaner now to the Roborock App, will this change the token?

Ah I understand, tbh I have never tried the roborock app. And since I have rooted it I only use HA and Valetudo. But I believe if you add it to a different app it will change the token. Not entirely sure, but I thought that that was the case. Only thing I can think of is to just try (but I am almost certain your token will change).

wow thank you this helped me so much, I was trying all other methods but always run into a problem with not having either rooted android device or windows