Xiaomi vacuum restore/select backup map (multi floor support)

I need a feature where I can switch the current map in my Roborock S6 to be able to put him in another floor in my house and start cleaning of selected rooms on that floor. All controlled by Home Assistant (except moving him physically to the other floor :grinning:).

Current functions of the Xiaomi integration let me start and stop a cleaning of selected rooms with
But if I start this service on floor A, but map from floor B is the current loaded map, the cleaning fails. The vacuum does not automatically load the correct map.

My Roborock S6 (Xiaomi) supports backup maps which can be used for multi floors in the house. It is possible to select the maps through the Xiaomi app. If I select the right map through the app first, room cleaning works as expected.

Target would be to have a service like xiaomi_miio.vacuum_restore_map which I can call before the segment cleaning service.

The MIIO tooling seems to already support this command:
With https://github.com/rytilahti/python-miio/blob/cb15f5dc3517cdbf18f8217cc3424c04414ab8d8/miio/vacuum.py#L698 it seems to be possible to also get the map IDs.

Do not forget to vote!

There is an old feature request for this with a different use case:

Hi, I’ve open a PR for this:

Unluckily I was hoping to benefit directly from this, having a Roborock Max 5, but unluckily this does not work on my model:

(xiaomi) 15:54:41 (/tmp/xiaomi)$ bin/miiocli vacuum --ip    --token XXX get_backup_maps
Running command get_backup_maps

Thank you so much for your effort. Because of that I worked hard on installing miiocli. I finally got it to work.
Nevertheless, you are right. I tried both commands get_backup_maps and use_backup_map. Both return unknown_method.
I have a Roborock S6 and changing maps with the Android app works fine. Anything else I can try?

I found a new set of commands in the OpenHab forum:

The command get_multi_maps_list works and returns:
[{'max_multi_map': 4, 'max_bak_map': 0, 'multi_map_count': 2, 'map_info': [{'mapFlag': 0, 'add_time': 1610144299, 'length': 11, 'name': 'Erdgeschoss', 'bak_maps': []}, {'mapFlag': 1, 'add_time': 1613669204, 'length': 12, 'name': 'Obergeschoss', 'bak_maps': []}]}]
Very interesting and exactly the map description I see in the Android App from Xiaomi.

With the help of different command lists, I found a new command through try and error, which might help to recover a dedicated map of a floor/level:
recover_multi_map []
It seems to be a valid method, but I could not figure out which parameters I have to provide. I called the commands with the mirobo tool in a Debian console ( mirobo --ip 192.168.x.x --token xxxxx raw-command recover_multi_map ). Responses of command:
recover_multi_map -> Error: No response from device
recover_multi_map 1 -> Error: {'code': -10005, 'message': 'Params is not an Array'}
recover_multi_map [1] -> Error: {'code': -10005, 'message': 'First element in array is not an object'}

Any idea, what parameters I could try? It looks, we are close :slight_smile:

Hi, I just tested a method which works on my Roborock S5 Max.

Based on XiaomiRobotVacuumProtocol/multimap.md at 953d026f4f77cb060a6e82acab8bd485a09e13d1 · marcelrv/XiaomiRobotVacuumProtocol · GitHub

The methods load_multi_map [1] and load_multi_map [0] work for me.

Can you try it ?

In my HA Service I do

Good Luck


Great, this works! Thank you very much for posting! :+1:

You’re welcome !
Thank for your previous OpenHab research, it helped me a lot !

Wow, I’ve noticed this just now!

It works, thank you very much!

Just as a reference, my maps on S5 Max are on indexes 0 and 2

It works like a charm!
Thank you, dude!

I’ve got roborock connected to HA, but when I search for commands I can’t find the load_multi_map command? Do I need something more than the xiaomi integration?

The action type is Call Service and service is vacuum.send.command.
In the command section you can use (in my e.g.) app_segment_clean or this load_multi_map command.
Parameters are also important: 0-4

Thought the service was load_multi_map!
Thanks! That worked like a charm :slight_smile:

1 Like

Oh wow - thanks everyone! I thought this functionality didn’t exist and it was beginning to frustrate me!