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

Tags: #<Tag:0x00007f325d8098a0>

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: