This is for anyone trying to connect the Xiaomi Roborock S6 to Home Assistant.
I am trying to get the RoboRock S6 connected to Home Assistant. Connecting using the Xiami Home went fine. I did not choose China according to the instructions here, but The Netherlands.
First I tried the Android App solution, but my version was different (5.6.60) and I did not have a /Smarthome folder and no other folder that looked like the right one. I did not try downloading another version through Aptoide, but thought the miio option looked easier.
First I needed a Linux host that understood the npm command. Iām using Docker on Synology but the Linux that comes with the Home Assistant container does not know npm. Also the marthoc/deconz or eclipse-mosquitto containers did not. Luckily my Synology knows now to npm, so I used that.
First:
sudo npm install -g miio
That gave some warnings but it looked okay. Then the command
miio discover
That gave error command not found.
After looking on the system I found that I could use
cd /node_modules/miio/cli
./index.js discover
I donāt know what I did wrong, but at least it gave me some Rockrock data.
With Android, you need version 5.4.54 of the app, to see the token in log file.
You have to googl a bit to find that version, since it is removed many places from the net because of that ābugā in the Mi Home of that version. Token is essential to connect with the Roborock.
I just deleted the Roborock from the App and reset the machine. Now it broadcasts a private network āroborock-vacuum-s6_miap6014ā. When I connect to it using my phone, I get ip-address 192.168.8.159. My normal subnet is 192.168.2.0/24, so I canāt connect to it from my PC (I donāt have a WLAN adapter) but also not from my Synology Diskstation where I have the miio tool.
I have a few options to connect to the Roborock:
from my Windows laptop, where I donāt have the miio tool, or a linux virtual machine. I could install VMWare Workstation and download some distribution that supports npm and use that on the laptop.
by changing my subnet from 192.168.2.0/24 to 192.168.0.0/16 (subnet 255.255.0.0) or to 192.168.8.0/24. That would mean a whole lot of configuration. I should do that sometimes at night, because in the daytime I would still like to be able to use my Home Assistant.
By adding an extra wifi subnet to my router (experia v10) or the PowerLine adapters (Devolo dLan). But I donāt know if itās possible to add a second wlan.
Getting a wlan adapter and connecting it to the synology. It should be possible to use it as a second network adapter, but Iāve never tried this on Linux as Iām a Windows guy.
I tried to connect from my phone to the default gateway, 192.168.2.1, but my connection is rejected. I hoped to be able to change the IP-address of the Roborock.
Maybe itās possible to install router software on my phone, so I can connect from my normal network to the Roborock.
Iāll sleep on it, but for now reconnect the Roborock to the App again, so I can clean the house tomorrow !
Thanks. I was busy on the miio-road that I forgot the possibility to install another version of the software. Iāl install aptoide and look for 5.4.54. Or on newsgroups. Should not be hard to find.
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.
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ā¦
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:
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).
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:
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:
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.
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
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 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