-
Notifications
You must be signed in to change notification settings - Fork 26
Send 0x92, 0xAB, 0x54, 0xFA to authCharacteristic. #3
Comments
I use random tokens and the same step 5 payload always. I didn't sniff it, it was taken from the mi home app. |
Also in my case the status update has 12 bytes (00 ff 00 00 50 20 00 00 00 01 02 00). Maybe we have different versions ? I have: |
I also have latest mihome app 5.4.54 EU server |
Ah I don't remember my model name... Can you check your kettle product ID? It's 131 for me. |
I cannot find the product id as integer. Only the info I supplied in comment above and on the kettle itself I can find model number: |
I have decompiled and deobfuscated the code and found out what they call "step4" is your step 5 and they send this: BLECipher.encryptTwoArraysTogether(this.TOKEN, ByteUtils.decodeInteger4((int) v92AB54FA)) |
It is not working for me so far. I have concluded that either my productId is different than 131 (and I cannot find it anywhere) or something in cipher or mixA or mixB method is not correct (I reimplemented it from GO to python). I ran tests and your GO implementation and my python yield same results. I think the productID might be different. |
LOL! I swear it was just constant and it works for me. Maybe they've updated the protocol but I don't think they could because it would break backwards compatibility. |
I finally found my productId, I don't know how to obtain it properly yet but I did it by sniffing request and response of mi home and iterating from 1 to 10000 and checking if the cipher equation is equal. My product id is 275 and now everything works perfectly. Good job on properly implementing the mixA, mixB and cypher methods, they will prove to be useful in other applications aswell (miFlora,...). |
Hey that’s cool! Btw, Mi Flora has no encryption and no pairing process. Same as Mi Scale. Come to your friends house and read their weight 😶 |
I found this issue where they struggle with it: sputnikdev/eclipse-smarthome-bluetooth-binding#18 |
Oh yeah. My code will help them. But Mi Flora particularly doesn’t need any auth. |
I have implemented it in python to be more "home-assistant" friendly :) https://github.com/drndos/mi-kettle-poc I hope it is within the "do whatever fuck you want license" :D |
Yay, that’s great! |
Do you mean the license of my work? |
Hello,
I tried to replicate your successful connection to kettle and I found an issue with step 5. in authentication.
In my case the bytearray was different than yours. It seems that with different token it is different. After sniffing it from my android, I made successful connection to kettle <3. Maybe we are missing something here and there is a way we can compute the 5. step bytearray. I tried different connections with android and each pairing process generates different token and different payload for step 5.
Thank you.
The text was updated successfully, but these errors were encountered: