Introduction
I have spent a while testing and figuring out exactly how to send commands to my Roborock Q Revo S via Node-RED and realised there isn’t any good single point of information that actually works. So here it is! (the post I wish I could have seen when I started looking for this info)
NOTE: As far as I can tell, this information should also work for S7 and S8’s as well, but I don’t have either to test on (please let me know if you try it).
I am assuming you have already got Node-RED running and have installed and configured the Roborock integration so that you can see your robot from there.
Determining Segment ID’s
Any rooms that you have setup in your app will have a segment ID defined. I haven’t found a proper way to get the segment ID’s for each room, so I came up with the following strategy:
Create an inject/action node pair to inject some arbitrary ID’s and monitor the Roborock app to see what happens. When a valid room ID is found, you will see the vac will start cleaning that room in the app.
See Start Command for specifics on what to put in the action node:
I have 10 rooms defined in the app, so I first tried 1, then 10, then 20; and I found that 20 was an ID for a room in my house, then I reduced / increased the number by 1 from there to determine the ID’s for each room.
Start Command
To start the robot vacuuming a room(s), you use an action node. Select your server, set action to ‘vacuum_send_command’, add an entity to targets (select your vacuum cleaner), set the Data to a JSON Object (change ‘NUMBER’ to the segment ID’s representing the rooms you want to clean; a comma separated list or a single number will work here):
{"command": "app_segment_clean","params": [{"segments": [NUMBER],"repeat": 1}]}
NOTE: You can change the repeat value from 1 to 2 and the will enable ‘x2’ mode (criss/cross cleaning pattern).
Mode Commands
The rest of the information (majority of this post) is care of @febo7011. He’s the true genius, so you should give him some love S7 Mop control - #44 by febo7011 (this is direct copy / paste of his info as I can’t summarise it any better).
NOTE: Use an action node exactly as before, but just change the Data payload:
- Vacuum Modes -
{"command":"set_custom_mode","params":[NUMBER]}
- NUMBER = 101 for silent
- NUMBER = 102 for balanced
- NUMBER = 103 for turbo
- NUMBER = 104 for max
- NUMBER = 105 for off
- NUMBER = 106 for custom
- Mopping Modes -
{"command":"set_water_box_custom_mode","params":[NUMBER]}
- NUMBER = 200 for off
- NUMBER = 201 for low
- NUMBER = 202 for medium
- NUMBER = 203 for high
- NUMBER = 204 for custom
- Mopping Routes -
{"command":"set_mop_mode","params":[NUMBER]}
- NUMBER = 300 for standard
- NUMBER = 301 for deep
- NUMBER = 302 for custom
- NUMBER = 303 for deep+
In Practice
I like to use my robot in either vacuum or mop mode (vac first, then mop the house), so I have two basic flows that I use in practice. Even though they are simple, I figured it might help some people to see how I’ve configured them to help them start to understand how you put them together to make it work.
Essentially it is like using the app; you configure each of the Modes (above) individually, then you send a start command (with a list of the rooms to clean).
My Vacuum Flow
I want to vac every room in my house with the balanced setting and enabling the x2 mode (criss cross pattern):
- Set Mop OFF:
{"command":"set_water_box_custom_mode","params":[200]}
- Set Fan Speed BALANCED:
{"command":"set_custom_mode","params":[102]}
- Start:
{"command":"app_segment_clean","params":[{"segments": [16,17,18,19,20,21,22,23,24,25],"repeat": 2}]}
My Mopping Flow
I want to only mop rooms with hard floors. I’ll use a medium water setting and set the route to deep (overlaps between passes):
- Set Fan Speed OFF:
{"command":"set_custom_mode","params":[105]}
- Set Mop MEDIUM:
{"command":"set_water_box_custom_mode","params":[202]}
- Set Route DEEP:
{"command":"set_mop_mode","params":[301]}
- Start:
{"command":"app_segment_clean","params":[16,20,22,23,24,25]}