thnx mate helped a lot.
i have another question .What is the easiest way to command vacuum to clean rooms from habpanel and from google assistnt using voice?I am thinking creating switches for every room and then with rules when switch on
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
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.
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.
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
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…
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
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.