Xiaomi Robot Vacuum Binding

Hi,
It is unclear how the rooms are coded.
get_map is to get the latest mapid from the cloud in order to download the (encoded) map.

Your best chance is to try the various numbers and see which room it goes. The room numbers start typically with 10 as first room

I‘m curious, did you manage to get a command with an parameter (in) working? I‘m still struggling.
Are the siid and aiid of the mop 2 pro identical to the mop 2s?

Maybe this helps you, here is the list of aiid/siid for your robot:

Hi Marcel, Andreas, thanks for reply.

Andreas, I’ve read your posts from few days ago. We are trying to find out the same thing!
So i tried the commands as you descripted, and the outputs was the same… same behavior, same errors, same “bling”.
I think, the ssids and piids are identical. I am based on this page https://home.miot-spec.com/spec/ijai.vacuum.v3
So, my best result is, as yours:

xiaomi_robot_execute.sendCommand('action{"did":"set-room-clean","siid":7,"aiid":3,"in":[24.10,25.0,26.1]}')

It gaves me a one “bling” and:

{"id":1158,"result":{"code":0},"exe_time":51}

Im dont know the rooms IDs, also as you, so the “10” from [24.10,25.0,26.1] is only my estimate.
At the moment, i think, we need to try the python-miio to find the correct parameters to fill the part: “in”: [].

I did quick check for you in the mihome app code for the v19
which makes me think you need in the in array something like:
[ “10,11,12”, 1,1]

or in words: a string with the roomIds (separated with comma) the model which seems to be the sweeptype dunno exactly what that expects and the per which is I guess starting/stopping/pausing.

