Xiaomi Robot Vacuum Binding

Oh wow, thank you.

The following channels work for me with the Roborock s5e:
status#water_box_status
status#lock_status
status#water_box_mode
status#mop_forbidden_enable

It would be nice if the labels had a corresponding text like the other channels:

The channel “status#water_box_carriage_status” is not displayed and cannot be linked to an item, although the Roborock supports this:

{
    "result": [{
            "msg_ver": 2,
            "msg_seq": 4945,
            "state": 8,
            "battery": 100,
            "clean_time": 2930,
            "clean_area": 45495000,
            "error_code": 0,
            "map_present": 1,
            "in_cleaning": 0,
            "in_returning": 0,
            "in_fresh_state": 1,
            "lab_status": 1,
            "water_box_status": 1,
            "fan_power": 106,
            "dnd_enabled": 1,
            "map_status": 3,
            "is_locating": 0,
            "lock_status": 0,
            "water_box_mode": 204,
            "water_box_carriage_status": 1, ///////// see here /////////
            "mop_forbidden_enable": 1
        }
    ],
    "id": 77
}

Also the channel “actions#segment” is not displayed.

Would it also be possible to select several rooms, which are then cleaned one after the other? So far I have solved this in a rule with item.sendCommand("app_segment_clean[16, 17, 18]").
.

I’m struggling with some errors about not connected to cloud. I’m using the exact same login information that i use in the mi home app. I’ve successfully achieved the token and added my vaccum in OH2, but I’m not able to retrieve the map.

[DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for 13302C00 type: GET_MAP, result: ["rubyslite%[xxxxxxxxx]"], fullresponse: {"result":["rubyslite%[xxxxxxxxx]"],"id":36}
[DEBUG] [o.internal.handler.MiIoVacuumHandler] - Not connected to Xiaomi cloud. Cannot retreive new map: rubyslite[xxxxxxxxx]
[INFO] [miio.internal.cloud.MiCloudConnector] - Error logging on to Xiaomi cloud (0): No http client cannot be started: Insufficient configured threads: required=81 < max=10 for QueuedThreadPool[ESH-httpClient-miio]@47094f7f{STARTED,5<=5<=10,i=5,q=0}[ReservedThreadExecutor@8974bd6{s=0/1,p=0}]

Thanks for the feedback @mas
I found the problem with the water_box_carriage_status seems overwrote it in my copy/pasting, now the channel definition was missing.
I’ll check on the channel naming. In my testing it came proper, but I’m sure I can fix that to the intended (friendly) names.

I’ll change the room cleaning channel to a string type, than it will accept anything, including more rooms as per your example.

@sjef86 If you are not on the latest version (2.5.8) suggest to update (at least the binding) to that version. It includes a fix for leaking threads.

If that does not solve it, your OH instance needs more threads… there is something in the configuration to set that (in textfiles) but you’ll need to search the forum to find the exact file & keyword

Hi Macel,

Thanks for the quick reply. I’m already running version 2.5.8 of your binding. But I’m on version OH 2.4 on docker. All resources on container set to unlimited.

Docker resources is not the problem. Take a look @ this topic

Do you know a better/smart way to prevent map rotation / coordinates loss?

@mas I fixed the items you mentioned. Pls give it another try (same link)
@mancer I believe the only way it can be restored turned map is to root your vacuum and install valetuo. Or always use room cleanups, never start a regular vacuum cycle as that has the chance of rotating the coordinates

Looks very good! :+1: Thank you!

Thanks Macel! This tip helped med solve the problem :smiley:

Viomi vacuum are rather different.
Pls check few messages above. Last week I shared file and some pointers for this vacuum.

Pls feedback what works and what… If it works fine I’ll add it to the regular distribution

@nighthawk777 can you please check the binding readme and/or scan the forum there are quite a few examples for item file.

As you indicated you are a newbie suggest to first het it to work with discovery and gui config then move it to text configuration.

Hey, I would like to buy a xiaomi robot,
What is the latest version that is fully supported by the binding?

I have the following problem.

  • Global Versie Xiaomi Mi robot stofzuiger. This is found in paper Ui, i retrieved the token.
    When i add the vacuum with the token, it’s add to the things, it goes online and after a few minutes/10 or so it goes offline: Status: OFFLINE - CONFIGURATION_ERROR

Whenever i make a change, Like Refresh Interval orso, it goes online -> 10 min -> offline

What’s my problem ? (same with the smartHUB)

@Peter_van_hanegem it is not directly clear what is the problem here.

Few thoughts:

  • Make sure the model is not defined with text. If you did the definition with text config remove that first and see if the problem goes away. If that fixes your problem, the text config is wrong, most likely missing the model.

  • Make sure your vacuum is not twice in your things (this can easily occur as it might be found with 2 different names by discovery). A Xiaomi device should only be added once, not twice as in the communication a sequence number is send along and the devices don’t like non-sequential numbers and stop responding for some time.

  • Make sure your vacuum is not defined at two country servers. The binding stores the responses from all country servers in the userdata/miio folder. If the vacuum is defined in multiple it can in some cases pick up the token from the wrong country. In that case, in your mihome app logon to the specif country, and remove the vacuum.

  • As you have also problem with smartHUB, it may indicate some wider problem with the OH framework item defintions saving/DB. What may helps is to remove the thing completely and have it re-discover again. As removing the thing at least clears the database entry for it and any corrupt config along. (are you using mapdb or jsondb? My experience is better (more stable) with jsondb)

If you tried all of these and the problem persists, pls send (PM) a debug log to see if anything strange happens.

Thanks, i will try your suggestions this weekend and come back to you.

Sorry, but my brain stopped working , What is the way in a rule to send a simple start command to the vacuume? I cant find any good examples
sendCommand(ActionCommand,“vacuum” )

i also miss the control section (but i am using a viomi v7/v8)
The first one is not supported by the binding (yet)

String  Robi_Control        "Robi Control"                      {channel="miio:basic:robi:actions#control"}
String  Robi_Command        "Robi Command (ADV)"                {channel="miio:basic:robi:actions#commands"}

yes but in a rule

Did you check if below command is working for your vacuum? If yes, we can add that to the json file as a new control channel.
As far as I know both v7 & v8 use the same commands, hence you can try the same file on your other model.

Please feedback your results. I normally only add support for a model if I get confirmations from users that it actually works.