Xiaomi Vacuum Control

Hi Silvan,

not sure if I’m able to help, but try these two hints:

  • Room numbers in JSON, have you tried if the room numbers in the json match the configuration of your Roborock? I did that by writing a simple script with the app_segment_clean[16] command
  • Item-prefix-configuration. As stated in the configuration hint, search in your items for (i.e.) _CleaningMap and use the prefix (everything before the underscore) in the configuration
    image

Hope it helps
Jan

Hi Jan,

thanks for your quick reply. Sadly i (at least think) have configured everything the way it should be. what model roborock are you using? i’m just wondering if it might have something to do with different commands on the different models…
Robot is called Dobby and every element has the Prefix Dobby…

Or did i mess up something with the JSON Object?

thank you very much,
Silvan

I’ve got a S6 - so I don’t think they have different commands.

Hard to tell if there’s something wrong with your JSON, you can try to paste it here to see it is at least well formed.

You can also check if the items used in the widget are available. As my installation is German, I have a mixture of item names:

The following items are used:

  • _Batterieladung
  • _ControlVacuum
  • _CleaningDuration
  • _ControlFanLevel
  • _ExecuteCommand

The last one is the most important one, as the commands are sent to this item.

Not sure how I can be of any more help here - good luck! :wink:

Regards
Jan

