Xiaomi Robot Vacuum Binding

I try that via REST command but nothing happens. Would be great if someone can explain how it works.

Anyway I don’t get a map. Only a string with data word tmp. How can I show the map?

Thanks you.

I just got a careli.fryer.maf02. It gets discovered in OH3 UI, but only with a few basic channels.
After creating the thing the debug log says

Mi Device model careli.fryer.maf02 identified as: Unknown Mi IO Device (unknown). Does not match thingtype miio:generic. Changing thingtype to miio:unsupported

Those are the only channels that are found:


Anything else I can do to debug?

This device is unsupported in your version of openhab. Update to oh3.2 and it will be discovered as basic device with channels.

I just implemented a rule set for this, hence sharing for others:

  • I do use one item per room (I got 4 rooms) to identify which room needs to be cleaned
  • I then have another item (also a switch) that I activate to execute the cleaning

Above enables me to combine rooms for cleaning.

The rule looks like this:
//Set item variables

var room_kitchen = itemRegistry.getItem("utilities_roborock_room_16").getState ();
var room_bedroom_master = itemRegistry.getItem("utilities_roborock_room_17").getState ();
var room_livingroom = itemRegistry.getItem("utilities_roborock_room_18").getState ();
var room_bedroom_children = itemRegistry.getItem("utilities_roborock_room_19").getState ();
var room_execute = itemRegistry.getItem("utilities_roborock_room_execute").getState ();

//Actions

//Set variables if switch is turned ON

if (room_kitchen == "ON"){
  var room_kitchen_number = "16, ";
} else {
  var room_kitchen_number = "";
}

if (room_bedroom_master == "ON"){
  var room_bedroom_master_number = "17, ";
} else {
  var room_bedroom_master_number = "";
}

if (room_livingroom == "ON"){
  var room_livingroom_number = "18, ";
} else {
  var room_livingroom_number = "";
}

if (room_bedroom_children == "ON"){
  var room_bedroom_children_number = "19, ";
} else {
  var room_bedroom_children_number = "";
}

//Combine room variables into control string

var room_con = "app_segment_clean [" + room_kitchen_number + room_bedroom_master_number + room_livingroom_number + room_bedroom_children_number +"]";

//Send command

events.sendCommand("utilities_roborock_executecommand", room_con);
Log.logInfo("TEST", "RULE - Utilities - Roborock Room Cleaning started for rooms:" + " " + room_con);
telegramAction.sendTelegram("RULE - Utilities - Roborock Room Cleaning started for rooms:" + " " + room_con);

//Clear all variable states

var room_con = 0;
events.sendCommand("utilities_roborock_room_execute", "OFF");
events.sendCommand("utilities_roborock_room_16", "OFF");
events.sendCommand("utilities_roborock_room_17", "OFF");
events.sendCommand("utilities_roborock_room_18", "OFF");
events.sendCommand("utilities_roborock_room_19", "OFF");

the control string can take any combination of rooms and it works.

The rule fires when the execute switch is turned ON and then takes the different room switches that were turned ON into the variables.
After execution of the command, all switches are reset to OFF.

I am sure it can be optimized and cut in half, but it works for now.
Hope it helps!

EDIT: For got to answer your 2nd question: I think there is no need to set the vacuum back to “pause” or “dock” as it will automatically return to the dock after cleaning anyways.

1 Like

Thanks for sharing. But how i get the room number if i don’t know it…

Have a look here.
You can send the command get_room_mapping to the command channel.
It will then show you in the log the different available rooms defined in the Xiaomi app.
You can then send the rooms to the command channel to identify which number is which room.

Hey Chris, thanks for reply.

I try it now via rule and via REST API and i get only NULL with get_map and get_room_mapping. It doesn’t matter. Do i something wrong? I have no clue how do it exactly to get the right result.

rule "RoomsVacuum"
when
    Item dummyschalter changed 
