Xiaomi Robot Vacuum Binding

From your earlier test I thought it expected a number without the quotes.
But seems the device did not responded to both.
Maybe short disruption, or device being overwhelmed.

I don’t really know can only recommend to test once more and see which one works. Can it be that the vacuum first needs to be vacuuming before you send the command?

Note would switch to debug logging instead of trace as it will make it much more readable

1 Like

Yes, the robot has to vacuum or move away from the dock before it can return to the dock.
In the log above, the first command id=86 is done by sending 1 to channel “miio:basic:Culi:vacuumaction”. Robot does not react with this.
The second command id=92 is done by sending string set_charge [1] to the channel “miio:basic:Culi:actions#commands”, as you told me last time. It was successful and robot started going to the dock.
I noticed a difference between 2 commands is the first (unsuccess) command has a couple of double quotes “1” around the value, but the second command does not have. I wonder if it is the problem?

viomi.vacuum.v8.json (11.0 KB)
Here’s the version which should fix the 3/4 mistake and should be sending the command without the quotes

1 Like

Well done! It works! :slight_smile:
This is the log in sequence of 3 commands: Start, Stop and Dock:

10:40:38.380 [DEBUG] [iio.internal.handler.MiIoBasicHandler] - Locating action for miio:basic:Culi channel 'vacuumaction': '1'
10:40:38.388 [DEBUG] [iio.internal.handler.MiIoBasicHandler] - Sending command set_mode_withroom[0,1,0]
10:40:38.398 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":126,"method":"set_mode_withroom","params":[0,1,0]} -> 192.168.0.210 (Device: 1091ACD0 token: 4E634D51XXXXXXXXXXXXXXXX5233637A Queue: 1).
10:40:38.404 [DEBUG] [iio.internal.handler.MiIoBasicHandler] - Conditional command set_charge[] not send, condition 'matchValue' not met
10:40:40.552 [DEBUG] [.internal.handler.MiIoAbstractHandler] - Received response for Culi type: UNKNOWN, result: ["ok"], fullresponse: {"result":["ok"],"id":126}
10:40:41.408 [DEBUG] [iio.internal.handler.MiIoBasicHandler] - Periodic update for 'miio:basic:Culi' (miio:basic)
10:40:41.413 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":127,"method":"get_prop","params":["run_state","mode","err_state","battary_life","box_type"]} -> 192.168.0.210 (Device: 1091ACD0 token: 4E634D51XXXXXXXXXXXXXXXX5233637A Queue: 1).
10:40:41.419 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":128,"method":"get_prop","params":["mop_route","s_time","s_area","suction_grade","water_grade"]} -> 192.168.0.210 (Device: 1091ACD0 token: 4E634D51XXXXXXXXXXXXXXXX5233637A Queue: 2).
10:40:41.429 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":129,"method":"get_prop","params":["remember_map","has_map","is_mop","has_newmap"]} -> 192.168.0.210 (Device: 1091ACD0 token: 4E634D51XXXXXXXXXXXXXXXX5233637A Queue: 3).
10:40:41.655 [DEBUG] [.internal.handler.MiIoAbstractHandler] - Received response for Culi type: GET_PROPERTY, result: [3,0,2110,100,3], fullresponse: {"result":[3,0,2110,100,3],"id":127}
10:40:41.712 [DEBUG] [.internal.handler.MiIoAbstractHandler] - Received response for Culi type: GET_PROPERTY, result: [0,0,0,0,12], fullresponse: {"result":[0,0,0,0,12],"id":128}
10:40:41.762 [DEBUG] [.internal.handler.MiIoAbstractHandler] - Received response for Culi type: GET_PROPERTY, result: [1,1,0,0], fullresponse: {"result":[1,1,0,0],"id":129}
10:40:45.267 [DEBUG] [iio.internal.handler.MiIoBasicHandler] - Locating action for miio:basic:Culi channel 'vacuumaction': '0'
10:40:45.286 [DEBUG] [iio.internal.handler.MiIoBasicHandler] - Sending command set_mode_withroom[0,0,0]
10:40:45.290 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":130,"method":"set_mode_withroom","params":[0,0,0]} -> 192.168.0.210 (Device: 1091ACD0 token: 4E634D51XXXXXXXXXXXXXXXX5233637A Queue: 1).
10:40:45.296 [DEBUG] [iio.internal.handler.MiIoBasicHandler] - Conditional command set_charge[] not send, condition 'matchValue' not met
10:40:48.302 [DEBUG] [iio.internal.handler.MiIoBasicHandler] - Periodic update for 'miio:basic:Culi' (miio:basic)
10:40:48.309 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":131,"method":"get_prop","params":["run_state","mode","err_state","battary_life","box_type"]} -> 192.168.0.210 (Device: 1091ACD0 token: 4E634D51XXXXXXXXXXXXXXXX5233637A Queue: 1).
10:40:48.315 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":132,"method":"get_prop","params":["mop_route","s_time","s_area","suction_grade","water_grade"]} -> 192.168.0.210 (Device: 1091ACD0 token: 4E634D51XXXXXXXXXXXXXXXX5233637A Queue: 2).
10:40:48.321 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":133,"method":"get_prop","params":["remember_map","has_map","is_mop","has_newmap"]} -> 192.168.0.210 (Device: 1091ACD0 token: 4E634D51XXXXXXXXXXXXXXXX5233637A Queue: 3).
10:40:49.097 [DEBUG] [.internal.handler.MiIoAbstractHandler] - Received response for Culi type: UNKNOWN, result: ["ok"], fullresponse: {"result":["ok"],"id":130}
10:40:49.143 [DEBUG] [.internal.handler.MiIoAbstractHandler] - Received response for Culi type: GET_PROPERTY, result: [1,0,0,100,3], fullresponse: {"result":[1,0,0,100,3],"id":131}
10:40:49.209 [DEBUG] [.internal.handler.MiIoAbstractHandler] - Received response for Culi type: GET_PROPERTY, result: [0,0,0,0,12], fullresponse: {"result":[0,0,0,0,12],"id":132}
10:40:49.260 [DEBUG] [.internal.handler.MiIoAbstractHandler] - Received response for Culi type: GET_PROPERTY, result: [1,1,0,0], fullresponse: {"result":[1,1,0,0],"id":133}
10:40:52.141 [DEBUG] [iio.internal.handler.MiIoBasicHandler] - Periodic update for 'miio:basic:Culi' (miio:basic)
10:40:52.135 [DEBUG] [iio.internal.handler.MiIoBasicHandler] - Locating action for miio:basic:Culi channel 'vacuumaction': '3'
10:40:52.152 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":134,"method":"get_prop","params":["run_state","mode","err_state","battary_life","box_type"]} -> 192.168.0.210 (Device: 1091ACD0 token: 4E634D51XXXXXXXXXXXXXXXX5233637A Queue: 1).
10:40:52.155 [DEBUG] [iio.internal.handler.MiIoBasicHandler] - Conditional command set_mode_withroom[0,"$value$",0] not send, condition 'matchValue' not met
10:40:52.159 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":135,"method":"get_prop","params":["mop_route","s_time","s_area","suction_grade","water_grade"]} -> 192.168.0.210 (Device: 1091ACD0 token: 4E634D51XXXXXXXXXXXXXXXX5233637A Queue: 2).
10:40:52.165 [DEBUG] [iio.internal.handler.MiIoBasicHandler] - Sending command set_charge[1]
10:40:52.170 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":136,"method":"get_prop","params":["remember_map","has_map","is_mop","has_newmap"]} -> 192.168.0.210 (Device: 1091ACD0 token: 4E634D51XXXXXXXXXXXXXXXX5233637A Queue: 3).
10:40:52.178 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":137,"method":"miIO.info","params":[]} -> 192.168.0.210 (Device: 1091ACD0 token: 4E634D51XXXXXXXXXXXXXXXX5233637A Queue: 3).
10:40:52.183 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":138,"method":"set_charge","params":[1]} -> 192.168.0.210 (Device: 1091ACD0 token: 4E634D51XXXXXXXXXXXXXXXX5233637A Queue: 4).
10:40:52.224 [DEBUG] [.internal.handler.MiIoAbstractHandler] - Received response for Culi type: GET_PROPERTY, result: [1,0,0,100,3], fullresponse: {"result":[1,0,0,100,3],"id":134}
10:40:52.291 [DEBUG] [.internal.handler.MiIoAbstractHandler] - Received response for Culi type: GET_PROPERTY, result: [0,0,0,0,12], fullresponse: {"result":[0,0,0,0,12],"id":135}
10:40:52.346 [DEBUG] [.internal.handler.MiIoAbstractHandler] - Received response for Culi type: GET_PROPERTY, result: [1,1,0,0], fullresponse: {"result":[1,1,0,0],"id":136}
10:40:52.379 [DEBUG] [.internal.handler.MiIoAbstractHandler] - Received response for Culi type: MIIO_INFO, result: {"hw_ver":"Linux","fw_ver":"3.5.3_0047","ap":{"ssid":"Kit Kat","bssid":"04:d4:c4:5f:e7:98"},"netif":{"localIp":"192.168.0.210","mask":"255.255.255.0","gw":"192.168.0.1"},"model":"viomi.vacuum.v7","mac":"50:EC:50:EF:4F:27","token":"4e634d5175695036415a49535233637a","life":919}, fullresponse: {"partner_id":"","id":137,"code":0,"message":"ok","result":{"hw_ver":"Linux","fw_ver":"3.5.3_0047","ap":{"ssid":"Kit Kat","bssid":"04:d4:c4:5f:e7:98"},"netif":{"localIp":"192.168.0.210","mask":"255.255.255.0","gw":"192.168.0.1"},"model":"viomi.vacuum.v7","mac":"50:EC:50:EF:4F:27","token":"4e634d5175695036415a49535233637a","life":919}}
10:40:52.387 [DEBUG] [.internal.handler.MiIoAbstractHandler] - No RSSI info in response
10:40:54.566 [DEBUG] [.internal.handler.MiIoAbstractHandler] - Received response for Culi type: UNKNOWN, result: ["ok"], fullresponse: {"result":["ok"],"id":138}
10:40:55.189 [DEBUG] [iio.internal.handler.MiIoBasicHandler] - Periodic update for 'miio:basic:Culi' (miio:basic)
10:40:55.194 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":139,"method":"get_prop","params":["run_state","mode","err_state","battary_life","box_type"]} -> 192.168.0.210 (Device: 1091ACD0 token: 4E634D51XXXXXXXXXXXXXXXX5233637A Queue: 1).
10:40:55.199 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":140,"method":"get_prop","params":["mop_route","s_time","s_area","suction_grade","water_grade"]} -> 192.168.0.210 (Device: 1091ACD0 token: 4E634D51XXXXXXXXXXXXXXXX5233637A Queue: 2).
10:40:55.206 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":141,"method":"get_prop","params":["remember_map","has_map","is_mop","has_newmap"]} -> 192.168.0.210 (Device: 1091ACD0 token: 4E634D51XXXXXXXXXXXXXXXX5233637A Queue: 3).
10:41:10.288 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Communication error for Mi device at 192.168.0.210: Receive timed out
10:41:10.293 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - No response from device 1091ACD0 at 192.168.0.210 for command {"id":139,"method":"get_prop","params":["run_state","mode","err_state","battary_life","box_type"]}.
10:41:10.301 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Received message is without id: {"error":"No Response"}
10:41:10.312 [DEBUG] [.internal.handler.MiIoAbstractHandler] - Received response for Culi type: GET_PROPERTY, result: null, fullresponse: {"error":"Received message is without id"}
10:41:10.317 [DEBUG] [.internal.handler.MiIoAbstractHandler] - Error received: "Received message is without id"
10:41:10.483 [DEBUG] [.internal.handler.MiIoAbstractHandler] - Received response for Culi type: GET_PROPERTY, result: [0,0,0,0,12], fullresponse: {"result":[0,0,0,0,12],"id":140}
10:41:10.631 [DEBUG] [.internal.handler.MiIoAbstractHandler] - Received response for Culi type: GET_PROPERTY, result: [1,1,0,0], fullresponse: {"result":[1,1,0,0],"id":141}
10:41:22.183 [DEBUG] [iio.internal.handler.MiIoBasicHandler] - Periodic update for 'miio:basic:Culi' (miio:basic)
10:41:22.188 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":142,"method":"get_prop","params":["run_state","mode","err_state","battary_life","box_type"]} -> 192.168.0.210 (Device: 1091ACD0 token: 4E634D51XXXXXXXXXXXXXXXX5233637A Queue: 1).
10:41:22.200 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":143,"method":"get_prop","params":["mop_route","s_time","s_area","suction_grade","water_grade"]} -> 192.168.0.210 (Device: 1091ACD0 token: 4E634D51XXXXXXXXXXXXXXXX5233637A Queue: 2).
10:41:22.212 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":144,"method":"get_prop","params":["remember_map","has_map","is_mop","has_newmap"]} -> 192.168.0.210 (Device: 1091ACD0 token: 4E634D51XXXXXXXXXXXXXXXX5233637A Queue: 3).
10:41:22.404 [DEBUG] [.internal.handler.MiIoAbstractHandler] - Received response for Culi type: GET_PROPERTY, result: [4,0,2104,99,3], fullresponse: {"result":[4,0,2104,99,3],"id":142}
10:41:22.506 [DEBUG] [.internal.handler.MiIoAbstractHandler] - Received response for Culi type: GET_PROPERTY, result: [0,0,0,0,12], fullresponse: {"result":[0,0,0,0,12],"id":143}
10:41:22.618 [DEBUG] [.internal.handler.MiIoAbstractHandler] - Received response for Culi type: GET_PROPERTY, result: [1,1,0,0], fullresponse: {"result":[1,1,0,0],"id":144}
10:41:52.222 [DEBUG] [iio.internal.handler.MiIoBasicHandler] - Periodic update for 'miio:basic:Culi' (miio:basic)
10:41:52.231 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":145,"method":"get_prop","params":["run_state","mode","err_state","battary_life","box_type"]} -> 192.168.0.210 (Device: 1091ACD0 token: 4E634D51XXXXXXXXXXXXXXXX5233637A Queue: 1).
10:41:52.242 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":146,"method":"get_prop","params":["mop_route","s_time","s_area","suction_grade","water_grade"]} -> 192.168.0.210 (Device: 1091ACD0 token: 4E634D51XXXXXXXXXXXXXXXX5233637A Queue: 2).
10:41:52.247 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":147,"method":"get_prop","params":["remember_map","has_map","is_mop","has_newmap"]} -> 192.168.0.210 (Device: 1091ACD0 token: 4E634D51XXXXXXXXXXXXXXXX5233637A Queue: 3).
10:41:52.252 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":148,"method":"miIO.info","params":[]} -> 192.168.0.210 (Device: 1091ACD0 token: 4E634D51XXXXXXXXXXXXXXXX5233637A Queue: 4).
10:41:52.314 [DEBUG] [.internal.handler.MiIoAbstractHandler] - Received response for Culi type: GET_PROPERTY, result: [5,0,2103,99,3], fullresponse: {"result":[5,0,2103,99,3],"id":145}
10:41:52.365 [DEBUG] [.internal.handler.MiIoAbstractHandler] - Received response for Culi type: GET_PROPERTY, result: [0,0,0,0,12], fullresponse: {"result":[0,0,0,0,12],"id":146}
10:41:52.410 [DEBUG] [.internal.handler.MiIoAbstractHandler] - Received response for Culi type: GET_PROPERTY, result: [1,1,0,0], fullresponse: {"result":[1,1,0,0],"id":147}
10:41:52.428 [DEBUG] [.internal.handler.MiIoAbstractHandler] - Received response for Culi type: MIIO_INFO, result: {"hw_ver":"Linux","fw_ver":"3.5.3_0047","ap":{"ssid":"Kit Kat","bssid":"04:d4:c4:5f:e7:98"},"netif":{"localIp":"192.168.0.210","mask":"255.255.255.0","gw":"192.168.0.1"},"model":"viomi.vacuum.v7","mac":"50:EC:50:EF:4F:27","token":"4e634d5175695036415a49535233637a","life":979}, fullresponse: {"partner_id":"","id":148,"code":0,"message":"ok","result":{"hw_ver":"Linux","fw_ver":"3.5.3_0047","ap":{"ssid":"Kit Kat","bssid":"04:d4:c4:5f:e7:98"},"netif":{"localIp":"192.168.0.210","mask":"255.255.255.0","gw":"192.168.0.1"},"model":"viomi.vacuum.v7","mac":"50:EC:50:EF:4F:27","token":"4e634d5175695036415a49535233637a","life":979}}
10:41:52.435 [DEBUG] [.internal.handler.MiIoAbstractHandler] - No RSSI info in response

