I’m at the last step (on the bottom of the site):
12. Copy the returned 32-digit hexadecimal string to your clipboard.
13. Open Terminal and execute this command: echo '0: ’ | xxd -r -p | openssl enc -d -aes-128-ecb -nopad -nosalt -K 00000000000000000000000000000000
I have the key, but it is 96 chars. And I don’t have any idea on how to execute the last step on Windows?
I don’t have any terminal.
And how come mine is 96 chars instead of 32-digit hexadecimal?
The problem is that recent versions of the iOS app have started to encrypt the tokens, so it needs to be decrypted in order to use in homeassistant.
Unfortunately I don’t know how/if this works in Windows, but the newest release of python-miio ships with a command-line tool called miio-extract-tokens which allows extracting those tokens automatically. https://github.com/rytilahti/python-miio/#miio-extract-tokens contains a short documentation and output when it’s run on Linux.
I’ve just got the new Gen2 (Xiaomi Mi Vacuum / RoboRock Vacuum) and have the 96 digit token. Was there any development progress to converting this on Windows / iOS (Non-Jailbroken). I don’t have any access to an Android / Linux box. I could potentially run the commands from the rPi itself (Using the Hass.IO Image) if that’s supported.
Could anyone help? Looking to be able to get this integrated into HA.
Hi joq3,
You found how to do this steps on windows?
I’m new on this, raspberry and home assistant, and I’m stuck on this steps also:
“12. Copy the returned 32-digit hexadecimal string to your clipboard.
13. Open Terminal and execute this command: echo '0: ’ | xxd -r -p | openssl enc -d -aes-128-ecb -nopad -nosalt -K 00000000000000000000000000000000”
Thanks
I was able to get this functioning with two adjustments / additional steps:
The name for the V2 Robot is ‘RoboRock Vacuum’ or something similar. If you look at the tables you can just scroll over to the right hand side and that will show you the name as well as the 96 digit token without having to use the SQL Query. this can be copied down.
Take that 96 digit key and paste into the following:
Paste in the key as Text / HEX
Function: AES
Mode: ECB
Key: Enter in 32 0’s
Key: 00000000000000000000000000000000
Change output to HEX
Click Decrpyt.
In the HEX output in the table, the key on the right hand side, two rows of 16 digit characters, will be your Token to use with the Vacuum platform. You should be good to go from here. I didn’t want to deal with an Android simulator and found this and pieced together from some other forums.
You have to be careful with the name you put in the quotes. You have to put the name that you have put in the MiHome application. In my case I had to put the following:
SELECT ZTOKEN FROM ZDEVICE WHERE ZNAME = “Ameba”
They should clarify it on the Home Assistant page of My Robot Vacuum:
Of course I have retrieved from my phone and then decrypted on http://aes.online-domain-tools.com/
I have followed all steps from xiaomi vacuum setup.
My question is how to paste key into configuration.yaml file.
What format in order to make it working.
2018-03-05 18:39:49 ERROR (MainThread) [homeassistant.components.vacuum] xiaomi_miio: Error on device update!
File “/usr/src/app/homeassistant/components/vacuum/xiaomi_miio.py”, line 368, in update
state = self._vacuum.status()
File “/usr/local/lib/python3.6/site-packages/miio/vacuum.py”, line 108, in status
return VacuumStatus(self.send(“get_status”)[0])
File “/usr/local/lib/python3.6/site-packages/miio/device.py”, line 216, in send
m = Message.build(msg, ctx)
Which version of HA you’re on? 0.64 has had improvements made on the Xiaomi platform fixing one of the communication issues.
Also which version of the Xiaomi firmware is installed on the vacuum?
Also can you try and extract the token again by following the instructions? I got caught last time where my extract didn’t work and I was mistakenly using an old extract.