Roborock S5 token

Hi all,

So having struggled to get the token from my Roborock S5 vacuum to use with Valetudo (Cloud Free Smart Vacuum – Valetudo for Roborock S5), I finally found a method that worked perfectly for me: Getting a Xiaomi API Token for a Roborock S5 to link with Home Assistant

However, all my issues are still not solved. Here is an example of the token I am able to extract with the above method:

S384VhMRhwCP+PeaY07sYgcJLLzlR/9RFmBE8r7CwybO2Bk0NelD8UK3y7hl21KO7iHc6k87w4i0BBdxzAH5kk3xc60R13gdMvQlUnCwybO2Bk0NKkwNW20oL3qjCEENcnu9xO+l9Z0fQgOf8bpJnsMSe1Ni0QMMX8CwybO2Bk0NpTGm2fkTbDBi3N7meDg+co46EhQi/4QcgJVA6/jFCg==

(I have changed some of the characters, so this is not the actual token)

Obviously this is not in the correct format. This token is 216 characters, and not in hex. Valetudo only allows hex characters, and similar to HA, it is 32 characters in length.

So, the question: How do I convert the token I have extracted into the format that is needed by Valetudo and HA?

Thank you in advance. :slight_smile:

You have a HASH and I think you need to decrypt your token. I suggest next steps:

The latest Mi Home app store the tokens encrypted into a 96 character key and require an extra step to decode this into the actual token. Visit this website and enter the details as shown below:

  • Input type: text
  • Input text (hex): your 96 character key
  • Selectbox Plaintext / Hex: Hex
  • Function: AES
  • Mode: ECB
  • Key (hex): 00000000000000000000000000000000
  • Selectbox Plaintext / Hex: Hex
  • Hit the decrypt button. Your token are the first two lines of the right block of code. These two lines should contain a token of 32 characters and should be the correct token for your device.

Extracted from:

Thank you. I have seen these steps, and I did try, but I receive an error:

Input is not valid hexadecimal string. Permitted characters are: [a-fA-F0-9 \n\r\t-] and the string must have even length.

Also, the token I am getting is 216 characters, and it is not hex, which is part of my confusion.