Mop Route is also working :slight_smile: , with 0 = S Pattern, 1 = Y Pattern (with my robot, in Mi Home there’s no C-Curved as given in your JSON file).

By the way, I need more help with:

  • I’m using network ping to detect whether the robot is online or offline. Is there a smarter way to do this?
  • Is it possible to list the maps stored in the Mi Home app, and then set the current map? Because I have 2 rooms with some “restricted areas” that I don’t want robot to go in.
    Thank you!
1 Like

Dear all,
I have a question conerning support for Mi Universal Remote (chuangmi.ir.v2).
I use it for some christmas lamps. Last year (still OH 2.4) I could use the device with this binding with genuine channel MiUniversalRemote_Actions_ExecuteCommand.
Now, the device gets discovered offering the following (test) channels as switch

  • Power On/Off
  • (experimental)Execute test to find supported channels
  • (experimental) Create experimental support for new MIOT protocol devices

I tried the last channel to send my payload as usual

MiUniversalRemote_Actions_ExecuteCommand.sendCommand(" miIO.ir_play {\"freq\": 38400, \"code\": \"Z6XQA4gBAAC6AwAAYQcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEA==\"} ")

with no success. Is there a way to make the device useful again for OH users?

Thank your very much for your support!

Suggest to check the Xiaomi Mi Infrared Remote Control topic.

