Homey Community Forum

[APP] Roborock Vacuum Cleaners

Roborock Vacuum Cleaners
Intelligent robot vacuum cleaners


Please note:
This app supports the newer models of the Xiaomi Roborock vacuum cleaner robots such as the S5 MAX, S6 and S7 models. This app has not been tested with older models. Scroll down for a full list with supported models an all of their functions.


What’s new in the latest live version 1.3.2:
Go to target is here! This release supports the go to target based on coordinates for all supported models. There is also a flow card released that enables you to set the scrub intensity on the S7 models. Furthermore there is a Swedish languages added and the bug that some models did not have all flow cards is solved.


Usage of the app:

  1. Install this app using the Homey app store;
  2. Find your robots Xiaomi token (see below);
  3. Find your robots IP address (see below);
  4. Add a new device using the app;
  5. Choose the device you wish to install;
  6. Fill in the form using the IP address and token you’ve found;
  7. Click ‘Test connection’ to see if you information is right;
  8. When approved, click ‘Add device’ to finish.

Advanced status flow cards
There is a IF/AND/OR card available that checks the status of the robot. This will enable you to make advanced flows based on what the vacuum cleaner is doing. In the view below you’ll find a list of all the tags that the status card understands:

  • charger-offline
    Find out if the vacuum cleaner is unable to find the docking station.

  • cleaning
    The vacuum cleaner is busy cleaning.

  • returning
    The vacuum cleaner is busy returning to the dock.

  • charging
    The vacuum cleaner is charging. When the battery is fully charged, this status will change to docked.

  • charging-error
    The vacuum cleaner is not able to charge.

  • paused
    The vacuum cleaner is paused during work.

  • spot-cleaning
    The vacuum cleaner is busy doing a spot cleaning.

  • error
    The vacuum cleaner has an error, maybe something is jamming the brush.

  • docked
    The vacuums battery is fully charged and it’s at his dock.

  • zone-cleaning
    The vacuum is busy doing a zone cleanup.


Going to target point:
This app supports “Go-To-Target”. This flow card might be a little bit hard to use, but if you take your time you’ll get the hang of it. To help you out, I created the image below.

Soo, the docking station is always 25500,25500. If you wish to let the robot move 1 meter to the right, change the coördinates to 26500,25500. Please note the +/- in the axis, look at the picture for the example. Moving left is minus, moving right is plus. Same goes for up and down.

Take your time… Move the robot to a pin-point, send it back to the dock and try again. Good luck!


Find room ID’s for room cleanup
Please notice that the flow card for room cleaning is currently in test, it’s not released!

The room cleaning card is using a special ID that Xiaomi gives to your room. With the following steps you will be able to find the room you wish to clean:

  1. Create a flow as shown below;
  2. Head back to your Xiaomi app;
  3. Edit your map; divide the rooms into whatever you wish;
  4. Make sure that you give all the rooms a name, else it won’t get a ID;
  5. Save your new edited map;
  6. The flow will detect changes and give a list of all the rooms available.

Please keep in mind your set polling frequency; every XX (frequency) seconds Homey will detect changes > rooms are changed > flowcard is triggered!!

The list you will get is a list with ID’s. It is not possible to give back room names in a easy way. Normally, the sequence of ID’s is the same sequence that you created rooms in. Detecting the right room is still a bit trial and error.

Once you trigger the flow card “Clean a room” with a certain ID and you head back to the Xiaomi app, you’ll see that the map wil gray out and only the room you’ve choosen (room ID) will light up. See image below for exampe.


Use zone cleanup based on coordinates
This app supports zone cleanup based on coordinates. The difference between zone and room is that this function does not need a room setup in the Xiaomi app. Let’s say for example you wish to clean a certain zone inside a room more often because the floor there gets more dirty, but you do not wish to create a new room in the Xiaomi app… This function is the answer!