then
    var data = sendCommand("RobbyBubbleExecuteCommand", "get_room_mapping");
    Log.logInfo("RBEC", "string:" + " " + data);
end

I do not use Rule DSL anymore, but below ECMA code works (just tested):

events.sendCommand("YOURITEM_executecommand", "get_room_mapping");

The output:

thnx mate for answer,i will try ur way when i find some time…
about get_room_mapping i sent it to the command channel but i get

2021-12-28 13:45:04.732 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'MiRobotVacuumV2_Actions_ExecuteCommand' received command get_room_mapping
2021-12-28 13:45:04.742 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'MiRobotVacuumV2_Actions_ExecuteCommand' predicted to become get_room_mapping
2021-12-28 13:45:04.750 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'MiRobotVacuumV2_Actions_ExecuteCommand' changed from {"result":["ok"],"id":14577} to get_room_mapping
2021-12-28 13:45:04.785 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'MiRobotVacuumV2_Actions_ExecuteCommand' changed from get_room_mapping to {"result":[],"id":12567}

maybe my roborock S5 doent support it?

It is because the command itself does not return anything directly.
Check your log/ the channel a few seconds later and you find the response

I got a S5 (Max) as well.

Thanks - that did the trick! Out of curiosity - why did I need 3.2 for this?

Recipe ID is something like A8543 for example. Do you think there’s a way to grab the recipe based on the ID from the/a Xiaomi database and display it in OH? That way we wouldn’t need to Xiaomi app but instead could simply select the recipe in OH…

I have this vacuum: https://www.openhab.org/addons/bindings/miio/#mi-robot-vacuum-mop-1c-stytj01zhm-dreame-vacuum-mc1808-channels

I don’t get any response. Nothing in log:

2021-12-28 13:42:55.785 [INFO ] [org.openhab.core.model.script.RBEC  ] - string: null
2021-12-28 13:45:25.079 [INFO ] [org.openhab.core.model.script.RBEC  ] - string: null

Thanks together for your help!

@marcel_verpaalen

DEBUG Mode show this in my log:

2021-12-28 14:05:39.108 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for device RobbyBubble type: GET_ROOM_MAPPING, result: null, fullresponse: {"id":5335,"error":{"code":-9999,"message":"user ack timeout"},"exe_time":4003}

Hi @downloadme4free, I didn’t have time to dig into the rules yet, probably within 2 weeks or so. I did the test via OH3 UI where I was manually sending commands from input card

1 Like

@Wikibear your device does not support the command. It is a completely different device command wise from the viomi/rockrobo devices

Your device is a ‘miot’ device, having different command structure.

How do I get the map and map IDs? Via App there is no problem to send the Bot into zones. I can edit the map in different zones. How can I send the Bot to a special zone in Openhab?

As it was only added recently. You might have gotten away with oh3.1 and downloading the json file as well. Don’t recall if it used 3.2 specific features in the json file.

