Offline Unbinding

Last Updated on : 2023-11-29 07:32:21download

This topic describes how offline unbinding works on Bluetooth sub-devices.


Offline unbinding is also known as abnormal unbinding or offline removing. The user triggers Remove or Remove and Clear Data on the app panel when the device is disconnected. On a successful operation, the device becomes unbound in the cloud, but remains in the bound state on the device side.

In this case, when this device is advertising, if any Tuya-based mobile app connects to it, the app will send the device a command to unbind. Note that the process of device handling offline unbinding will not be reflected on the mobile app.

Data structure


typedef struct {
    UINT8_T data;
} tuya_ble_anomaly_unbound_data_t;

data: A reserved field having no meaning.

API description

Trigger event

The user taps Remove or Remove and Clear Data on the app panel while the device is offline.


How to use

Communication process

Offline Unbinding

Code development

See the example code in tal_sdk_test.c.

VOID_T tal_sdk_test_ble_protocol_callback(tuya_ble_cb_evt_param_t* event)
    UINT8_T *rsp_buf = NULL;
    UINT16_T rsp_buf_len = 0;

    switch (event->evt) {

        } break;


        default: {
        } break;

Functional testing


  • You have installed the Tuya app on your phone.
  • Your device has been paired.


  1. After the device has been paired, turn off Bluetooth on the phone.

  2. Open the device panel on the app and tap the pencil icon in the top right corner.

  3. Tap Remove Device.

  4. Go back to the home page of the app. Tap + in the top right corner and then Add Device. The mobile phone will scan for Bluetooth devices and then trigger the offline unbinding process.

    Offline Unbinding

If you have any problems with host usage, see Logic Host User Guide.

Support and help

If you have any problems with TuyaOS development, you can post your questions in the Tuya Developer Forum.