enri
(Enri)
September 15, 2017, 10:33am
1
Hello,
I’m using Hass.io for the first time and I’m trying to get Mi Robot working.
When I try to get the token I get a 96 char key which is not permitted. I’m trying with the iBackup+SQLite method.
I noticed I can use `mirobo discover --handshake 1’ but I don’t know how to lunch the command using Hass.io .
Any ideas?
thanks
`
itchaboy
(Itchaboy)
September 15, 2017, 2:34pm
2
Yeah 96 characters is way to much. This is my old token 32336170646c4933556e547830324e6b
Though I used the android backup method so I can’t help with the iPhone method
pplucky
(Pplucky)
September 15, 2017, 11:20pm
3
Check this possibility here:
Yeay! I managed to decrypt the 96 character token:
# AES-ECB decrypt a 96 character iOS token -> valid 32 character token
from Crypto.Cipher import AES
import binascii
keystring = '00000000000000000000000000000000'
iostoken = '16a935db276e19b1c7bef0739f2deb7d3aca43c5e26a3c6445351cb2fb8495ea0143db63ee66b0cdff9f69917680151e'
key = bytes.fromhex(keystring)
cipher = AES.new(key, AES.MODE_ECB)
token = cipher.decrypt(bytes.fromhex(iostoken[:64]))
print(token)
# Output: b'4a447a414670584967465055415…
3 Likes
enri
(Enri)
September 16, 2017, 6:45am
4
seems this is the right way! Thanks!! I can I do this with Hass.io ?
syssi
September 16, 2017, 7:41am
5
It’s easier to use a python3 + pycrypto installation. The next python-mirobo version will provide a tool called “miio-extract-tokens”: add a note about miio-extract-tokens by rytilahti · Pull Request #79 · rytilahti/python-miio · GitHub
2 Likes
enri
(Enri)
September 16, 2017, 12:42pm
6
this is great! So, it’s only a matter of time! thanks