How to implement Wi-Fi provisioning in a Flutter app, similar to Mi Home app?
03:22 08 Jul 2026

I'm building a Flutter application that should let users connect a Xiaomi Smart Air Purifier 4 Compact to their home Wi-Fi network — similar to how the official Mi Home / Xiaomi Home app does it during first-time device setup.

What I'm trying to achieve:
When you add a new Xiaomi/Mi device in the official app, it typically follows this flow:

  1. Put the device into configuration/pairing mode (usually a blinking LED after a reset or button press).

  2. The phone connects either to the device's temporary Wi-Fi hotspot (AP mode) or broadcasts Wi-Fi credentials to the device over the phone's own Wi-Fi (SmartConfig / EasyLink, which uses UDP multicast/broadcast packets encoding the SSID and password).

  3. The device receives the credentials, joins the home network, and then registers itself with the Xiaomi cloud/account.

I want to replicate this device-to-Wi-Fi provisioning step in my own Flutter app using Dart, without relying on the Mi Home app.

What I've tried / researched so far:

  • Looked into the wifi_iot and network_info_plus Flutter packages to manage phone Wi-Fi connections and read SSID info.

  • Found that Xiaomi devices commonly support a provisioning protocol (similar to ESP-Touch/SmartConfig used by many IoT vendors), but I haven't found official documentation or an open protocol spec for miIO-based devices.

  • Considered connecting to the purifier's AP hotspot directly using wifi_iot's connect() method and then sending an HTTP/UDP request with the target SSID/password, but I'm unsure of the exact endpoint, port, or payload format the Xiaomi firmware expects.

My questions:

  1. Is there a documented or reverse-engineered protocol for provisioning Xiaomi/Mi Home devices (specifically newer "miIO" or "MIoT" spec devices like the Air Purifier 4 Compact) over Wi-Fi from a custom app?

  2. Are there any open-source Dart/Flutter packages or reference implementations (e.g., ports of python-miio or similar) that handle this handshake?

  3. If direct provisioning isn't feasible without Xiaomi's proprietary cloud/SDK, is there a supported Xiaomi IoT Developer Platform API that allows triggering this pairing flow from a third-party app instead?

flutter dart wifi xiaomi mi