I actually prepared a regular json file for the device recently, but did not test it. I’ll try to upload it tonight for testing. In the mean time, would be good to see the debug log when you send the command to better understand what the device is responding. (as the mihome plugin uses very diferent commands involving the cloud). Please post in the remote topic.

Note you can connect the execute actions channel just the same in the 3.x versions. As before this channel is marked advanced, hence only visible when you check the ‘show advanced’ box

2 Likes

You saved my day! Thank you!!! Using the hidden (advanced) channel makes the device work as before.
I only send the payload as written before:

MiUniversalRemote_Actions_ExecuteCommand.sendCommand(" miIO.ir_play {\"freq\": 38400, \"code\": \"Z6XQA4gBAAC6AwAAYQcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEAAREAABAQESEA==\"} ")

That’s how I got it working a few year ago and only use the remote in December. :wink:
If you need any help in testing, let me know and thanks again!

1 Like

Hi @downloadme4free,

Can you please share your configuration files and rules for sending the commands to the vacuum?
I have v6 and that seems to be working also
Thanks

@DarkoG The file is also available in the current snapshot release of OH.

Thanks @marcel_verpaalen, I noted better descriptions but I am still on v3.1.1. Would the addon work on it?
Currently the vacuum is connected to Internet but ultimately I want to firewall it and do everything local. Is it possible to change the mode and maps?
I would assume the way to do it would be via the advanced channel, so therefore I asked @downloadme4free if he could share the rules so I could save some time.

