Download map of vacuum from Xiaomi cloud to determine zone coordinates

I just drop it here in case someone finds it useful:

If you use the Xiaomi Miio integration for your robot vacuum and you want to clean a zone you first need to determine the zone coordinates. The docs of the integration show how to get the coordinates using some android app or when using Valetudo firmware.

Since I do not use any of these, I needed to find a different way. And I found the solution at the iobroker-side. I took the code and put together a small command line tool which you can use to download the map of the vacuum from the cloud. You can then open it in the Xiaomi Vacuum Map Viewer to get the coordinates for your zones.

As I thought this could be useful for other HomeAssistant users I published my code incl. instructions on how to use it here: GitHub - da-mkay/mihome-vacuum-map-dl: Download rrmap of your vacuum from xiaomi cloud

PS: I know there is also lovelace-xiaomi-vacuum-map-card but for know I want to stick to the original Xiaomi Miio integration.

Hello
Thank you. Got the new Xiaomi X20+ and am trying your way. But fail already with the installation. Prerequisite is “NodeJS”. Where can I find this exactly? With “git” is your git meant, right?
Sorry, I’m no longer a beginner, but I always have trouble with these gits when something has to be installed…
Thanks for the help.

You can find an installer for NodeJS here: Node.js — Download Node.js®
Git is a tool that you need to install as well. You need it to be able to run “git clone …” as described in the project’s README to clone the git repository of the project, i.e. downloading the project’s code.

Thank you. So install everything on Windows, not in Home Assistant?
The git tool is this one? https://gitforwindows.org/

Yes, you do not install this in Home Assistant. My project is a tool that you run locally to download the map from your vacuum.
Regarding git: Personally, I would download it from the official site: Git - Downloading Package

I’m slowly getting closer. Thanks for the support. Unfortunately, I get the following error message(s). Do you have any ideas?

Hello,
I am getting the same error message.
Fehlermeldung Karte

Sorry for the late reply, I was on vacation.

I do get the same error, if my machine and the vacuum cannot communicate. For example because the vacuum is in a guest wifi, or there is no network route to the network the vacuum is in, or a firewall blocks communication.

Try if you can ping the vacuum from your machine. At least my Roborock S7 answers to ping messages. If you get an answer, communication should work. If not, you need to fix those network issues before my tool can download the map from the vacuum :slight_smile:

Hi,
i know its 2 year later. but does this still work?
because i do get a error

and yes i can ping the vacuum. its Xiamomi x20+.
im some what off newbie here :slight_smile:
Thanks in advance for your help

Unfortunately, no.
I tried it 1 or 2 months ago. But I always ran into an error. The login was forcing me to solve a captcha, but this process was not implemented. I checked out other libraries on how they do it, and wanted to implement it as well. But it did not work for me. I think I got blocked temporarily due to too many attempts :smiley:

My last try was to use the home assistant integration "Xiaomi Cloud Map Extractor". It has the option store_map_raw which you can set to true. Once the integration is able to download the map, it stores it so you can access it later.
But of course, this integration was not working for me as well. I noticed the same errors regarding captchas in the logs. I was about to give up, but after some hours I saw that the integration was magically able to download and store the map.
So I guess my account was temporarily blocked and got unblocked after some time automatically. If you need to access/download the map of your router, give this integration a try.