Xiaomi Robot Vacuum Binding

I confirm that is a issue. I’ll fix it with the next release

I would consider that unlikely… robot has a quite significant accu, and the messages send are simple, not data intensive. If so I would consider it more of a firmware bug.
Anyhow, I would encourage you to test it. The refresh interval can be changed in the configuration, it is marked as advanced, so you need to select show more to see it

@marcel_verpaalen quick question, any idea how to get the token with an IOS device?

I don’t have any IOS devices, but this is what I read on one of the other forums

I setup my iOS device with the Mi-Home app.
Created an unencrypted backup of the device on my laptop using itunes.
Installed iBackup Viewer from here: http://www.imactools.com/iphonebackupviewer/
Extracted this file /raw data/com.xiami.mihome/_mihome.sqlite to my computer
Open the file extracted using notepad. You will then see the list of all the device in your account with their token

Binding was updated today and loaded to the market place.

Changed to prior version:

  • Fix wrong total cleaning time, change format total cleaning time to minutes @oliver
  • Allowed control of vacuum fan level

NB, as channels changed. You need to delete your thing and add it again to have all the channels properly available.

Works like a charm. Thanks a lot for this amazing binding!

Do you think it’s possible to integrate the cleaning map in openHAB?

1 Like

Once day maybe…:slight_smile: I would love to have it as well.
It is actually quite complicated as far as I can see. The maps are not coming from the device itself, instead from the Xiaomi cloud. I sniff the network traffic, setting up MITM proxy to workaount the ssl encryption, but even than, there is quite some crypto stuff done. So the data can’t be easy read.
There is some documentation how to logon to the cloud & sdk, but it requires you to sign up and provide copies of my passport, which I’m not willing to do.Besides if I remember well, it was all in Chinese.
Anyway, I guess in the long run we will figure out how, as that would also solve the token retrieval, but don’t count on it anytime soon.

1 Like

@marcel_verpaalen, my log file is full of these messages:

13:45:51.056 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'xiaomivacuum:vacuum:Hugo' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): No valid status response
13:46:21.096 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'xiaomivacuum:vacuum:Hugo' changed from OFFLINE (COMMUNICATION_ERROR): No valid status response to ONLINE
13:46:31.115 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'xiaomivacuum:vacuum:Hugo' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): No valid status response
13:47:01.142 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'xiaomivacuum:vacuum:Hugo' changed from OFFLINE (COMMUNICATION_ERROR): No valid status response to ONLINE
13:47:11.171 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'xiaomivacuum:vacuum:Hugo' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): No valid status response
13:48:21.189 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'xiaomivacuum:vacuum:Hugo' changed from OFFLINE (COMMUNICATION_ERROR): No valid status response to ONLINE
13:48:31.317 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'xiaomivacuum:vacuum:Hugo' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): No valid consumables response
13:49:01.328 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'xiaomivacuum:vacuum:Hugo' changed from OFFLINE (COMMUNICATION_ERROR): No valid consumables response to ONLINE
13:49:11.421 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'xiaomivacuum:vacuum:Hugo' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): No valid status response

Maybe I am just bad…but i have no idea to install this…can you quickly help me?!

Hi @Multisaft7

First install the market place binding. See Distributing bindings through the IoT Marketplace for details.
Once that is activated you can go to the addons, and select the Xiaomi Vacuum binding (see screenie).
Once installed, read the first topic on how to get the tolken, as that is the tricky piece.

Hope this helps you getting started.

1 Like

But for this market installation i need a snapshot version of openhab? right?

I think release 2.1 already has the market place binding. Released versions before 2.1 won’t have it indeed.

1 Like

Same here…

Status: OFFLINE - COMMUNICATION_ERROR No valid Network response

The most common reason is wrong token.
As in that case the vacuum is not responding at all.
If you are sure the token is correct, can you pm the (whole) log on trace level, than I can try to understand what’s happening.

Hi Updated the version today

31 July More logging wrt connectivity

  • Set online if at least 1 message works
  • Add the network parameters (e.g. signal strenght)
  • Add the firmware version
  • (Experimental) Allow for other MiIo devices to be added (manually) and send commands to.

NB, for other MiIo devices (e.g. powerstrip) the only possibility is to manually send commands via the command channel.

As usual, to update, remove the binding and add it again.
Also as channels have changed, delete the thing and add it back again to have the correct channel definition.

I don’t know if this helps anybody with finding the tokens of xiaomi products but it did provideme with a token for my wifi plug : https://github.com/aholstenson/miio/blob/master/docs/management.md

It did not find my token for the vacuum robot, and I’ll test the wifi plug

