Wi-Fi EZ Mode

Last Updated on : 2026-01-28 02:20:46download

This topic describes pairing a device using the Wi-Fi EZ mode, also known as Wi-Fi Easy Connect or SmartConfig. In the pairing process, a mobile phone connects to the router and broadcasts the Wi-Fi credentials and pairing token to enable the smart device to get this information for connection and pairing. It is easy-to-use, but has compatibility requirements for mobile phones and routers. The success rate is lower than that of AP mode.

Pairing process

  • Before pairing.

    • Guide the user to reset the device to Wi-Fi EZ mode, typically identified by a fast-blinking Wi-Fi indicator.
    • Guide the user to connect their phone to a Wi-Fi network, usually a 2.4 GHz Wi-Fi network.
  • Get the pairing token and Wi-Fi network credentials.

    • The app gets the pairing token by calling the method in the SDK.
    • The app gets the Wi-Fi network credentials (SSID and password) input by the user. The SSID can also be obtained through an API call.
  • Start pairing.

    The app calls the pairing method in the SDK to set the Wi-Fi network credentials (SSID and password) and the pairing token.

  • Finish pairing.

    The app receives a callback from the SDK and finishes the pairing process.

EZ pairing API example

For more information, see Device Pairing.

Get a pairing token

// Get a token
this.activatorToken = await TSmartActivatorRequester.getActivatorToken(this.homeId)

Implement methods in the pairing listener

activatorListener: ITSmartActivatorListener = {
    onActiveSetpAndError: (step: TSmartActivatorStep, error?: Error, device?: TSmartDeviceModel) => {
      // Implement the relevant logic.
    },

    onActiveSuccess: (deviceModel: TSmartDeviceModel) => {
      // Handle the logic for successful pairing, such as updating the UI and navigating to the next page.
    },
};

Create an EZ pairing instance

const activatorBuilder = TSmartActivator.buildEzActivatorBuilder(
          this.ssid,
          this.password,
          120 * 1000,
          this.activatorListener,
          this.homeId,
        )
this.activator = TSmartActivator.createActivator(activatorBuilder);

Start pairing

this.activator.startActive()

Stop pairing

this.activator.stopActive()