Guide to retrieve Xiaomi Roborock (and other) tokens!

Got the same issue with the S6 MaxV. The logs say “timeout”.

Ive got the S6 MaxV and have tried the following without any success:

The Windows app does indeed report a token, but it does not work. For me it results in “time out” in the log and the vaccum entity is “unavailable”.

2 Likes

self error on my s5 max. Not available. Did you get it working?
wants to use the roborock app, not mi home

I’ve managed to retrieve the token and added my S4 into HA.
Then at the first night, aprox. around 3 o clock it looses connection and is not able to get back up

Got exception while fetching the state: Unable to discover the device 10.1.50.48
Got exception while fetching the state: No response from the device

If I reset the WiFi, get the token I can re-add it, but it will loose connection the following night.
I’m using the RoboRock app, tried the MiHome too. But this didn’t change.

Any ideas?

I have read that using the Roborock app causes the vacuum to be assigned a new token. Don’t use that app (unpair from it), use the Xiaomi one instead. Obviously you will still need to get the latest token, but after that, don’t reconnect to the Roborock app

1 Like

I’ve also tried to add it… I retreived the token, but I got an unavailable Vacuum… @dominicr How did you manage to correctly add it? (S5max here)

I used the following in the configuration.yaml

vacuum:

  - platform: xiaomi_miio
    host: 192.168.90.x
    token: 785xxxxx

Or do I need to use another platform?

hi
which one
s5max ? s6? … etc…

I’m not sure which model was discussed in terms of the Roborock app causing new tokens to be generated but I think it applies to all models…

I have an S5 and only had success retrieving the token using the old xiaomi app method.

If you can root your vacuum I’d say do that, with e.g. Valetudo you can easily get your token, and is also good for importing live maps into HA.

You will also get rid of the Chinese call home and you no longer need an active Internet connection.

If you have a supported xiaomi vacuum I highly suggest you root it (it is fairly simple to do)

Hi SMAW,

i’ve finally managed by deleting the RoboRock app and using the Mi Home version 5.4.54.
Reset the WIFI and add it with the Mihome app. Afterwards you can find the token in the file located in SmartHome/logs/Plug_Devicemanager/

I’ve just used the Mi Home app to set it up and left it. Now it’s working perfect in HA :slight_smile:

Ah, good to hear… Which firmware version of the Roborock do you have? Because the latest firmware is resetting the token every night?

I’m running the latest 3.5.8_0358 firmware.
If I check my logs between 3 and 4am it looses connection for a brief moment and comes back.

Sorry for a question on an old reply, but which app are you using to connect the vacuum? I just got an S4 and while the app gives me a token, it doesn’t seem to be working when connecting to Home Assistant.

Nevemind, I had one last ditch attempt and managed to get the token registering when adding the vacuum with the roborock app instead of the Xiaomi one.

Now onto the automations…

Hi, How did you get token out of Roborock app?

I just got my Roborock S6 MaxV (firmware: 01.49.66) and looking for a way to get token for HA integration.
Currently I am using it over Roborock iOS app, because it was not possible to add it to MiHome app. Getting token from MiHome iOS app is pretty easy, but never did it with Roborock app.

Check out the latest discussion on it over here:

1 Like

Just thought I’d pop in with another option of retrieving the access token. I came across https://github.com/PiotrMachowski/Xiaomi-cloud-tokens-extractor on twitter, which has worked wonders as another option for retrieving the token.

11 Likes

Thanks, it was almost too easy :see_no_evil::blush:

1 Like

This was honestly so helpful! Ty
I tried with downgrading the app and accessing the log file but the token wasn’t working.

This did the job perfectly

can we plaster this everywhere!
This is amazing