I had no success with the wifi plug: (https://www.aliexpress.com/item/Original-Xiaomi-Mi-Smart-Socket-Basic-Edition-WiFi-Cute-Mini-High-Temperature-Protection-Input-90-250V/32810958871.html?spm=a2g0s.9042311.0.0.z2CacC)

there is the log:

2017-08-01 19:23:23.655 [ThingAddedEvent           ] - Thing 'xiaomivacuum:unknown:71a3e518' has been added.
2017-08-01 19:23:23.669 [hingStatusInfoChangedEvent] - 'xiaomivacuum:unknown:71a3e518' changed from UNINITIALIZED to INITIALIZING
2017-08-01 19:23:23.748 [ThingUpdatedEvent         ] - Thing 'xiaomivacuum:unknown:71a3e518' has been updated.
2017-08-01 19:23:23.754 [hingStatusInfoChangedEvent] - 'xiaomivacuum:unknown:71a3e518' changed from INITIALIZING to ONLINE
2017-08-01 19:23:32.587 [hingStatusInfoChangedEvent] - 'xiaomivacuum:unknown:71a3e518' changed from ONLINE to REMOVING
2017-08-01 19:23:43.778 [hingStatusInfoChangedEvent] - 'xiaomivacuum:unknown:71a3e518' changed from REMOVING to REMOVED
2017-08-01 19:23:43.862 [hingStatusInfoChangedEvent] - 'xiaomivacuum:unknown:71a3e518' changed from REMOVED to UNINITIALIZED
2017-08-01 19:23:43.872 [hingStatusInfoChangedEvent] - 'xiaomivacuum:unknown:71a3e518' changed from REMOVED to UNINITIALIZED (HANDLER_MISSING_ERROR)
2017-08-01 19:23:43.880 [ThingRemovedEvent         ] - Thing 'xiaomivacuum:unknown:71a3e518' has been removed.
2017-08-01 19:24:20.212 [ThingAddedEvent           ] - Thing 'xiaomivacuum:unknown:820b127c' has been added.
2017-08-01 19:24:20.226 [hingStatusInfoChangedEvent] - 'xiaomivacuum:unknown:820b127c' changed from UNINITIALIZED to INITIALIZING
2017-08-01 19:24:20.333 [ThingUpdatedEvent         ] - Thing 'xiaomivacuum:unknown:820b127c' has been updated.
2017-08-01 19:24:20.339 [hingStatusInfoChangedEvent] - 'xiaomivacuum:unknown:820b127c' changed from INITIALIZING to ONLINE
2017-08-01 19:24:40.350 [hingStatusInfoChangedEvent] - 'xiaomivacuum:unknown:820b127c' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): No valid Network response
2017-08-01 19:25:10.365 [hingStatusInfoChangedEvent] - 'xiaomivacuum:unknown:820b127c' changed from OFFLINE (COMMUNICATION_ERROR): No valid Network response to ONLINE
2017-08-01 19:25:20.382 [hingStatusInfoChangedEvent] - 'xiaomivacuum:unknown:820b127c' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): No valid Network response
2017-08-01 19:25:40.856 [ItemChannelLinkAddedEvent ] - Link 'xiaomivacuum_unknown_820b127c_network_ssid-xiaomivacuum:unknown:820b127c:network#ssid' has been added.
2017-08-01 19:25:50.398 [hingStatusInfoChangedEvent] - 'xiaomivacuum:unknown:820b127c' changed from OFFLINE (COMMUNICATION_ERROR): No valid Network response to ONLINE
2017-08-01 19:26:00.405 [hingStatusInfoChangedEvent] - 'xiaomivacuum:unknown:820b127c' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): No valid Network response
2017-08-01 19:26:16.913 [hingStatusInfoChangedEvent] - 'xiaomivacuum:unknown:820b127c' changed from OFFLINE (COMMUNICATION_ERROR): No valid Network response to REMOVING
2017-08-01 19:26:16.919 [hingStatusInfoChangedEvent] - 'xiaomivacuum:unknown:820b127c' changed from REMOVING to REMOVED
2017-08-01 19:26:16.974 [temChannelLinkRemovedEvent] - Link 'xiaomivacuum_unknown_820b127c_network_ssid => xiaomivacuum:unknown:820b127c:network#ssid' has been removed.
2017-08-01 19:26:17.306 [hingStatusInfoChangedEvent] - 'xiaomivacuum:unknown:820b127c' changed from REMOVED to UNINITIALIZED (HANDLER_MISSING_ERROR)
2017-08-01 19:26:17.308 [hingStatusInfoChangedEvent] - 'xiaomivacuum:unknown:820b127c' changed from REMOVED to UNINITIALIZED
2017-08-01 19:26:17.312 [ThingRemovedEvent         ] - Thing 'xiaomivacuum:unknown:820b127c' has been removed.

I can 't verfify if the token was correct, though.
Thank you so much for developing this :slight_smile:

Unfortunately, I’m getting communication error with the right device id and right token.
It keeps going online and offline every 2 seconds.
And as total newbie, I don’t understand how do you use the command channel to power on off ?

A quick iOS Guide to get the “Right” Token:

  1. Setup iOS device with the Mi-Home app.
  2. Create an backup of your iOS Device using iTunes.
  3. Install iBackup Viewer from here: http://www.imactools.com/iphonebackupviewer/
  4. Extract this file /raw data/com.xiami.mihome/mihome.sqlite to your computer (In my case it was not the mihome.sqlite…but the 1589697581_mihome.sqlite works for me…
  5. Open the file extracted using DB Browser for Sqlite (http://sqlitebrowser.org/). You will then see the list of all the device in your account with their token.!image

I hope this will work for the Apple Users :wink:

10 Likes

I am making some changes that may help.
I’ll also give some examples of what I think are valid commands to control the light.

Still nothing will work without valid tolken, so that’s prerequisite to get anything working.

Sound good! :slight_smile:
Is there a way to determine if I use the correct token?