I expect indeed the file will work also for 3.1.x
See it here openhab-addons/viomi.vacuum.v8.json at main · openhab/openhab-addons · GitHub

maps changing… dunno. Maybe @downloadme4free already found the commands for it.
If not, these are the commands for your device known… best guess would be the get/set_map

            "set_ordertime",
            "set_mode",
            "set_pointclean",
            "set_mode_withroom",
            "set_timezoneorder",
            "set_voice",
            "set_remember",
            "set_repeat",
            "set_calibration",
            "set_resetmap",
            "set_resetpos",
            "set_moproute",
            "set_charge",
            "set_suction",
            "set_mop",
            "set_",
            "set_lang",
            "set_uploadmap",
            "set_notdisturb",
            "set_zone",
            "set_newmap",
            "set_direction",
            "set_timezone",
            "set_wall",
            "set_map",
            "set_consumables",
            "get_prop",
            "get_notdisturb",
            "get_map",
            "get_ordertime",
            "get_downloadstatus",
            "get_curpos"

@ DarkoG
I have no rules at all. I just install the binding, create the robot thing and channels in textual configuration files. All credits go to Marcel and his supporters, and it’s my pleasure to share with you. Here is my configuration:
Things file:

Thing miio:basic:Culi "Culi Vacuum Cleaner" @ "Livingroom" [
  host="192.168.0.210", 
  token="TOKEN", 
  deviceId="DEVICE_ID",
  model="viomi.vacuum.v7"
]