Look at the image below for an example on how the zoned cleanup works. You need to find the two coordinates first, check the coordinate function above to find out how to do this. Now, with the coordinates, fill in the flow card form using the two opposite corners of the chosen zone. The robot will create a rectangle using these coordinates by itself.

You can use the last form field in the flow card to tell the robot how many times he needs to clean this zone. This may be a 1-3 numeric value.


Supported languages:
The following languages are supported. English and Dutch is written by myself. Are you up for a translation? Please contact me with a DM and I will send you the translation files.

:denmark: Danish not supported! We need a translator!
:de: Under construction, coming soon!
:uk: English
:es: Spanish not supported! We need a translator!
:fr: French not supported! We need a translator!
:it: Italian not supported! We need a translator!
:netherlands: Dutch
:norway: Norwegian not supported! We need a translator!
:sweden: Swedish (John Severinson)


Wish to say thank you?
I’d love a good sigar! Contribute by making a PayPal donation. Thank you in advance! It would also be great if you posted a review in the Homey app store!

image

8 Likes

Changelog

You are able to install the test version using the official Homey link added below. Installing this test version allows you to test and experience the newest version that’s going to be released in the near future. Please notice that this version is not stable! If you wish a stable version, use the one provided in the Homey app store.

If there is currently no test version available, this link will automatically change into the normal Homey app store URL. View the list below to see if there is a test version.

Future version 1.5.0 - Not available for public right now!
This is a big one! This release contains zone cleanup based on coordinates, watertank flowcards for the S5 Max and S6 MaxV, trigger flow card with a large summary able to tell area and time information and a trigger flow card that tells you if the map (floor plan) is changed.

Current test version 1.4.2
Fixed issues with room cleaning flow cards that would not show up for devices other than the S7 models. Also fixed the room change alert flow card that would not work properly in some cases.

Version 1.4.1
I’ve added the room cleanup part. This card is using a room ID (numeric). To get the rooms, there is a trigger card build in that will give a list of rooms once the map is edited in the Xiaomi app.

Version 1.3.3
This version contains the bugfix that should solve the ‘status has changed’ card not working on other devices then the S7.

Current live version 1.3.2
Go to target is here! This release supports the go to target based on coordinates for all supported models. There is also a flow card released that enables you to set the scrub intensity on the S7 models. Furthermore there is a Swedish languages added and the bug that some models did not have all flow cards is solved.

Version 1.3.2
Solved a bug that disabled WHEN cards for other models than the S7.

Version 1.3.1
Solved a bug that disabled the FLOW cards for go-to-target on other models than the S7.

Version 1.3.0
This release contains the go-to-target cards and a FLOW card to set the scrub intensity for the S7 models, as well as a few bugfixes and a Swedish language pack.

Version 1.2.0
The device list is splitted into the Roborock versions this app supports. This will make it easier for users to find out if the app is usefull for them. Furthermore I am able to add mop functions to the right models instead of adding these to all. Some smaller bugfixes took place and the app settings menu is removed, since there are no general settings.

Version 1.1.3
Changed some text in the official readme file that Athoms wants to be corrected. Also added a new slogan since the old one was not valid according to Athom.

Retrieving the Xiaomi token
There are many ways to retrieve the Xiaomi token. I have choosen to display these two options. The Mac OSX option is tested and written by myself, the Windows options is using a extractor (.exe file). I have not used this myself but I trust the community users that provided this URL used them with succes…

