Not sure how to be more clear… Again read the docs, do exacty what is written and you’ll be fine. If not, post what you have done.
comments are just a note regarding android. Follow instructiions at the bottom of page:
iOS
- Configure the robot with the Mi-Home app.
- Using iTunes, create an unencrypted backup of your iPhone.
- Install iBackup Viewer, open it, and open your backup.
- Open the “Raw Data” module.
- Navigate to com.xiaomi.mihome.
- Search for a file that looks like this: 123456789_mihome.sqlite – note that _mihome.sqlite is not the correct file.
- Save this file to your filesystem.
- Install DB Browser for SQLite.
- Open DB Browser and load the .sqlite file you saved from your backup.
- Click on the Execute SQL tab.
- Input and run this query: SELECT ZTOKEN FROM ZDEVICE WHERE ZNAME LIKE “%Vacuum%”
- Copy the returned 32-digit hexadecimal string to your clipboard.
- Open Terminal and execute this command: echo '0: ’ | xxd -r -p | opensslenc -d -aes-128-ecb -nopad -nosalt -K 00000000000000000000000000000000
- Use the resulting string as your token.
I had trouble getting my token out of iOS… I ended up extracting the SQL database from an iPhone backup if you have access to OS X. Maybe it will help you, here are my notes
I guess there are two things that aren’t clear:
-
how do you do this with Linux? The iBackup Viewer app that’s referenced seems to only be available for Mac or Windows
-
what about the box below from the docs? Does this not apply at all for iOS?
As per python-miio issue 185 the Mi-Home app no longer stores the token within the database (it’s retrieved from Xiaomi servers from version 5.0.31+). Currently the only known fix is to uninstall, then install a downgraded version of the apk. Apkmirror is a trusted source for older versions of the app. Mi-Home version 5.0.0 is confirmed as working for the following Android methods.
Thanks @oakbrad that’s really helpful!
You need MacOS or Windows as you need a backup created in iTunes. The “info box” applies to Android only. If you have an IOS device but no Windows or MacOS you could install the Mi-Home version 5.0.0 app on an Android emulator.
Same here stuck on the DB Browser part. I see the file bit the command SELECT ZTOKEN FROM ZDEVICE WHERE ZNAME LIKE “%Vacuum%” returns nothing.
I have IOS and Mac OS
It probably means you’ve selected the wrong file @ point 6.
I’ve never had any luck with the search actually. I did write a blog post with screen shots about how to retrieve the token here.
Maybe that will help. It’s pretty easy to find even without searching.
I had no trouble extracting the token from an iTunes backup of my phone but should have realised the command had to be run on a unix system when the instructions here mentioned Terminal instead of Command Prompt. @David’s instructions were much clearer.
Thank You David!! Can you please add these pictures somewhere to the poor instructions of home assistant integration?