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.

13 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

I was wandering the same thing…did you manage to use it in Roborock app after adding it in MiHome?

The answer is easy: No, you can’t do that. But the good thing is, that the Xiaomi App has all the same features as Roborock has.

Hi, I wanted to write my experience to find the token in the mi home app. I tried following the guide with bluestacks but the db did not have the token inside, not even encrypted. Then I copied the whole com.xiaomi.smarthome folder after having always rooted on bluestacks and I found the token inside the device_list _… file which is located in the \ com.xiaomi.smarthome \ files \ device \ cache.
token is highlighted in green to the right in the image.

3 Likes

Not working with latest MiHome app. But easy to find token as described in first post with old version of MiHome (don’t want to emulate and bla bla)

  • I already had installed latest MiHome and added roborock, so I uninstalled it
  • install MiHome version 5.4.49 (I found it on apkmirror), then login … exit app
  • go and search “Plug_Devicemanager” and there u go, like posted by Jim in first post
  • after u have the token, uninstall the old MiHome and install the new one from Play Store

Thanks for suggestion. I’ve used this method yesterday, with Nox emulator (easily switchable to rooted), and it worked retrieving token for a Roborock S5 Max.

Please not that then I had to stop using Roborock app (suggested in user manual) on my main Android phone, in favour of Xiaomi Home app. This was due to the fact the two apps do not share users database.
As far as I could understand, token created and retrieved with Xiaomi Home app was erasing/overwriting the token initially created by Roborock app. Viceversa if I associated again my robot to Roborock app, this would have deleted the token of Xiaomi home app, but then I would not have a known token.

Hello
I have Xiaomi smart Home kit
1x hub, 2 x movement sensor, 2x door sensor, switch , and I buyed camera Xiaomi 360
All is eu version
When I switch hub to mainland China ( and install 5.4.49 ) I can’t add any device to the hub
Can you help me to get token
Is it universal

i get this error in mi home app 5.5.4. unable to initialize extension when i click on
my s5 max (it is online) but i cant see the map i have removed it from roborock app

Hi,

I ran into a problem today too. It took me a lot of time, but I figured it out.

After you get this message, cancel process. Turn off the app and get the token according to the instructions (it will already be loaded in the file). When you open xiaomi app, roborock will be added to it, but it cannot be controlled. Update app. Roborock will now be available and the token will still work.