for the recipes:
you could try to download this file (see binding readme on how to use local json files).
I added a recipes channel. When I run it it is an rather empty list (it responds with {"recipes":[],"hasMore":false,"nextId":0} but I can imagine for you it has recipes.

careli.fryer.maf02-miot.json (10.8 KB)

1 Like

See https://home.miot-spec.com/spec/dreame.vacuum.mc1808
You can experiment with commands in siid 23

Alternatively, you copy the json file for your device look and add to it.
dreame.vacuum.mc1808-0-miot.json (19.2 KB)

seems like it requires the right country to get a response…
It shows 100 recipies at the time.Don’t know how you get the next page though.

You’ll need to fidle & create your own widget to display the recipe db, but indeed doable.

recipies look like below. The recipeCommand has all the details for your recipe.

{
			"recipeID": 7795,
			"recipeName": "Onion Rings",
			"recipeImage": "https://cdn.awsde0.fds.api.mi-img.com/ysp/%E5%B0%8F%E5%9B%BE/1%E3%80%81%E6%B4%8B%E8%91%B1%E5%9C%88/192.jpg",
			"recipeCommand": "{\"topImage\":\"https://cdn.awssgp0.fds.api.mi-img.com/ysp/%E5%B0%8F%E7%B1%B3%E6%B5%B7%E5%A4%96%E4%BA%91%E9%A3%9F%E8%B0%B1/%E5%A4%A7%E5%9B%BE/1%E3%80%81%E6%B4%8B%E8%91%B1%E5%9C%88/1%E3%80%81%E9%A6%96%E5%9B%BE.jpg\",\n\"cookCommand\":{\"time\":11,\"timeDesc\":\"11 minutes\",\"temperature\":180,\"temperatureDesc\":\"180℃\",\"preHeat\":1,\"capacity\":0},\n\"share\":\"3 persons\",\n\"intro\":\"Golden onion rings are crispy and crunchy with a rich onion flavor. With their crispy coating and soft middle, they are a firm family favorite and make a great companion to your free time. Dip these onion rings in a sweet and tangy ketchup for an irresistible taste.\",\n\"recipeIntro\":\"Onion Rings\",\n\"prepareFood\":[\n{\"food\":\"Sweet onion\",\"amount\":\"1\"},\n{\"food\":\"All-purpose flour\",\"amount\":\"80g\"},\n{\"food\":\"Baking powder\",\"amount\":\"3g\"},\n{\"food\":\"Salt\",\"amount\":\"10g\"},\n{\"food\":\"Breadcrumbs\",\"amount\":\"60g\"},\n{\"food\":\"Eggs\",\"amount\":\"2\"}],\n\"cookProcess\":[\n{\"img\":\"https://cdn.awssgp0.fds.api.mi-img.com/ysp/%E5%B0%8F%E7%B1%B3%E6%B5%B7%E5%A4%96%E4%BA%91%E9%A3%9F%E8%B0%B1/%E5%A4%A7%E5%9B%BE/1%E3%80%81%E6%B4%8B%E8%91%B1%E5%9C%88/3%E3%80%81%E6%8A%8A%E7%94%9C%E6%B4%8B%E8%91%B1%E5%88%87%E6%88%90%E7%BA%A60.jpg\",\n\"step\":\" Tap the start program and activate preheat to start preheating the air fryer.(When the air fryer reaches preset temperature, it will beep and the preheating will finish.) Cut the sweet onion into thin slices of about 1/5 in thick, and then separate them into rings and set aside.\"},\n{\"img\":\"https://cdn.awssgp0.fds.api.mi-img.com/ysp/%E5%B0%8F%E7%B1%B3%E6%B5%B7%E5%A4%96%E4%BA%91%E9%A3%9F%E8%B0%B1/%E5%A4%A7%E5%9B%BE/1%E3%80%81%E6%B4%8B%E8%91%B1%E5%9C%88/4%E3%80%81%E6%89%80%E6%9C%89%E6%B4%8B%E8%91%B1%E5%9C%88%E9%83%BD%E6%B2%BE%E4%B8%8A%E9%85%8D%E6%96%99.jpg\",\n\"step\":\" Pour the flour, baking powder and salt into a resealable plastic bag. Then seal it and shake well. Next, add the onion rings, seal the bag again, and shake until all the onion rings are coated in the flour mixture.\"},\n{\"img\":\"https://cdn.awssgp0.fds.api.mi-img.com/ysp/%E5%B0%8F%E7%B1%B3%E6%B5%B7%E5%A4%96%E4%BA%91%E9%A3%9F%E8%B0%B1/%E5%A4%A7%E5%9B%BE/1%E3%80%81%E6%B4%8B%E8%91%B1%E5%9C%88/5%E3%80%81%E4%BB%8E%E8%A2%8B%E5%AD%90%E9%87%8C%E5%8F%96%E4%B8%80%E4%B8%AA%E6%B4%8B%E8%91%B1%E5%9C%88%EF%BC%8C%E6%8A%96%E6%8E%89%E5%A4%9A%E4%BD%99%E7%9A%84%E7%B2%89%E5%90%8E%E6%B5%B8%E5%85%A5%E8%9B%8B%E6%B6%B2.jpg\",\n\"step\":\" Take one onion ring at a time from the bag, and shake off any excess flour mixture and dip it into the beaten eggs.\"},\n{\"img\":\"https://cdn.awssgp0.fds.api.mi-img.com/ysp/%E5%B0%8F%E7%B1%B3%E6%B5%B7%E5%A4%96%E4%BA%91%E9%A3%9F%E8%B0%B1/%E5%A4%A7%E5%9B%BE/1%E3%80%81%E6%B4%8B%E8%91%B1%E5%9C%88/6%E3%80%81%E6%95%B4%E4%B8%AA%E6%B4%8B%E8%91%B1%E5%9C%88%E9%83%BD%E9%BB%8F%E4%B8%8A%E9%9D%A2%E5%8C%85%E7%B3%A0.jpg\",\n\"step\":\" Drain off any excess mixture and place the onion ring on a plate of the breadcrumbs so that the whole onion ring gets coated in the breadcrumbs.\"},\n{\"img\":\"https://cdn.awssgp0.fds.api.mi-img.com/ysp/%E5%B0%8F%E7%B1%B3%E6%B5%B7%E5%A4%96%E4%BA%91%E9%A3%9F%E8%B0%B1/%E5%A4%A7%E5%9B%BE/1%E3%80%81%E6%B4%8B%E8%91%B1%E5%9C%88/7%E3%80%81%E5%B0%86%E6%B4%8B%E8%91%B1%E5%9C%88%E6%94%BE%E5%88%B0%E5%B7%B2%E7%BB%8F%E5%AE%8C%E6%88%90%E9%A2%84%E7%83%AD%E7%9A%84%E7%82%B8%E7%AF%AE%E4%B8%AD.jpg\",\n\"step\":\" After the air fryer has preheated, pull out the basket and line it with a layer of aluminum foil. Place the onion rings in the basket and push it back into the air fryer to resume cooking.\"},\n{\"img\":\"https://cdn.awssgp0.fds.api.mi-img.com/ysp/%E5%B0%8F%E7%B1%B3%E6%B5%B7%E5%A4%96%E4%BA%91%E9%A3%9F%E8%B0%B1/%E5%A4%A7%E5%9B%BE/1%E3%80%81%E6%B4%8B%E8%91%B1%E5%9C%88/8%E3%80%81%E6%88%90%E5%93%81.jpg\",\n\"step\":\" Remove from the air fryer and enjoy.\"}],\n\"tips\":\"1. When using the grill to fry two layers of onion rings at once, remove the onion rings on the top layer and the grill once they're cooked well, and then continue to cook the onion rings on the bottom layer for a further two minutes. \\n2. Adjust the cooking time and temperature according to your personal taste and the ingredients you're using.\"}\n",
			"recipeTags": [
				"snack"
			],
			"vendor": "careli",
			"deviceType": "fryer",
			"model": "careli.fryer.maf02",
			"region": 4,
			"status": 3,
			"createTime": 1626875504,
			"updateTime": 1627028789,
			"lang": "en"
		}

Issue with Qingping Air Monitor Lite (cgllc.airm.cgdn1)
For unknown reason unit become offline in OH. At same time it was accessible via MiHome app and has good WiFi connection.
Restart of binding and even reboot of Rpi do not helps.
So, I tried to delete thing and recreate it manually - still no luck…
Then I found in MiHome app that device was connected to network “remotely” and changed OH thing properties “Communication Method” from Direct (Default) to Cloud.
This resolve problem and thing turn to Online shortly.
Marcel, maybe you can add to binding test of connection type when thing going offline?
Thanks!