riston
(Risto Novik)
October 23, 2020, 8:20am
1
Hello, struggling with Roborock S5 Max to integrate with Home Assistant, I am in the first phase to get the token.
I don’t have separate Xiaomi Gateway.
From the HA page, this option I understand basically doesn’t work with Roborock devices as these aren’t listed in Mi Home application https://www.home-assistant.io/integrations/xiaomi_miio/#android-not-rooted ?
The Miio NPM cli is broken and doesn’t work with newer devices, I used the python one and after resetting the device I was able to discover it https://python-miio.readthedocs.io/en/latest/discovery.html .
What I don’t understand is that after discovery how do I configure the wifi AP point to work in my local network? When I do it from Roborock APP it would generate a new token and I am not able to reconnect to vacuum anymore. Is there a blog post guide how this whole setup should work?
Floo
October 24, 2020, 1:54pm
2
you can find different methods to obtain the token here:
# Obtain Mi Home device token
Use any of these methods to obtain the device token for the supported miio devices.
## Method 1 - Obtain device token for miio devices that hide their token after setup
Use one of these methods to obtain the device token for devices that hide their tokens after setup in the Mi Home App (like the Mi Robot Vacuum Cleaner with firmware 3.3.9_003077 or higher). This is usually the case for most Mi Home devices. The latest versions of the Mi Home smartphone app dont hold the token anymore so before you begin with any of these methods you will need to install an older version of the smartphone app. Version 5.0.19 works for sure with the 1st gen Vacuum Robot, for the 2nd gen (S50) you should try version 3.3.9_5.0.30. Android users can find older version of the app [here](https://www.apkmirror.com/apk/xiaomi-inc/mihome/).
### Android users
#### Rooted Android Phones
* Setup your Android device with the Mi Home app version 5.0.19 or lower
* Install [aSQLiteManager](https://play.google.com/store/apps/details?id=dk.andsen.asqlitemanager) on your phone
* Use a file browser with granted root privilege and browse to /data/data/com.xiaomi.smarthome/databases/
* Copy miio2.db to an accessable location
* Open your copy of miio2.db with aSQLiteManager and execute the query "select token from devicerecord where localIP is '192.168.0.1'" where you replace the IP address with the IP address of the device you want to get the token from. It will show you the 32 character device token for your Mi Home device.
#### Non-Rooted Android Phones
##### Extract token from log file
This method will only work when you install the Mi Home app version v5.4.54. You can find it [here](https://android-apk.org/com.xiaomi.smarthome/43397902-mi-home/). It looks like Xiaomi made a mistake in this app version where the log file written to internal memory exposes the device tokens of your Xiaomi miio devices.
* Setup your Android device with the Mi Home app version 5.4.54
* Log in with you Xiaomi account
* Use a file explorer to navigate to /sdcard/SmartHome/logs/Plug_Devicemanager/
This file has been truncated. show original
I managed to obtain the token via iOS backup few weeks ago
ps: i only use the MiHome app