Items file:

Group gVacuum "Culi vacuum [%s]" <water> { channel="network:pingdevice:Xiaomi_Mijia_Vacuum:online" }

// XIAOMI MIJIA VACUUM CLEANER STYJ02YM / STYTJ02YM (recognized as Mi Robot Vacuum-Mop P (viomi.vacuum.v7))
Switch Vacuum_Available "Available [MAP(vacuum_state.map):%s]" <switch> (gVacuum) { channel="network:pingdevice:Xiaomi_Mijia_Vacuum:online" }
Number Vacuum_Action "Action []" <motion> { channel="miio:basic:Culi:vacuumaction" }
//String Vacuum_Command { channel="miio:basic:Culi:actions#commands" }      // native method, send string to this channel
Number Vacuum_State "State [MAP(vacuum_state.map):%s]" <status> { channel="miio:basic:Culi:state" }
Number Vacuum_Mode "Mode [%s]" <settings> { channel="miio:basic:Culi:mode" }
Number Vacuum_Error_State "Status [MAP(vacuum_error.map):%s]" <status> { channel="miio:basic:Culi:err_state" }
Number Vacuum_Battery_Life "Battery level [%d %%]" <batterylevel> { channel="miio:basic:Culi:battery_life" }
Number Vacuum_Box_Type "Box type [MAP(vacuum_box_type.map):%s]" <wallswitch> { channel="miio:basic:Culi:box_type" }
Number Vacuum_Mop_Type "Mop type [%d]" <movecontrol> { channel="miio:basic:Culi:mop_type" }
Number Vacuum_S_Time "Clean time [%d mins]" <time> { channel="miio:basic:Culi:s_time" }
Number Vacuum_S_Area "Clean area [%d m²]" <incline> { channel="miio:basic:Culi:s_area" }
Number Vacuum_Suction_Grade "Suction grade [%s]" <qualityofservice> { channel="miio:basic:Culi:suction_grade" }
Number Vacuum_Water_Grade "Water grade [%s]" <water> { channel="miio:basic:Culi:water_grade" }
Number Vacuum_Remember_Map "Remember map [%d]" { channel="miio:basic:Culi:remember_map" }
Number Vacuum_Has_Map "Has map [%d]" { channel="miio:basic:Culi:has_map" }
Number Vacuum_Is_Mop "Is mop [%d]" { channel="miio:basic:Culi:is_mop" }
Number Vacuum_Has_New_Map "Has new map [%d]" { channel="miio:basic:Culi:has_newmap" }
Number Vacuum_Mop_Route "Mop route [%d]" <flow> { channel="miio:basic:Culi:mop_route" }

