I am wondering if the Xiaomi Mi Robot Vacuum cleaner has some kind of API to control it (start, stop, status, …).
It’s obviously a good choice in terms of price performance.
See a test here (sorry, just in German):
Anyone who has one and tried to re-engineer it?
It is approved now, so it should show up in the market place if you have that loaded.
NB, keep in mind you need a very recent OH2 setup (I think build 950 or later) as it uses a recent feature from smarthome.
Note the specific procedure to get the token (if you did not retrieve that before)
Reset the vacuum (no worry, your usage settings remain). This will disconnect it from the normal wifi network.
Connect to it’s wifi hotspot
Run openhab discovery. NB, this needs to be done from the laptop that is connected to the vacuum wifi, not from your normal network.
Openhab should discover the vacuum including the token.
Once openhab has the token, you can link the vacuum back to the normal network with the MiHome app.
Once it is connected back to the normal network, run discovery once more. This will update the IP address to the new IP address of the vacuum.
I recommend to save your token, so you don’t need to repeat this procedure each time you pull an updated version of the binding.
Each time you reset your vacuum, the token is changing, hence this procedure needs to be repeated.
Alternative ways to get the token:
Same procedure, but using the pymirobo application.
Gain root access on your phone, and and open the database from the mihome application. The token is visible in the database
Xiaomi changed the Token handling in the last Firmware Version (3.3.9_003074). The token would be changed after the Mi-Home App is connected with the Robot. So you can’t use the initial Token any more. But there is another way. As described here (http://forum.iobroker.net/viewtopic.php?f=23&t=4898&start=800#p71036) you could read the Token from the Mi-Home app.
In short you have to:
Connect the Mi-Home App with the Robot
Change Wlan an Settings
Enable Developer Options in Android
Download the MiToolKit
Connect your Phone to your PC and start the MiToolKit
I don’t have the latest version yet I think, as it still works for me.
The other way I found was indeed reading the mio2db file with sqllite, but that requires you to be able to make a backup (root access) I think the tool you suggest does something similar.
I’ll update my firmware and see if there is an alternative. I have 2 idea’s I want to try out.
(Option 1 would be that after the token is received, the linking to the mi account is done by openhab, option 2 is to log on to the mi account and retrieve it) this may be possible as I noticed that you can use the vacuum from multiple phones without requiring to link it again. The token db is synced over your devices at log on
yes you are right, the tool reads the sqlitedb. But you don’t need root access. The Tool creates a backup of the app with the developer access and then reads the sqlite from the backup. There is also a Solution for iOS Users.
Option2 would be realy great cause you don’t need to switch the Wifi on your openHAB Host. Pls let me know if i could support you in any way.
Hey! Received my robot 2 days ago and I’m totally exited to check out your binding! Just updated to openHAB 2.1. For now there is no Xiaomi Robot binding available. I guess it has to get a few adjustments to be compatible with 2.1, right?