here some of the relevant parts of the source:

  function controlClean(status) {
    var rooIds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
    var per = status == _SCPublic.SCControlParam.start ? _SCPublic.SCSetRoomCleanParam.start : _SCPublic.SCSetRoomCleanParam.pause;
    var model = _SCDevice.SCDevice.stateModel.S2P8_sweepType == _SCPublic.SCCleanModel.border ? _SCPublic.SCSetRoomModeParam.border : _SCPublic.SCSetRoomModeParam.auto;
    _WLLog.default.log('controlClean_s2p8:', _SCDevice.SCDevice.stateModel.S2P8_sweepType);
    return setRoomClean(rooIds, per, model);
  }


  function setRoomClean(ids, per, model) {
    var values = [ids.join(","), model, per];
    
var params = _encapDo(_SCNetEnum.default.NetServer.S7sweep, _SCNetEnum.default.S7SweepAction.S7A3_setRoomClean, values);
    
var matches = /function\s*(\w*)/i.exec(arguments.callee.toString());
    _WLLog.default.log(_WLDateUtils.default.nowText() + " \u9009\u623F\u95F4\u6E05\u626B:", matches[1], params);


 var SCSetRoomCleanParam = {
    stop: 0,
    start: 1,
    pause: 2,
    puaseFalse: 3
  };
  exports.SCSetRoomCleanParam = SCSetRoomCleanParam;
  var SCSetRoomModeParam = {
    auto: 0,
    border: 1
  };
  exports.SCSetRoomModeParam = SCSetRoomModeParam;
  var SCBuildParam = {
    noBuild: 0,
    onlyBuild: 1,
    buildSweep: 2
  };

Thanks for checking the code, but unfortunately I still did not manage to get it work.

'action{“siid”:7,“aiid”:3,“in”:[ “10,11,12,13”, 1,1]}‘

I’ll try out more variants next week.

Andreas, Marcel, the command doesn’t work for me either.

But, yesterday a spend lot of hours to search some more informations.
I found this thread:
https://community.openhab.org/t/miio-binding-execute-rpc-command-for-dreame-d9/132906

The syntax of the command is little different as we excepted. Regarding to ChrisM and anDuR posts, the syntax is:

xiaomi_robot_execute.sendCommand('action{"did":"set-room-clean","siid":7,"aiid":3,"in":[{"piid":24,"value":10},{"piid":25,"value":0},{"piid":26,"value":1}]}')

And it works!!! The vacuum start to clean.

But for me, i still don’t know the room IDs. I tried 10, 15, 20, 25, 30, but the vacuum still start to clean all rooms.

But, there is a another solution to get a right command direct from the Mi home app.
In the mentioned thread, there is a android version of Mi home by vevs, which make it possible to log and save the messages to file, so you can get the exact command, what you need.

I need some time to try it out, but christmas holidays ends, and there will be less time :confused:

1 Like

My first room starts at 16. So 16, 17 etc. I’ve also read about certain vaccums using A B C to identify rooms, maybe try that too?

Correct, that was how I figured out the commands for my roborock s6 max v.

But how about first using this command to find out the map id:

Robot_Command.sendCommand(‘action{“did”:“vacuum-get-map-list”,“siid”:10,“aiid”:1,“in”:[]}’)

And then use the following command to find out the room ids:
Robot_Command.sendCommand(‘action{“did”:“vacuum-get-map-room-list”,“siid”:10,“aiid”:13,“in”:[{“piid”:2,“value”:map-id from the previous command}]}’)

Thanks to you we now use the correct syntax so this command should work.

Ok update: I tested it out my own - but it did not work for me neither. It only reported back something like Room1 Id10 although in the saved map I have got three rooms.

Yep, me to, only 1 room, with ID 10.
I finally succeeded to get log output from android Mi home app by vevs.
I got this command, when i start clean the specific room:

2023-01-09 16:43:56 -> {"params":{"aiid":3,"did":"1027817822","in":["11",0,1],"siid":7}} /miotspec/action
  • 1027817822 is my device ID
  • 11 is from 24 - clean-room-ids
  • 0 is rom 25 -clean-room-mode
  • 1 is from 26 - clean-room-oper

But now, how to implement it to acceptable format by OH.
I tried few versions:

xiaomi_robot_execute.sendCommand('{"params":{"aiid":3,"did":"1027817822","in":["11",0,1],"siid":7}} /miotspec/action')
xiaomi_robot_execute.sendCommand('{"params":{"aiid":3,"did":"1027817822","in":["11",0,1],"siid":7}}')
xiaomi_robot_execute.sendCommand('action{"aiid":3,"did":"1027817822","in":["11",0,1],"siid":7}')

none of them worked. Any ideas?

Tried this one yet:

xiaomi_robot_execute.sendCommand(‘action{“did”:“1027817822”,“siid”:7,“aiid”:3,“in”:[“11”,0,1]}’)

Your last one is the formatted the way OH miio binding needs it.
The value in did is not relevant → in the binding we set it to the command to have it recognizable so we don’t need to remember what the aiid/siid etc mean.

This is indeed what was expected from the source code.

I am curious as it seems than to accept two formats as you said "in":[{"piid":24,"value":10},{"piid":25,"value":0},{"piid":26,"value":1}]} was also working for you.

Or how about combining the two formats:

xiaomi_robot_execute.sendCommand('action{"siid":7,"aiid":3,"in":[{"piid":24,"value":"11"},{"piid":25,"value":0},{"piid":26,"value":1}]}')

Put the room id into brackets because it is formatted as a string while the parameters for mode and operation are unit8.
But I’m just guessing.

Success! The {“piid”:24,“value”:“11”} got the trick.

The command below works as well, if you want to clean more rooms.

xiaomi_robot_execute.sendCommand('action{"siid":7,"aiid":3,"in":[{"piid":24,"value":"11,12"},{"piid":25,"value":0},{"piid":26,"value":1}]}')

for rooms with ID 11 and 12

Thank you guys.

2 Likes

Thanks to you Tommi and of course thanks to you Marcel!

Mine works as well, was a bit try and error with my room ids, three rooms from 10-12 and of course id 12 it was…
But now it works!