There we go!!
I didn’t have the _ExecuteCommand Item, i used to use the CleanRoom [room#] item. now it’s working just fine! thank you very much!

P.S. you don’t happen to know how i can tell the robot to go to a specific point (for example to empty the dustbin)?

Glad to hear!

The “go to spot” is on my wishlist as well, haven’t found time to figure it out but I will add it to the widget as soon as I found a solution on how to find the coordinates to move to.

The github repo here contains all the info required.

With app_goto_target[x,y] you can move your roborock.

you can examine the source code of the offline robomap viewer (in the oh github) to understand the logic… but it is kind of tricky/non-intuitive

If you just occasionally want to find a coordinate, you can use that tool or use the easy startable version of that tool which is posted on the forum

1 Like

Thank you for your hint. Motivated by the previous conversation, I already found your mentioned thread and used the Map Viewer to find the coordinates. Should be enough for this widget.

Added the feature to “empty the bin” yesterday and doing other minor tweaks and testing it currently.

1 Like

I also don’t have that _ExecuteCommand Item. I use the miio:generic Binding with a Roborock S7. That should be similar as for the S6.

@Silvan: How did you get that _ExecuteCommand Item?

Also, I cannot see the image of the Map. Any ideas, why?

The _ExecuteCommand Channel is only visible if you check the “Show Advanced” box on the top right of the Thing Configuration.

is your map item set to image type?

1 Like

Thank you! It’s executing now.

The map item has been set to image type and the map is still not shown.
grafik

Hi @boozzz, is the image just not showing within the widget or is the map just not showing at all?

And have you configured cloud connectivity in the binding? That was my issue why it did not load the map.

@wzbfyb Cloud is enabled.
@Tetsuo The image is not showing at all. In the Things Channel it is also not showing.

Strange, can’t remember that I had to do anything special to get the map working.
Basically just created the default items for all (including advanced) from “Add items from thing” and it worked.

Have you any log output hinting an error?

This widget looks great. I very much would like to use it.
However when I copied the code and tried to save it, it produces a server error and is not possible to save. I suspect a typo when it was merged for the last time.

I am able to copy and save other widgets without a problem.

Does anyone else face the same problem?

Hi, I’ve the same issue with getting displayed the cleaning map in OH3.1. The _celaningMap item is created as type of image and it’s value alway is NULL and no image is displayed.

No errors in the log file. In DEBUG mode the rrmap files were saved in /var/lib/openhab/miio and there were no problems with the communication to the cloud. All other data are displayed correctly in the items.

Did you get your map working, yet?

That would indeed be odd, I’m not aware of specific issues for the maps in 3.1.
Esp if you have rrmap files created and no errors.

Are you 100% sure it is linked to a channel?

If indeed that is the case, share a debug log… maybe I can detect something odd that would be causing this. Another thought could be to download the offline map viewer, and see if that one shows something with the rrmap files

Yes, 100 % sure it is linked to a channel. The screen snipped shows the grey image and the channel which is the item linked to.

I also downloaded the offline map viewer and can see there my map loading a rrmap file which was created in DEBUG-Mode before.

It seems to me like the item not getting updated with the map image. All other items of the vaccum getting updated periodically.

Here a log snippet for a Periodic update process for the values of the roborock.

2021-11-24 15:15:54.445 [DEBUG] [o.internal.handler.MiIoVacuumHandler] - Periodic update for 'miio:generic:0F92FFDD' (miio:vacuum)

2021-11-24 15:15:54.447 [DEBUG] [nal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":1470,"method":"get_dnd_timer","params":[]} -> 192.168.178.31 (Device: 0F92FFDD token: 70723077XXXXXXXXXXXXXXXX5339696D Queue: 1). Send via cloudserver: de

2021-11-24 15:15:54.450 [DEBUG] [nal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":1471,"method":"get_clean_summary","params":[]} -> 192.168.178.31 (Device: 0F92FFDD token: 70723077XXXXXXXXXXXXXXXX5339696D Queue: 2). Send via cloudserver: de

2021-11-24 15:15:54.452 [DEBUG] [nal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":1472,"method":"get_status","params":[]} -> 192.168.178.31 (Device: 0F92FFDD token: 70723077XXXXXXXXXXXXXXXX5339696D Queue: 3). Send via cloudserver: de

2021-11-24 15:15:54.454 [DEBUG] [nal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":1473,"method":"miIO.info","params":[]} -> 192.168.178.31 (Device: 0F92FFDD token: 70723077XXXXXXXXXXXXXXXX5339696D Queue: 4). Send via cloudserver: de

2021-11-24 15:15:54.456 [DEBUG] [nal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":1474,"method":"get_consumable","params":[]} -> 192.168.178.31 (Device: 0F92FFDD token: 70723077XXXXXXXXXXXXXXXX5339696D Queue: 5). Send via cloudserver: de

2021-11-24 15:15:54.459 [DEBUG] [nal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":1475,"method":"get_map_v1","params":[]} -> 192.168.178.31 (Device: 0F92FFDD token: 70723077XXXXXXXXXXXXXXXX5339696D Queue: 6). Send via cloudserver: de

2021-11-24 15:15:54.524 [DEBUG] [miio.internal.cloud.MiCloudConnector] - Send request: {"id":1470,"method":"get_dnd_timer","params":[]} to https://de.api.io.mi.com/app/home/rpc/261291997

2021-11-24 15:15:54.605 [DEBUG] [miio.internal.cloud.MiCloudConnector] - Request to de server /home/rpc/261291997. Response: {"code":0,"exe_time":1,"id":1470,"otlocalts":1637763354586553,"result":[{"enabled":1,"end_hour":8,"end_minute":0,"start_hour":22,"start_minute":0}]}

2021-11-24 15:15:54.607 [DEBUG] [miio.internal.cloud.MiCloudConnector] - response: {"code":0,"exe_time":1,"id":1470,"otlocalts":1637763354586553,"result":[{"enabled":1,"end_hour":8,"end_minute":0,"start_hour":22,"start_minute":0}]}

2021-11-24 15:15:54.609 [DEBUG] [nal.transport.MiIoAsyncCommunication] - Command {"id":1470,"method":"get_dnd_timer","params":[]} send via cloudserver de

2021-11-24 15:15:54.611 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for 0F92FFDD type: DND_GET, result: [{"enabled":1,"end_hour":8,"end_minute":0,"start_hour":22,"start_minute":0}], fullresponse: {"code":0,"exe_time":1,"id":1470,"otlocalts":1637763354586553,"result":[{"enabled":1,"end_hour":8,"end_minute":0,"start_hour":22,"start_minute":0}]}

2021-11-24 15:15:54.614 [DEBUG] [miio.internal.cloud.MiCloudConnector] - Send request: {"id":1471,"method":"get_clean_summary","params":[]} to https://de.api.io.mi.com/app/home/rpc/261291997

2021-11-24 15:15:54.698 [DEBUG] [miio.internal.cloud.MiCloudConnector] - Request to de server /home/rpc/261291997. Response: {"code":0,"exe_time":2,"id":1471,"otlocalts":1637763354678727,"result":[204315,3296485000,116,[1637749202,1637610570,1637500520,1637223256,1636557125,1636546706,1636191730,1634727567,1632386141,1631019495,1630673264,1629957677,1627904506,1627744168,1627476064,1627108163,1626077677,1624960997,1624089186,1623762650]]}

2021-11-24 15:15:54.699 [DEBUG] [miio.internal.cloud.MiCloudConnector] - response: {"code":0,"exe_time":2,"id":1471,"otlocalts":1637763354678727,"result":[204315,3296485000,116,[1637749202,1637610570,1637500520,1637223256,1636557125,1636546706,1636191730,1634727567,1632386141,1631019495,1630673264,1629957677,1627904506,1627744168,1627476064,1627108163,1626077677,1624960997,1624089186,1623762650]]}

2021-11-24 15:15:54.701 [DEBUG] [nal.transport.MiIoAsyncCommunication] - Command {"id":1471,"method":"get_clean_summary","params":[]} send via cloudserver de

2021-11-24 15:15:54.704 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for 0F92FFDD type: CLEAN_SUMMARY_GET, result: [204315,3296485000,116,[1637749202,1637610570,1637500520,1637223256,1636557125,1636546706,1636191730,1634727567,1632386141,1631019495,1630673264,1629957677,1627904506,1627744168,1627476064,1627108163,1626077677,1624960997,1624089186,1623762650]], fullresponse: {"code":0,"exe_time":2,"id":1471,"otlocalts":1637763354678727,"result":[204315,3296485000,116,[1637749202,1637610570,1637500520,1637223256,1636557125,1636546706,1636191730,1634727567,1632386141,1631019495,1630673264,1629957677,1627904506,1627744168,1627476064,1627108163,1626077677,1624960997,1624089186,1623762650]]}

2021-11-24 15:15:54.707 [DEBUG] [miio.internal.cloud.MiCloudConnector] - Send request: {"id":1472,"method":"get_status","params":[]} to https://de.api.io.mi.com/app/home/rpc/261291997

2021-11-24 15:15:54.788 [DEBUG] [miio.internal.cloud.MiCloudConnector] - Request to de server /home/rpc/261291997. Response: {"code":0,"exe_time":1,"id":1472,"otlocalts":1637763354769739,"result":[{"battery":100,"clean_area":892500,"clean_time":37,"dnd_enabled":0,"error_code":0,"fan_power":102,"in_cleaning":1,"in_fresh_state":0,"in_returning":0,"lab_status":1,"lock_status":0,"map_present":1,"map_status":3,"msg_seq":891,"msg_ver":3,"state":5,"water_box_status":0}]}

2021-11-24 15:15:54.790 [DEBUG] [miio.internal.cloud.MiCloudConnector] - response: {"code":0,"exe_time":1,"id":1472,"otlocalts":1637763354769739,"result":[{"battery":100,"clean_area":892500,"clean_time":37,"dnd_enabled":0,"error_code":0,"fan_power":102,"in_cleaning":1,"in_fresh_state":0,"in_returning":0,"lab_status":1,"lock_status":0,"map_present":1,"map_status":3,"msg_seq":891,"msg_ver":3,"state":5,"water_box_status":0}]}

2021-11-24 15:15:54.792 [DEBUG] [nal.transport.MiIoAsyncCommunication] - Command {"id":1472,"method":"get_status","params":[]} send via cloudserver de

2021-11-24 15:15:54.795 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for 0F92FFDD type: GET_STATUS, result: [{"battery":100,"clean_area":892500,"clean_time":37,"dnd_enabled":0,"error_code":0,"fan_power":102,"in_cleaning":1,"in_fresh_state":0,"in_returning":0,"lab_status":1,"lock_status":0,"map_present":1,"map_status":3,"msg_seq":891,"msg_ver":3,"state":5,"water_box_status":0}], fullresponse: {"code":0,"exe_time":1,"id":1472,"otlocalts":1637763354769739,"result":[{"battery":100,"clean_area":892500,"clean_time":37,"dnd_enabled":0,"error_code":0,"fan_power":102,"in_cleaning":1,"in_fresh_state":0,"in_returning":0,"lab_status":1,"lock_status":0,"map_present":1,"map_status":3,"msg_seq":891,"msg_ver":3,"state":5,"water_box_status":0}]}

2021-11-24 15:15:54.805 [DEBUG] [miio.internal.cloud.MiCloudConnector] - Send request: {"id":1473,"method":"miIO.info","params":[]} to https://de.api.io.mi.com/app/home/rpc/261291997

2021-11-24 15:15:54.886 [DEBUG] [miio.internal.cloud.MiCloudConnector] - Request to de server /home/rpc/261291997. Response: {"code":0,"id":1473,"message":"ok","otlocalts":1637763354867319,"partner_id":"","result":{"ap":{"bssid":"3C:92:AB:6A:D3:6C","rssi":-41,"ssid":"HomeWLAN"},"fw_ver":"3.5.8_002034","hw_ver":"Linux","life":15863,"mac":"50:EC:50:12:44:B6","miio_ver":"miio-client 3.5.8","model":"roborock.vacuum.s5","netif":{"gw":"192.168.178.1","localIp":"192.168.178.31","mask":"255.255.255.0"},"token":"70723077XXXXXXXXXXXXXXXX5339696D"}}

2021-11-24 15:15:54.888 [DEBUG] [miio.internal.cloud.MiCloudConnector] - response: {"code":0,"id":1473,"message":"ok","otlocalts":1637763354867319,"partner_id":"","result":{"ap":{"bssid":"3C:92:AB:6A:D3:6C","rssi":-41,"ssid":"HomeWLAN"},"fw_ver":"3.5.8_002034","hw_ver":"Linux","life":15863,"mac":"50:EC:50:12:44:B6","miio_ver":"miio-client 3.5.8","model":"roborock.vacuum.s5","netif":{"gw":"192.168.178.1","localIp":"192.168.178.31","mask":"255.255.255.0"},"token":"70723077XXXXXXXXXXXXXXXX5339696D"}}

2021-11-24 15:15:54.890 [DEBUG] [nal.transport.MiIoAsyncCommunication] - Command {"id":1473,"method":"miIO.info","params":[]} send via cloudserver de

2021-11-24 15:15:54.893 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for 0F92FFDD type: MIIO_INFO, result: {"ap":{"bssid":"3C:92:AB:6A:D3:6C","rssi":-41,"ssid":"HomeWLAN"},"fw_ver":"3.5.8_002034","hw_ver":"Linux","life":15863,"mac":"50:EC:50:12:44:B6","miio_ver":"miio-client 3.5.8","model":"roborock.vacuum.s5","netif":{"gw":"192.168.178.1","localIp":"192.168.178.31","mask":"255.255.255.0"},"token":"70723077XXXXXXXXXXXXXXXX5339696D"}, fullresponse: {"code":0,"id":1473,"message":"ok","otlocalts":1637763354867319,"partner_id":"","result":{"ap":{"bssid":"3C:92:AB:6A:D3:6C","rssi":-41,"ssid":"HomeWLAN"},"fw_ver":"3.5.8_002034","hw_ver":"Linux","life":15863,"mac":"50:EC:50:12:44:B6","miio_ver":"miio-client 3.5.8","model":"roborock.vacuum.s5","netif":{"gw":"192.168.178.1","localIp":"192.168.178.31","mask":"255.255.255.0"},"token":"70723077XXXXXXXXXXXXXXXX5339696D"}}

2021-11-24 15:15:54.896 [DEBUG] [miio.internal.cloud.MiCloudConnector] - Send request: {"id":1474,"method":"get_consumable","params":[]} to https://de.api.io.mi.com/app/home/rpc/261291997

2021-11-24 15:15:54.978 [DEBUG] [miio.internal.cloud.MiCloudConnector] - Request to de server /home/rpc/261291997. Response: {"code":0,"exe_time":2,"id":1474,"otlocalts":1637763354959754,"result":[{"filter_element_work_time":0,"filter_work_time":25009,"main_brush_work_time":205220,"sensor_dirty_time":3875,"side_brush_work_time":205220}]}

2021-11-24 15:15:54.980 [DEBUG] [miio.internal.cloud.MiCloudConnector] - response: {"code":0,"exe_time":2,"id":1474,"otlocalts":1637763354959754,"result":[{"filter_element_work_time":0,"filter_work_time":25009,"main_brush_work_time":205220,"sensor_dirty_time":3875,"side_brush_work_time":205220}]}

2021-11-24 15:15:54.982 [DEBUG] [nal.transport.MiIoAsyncCommunication] - Command {"id":1474,"method":"get_consumable","params":[]} send via cloudserver de

2021-11-24 15:15:54.985 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for 0F92FFDD type: CONSUMABLES_GET, result: [{"filter_element_work_time":0,"filter_work_time":25009,"main_brush_work_time":205220,"sensor_dirty_time":3875,"side_brush_work_time":205220}], fullresponse: {"code":0,"exe_time":2,"id":1474,"otlocalts":1637763354959754,"result":[{"filter_element_work_time":0,"filter_work_time":25009,"main_brush_work_time":205220,"sensor_dirty_time":3875,"side_brush_work_time":205220}]}

2021-11-24 15:15:54.992 [DEBUG] [miio.internal.cloud.MiCloudConnector] - Send request: {"id":1475,"method":"get_map_v1","params":[]} to https://de.api.io.mi.com/app/home/rpc/261291997

2021-11-24 15:15:55.074 [DEBUG] [miio.internal.cloud.MiCloudConnector] - Request to de server /home/rpc/261291997. Response: {"code":0,"exe_time":1,"id":1475,"otlocalts":1637763355055787,"result":["robomap%2F261291997%2F15"]}

2021-11-24 15:15:55.076 [DEBUG] [miio.internal.cloud.MiCloudConnector] - response: {"code":0,"exe_time":1,"id":1475,"otlocalts":1637763355055787,"result":["robomap%2F261291997%2F15"]}

2021-11-24 15:15:55.078 [DEBUG] [nal.transport.MiIoAsyncCommunication] - Command {"id":1475,"method":"get_map_v1","params":[]} send via cloudserver de

2021-11-24 15:15:55.080 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for 0F92FFDD type: GET_MAP, result: ["robomap%2F261291997%2F15"], fullresponse: {"code":0,"exe_time":1,"id":1475,"otlocalts":1637763355055787,"result":["robomap%2F261291997%2F15"]}

2021-11-24 15:15:55.083 [DEBUG] [g.miio.internal.cloud.CloudConnector] - Getting vacuum map robomap%2F261291997%2F15 from Xiaomi cloud server: 'de'

2021-11-24 15:15:55.084 [DEBUG] [miio.internal.cloud.MiCloudConnector] - Send request: {"obj_name":"robomap%2F261291997%2F15"} to https://de.api.io.mi.com/app/home/getmapfileurl

2021-11-24 15:15:55.127 [DEBUG] [miio.internal.cloud.MiCloudConnector] - Received  JSON message {"code":0,"message":"ok","result":{"url":"https://awsde0.fds.api.xiaomi.com/robomap/robomap/261291997/15?Expires=1637765155000&GalaxyAccessKeyId=5173733726437&Signature=X9AKjZl0Smt7Wdk3Gmf4lta4Lok=","obj_name":"robomap/261291997/15","method":"GET","expires_time":1637765155,"ok":true}}

2021-11-24 15:15:55.502 [DEBUG] [o.internal.handler.MiIoVacuumHandler] - Mapdata saved to /var/lib/openhab/miio/robomap%2F261291997%2F1520211124-151555.rrmap

2021-11-24 15:15:56.109 [DEBUG] [inding.miio.internal.robot.RRMapDraw] - Identified rooms in map: 16 17 1 18 19 20 21

After that all items except the cleaningMap item were updated:

2021-11-24 15:27:25.221 [INFO ] [openhab.event.ItemStateEvent        ] - Item 'Vacuum_Cleaner_Roberta_Batterieladung' updated to 100

2021-11-24 15:27:25.225 [INFO ] [openhab.event.ItemStateEvent        ] - Item 'Vacuum_Cleaner_Roberta_Status_Clean_Area' updated to 1.1

2021-11-24 15:27:25.229 [INFO ] [openhab.event.ItemStateEvent        ] - Item 'Vacuum_Cleaner_Roberta_CleaningTime' updated to 0

2021-11-24 15:27:25.231 [INFO ] [openhab.event.ItemStateEvent        ] - Item 'Vacuum_Cleaner_Roberta_ErrorCode' updated to No error

2021-11-24 15:27:25.234 [INFO ] [openhab.event.ItemStateEvent        ] - Item 'Vacuum_Cleaner_Roberta_FanPower' updated to 102

2021-11-24 15:27:25.236 [INFO ] [openhab.event.ItemStateEvent        ] - Item 'Vacuum_Cleaner_Roberta_ControlFanLevel' updated to 102

2021-11-24 15:27:25.239 [INFO ] [openhab.event.ItemStateEvent        ] - Item 'Vacuum_Cleaner_Roberta_State' updated to Charging

2021-11-24 15:27:25.241 [INFO ] [openhab.event.ItemStateEvent        ] - Item 'Vacuum_Cleaner_Roberta_ControlVacuum' updated to dock

2021-11-24 15:27:25.320 [INFO ] [openhab.event.ItemStateEvent        ] - Item 'Vacuum_Cleaner_Roberta_MainBrushRemaining' updated to 81

2021-11-24 15:27:25.324 [INFO ] [openhab.event.ItemStateEvent        ] - Item 'Vacuum_Cleaner_Roberta_SideBrushRemaining' updated to 71

2021-11-24 15:27:25.327 [INFO ] [openhab.event.ItemStateEvent        ] - Item 'Vacuum_Cleaner_Roberta_FilterUsageRemaining' updated to 96

2021-11-24 15:27:25.329 [INFO ] [openhab.event.ItemStateEvent        ] - Item 'Vacuum_Cleaner_Roberta_SensorDirtRemaining' updated to 96

Yes, indeed something is happening in the parser. So at least it gets to the processing stage as you have a line.
2021-11-24 15:15:56.109 [DEBUG] [inding.miio.internal.robot.RRMapDraw] - Identified rooms in map: 16 17 1 18 19 20 21

RRMapDraw is responsible for rendering the image. The only thing that comes to mind was an issue with the fonts, which was reported long time ago. (somehow java did not see any available fonts in a headless server).

To avoid the text, checkout this post Xiaomi Robot Vacuum Binding - #1895 by marcel_verpaalen mapConfig.json should contain an empty text like this { "text": ""}
You can also try the following { "text": "" , "cropBorder": -1 , "showLogo": false} as that avoids some nastry logic.

Note, your path of the file is somewhat unusual (it does not contain the usual userdata part), I think the mapConfig.json needs to be stored in the same folder

Unfortunately no changes in behaviour.

I tried to use { "text": ""} or { "text": "" , "cropBorder": -1 , "showLogo": false} or a blank file named mapConfig.json in the hope the binding will create a valid file out of it, only for testing, if this file is recognized from the binding. But the file leaves empty.

After editing the file mapConfig.json I restarted first the binding, than the openhab service and than editing some minor changes to the thing. Nothing changed in concern to the mapConfig.json file or the display issue of the map image.

I put the file mapConfig.json to this location /var/lib/openhab/miio. Here also the rrmap files and miio-Tokens.json files stored.

The log shows the same as before an ends with:
2021-11-24 18:26:36.226 [DEBUG] [inding.miio.internal.robot.RRMapDraw] - Identified rooms in map: 16 17 1 18 19 20 21

I use openhabianpi installtion of OH3.1 on an raspberry pi 3b.

Did you expect any more log messages after the last one with RRMapDraw? I see no java errors or other errors in the log concerning this issue. Maybe some general issue with image item in OH3.1?
I did not use the image item before, so don’t know if it is working in general.