Sitemaps

        Group item=gVacuum {
            Text item=Vacuum_Available visibility=[Vacuum_Available==OFF, Vacuum_Available==NULL, Vacuum_Available==UNDEF]
            Switch item=Vacuum_Action mappings=[ 1="Start", 0="Stop", 2="Pause", 3="Dock" ] visibility=[Vacuum_Available==ON]
            //Switch item=Vacuum_Command mappings=[ "set_charge [1]"="Dock" ] visibility=[Vacuum_Available==ON]
            Text item=Vacuum_State visibility=[Vacuum_Available==ON]
            Text item=Vacuum_Error_State visibility=[Vacuum_Available==ON]
            Text item=Vacuum_Battery_Life visibility=[Vacuum_Available==ON]
            Selection item=Vacuum_Mode mappings=[ 0="Vacuum only", 1="Vacuum & Mop", 2="Mop", 3="Clean zone", 4="Clean spot" ] visibility=[Vacuum_Available==ON]
            Selection item=Vacuum_Suction_Grade mappings=[ 0="Silent", 1="Standard", 2="Medium", 3="Turbo" ] visibility=[Vacuum_Available==ON]
            Selection item=Vacuum_Water_Grade mappings=[ 11="Low", 12="Medium", 13="High" ] visibility=[Vacuum_Available==ON]
            Selection item=Vacuum_Mop_Route mappings=[ 0="S - Pattern", 1="Y - Pattern" ] visibility=[Vacuum_Available==ON]
            Selection item=Vacuum_Remember_Map mappings=[ 0="No", 1="Yes" ] visibility=[Vacuum_Available==ON]
            Text item=Vacuum_Box_Type visibility=[Vacuum_Available==ON]
            Text item=Vacuum_Mop_Type visibility=[Vacuum_Available==ON]
            Text item=Vacuum_S_Time visibility=[Vacuum_Available==ON]
            Text item=Vacuum_S_Area visibility=[Vacuum_Available==ON]
            Text item=Vacuum_Has_Map visibility=[Vacuum_Available==ON]
			Text item=Vacuum_Is_Mop visibility=[Vacuum_Available==ON]
			Text item=Vacuum_Has_New_Map visibility=[Vacuum_Available==ON]
        }