xiaomi_robot_execute.sendCommand('action{"siid":7,"aiid":3,"in":[{"piid":24,"value":"12"},{"piid":25,"value":0},{"piid":26,"value":1}]}')

I just have one floor. Frequently my Roborock S5 is changing the map (closed doors, stuck somewhere) and then it will not enter a room or is totaly lost.
Then I need to open the Xiaomi App and load my manual saved map.

I want to accomplish this by openhab. I have tried to read the actual map.
Sendind the command “get_map” to a “miio:vacuum:1234567:actions#commands” linked item let me read the map ID.
roborockCommands.sendCommand("get_map")
The item roborockCommands will change to “retry” when not moving. While moving it will change to result":[“robomap%2F987654321%2F16”]

No I know the Map ID of a working map.

But how to tell roborock to the load the map when I see his “self changed map” is wrong?

I have tried several commands and methods, even json formated Strings. Nothing worked.

I have this channels:
miio:vacuum:1234567:actions#commands
miio:vacuum:1234567:status#map_status
miio:vacuum:1234567:info#multi_maps_list

Hey,
I’m trying t get my Xiaomi Robot Vacuum X10+ working with the binding. It is discovered with token but it is permanently offline. Thing type shows "unsupported Xiaomi Mi Device.
Any chance to get it implemented/working?
Thanks

Tim

See the readme. Override the model with a supported model. Most likely it will work.
Report back your results and we can include it.

If above does not work use the create experimental miot support switch of the unsupported device.

Hi Guys,

i want to define a rule set where the dust container is the trigger ( has been removed and deployed). Could you please help me to read out the status of the container? Is it even possible to get this information?

Thing:

UID: miio:generic:18D11F6A
label: Roborock S5 Max
thingTypeUID: miio:vacuum
configuration:
  cloudServer: de
  refreshInterval: 30
  host: 192.168.101.217
  model: roborock.vacuum.s5e
  communication: direct
  deviceId: "xxxx"
  timeout: 15000
  token: xxxx

Thanks in Advance
Simon

I have a new Roborock S7 MaxV Ultra and connot get a zoned area to run from OpenHAB 3.4.3

I have the Miio Binding installed and online. I see the log updating when I manually run the vacuum. I can send the commands to ‘vacuum’ and ‘dock’ and they seem to work fine.

I have used the Xiaomi Robot Radar Map to find the zone coordinates, but my log will just show below where it accepts the coordinates and then quickly goes back to ‘dock’:

2023-04-30 14:43:30.646 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'Carson_Vacuum_Control_Vacuum' received command app_zoned_clean[[28850,32500,31750,33400,1]]
2023-04-30 14:43:30.648 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'Carson_Vacuum_Control_Vacuum' predicted to become app_zoned_clean[[28850,32500,31750,33400,1]]
2023-04-30 14:43:30.658 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Carson_Vacuum_Control_Vacuum' changed from dock to app_zoned_clean[[28850,32500,31750,33400,1]]
2023-04-30 14:43:33.773 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Carson_Vacuum_Control_Vacuum' changed from app_zoned_clean[[28850,32500,31750,33400,1]] to dock

Items:

String CarsonActionsCommands 	"Execute Command"   (gVac)    {channel="miio:generic:1FF3DF84:actions#control" }

Rule:

rule "Testing"
when
	Item vTesting changed to ON

then
	logInfo("Testing", "Testing set to ON")	
	CarsonActionsCommands.sendCommand('app_zoned_clean[[28850,32500,31750,33400,1]]')
end

Any ideas on why the zone is not working or is there a better way to have it just vacuum a specific zone?

Thanks in advance!

Hi all,
Hope it’s the right place to report the issue. Recently I found map function stops working in both Mi Home app as well as via MIIO binding. I contacted Xiaomi and they said I should disable MIIO binding without giving me a explanation. So looks to me that Xiaomi/Roborock starts to block map functionality without their app. My question is: how can I make sure MIIO doesn’t talk to Xiaomi Cloud? Is it enough just not to configure the map item? Many thanks in advance!