Xiaomi Robot Vacuum Binding

Interesting finding… note that these channels have not been changed since the very first version of the binding. However, that probably indicates some other issue which maybe to more strict checking in the latest version came to light.

NB, in most cases, the issue CONFIGURATION_ERROR is due to the fact the model info is mandatory in the text config, which was not mandatory in the early 2.4 versions.

Hi,

I got a Roborock S5 Max.
I am trying to get the token somehow, but up to now: no chance.

Is there anybody with the ROBOROCK App on iPhone who managed to extract the token?
With the information from the binding I do not succeed. They are all talking about MI HOME App…I am not using this one, and I am afraid to use it, because the token will most probably change between the use of these 2 apps (???).
Any help appreciated…

Best regards
Stefan

With app_zoned_clean you can specify how often the cleaning should be done, once, twice or three times.
With ‘segment clean’ you can also specify this in the app. Is there a way to specify the number for app_segment_clean as well?

Hi Stefan,

you have to use an android device with a special version of the MI Home App in order to be able to read out the token. Take a look at this website.

Best regards

How did you tried to extract the token?
I think it doesn’t differ that much from the Mi-Home app.
Tell me the steps you have tried. The token extract is not that easy on an iPhone for the first try, but it is doable.

I think it will not change. It will only change token when you disconnect the Robot from your Wi-Fi or (obviously) you reset the robot.

I did the device binding and send it to you, but still can’t get the configuration in openhab, the only way for me to make it work from openhab is sending the comands, is there anyway how I can test the binding that I made and implement it in openhab or I need to wait for you to upload it to the binding?

Even if the model info was not mandatory, I had it anyways from the beginning :slight_smile:

Anyhow, I could replicate the behavior:

  • Comment out the consumables#*_time, it works
  • Remove the comment, it gives CONFIGURATION_ERROR

Note also that the consumables#*_time channels are not even visible in PaperUI – that was actually the hint that suggested me to comment them out from configuration.

Thanks for your reply, I will sent screenshots later on, but for sure you need to reset the S5 to connect it to the other app, because you need to use its “own” WIFI to setup, otherwise you will not be able to see the device in the MI APP.

Then I am lost at this point. No Android Device. :frowning:

Just use the Home App Its nearly the same behavior with some additional stuff like a remote. The map is stored at Xiaomi/Roborock servers and will survive the cange of the app.

Hallo,
I have a discovery problem with my vaacum. It is discovered two time.
one is discovered like vaacum and the other is generic. do you know why?

> 2020-01-16 19:33:11.996 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'miio:generic:05C5F2F5' to inbox.
> 
> ==> /var/log/openhab2/events.log <==
> 
> 2020-01-16 19:33:11.997 [home.event.InboxAddedEvent] - Discovery Result with UID 'miio:generic:05C5F2F5' has been added.
> 
> 2020-01-16 19:33:12.290 [home.event.InboxAddedEvent] - Discovery Result with UID 'miio:vacuum:05C5F2F5' has been added.
> 
> ==> /var/log/openhab2/openhab.log <==
> 
> 2020-01-16 19:33:12.289 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'miio:vacuum:05C5F2F5' to inbox.

This is because Xiaomi impemented 2 different methods for discovering devices. Depending on the device it supports one of the 2 methods or both. If it supports both you see it twice.
You can ignore one of the 2, functionality is not different.
Initial description label will be different as both methods provide different initial information.

Thanks Marcel. I thought I messed with the bindings :laughing:

Hi all,

I have added my Mi Robot - all items work, apart from network ones.
Defined similar to the following:

String  XiaVac_NetSSID    "Network SSID [%s]"     <network>   (gXiaomiVac,gXiaomiVacNetwork) {channel="miio:vacuum:XXXXXXX:network#ssid" }
String  XiaVac_NetBSSID   "Network BSSID [%s]"    <network>   (gXiaomiVac,gXiaomiVacNetwork) {channel="miio:vacuum:XXXXXXX:network#bssid" }
Number  XiaVac_NetRSSI    "Network RSSI [%1.0f]"  <network>   (gXiaomiVac,gXiaomiVacNetwork) {channel="miio:vacuum:XXXXXXX:network#rssi" }
Number  XiaVac_NetLife    "Uptime [%1.0f]"        <clock>     (gXiaomiVac,gXiaomiVacNetwork) {channel="miio:vacuum:XXXXXXX:network#life" }

