Skip to content

Setup with Local Connection Not Recommended ​

This method should be used to establish a direct local connection to the robot vacuum without relying on continuous cloud connectivity. To use this method, the device must have been successfully added to the official Xiaomi Home application (available for iOS and Android) at least once to generate a valid token. Furthermore, it must remain linked to the account during this setup step so that the integration can retrieve the required IP address and token from the cloud.

Local Connection ConfigurationLocal Connection Configuration

Device Compatibility

This connection method is exclusively supported for devices manufactured before 2022 that are supported with the Xiaomi Home application. If a device cannot be added to the Xiaomi Home app, it will not expose a local API under any circumstances with any token.

No Map Support Not Recommended

It is not technically possible to retrieve map data through the local API. As a result, the local connection method provides no map support, which completely disables several core features that rely on map data such as Cleaning History, Map Recovery, and dynamic Room Entities. Because the map and its dependent features are central to the integration's core functionality, this connection method is strictly not recommended. For a complete and fully functional experience, it is highly advised to use one of the cloud connection methods instead.

Retrieving IP and Token ​

To configure the local connection, you must manually provide the device's IP address and token.

Subnet Requirement

For security reasons, the device only responds to requests originating from its own subnet. Therefore, the robot vacuum and Home Assistant must be on the exact same subnet for local communication to work. See this python-miio article for troubleshooting cross-subnet issues.

Method 1: Xiaomi Cloud Tokens Extractor Recommended ​

This is the most reliable method. It runs on Windows, macOS, or Linux, connecting directly to the Xiaomi cloud servers to retrieve the IP addresses and tokens for all devices linked to the account simultaneously.

  1. Download the Tool: Download the appropriate release (e.g., .exe for Windows) of the Xiaomi Cloud Tokens Extractor from GitHub.
  2. Run the Application: Execute the downloaded file to open a terminal interface.
  3. Enter Credentials: Provide the exact username (Email or Xiaomi ID) and password used for the Xiaomi Home application.
  4. Select Server Region: Specify the server region matching the Xiaomi Home app (e.g., de for Europe). If the region is unknown, leave the prompt blank and press Enter to scan all available servers.
  5. Retrieve the Token: The tool will output a list of all devices connected to the account. Locate the target vacuum in the list and copy its corresponding 32-character token.

Method 2: Desktop GUI Application (Get_MiHome_devices_token) ​

For users who prefer a graphical user interface over a command-line tool, a desktop application is available.

  1. Download the Application: Download and install the Get_MiHome_devices_token application from GitHub.
  2. Login: Open the application, enter the Xiaomi account credentials, and select the appropriate server region.
  3. Retrieve the Token: Once authenticated, all linked devices, along with their respective IP addresses and tokens, will be displayed in a tabular format.

Method 3: Modded Mi Home App for Android Not Recommended ​

Android users can utilize a modified version of the Mi Home application to view tokens directly within the app interface on their mobile device.

  1. Uninstall Original App: Completely uninstall the official Mi Home application from the Android device. (Note: Devices will remain safely linked to the cloud account).
  2. Install Modded App: Search online for the "MiHome by Vevs" modified APK, download the latest version, and install it on the device.
  3. Login: Open the modified application and log in using the Xiaomi account credentials.
  4. Retrieve the Token: Select the target vacuum to open its control interface. Tap the three dots in the top right corner to access settings, then navigate to the Network Info or General Settings section. The device's IP address and token will be directly visible on this screen.