About maps: I still don’t know how to get the map list from Mi Home and set the current map. Currently I’m using Mi Home to set the map, which is an “acceptable solution” for me because I rarely need the robot to clean another room

OK, I just installed OHv3.2 and I was playing a bit with the vacuum, so I configured the vacuum as miio:generic device and used the channel ExecuteCommand to get the maps.
So sending

get_map

returns something like this

{"result":[{"name":"Kitchen","id":123456,"cur":true},{"name":"Living","id":1234567,"cur":false},{"name":"Hall en kids","id":12345678,"cur":false},{"name":"Upstairs","id":123456789,"cur":false},{"name":"KitchenNoLim","id":1234567890,"cur":false}],"id":123}

You can then change the maps by sending the command set_map with the id of the map. For example

set_map[1234567]

This didn’t work when the device is set as basic

1 Like

I am strugling a bit with the things file configuration. When I had

Thing miio:basic:CleaningRobotKitchen "Cleaning Robot Kitchen" [
  host="192.168.x.x",
  token="token",
  deviceId="deviceId",
  model="viomi.vacuum.v6"
]

The thing is online, but when I change to miio:generic:CleaningRobotKitchen I get handler error. Config via the UI works

EDIT
I also see the following in the log:

2021-12-21 00:30:56.937 [INFO ] [internal.handler.MiIoAbstractHandler] - Mi Device model viomi.vacuum.v6 identified as: Viomi Cleaning Robot V-RVCLM21B (viomi.vacuum.v6). Does not match thingtype miio:generic. Changing thingtype to miio:basic