Mac OSX
In order to make this app work, you will need the device token that a robot will gain when installing through the official Xiaomi app.

  1. Remove the robot from your Xiaomi app (only Xiaomi works!)
  2. Make sure you reset WIFI by holding ZONE and HOME at the same time
  3. Wait for the reset WIFI voice to sound
  4. Head back to the app and add your robot
  5. Go through the add process as you usually would
  6. Once installed, connect your iPhone to your computer
  7. Create a backup using Finder, make sure you create a uncrypted backup!
  8. Download and install iBackup viewer from here
  9. Open iBackup viewer and click the backup that has been created in step 7
  10. Click on RAW DATA, the tree icon
  11. Search in the left field for com.xiaomi.mihome and open it
  12. Search for ‘sqlite’ and press the file ‘Documents/[ID]_mihome.sqlite’
  13. Press the download button in the top bar and save the file to your desktop
  14. Now go download ‘DB Browser for SQLite’ from here
  15. Click on ‘Open file’ and choose the recently saved file on your desktop
  16. Click on execute query and add:
    select ZTOKEN from ZDEVICE where ZLOCALIP is ‘192.168.XX.XX’
    Where the XX.XX is the IP from the Roborock.
  17. The result will be a HEX encrypted key
  18. Go to this website and paste the key there in ‘input text’
    18.1 Choose HEX
    18.2 AES
    18.3 MODE
    18.4 Key = 00000000000000000000000000000000
    18.5 Choose HEX
    18.6 Press decrypt
  19. Your 32 character key will show up in the right box, it’s the two rules code
  20. Save this code somewere or keep the website open.

More information about this method on this website I found. There are also other ways for other platforms there, which I have not tested myself. The option above worked for me!

Windows
Use the extractor tool as provided on Github:

Retrieving the Xiaomi IP address
Once you have found the token, retrieving the IP address is very easy.

  1. Open the official Xiaomi app;
  2. Press your robots tile;
  3. Press the tree dots in the upper right corner;
  4. Press ‘Extra settings’;
  5. Press ‘Network settings’;
  6. You’ll find the IP address there.

Official supported devices
The list below will display all official supported Roborock devices. There is still a good option that a device that is not displayed will work properly, but they have not yet been tested.

Do you have a Roborock which is not displayed in the list below? You could help others by showing us if your device will work! Please test all the flows, all the IF/THEN cards and post your found options below in a new reply. If everything works well, I will add this device to the official tested list. Thank you for your support!


This app offers full support for the Roborock S7 model. All of the functions:

  • Start cleaning
  • Stop cleaning
  • Start spot cleaning
  • Return to charger
  • Let the robot speak (Hi i’m over here!)
  • Set vacuum power
  • Set scrub intensity
  • Move to coordinate based target
  • Clean a room
  • Clean a coordinate based zone
  • Trigger a flow when the cleaning summary changes
  • Trigger a flow when the map switches
  • Trigger a flow when the map in the Xiaomi app changes

This app offers full support for the Roborock S6 MaxV model. All of the functions:

  • Start cleaning
  • Stop cleaning
  • Start spot cleaning
  • Return to charger
  • Let the robot speak (Hi i’m over here!)
  • Set vacuum power
  • Set watertank intensity
  • Move to coordinate based target
  • Clean a room
  • Clean a coordinate based zone
  • Trigger a flow when the cleaning summary changes
  • Trigger a flow when the map switches
  • Trigger a flow when the map in the Xiaomi app changes

This app offers full support for the Roborock S6 model. All of the functions:

  • Start cleaning
  • Stop cleaning
  • Start spot cleaning
  • Return to charger
  • Let the robot speak (Hi i’m over here!)
  • Set vacuum power
  • Move to coordinate based target
  • Clean a room
  • Clean a coordinate based zone
  • Trigger a flow when the cleaning summary changes
  • Trigger a flow when the map switches
  • Trigger a flow when the map in the Xiaomi app changes

This app offers full support for the Roborock S6 Pure model. All of the functions:

  • Start cleaning
  • Stop cleaning
  • Start spot cleaning
  • Return to charger
  • Let the robot speak (Hi i’m over here!)
  • Set vacuum power
  • Move to coordinate based target
  • Clean a room
  • Clean a coordinate based zone
  • Trigger a flow when the cleaning summary changes
  • Trigger a flow when the map switches
  • Trigger a flow when the map in the Xiaomi app changes

