Request Roborock App Binding

Fantastic!
Question: do you see in the future the possibility of sending commands? Like “vaccum rooms X Y Z”?

1 Like

Looking into this now… The command is actually there now, but I need to work out how MiIo populates the room list.

The goal will be to do the same to support routines.

I’ll also look to add this to the marketplace to make it easier to test.

Looking into this now… The command is actually there now, but I need to work out how MiIo populates the room list.

The goal will be to do the same to support routines.

I’ll also look to add this to the marketplace to make it easier to test.

It doesn’t actually. So the way I see miio working is, you have a channel called “execute command”. You have to “guess” the numbers of each room, as we don’t have obvious visibility for them (the way I do it is I look at the channel “vaccum room”. I send it to vaccum each room individually and I take note of the number on the channel) and once you know the correct numbers you send the command to that channel.

There’s a widget that does this very well too from tetsuo, in the forum. You can pick each room individually and you press “vaccum” and it sends that exact command to the robot.
There’s other cool things there that I’m using like:
Command to tell the robot to clean one room twice: app_segment_clean[{“segments”: [16],“repeat”: 2}] (you can replace the 2 with 3 for three cleanings in the same room)

Command to tell the robot to go to a specific place in the map: app_goto_target [29000,28000]

Command to tell the robot to go to the dock: app_goto_target [25500,25500] (the dock the the central place so the number never changes)

Command to tell the robot to clean one room: app_segment_clean[20]
(You can iterate thorough additional rooms → all or just a couple. The widget I mentioned previously can do that.

Hope this helps somehow!

Edit: oh more info, all rooms appear to start at number 16 - unsure if all robots are the same. But mine was reseted many times and every time it starts at 16.

There’s an advanced channel called: info#room_mapping

It gives output like:
[[16,“547001147523”,“not found”],[17,“547001147526”,“not found”],[19,“547001147522”,“not found”],[20,“547001014057”,“not found”],[21,“547001147524”,“not found”]]

The ‘not found’ should be the name of the room (as I read the code)

You should then be able to use the ‘Vacuum room’ command to go to a specific room.

I hope to have this working for the roborock binding soon.

1 Like

Found the widget I mentioned:

Maybe you can find something of interest in the code?

Never noticed that channel…. I seem to have been making my life harder than needed. Tomorrow I’ll try it out :slight_smile:

I only found it cos I was searching the code to see if MiIo could handle room vacuuming and to see how it was done :slight_smile:

In reality, I normally just use the control channel to start/stop the vacuum.

I fixed room mapping. The response to get_room_mapping is a little different to the MiIo binding.
In MiIo, the binding reports:

[[16,"547001147523","Toilet"],[17,"547001147526","Hallway"],[19,"547001147522","Bathroom"],[20,"547001014057","Living room"],[21,"547001147524","Guest Bedroom"]]

The 1st part is the room number that can be used for the ‘Vacuum Room’ channel the second is the string value that’s matched against the home data, and the 3rd part is the name of the room from room data.

With the Roborock API, it was looking like:

[[16,"11073579",13,"Dining room"],[17,"11073586",6,"Living room"],[18,"11073593",12,"Toilet"],[19,"11073601",12,"Storage"],[20,"11073613",2,"Master bedroom"],[21,"11073622",8,"Corridor"],[22,"11073618",12,"Ensuite"],[23,"11073631",12,"Laundry"],[24,"11073649",14,"Kitchen"]]

(NB: these are different levels in my house, hence the rooms are different).
I have no idea what the 3rd id is. I’ve chose to instead of appending the room name at the end, to replace the 2nd value of the array, and remove the 3rd, so it looks like:

[[16,"Dining room"],[17,"Living room"],[18,"Toilet"],[19,"Storage"],[20,"Master bedroom"],[21,"Corridor"],[22,"Ensuite"],[23,"Laundry"],[24,"Kitchen"]]

OK commands with parameters (like sending the vac to a room) don’t work yet as the parameters are being passed with " marks.

python-roborock (works):

{"dps":{"101":"{\"id\":20001,\"method\":\"get_clean_record\",\"params\":[1750834989],\"security\":{\"endpoint\":\"4tiQ8BRg\",\"nonce\":\"53055b258a8316e075f85ab7a71f5445\"}}"},"t":1750987619}

My code (fails):

{"t":1750992780,"dps":{"101":"{\"method\":\"get_clean_record\",\"id\":26399,\"params\":\"[1750834989]\"}"}}

so basically it’s "params":"[1750834989]" that is the key difference. I need to figure out how to remove the " marks…

That “dps” reminds me of Tuya protocol.

It was fun coding it (not). the commands are similar to MiIo but sent over mqtt. I’ll have another look at MiIo and how it builds the params to send

ok I used some fudgery to replace parts of the payload before sending it :slight_smile:

Can I suggest this topic is now closed and discussion moved to Roborock binding for robot vacuum cleaners [5.0.0; 6.0.0] ?

1 Like