Connecting Xiaomi Roborock S6

After you have started the app one time (and logged in), just exit the app.
Find the log with new timestamp in the folder /sdcard/SmartHome/logs/Plug_Devicemanager/
Open the log (text file). and search for the word token: and it should be 32-characters long.

I looked for version 5.4.54 on these websites:

So, you’re saying I don’t need to connect the Roborock using the app, just get the api key?

By the way, when I set my location to China, I can only add an Xiaomi Viomi but I can’t find of connect the Roborock S6. When set to Europe I can select to add it, but now the app cannot find the robot. Just presses the reset button (right to the wifi led) and kept spot and home buttons pressed. Now it’s factory resetting…

Okay, it’s connected to the app.

I opened the file with Notepad but that’s one blur with characters. I copied it to Notepad++ and now it’s a bit more readable.

I found the token, put in my configuration.yaml and restarted.

Now I have vacuum.stoffel in Home Assistant. But with status ‘unavailable’. And when I say vacuum.start to stoffel, nothing happens.

And you have added something like this in the configuration.yaml and restarted HA ?

vacuum:

  • platform: xiaomi_miio
    host: 192.168.X.X
    token: 5488808754XXXXXXXXXXX

And: Home Assistant need to have outbound internet, so do the Roborock.
DNS and default gateway correctly set, because both connect to Mi Home cloud to communicate.

Aha, I think I found the problem. I was looking for the “token” string, but I did not realise that Mi Home app had also found my Yeelight lamps and I used the token of the first lamp.

So the part that I should be looking for was in a very long json variable, where only this piece was relevant:

{"did":"321283121","token":"6a3157346f7451336d5747536b4a6c78","longitude":"0.00000000","latitude":"0.00000000","name":"Roborock S6","pid":"0","localip":"192.168.2.212","mac":"64:90:C1:10:60:14", ...

Note the token string, and a few entries later “Roborock S6”. That’s the one.

Everything is working fine now. I added the two custom cards for the Roborock. Only the map is not displaying, but I can start and stop stoffel from within Home Assistant.

Thanks, Smurfen, for your support and putting me back on the right track when I wanted to stray from it (the miio path).

1 Like

That´s good to hear that you got it to work, just a pleasure to help each other here.

To get live map, you have to root the Roborock, mine is from january so because of warranty i do not want to do that.
But i have a map, predefined rooms, zone cleaning from HA, but you don´t see the robot and it is not live. Map is based on floor plan drawing, and calibrated by using coordinates and XY pixels. Look here:

I am using that card, and in addition a card from here:

1 Like

Thanks, I will do that.

I tried a number of options to get the right coordinates, The Flolevac app returned a jibberish map that was no use. Finally I just measured my room and calculated coordinates based on 1 point is 1 mm and the center is [25600, 25600]. What did not help was that the lovelace-xiaomi-vacuum-map-card remembered the old data, even after clearing the cache and rebooting my computer. If I updated the map.png I kept getting the first one I made, so I ended up with map6.png.

Maybe it’s me, because with the Xiaomi Vacuum cleaner Card I renamed the

automation.takarítas_utemezese_hetvegen

to

automation.cleaning_timer_weekend

but only the first name kept showing up.

Anyways, here’s what I did to get the coordinates, with a screenshot of the Xiami Home map.

From Developer Tools, Services, choose service vacuum.send_command and give these parameters:

  entity_id: vacuum.stoffel
  command: app_goto_target
  params: [24600, 24600]

This helps with finding the right coordinates on the map.

I ended up with this in my configuration:

- calibration_points:
      x: 20900
      y: 19500
    map:
      x: 37
      y: 37
  - vacuum:
      x: 26300
      y: 19500
    map:
      x: 37
      y: 1275
  - vacuum:
      x: 26300
      y: 29500
    map:
      x: 2361
      y: 1275

One funny thing I noticed is that when the Roborock encounters a mirror (or a shiny vase on the floor) it thinks that there is something behind the mirror. Next time I will check if it slows down there or just crashes hard in the mirror. :slight_smile:

I used my original house floorplan drawing, and used paint.net with layers to create the map.
Then used goto to three points to get the calibration coordinates.

I have wardrobe with doors in mirror, it slows down and never bumped in to the doors :slight_smile:

Did you ever get the live cards working in HA? Did you root your S6? I have a S5 Max and i managed to get everything working in HA expect the live maps… still trying to figure out how to do that… any tips are helpful

I have not hacked my Roborock, so the live map does not work for me.

a simple new way for the Roborock S6 Token:

1 Like

I used token extractor tool to add to config,yaml but the vacuum state stays on unavailable. When i check the logs:
meassistant.components.vacuum] Updating xiaomi_miio vacuum took longer than the scheduled update interval 0:00:20strong text
can some please help. thanks

Can you ping the vacuum from your ha host?

I Got it

check out:

This was very smooth! :slight_smile:

May I ask why you did not using this token tool?

4 Likes

Thank for this link, its saved me alot of hard work, without an android device nearby

Given all of the changes from when you first posted, have you created a step by step guide to how you connected, configured and manage your RoboRock S6 through Home Assistant?

OH, I just saw. @PetrosKalogeras did a video walking through it all! Giving it a go now!