Xiaomi Vacuum Map Viewer (to find coordinates for zone cleaning)

Sorry for the noob question.

Can’t find Userdata folder.
Where is it located?

If I remember correctly the map is saved after the robot has returned to the dock.

as you could see in the doc the userdata location differs per installation so expect it somewhere in one of these:
Userdata like rrd4j databases /opt/openhab2/userdata or /var/lib/openhab2 or maybe even /usr/share/openhab2

mine in the first, start with the folder where you installed OH in, that would be my best guess.
If I you can find it… while being created, it gives a message in the debug log Mapdata saved to ...

It is saving the file whenever a map is received and cloud connection & debug log are enabled.
The binding requests a map when none is present or with every refresh when the vacuum is vacuuming

He doesn’t save the map.

He did a full clean up.
The map is updated in the mi home app, because a room wasn’t there in the map before.
There is no map file in the userdata folder and there is no entry in the log entry that he is saving the map.

2020-11-18 09:26:43.550 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for robby type: GET_STATUS, result: [{"msg_ver":2,"msg_seq":822,"state":5,"battery":61,"clean_time":4530,"clean_area":72215000,"error_code":0,"map_present":1,"in_cleaning":1,"in_returning":0,"in_fresh_state":0,

2020-11-18 09:28:43.531 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for robby type: GET_STATUS, result: [{"msg_ver":2,"msg_seq":830,"state":6,"battery":60,"clean_time":4632,"clean_area":72837500,"error_code":0,"map_present":1,"in_cleaning":0,"in_returning":1,"in_fresh_state":0,

2020-11-18 09:30:43.591 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for robby type: GET_STATUS, result: [{"msg_ver":2,"msg_seq":861,"state":8,"battery":60,"clean_time":4632,"clean_area":72837500,"error_code":0,"map_present":1,"in_cleaning":0,"in_returning":0,"in_fresh_state":1

Any ideas what goes wrong?
Should I delete the map in the mi home app?

Can you try to enable the command channel and execute the command get_map_v1[]
This should trigger the pulling of the map from the vacuum.

If the map does not show up, pls share the debug log to see what is going on.

I have it.

I linked the cleaning#map item.
In BasicUI it shows the map, after adding it to the sitemap.
And the file was created after enabling debug log level.

Thank you.

Wanted to share this. I’m late to the “party” here, but just got a Roborock S4MAX and in investigating how to integrate with OH I came across this thread.

I downloaded this software, the latest version from the OP is 2.5.9. I enabled debug logging, I got my map loaded it up into the viewer, drew my zone and copied my command from the viewer and pasted into my OH rule.

app_zone_clean[[ 30560,23600,32540,27160,1 ]]

However this results in an error:

{"id":6282,"result":"unknown_method","exe_time":100}

Then I found the quoted comment in this thread from October from @kemotsysinc which showed an error in the command provided by the viewer where the command needs to be:

app_zoned_clean[[ 30560,23600,32540,27160,1 ]]

app_zoned_clean not app_zone_clean

Just wanted to provide this feedback on this small bug. @marcel_verpaalen thanks this this great piece of software. My coordinates were perfect and other than having to search a bit and add a ‘d’ to the command everything worked great!

1 Like

Indeed seems I missed it indeed. Fix is underway [miio] fix printed zone clean command by marcelrv · Pull Request #9865 · openhab/openhab-addons · GitHub

1 Like

Curious if this new release will still work if I am running OH 2.5?

yes, it will still work fine. It should be usable with both java JRE’s 1.8 (OH2) & java JRE11 (OH3).

The standalone viewer has no real dependency to the OH version, outside of that indicates the version of the source code so I can track which improvements were incorporated.

btw. I updated the version in the first post

hi marcel,
thanks for the program roboMapViewer3.0.0-1.zip
but…how get I the maps in rrmap format, and is this a screenshop from the xiaomi app?
my homebridge is workingbut the trail & error for the coordinates is a time consuming issue.
the java program is helping but only the map in the wright file is the problem.
do you have als problems that the map is in a angle?

regards Ralph

If you enable debug mode for the binding, the rrmaps are saved in the userata/miio folder.
It is not a screenshot of the mihome app, it is downloading the rrmap from the cloud and decoding the format.

Hi Marcel,
Dit is toch wat te beknopt. Als natuurkundige kan ik wel een beetje programmeren maar niet zo thuis hierin.

Moet ik de debug mode aanzetten in jou Java programma’s ?

Of is er een ander programma voor rrmap te creëren.

Dank je wel voor je snel response

Groet Ralph

Okay… than in a few sentences more…
The RRmap files are downloaded by running openhab while running the vacuum.
In Openhab, in the console enable debug. log:set DEBUG org.openhab.binding.miio
This assumes you:

  1. have openhab & miio binding installed
  2. have your vacuum defined as thing AND have linked the map channel.
  3. Have entered the cloud credentials in the binding config
    If all above is true and you can see the map in openhab, the files are saved in the location indicated in my previous message.

The java program in the first post is a standalone java program, which runs independent from openhab which can decode and view the rrmap files and as cherry on top, allows for easy selecting a square and get the coordinates.

Mine wasnt in userdata folder, but in /var/lib/openhab2/miio/ directly

1 Like

Hi,

I fullfilled all points you mentioned, I see in log, that map is downloaded and indeed it is in /var/lib/openhab/miio folder, Image item is defined with correct channel, but I cannot see the map in sitemap. Any idea why?

nope, not at the top of my mind…
do you see any error messages in the debug loggin?
if nothing obvious than share a rrmap file then I can try to open it here. What model vacuum do you have

@marcel_verpaalen
Hello. Thanks for you job. I have one question: is it possible to restore the map back to robot? to guarantee the correct binding of the saved coordinates in the case of a map changing

Hi @marcel_verpaalen,

Thanks for quick answer, I do not see anything strange in log:

2021-05-25 06:32:34.756 [DEBUG] [o.internal.handler.MiIoVacuumHandler] - Periodic update for 'miio:vacuum:xiaomi' (miio:vacuum)
2021-05-25 06:32:34.759 [DEBUG] [nal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":4657,"method":"get_dnd_timer","params":[]} -> 192.168.0.110 (Device: 0F9DDE9B token: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Queue: 1).
2021-05-25 06:32:34.761 [DEBUG] [nal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":4658,"method":"get_clean_summary","params":[]} -> 192.168.0.110 (Device: 0F9DDE9B token: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Queue: 2).
2021-05-25 06:32:34.761 [DEBUG] [nal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":4659,"method":"get_status","params":[]} -> 192.168.0.110 (Device: 0F9DDE9B token: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Queue: 3).
2021-05-25 06:32:34.761 [DEBUG] [nal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":4660,"method":"miIO.info","params":[]} -> 192.168.0.110 (Device: 0F9DDE9B token: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Queue: 4).
2021-05-25 06:32:34.762 [DEBUG] [nal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":4661,"method":"get_consumable","params":[]} -> 192.168.0.110 (Device: 0F9DDE9B token: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Queue: 5).
2021-05-25 06:32:34.843 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for xiaomi type: DND_GET, result: [{"start_hour":22,"start_minute":0,"end_hour":8,"end_minute":0,"enabled":1}], fullresponse: {"result":[{"start_hour":22,"start_minute":0,"end_hour":8,"end_minute":0,"enabled":1}],"id":4657}
2021-05-25 06:32:34.852 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for xiaomi type: CLEAN_SUMMARY_GET, result: [1070719,16704437500,427,[1621839645,1621764583,1621700723,1621690995,1621663678,1621591493,1621578133,1621490620,1621399268,1621334500,1621231104,1621151029,1621068811,1620973203,1620906963,1620732787,1620655909,1620572143,1620487883,1620462922]], fullresponse: {"result":[1070719,16704437500,427,[1621839645,1621764583,1621700723,1621690995,1621663678,1621591493,1621578133,1621490620,1621399268,1621334500,1621231104,1621151029,1621068811,1620973203,1620906963,1620732787,1620655909,1620572143,1620487883,1620462922]],"id":4658}
2021-05-25 06:32:34.858 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for xiaomi type: GET_STATUS, result: [{"msg_ver":3,"msg_seq":1144,"state":8,"battery":100,"clean_time":2143,"clean_area":35160000,"error_code":0,"map_present":1,"in_cleaning":0,"in_returning":0,"in_fresh_state":1,"lab_status":1,"water_box_status":0,"fan_power":103,"dnd_enabled":1,"map_status":3,"lock_status":0}], fullresponse: {"result":[{"msg_ver":3,"msg_seq":1144,"state":8,"battery":100,"clean_time":2143,"clean_area":35160000,"error_code":0,"map_present":1,"in_cleaning":0,"in_returning":0,"in_fresh_state":1,"lab_status":1,"water_box_status":0,"fan_power":103,"dnd_enabled":1,"map_status":3,"lock_status":0}],"id":4659}
2021-05-25 06:32:34.863 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for xiaomi type: MIIO_INFO, result: {"hw_ver":"Linux","fw_ver":"3.5.8_002034","ap":{"ssid":"Nelson","bssid":"A0:40:A0:98:CB:1F","rssi":-51},"netif":{"localIp":"192.168.0.110","mask":"255.255.255.0","gw":"192.168.0.1"},"miio_ver":"miio-client 3.5.8","model":"roborock.vacuum.s5","mac":"50:EC:50:1D:23:74","token":"37663936773959436e3452346e437667","life":11374}, fullresponse: {"partner_id":"","id":4660,"code":0,"message":"ok","result":{"hw_ver":"Linux","fw_ver":"3.5.8_002034","ap":{"ssid":"XXXXXX","bssid":"XX:XX:XX:XX:XX:XX","rssi":-51},"netif":{"localIp":"192.168.0.110","mask":"255.255.255.0","gw":"192.168.0.1"},"miio_ver":"miio-client 3.5.8","model":"roborock.vacuum.s5","mac":"50:EC:50:1D:23:74","token":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX","life":11374}}
2021-05-25 06:43:56.302 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for xiaomi type: GET_STATUS, result: [{"msg_ver":3,"msg_seq":1206,"state":8,"battery":100,"clean_time":2143,"clean_area":35160000,"error_code":0,"map_present":1,"in_cleaning":0,"in_returning":0,"in_fresh_state":1,"lab_status":1,"water_box_status":0,"fan_power":103,"dnd_enabled":1,"map_status":3,"lock_status":0}], fullresponse: {"result":[{"msg_ver":3,"msg_seq":1206,"state":8,"battery":100,"clean_time":2143,"clean_area":35160000,"error_code":0,"map_present":1,"in_cleaning":0,"in_returning":0,"in_fresh_state":1,"lab_status":1,"water_box_status":0,"fan_power":103,"dnd_enabled":1,"map_status":3,"lock_status":0}],"id":4935}

Here is the defined item:

Image 	Roborock_Map 	"Mapa"      <roborock1>	  {channel="miio:vacuum:xiaomi:cleaning#map"}																							                                                                  

Here is a piece of sitemap:

Image item=Roborock_Map

Here is last rrmap file:
rrmap file

Hey,

This tool looks awesome!

I just have 2 basic question’s.

  1. What version of the cleaner I need to use the map Function in openhab? I have the first version of the Xiaomi vacuum cleaner. I can choose am area in the map inside the app but with openhab it would be much cooler

  2. Is this also usable with openhab 3?
    I guess yes if the tool is standalone

Great work anyway!