2021-12-21 00:30:56.956 [WARN ] [mon.registry.AbstractManagedProvider] - Could not update element with key miio:generic:CleaningRobotKitchen in ManagedThingProvider, because it does not exists.

EDIT 2

OK Installing MAP transformations solved the problem

Well, I will try generic thing type instead of basic to see how it work. I will try get the maps also. Thank you!

@downloadme4free @DarkoG there is no functional difference between the generic and basic for your device. The generic type changes itself to the right type as soon as the first info message is successfully received. (this is what is happening when you see the log message you shared 2021-12-21 00:30:56.937 [INFO ] [internal.handler.MiIoAbstractHandler] - Mi Device model viomi.vacuum.v6 identified as: Viomi Cleaning Robot V-RVCLM21B (viomi.vacuum.v6). Does not match thingtype miio:generic. Changing thingtype to miio:basic

When using text config I recommend to use the right type directly.
The automatic discovery uses generic as for things where the token is not yet known, the binding does not know what type it will be. Hence it creates a generic one, waits for the token and the first message with the model and than changes itself to the right type (e.g. vacuum, basic, unsupported)

You can see in the thing code what is the real type it is using. like in the screenshot
image

1 Like

Thanks @marcel_verpaalen, I gave another try and it worked also with basic device. It looks like I had some error in my input card I used for testing

1 Like

@marcel_verpaalen hi mate. I updated to 3.2 and i created an empty “mapConfig.json” file in the miio folder.Then i restarted openhab but mapConfig.json remains empty…Any ideas?

Suggest to check the debug log… it should give some info on what is going on…
expect one of the below messages… it should also tell the exact location the binding is looking for the file

Vacuum map draw options file {} not found. Using defaults
Error reading vacuum map draw options file {}: {}
Write default map draw options to {}

i ve got

2021-12-23 14:31:56.387 [INFO ] [o.internal.handler.MiIoVacuumHandler] - Error reading vacuum map draw options file /var/lib/openhab/miio/mapConfig.json: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was NUMBER at line 1 column 5 path $
2021-12-23 14:31:56.389 [INFO ] [o.internal.handler.MiIoVacuumHandler] - Write default map draw options to /var/lib/openhab/miio/mapConfig.json
2021-12-23 14:31:56.396 [INFO ] [o.internal.handler.MiIoVacuumHandler] - Error writing Vacuum map draw options file: /var/lib/openhab/miio/mapConfig.json (Permission denied)

i think because

openhabian@openhabian:/var/lib/openhab/miio $ ls -l
total 80
-rw-r--r-- 1 openhab openhab    37 Dec 23 14:27 info_03731D48.json
-rw-r--r-- 1 openhab openhab    37 Dec 23 14:27 info_0373285C.json
-rw-r--r-- 1 openhab openhab    37 Dec 23 14:27 info_04554D77.json
-rw-r--r-- 1 openhab openhab    37 Dec 23 14:27 info_04982EAB.json
-rw-r--r-- 1 openhab openhab    37 Dec 23 14:27 info_05C2F417.json
-rw-r--r-- 1 openhab openhab    38 Dec 23 14:27 info_13F83F66.json
-rw-r--r-- 1 root    root        5 Dec 23 14:38 mapConfig.json
-rw-r--r-- 1 openhab openhab 28593 Dec 22 09:48 miioTokens-cn.json
-rw-r--r-- 1 openhab openhab  2423 Dec 23 14:31 miioTokens-de.json
-rw-r--r-- 1 openhab openhab    46 Dec 22 09:48 miioTokens-i2.json
-rw-r--r-- 1 openhab openhab    46 Dec 22 09:48 miioTokens-ru.json
-rw-r--r-- 1 openhab openhab    46 Dec 22 09:48 miioTokens-sg.json
-rw-r--r-- 1 openhab openhab    46 Dec 22 09:48 miioTokens-tw.json
-rw-r--r-- 1 openhab openhab    46 Dec 22 09:48 miioTokens-us.json

how can i fix that…
?