Values are just empty. Same binding with, for instance, Yeelight shows network stuff.
What can be a reason?

Thanks.

Thanks for this binding!

Had some difficulties with retrieving the token but finally managed to use my Roborock S5 Max in openHAB!
First mistake I made was using the Roborock app in stead of the Xiaomi Home app.
After that it worked fine!

Now I can use the sitemap to select specific rooms and start cleaning them.
If anyone is interested I can post some code for that, must mostly I found out with the posts from others in this topic.

Hi,

I would like to get access to the map data from the xiaomi cloud. As described in the protocol map_v1, I have received the pointer to map data (example: robomap%2F123456789%2F0).

With which base-url can I get the map information?

https://???/robomap%2F123456789%2F0

Best regards,
Phil

@philissimo as it states on the page Unfortunately no examples yet to retrieve it independently of the Mi Home app
There is no URL to pull unless you root your device and install additional software on it.

The only other alternative is to pull it from the xiaomi clound which requires the reverse engineering of the protocol or signing NDA (which prevents it as opensource solution)

@marcel But it seems there is a way since the 3rd party app for the xiaomi vacuums “Flolevac” displays the map. It does however require you to sign in to the xiaomi cloud with your credentials.

@ralle Indeed… as said: or signing NDA (which prevents it as opensource solution)
Flole to my knowledge indeed signed the NDA and is not putting his solution as opensource.

I don’t want to go that rabbit hole of signing a NDA as that may prevent me from continuing to support the binding. As there are alternatives (rooting the device) and the xiaomi cloud access is kind of complex to reverse engineer I’m not looking into this at the moment. Happy if some one can figure it out and develops a way to communicate. The binding can be improved to communicate in 2 different ways without major rewrites.

hi Marcel, thanks for the binding.

I’m trying to get a 2S Air Purifier working. The thing autodiscovered, I’ve given it the token, and it’s changed to online - but no matter what I try (basic/generic) in the items file I can’t get a response.

in paperUI my thing is:

Xiaomi Mi Device 07FC0D9E (133959070) zhimi-airpurifier-mc1_miio133959070 ONLINE
Xiaomi Mi Basic Device
miio:basic:07FC0D9E

and my items are:-

Group G_airpurifier "Mi Air Purifier 2S" <status>	(gGroups, gDevices, FF_Office)
Switch power "Power" (G_airpurifier) {channel="miio:basic:07FC0D9E:power"}
String mode "Mode" (G_airpurifier) {channel="miio:basic:07FC0D9E:mode"}
Number humidity "Humidity" (G_airpurifier) {channel="miio:basic:07FC0D9E:humidity"}
Number aqi "Air Quality Index" (G_airpurifier) {channel="miio:basic:07FC0D9E:aqi"}
Number averageaqi "Average Air Quality Index" (G_airpurifier) {channel="miio:basic:07FC0D9E:averageaqi"}
Switch led "LED Status" (G_airpurifier) {channel="miio:basic:07FC0D9E:led"}
Switch buzzer "Buzzer Status" (G_airpurifier) {channel="miio:basic:07FC0D9E:buzzer"}
Number filtermaxlife "Filter Max Life" (G_airpurifier) {channel="miio:basic:07FC0D9E:filtermaxlife"}
Number filterhours "Filter Hours used" (G_airpurifier) {channel="miio:basic:07FC0D9E:filterhours"}
Number usedhours "Run Time" (G_airpurifier) {channel="miio:basic:07FC0D9E:usedhours"}
Number motorspeed "Motor Speed" (G_airpurifier) {channel="miio:basic:07FC0D9E:motorspeed"}
Number filterlife "Filter  Life" (G_airpurifier) {channel="miio:basic:07FC0D9E:filterlife"}
Number favoritelevel "Favorite Level" (G_airpurifier) {channel="miio:basic:07FC0D9E:favoritelevel"}
Number temperature "Temperature" (G_airpurifier) {channel="miio:basic:07FC0D9E:temperature"}
Number purifyvolume "Purivied Volume" (G_airpurifier) {channel="miio:basic:07FC0D9E:purifyvolume"}
Switch childlock "Child Lock" (G_airpurifier) {channel="miio:basic:07FC0D9E:childlock"}

Is anyone able to tell me what i’ve got wrong please? Thanks.