This app offers full support for the Roborock S6 Pure model. All of the functions:

  • Start cleaning
  • Stop cleaning
  • Start spot cleaning
  • Return to charger
  • Let the robot speak (Hi i’m over here!)
  • Set vacuum power
  • Set watertank intensity
  • Move to coordinate based target
  • Clean a room
  • Clean a coordinate based zone
  • Trigger a flow when the cleaning summary changes
  • Trigger a flow when the map switches
  • Trigger a flow when the map in the Xiaomi app changes

Hi Justin, for windows user GitHub - PiotrMachowski/Xiaomi-cloud-tokens-extractor: This tool/script retrieves tokens for all devices connected to Xiaomi cloud and encryption keys for BLE devices. is the easiest way to extract the tokens. Follow these steps:

1 Like

Thank you Joka! I will update my thread.

The app is officially released. Please scroll up to the first post for the official store URL!

1 Like

I had a sideloaded Roborock app before, working with my S6maxV. In that app there was an AND-card: “Vaccum is on”. I used that to detect if Roborock was working. So my question is how the Status-card works.
If Roborock is Spot cleaning, is Cleaning also true?
If Roborock is Charging, is Stopped and Docked also true?

Polling in seconds is suggested to 60 seconds. Does that mean that a change i status can be acknowledged in 1 to 60 seconds?
How low can polling be set without being banned of the server?

Polling interval is accepting 60 and up. It should validate the settings and not accept anything lower than 60, if i’m correct?

I will write a better ‘status’ description when i’m back home!

I think I can answer the question about Status functionality myself.
Status seems to be separate and when Roborock is charging it is not “Docked”, meaning when charging stops it will trigger status Docked.
In some cases it seems like the On-functionality could be useful:
Status Cleaning = On
Status Spot cleaning = On
Status Docked = Off
Status Charging = Off
Status Stopped = Off
The sideloaded app I used before had this functionality. See attached When and And-cards.


Sounds like a usefull function indeed, I will try and implement this in the future.

You’re right about the docked/charging status. As a workaround you might use a AND + OR card using “charging” and “docked” to find out if the roborock is currently “off”.

Or even better, use one card and check if the status is “cleaning”. Ofcourse this will not work when you’re using spot cleaning, but I guess most people don’t use this? If you do, then fallback to the AND/OR as mentioned above.

I will add your ON/OFF to my to-do list.

1 Like

By the way, I do not own a S6 MaxV soo I was not able to test this device. According to other developers on Github and some threads I found the S6 MaxV should use the same protocols soo it should work 100%, but if you bump into any failures or crashes please let me know!

1 Like

Final mention about the status… When “docked” is triggered you can be sure the battery is fully charged again.

In other words, if you’re trying to build a flow that’s triggering the vacuum once it’s fully charged again, try using this trigger… It’s less load for Homey checking with “status has changed” and new status is “docked” then using a battery trigger which will hit your flow much more often :slight_smile:

1 Like

There are many more features that Roborock accepts. Please see the updated first post in this thread about all the vacuum status options.

@Morgan , could you please post a picture of the vacuum power settings and water settings from you Roborock or Xiaomi app?

Move to target is a success! I will test this in the upcoming days in order to make sure it works just fine, then i’ll release it.

1 Like

Thanks for the app @Justin. Great work.

I can confirm that the S5Max is working with this app. I’m close to ditching the nodered workaround for the S5max.

My humble suggestions for app improvement are following:

  1. Room cleaning to select which rooms will be cleaned each time. In node red every room is marked with specific number that is used in the command to clean.
    a. I use this to block the vacuum from entering certain rooms when they are not organized so that they can be cleaned.
    b. I also use this to clean certain rooms only when needed.
  2. Go to target coordinates
    a. I use this to get the vacuum close to the trashbin when it’s full or has cleaned certain amount of area.
  3. Zone cleaning
  4. The cleaned area information.
    a. I use this to detect how large area vacuum has cleaned and based on that send it to the trashbin and notify me to empty the bin.