Xiaomi Robot Vacuum Binding

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?

@Moellegaard If you open the database (see screenshot in above post) from a working Android or Apple Mi Home app, than you can be fairly confident you have the right key.

It needs to respond to any command other than the ‘ping’ (only the ping goes without tolken).
So if the device is getting discovered or you can see that the ping succeeded, but it does not reply to any command you can be fairly sure the tolken is not correct.

1 Like

Thanks for the binding Marcel.

I’ve just had one of these arrive, and I’m confused by the mi home app so thought I’d ask here.

I’ve connected to the vacuum on WiFi and it shows in the app with the charge %, but there’s no other controls I can find. Can anyone help or suggest anything?

This is how it looks for me in the Mi app.
The buttons in the bottom operate the vacuum.

For openhab you need to extract the tolken from the app as described in the first post

and that’s not how it looks for me. :frowning:

Am I even using the right app? It’s this one I’m using

All i have is something similar to this (taken from google; mine shows my vacuum):-

… and there doesn’t seem to be any way to get any further functions.

Okay, so the screen I showed is after I click the vacuum icon on the screen you showed .

If it does not being you to the screen I showed, maybe something went wrong with downloading the plugin. I would uninstall and reinstall the app.

Hi, I am currently owner of an old roomba 550 vacuum cleaner, it does not vacuum the best and it does not like my black carpet(it thinks its falling of a stair or something). So I am considering upgrading to the xiamo but I have a few questions:
does anyone sell it in europe, or do I need to pay the 25% import tax?
How well does it vacuum?
What is the overall height of it?
What is the height of the docking station?
What is the depth of it when docked, icluding charge station?
Is it easy to get replacement parts for it?

The binding looks awesome:slight_smile:

Thanks Marcel. Nothing happens when i click on the vacuum icon, and i’ve installed on two different devices and it’s been like that. I guess i can only try again.

does anyone sell it in europe, or do I need to pay the 25% import tax?
I just ordered from China for GBP260 and didn’t pay any import duty (but maybe I got lucky?).

How well does it vacuum?
The vacuuming is good, but i can’t say how it compares with others.

What is the overall height of it?
approx 9cm

What is the height of the docking station?
approx 13cm

What is the depth of it when docked, icluding charge station?
approx 40cm

Is it easy to get replacement parts for it?
no idea.

You can find at least a few sellers on Aliexpress that ship from within the EU. The price is around 310€.

@Multisaft7
A new version of the iBackup Viewr is out - you can now specify a password when you open the backups. Meaning you no longer need to create an unencrypted backup - you can just use an encrypted one.

@marcel_verpaalen
Thank you so much for creating this binding. Works like a charm for me although I needed to take the robot out of the guest wifi into my standard wifi to discover it as a thing through the binding. Any way to get around that? I would like to keep it in the guest wifi for security reasons.

One question:
You posted on July21st that the channels changed with a new release. Does this mean that the .items-file also needs to be modified? To me it looks like verything is fine.
I used the .items you posted on July 10th. It would be great if you could provide a new sample .items and .sitemap file whenever the channels change. This would make adding the robot to basic UI so much easier for noobs like me.

1 Like

@Michael_Freundlieb
Thanks for your feedback.

Wrt to the channels update, I think most times I updated the 2nd post along with the changes in the binding. Hence, if you copied that file you should be fine.
The very latest update adds network channels, I think those still need to be added to the 2nd post for completion. I’ll add that shortly. (These files I copied from my production system… I’ve not yet addressed those channels there)

Wrt to your guest network… the binding needs to be able to directly reach the vacuum. So if you have it on your guestnetwork, you probably need to add a route/firewall rule to allow that connection to work.
The mihome app probably works in ‘remote’ mode (can be seen in the app) this means it communicates all commands via the cloud in that case. As the cloud logon & communication is not yet understood, connections for the binding are send directly instead of via the cloud.
So I suggest to setup your network indeed so the vacuum is separated from the main network, but still directly reachable from it. (E.g with static routes, firewalls, vlans etc).
The port to open is udp 54321.
Hope this helps

New update is available
Changes:

  • Discovery is done as generic mi io device. Once a valid token is entered, the generic device is changed to a vacuum.
    In case of other mi io devices it is changed to an ‘unsupported’ devicetype. That still allows for custom commands to be send.
  • change the logic of online/offline. This should prevent ‘flipping’ between online& offline each time.
    Note when the binding is starting, the very first online indicated that the device is pingable. If afterwards out goes offline is mainly indicated a tolken issue.

Note. I’ll add some test commands for other Xiaomi devices shortly.