Copied!
Private Cloud
  • Application Development Services
    • Quick Start
    • API Gateway
      • API Request
        • Request Structure
        • Authorization Method
        • Sign Requests
        • Global Error Codes
      • Best Practice
        • Set Postman Environment and Call API Operations
      • API List
        • Basic API
          • Authorization Token Management
            • Refresh Token
            • Get a Token
        • IoT Core
          • Device Management
            • Query Devices in Space
            • Get Status Reporting Log
            • Get Update Progress
            • Query Device Details in Bulk
            • Delete Device
            • Get Update Information
            • Query Device Details
            • Confirm Start of Update
            • Get Device State
            • Get Operation Log
            • Modify Basic Properties
            • Freeze/Unfreeze Device
            • Transfer Device
            • Restore Factory Defaults
            • Query Pairing Result
          • Device Control
            • Send Property
            • Query Properties
            • Modify Properties
            • Set Desired Property
            • Query Desired Properties
            • Query Things Data Model
            • Device Control (Standard Instruction Set)
              • Get Status Set
              • Send Commands
              • Get Specifications and Properties of the Device
              • Get Instruction Set of the Device
              • Get Instruction Set of the Category
              • Get Status of a Single Device
              • Get Latest Status of Multiple Devices
          • Device Group
            • Create Group
            • Delete Group
            • Query Group
            • Rename Group
            • Get Group in Space
            • Add Device
            • Delete Devices
            • Get Device Group
            • Query Group Properties
            • Send Group Properties
            • Query Group Devices
    • Message Gateway
      • Preparations
      • Development Guide
        • Integrate with Message Service
        • Data Signature
        • Message Types
      • Best Practices
        • Get Push Messages by Pulsar (Java SDK)
        • Get Push Messages by Pulsar (Python SDK)
        • Get Push Messages by Pulsar (Go SDK)
        • Get Push Messages by Pulsar (Node.js SDK)
        • Get Push Messages by Pulsar (C# SDK)
  • App Development
    • Preparation
    • Developer Guide for iOS
      • Fast Integration with Cube App SDK for iOS
      • Upgrade Guide
      • Quick Start with Cube App SDK for iOS
      • iOS App: Implement User Account Features
      • User Account Management (iOS)
        • Register and Login with Phone Number
        • Register and Login with Email Address
        • Login with UID
        • Login with Third-Party Account
        • Register and Login with Anonymous Account
        • QR Code-Based Login Authorization
        • Manage User Accounts
      • Home Management
        • Home Information Management
        • Room Information Management
        • Member Information Management
      • Device Pairing (iOS)
        • Wi-Fi EZ Mode
        • AP Mode
        • Wired Mode
        • Sub-Device Pairing
        • NB-IoT Device Pairing
        • HomeKit Device Pairing
        • Pegasus Pairing
        • CPPLUS Link-Based Device Binding
        • Matter Devices
          • Prepare for Integration with Matter Device
          • Pair Matter Device
        • Pair with QR Code on Device
      • Bluetooth Devices
        • Bluetooth Mesh
        • CPPLUS Mesh
      • Device Management
        • Firmware Update
        • Query Reported DP Logs
        • Device Sharing
        • Backup Wi-Fi Networks
        • Offline Device Alerts
        • CPPLUS Link-Based Devices
        • Manage Matter Devices
      • Device Control
        • Multi-Control Linkage
        • Scheduled Tasks
        • Group Management
        • All Category Control Panel
        • Air Conditioning Category Control Panel
        • Switch Control Panel
        • Device DP Parser
      • Smart Scenes
        • Scene Recommendation
      • Common API Methods
      • Integrate with Push Notifications
      • Message Management
        • Configure Push Notifications
        • Message Capabilities
      • Configure Widget Project
      • Error Codes
      • FAQ
      • Extension SDK
        • IPC SDK
          • SDK Architecture
          • Fast Integration with IPC SDK for iOS
          • Quick Start with IPC SDK for iOS
          • IPCs
          • Device Pairing
          • IPC Control (iOS)
          • Live Video Streaming
          • Playback of Video Stored on SD Card
          • SD Card Management
          • Audio and Video Features
          • Low Power Doorbell
          • PTZ Control
          • Doorbell Call Service
          • Cloud Storage
          • Cloud Storage Debugging Tool
          • Detection Alerts
          • Encrypted Images
          • Timeline View
          • Offline Log
          • Migrate IPC UI BizBundles
          • P2P Capabilities
          • IPC SDK Automated Test Tool
          • IPC SDK Test Cases (Reference)
          • FAQ
          • Error Codes
        • Sweeper SDK
          • P2P Download from Robot Vacuums
          • Gyroscope and Visual Robot Vacuums
          • Laser Robot Vacuum
          • Voice Package Download
          • Error Codes
          • Sample Code
        • Smart Lock SDK
          • Wi-Fi Lock
          • Bluetooth Lock
          • Wi-Fi Lock Audio and Video Capability
          • Smart Lock Basic API
      • What is UI BizBundle SDK for iOS?
        • Preparation
        • Integrate with Framework
        • Home Management UI BizBundle
        • Device Pairing UI BizBundle
        • Scene UI BizBundle
        • Multi-Control Linkage UI BizBundle
        • Device Control UI BizBundle
        • OTA UI BizBundle
        • Group Management UI BizBundle
        • Device Details UI BizBundle
        • Panel Multilingual BizBundle
        • IPC UI BizBundles
        • Cloud Storage UI BizBundle
        • FAQ UI BizBundle
        • Message Center UI BizBundle
        • Voice Skills Account Linking UI BizBundle
        • Theme Color Configuration BizBundle
        • Sharing UI BizBundle
      • Changelog
    • Developer Guide for Android
      • Fast Integration with Cube App SDK for Android
      • Upgrade Guide
      • User Account Management
        • Register and Login with Phone Number
        • Register and Login with Email Address
        • Login with UID
        • Login with Third-Party Account
        • Register and Login with Anonymous Account
        • QR Code-Based Login Authorization
        • Manage User Accounts
      • Home Management
        • Home Information Management
        • Room Information Management
        • Member Information Management
      • Device Pairing (iOS)
        • Wi-Fi EZ Mode
        • AP Mode
        • Wired Mode
        • Pair with QR Code on Device
        • Pegasus Pairing
        • Sub-Device Pairing
        • NB-IoT Device Pairing
        • CPPLUS Link-Based Device Binding
        • Matter Devices
          • Prepare for Integration with Matter Device
          • Pair Matter Device
        • Pair with QR Code on Device
      • Bluetooth Devices
        • Bluetooth LE Devices
        • Bluetooth Mesh
        • CPPLUS Mesh
      • Device Management
        • Firmware Update
        • Query Reported DP Logs
        • Device Sharing
        • Backup Wi-Fi Networks
        • Notifications of Devices Getting Offline
        • CPPLUS Link-Based Devices
        • Manage Matter Devices
      • Device Control
        • Sub-Device Control Through Zigbee Gateway
        • Multi-Control Linkage
        • Scheduled Tasks
        • Group Management
        • Device DP Parser
      • Smart Scenes
        • Scene Recommendation
      • Common API Methods
      • Integrate with Push Notifications
        • Integrate with FCM Push
        • Integrate with Xiaomi Push Notifications
        • Integrate with Huawei Push Notifications
      • Message Management
        • Configure Push Notifications
        • Message Capabilities
      • Error Codes
      • FAQ
      • Extension SDK
        • IPC SDK
          • IPC SDK Architecture
          • Fast Integration with IPC SDK for Android
          • IPCs
          • Device Pairing
          • Live Video Streaming
          • SD Card-Stored Video Playback
          • SD Card Management
          • Audio and Video Features
          • Cloud Storage
          • Cloud Storage Debugging Tool
          • Alert List
          • Video Alerts
          • Low Power Doorbell
          • Encrypted Images
          • Timeline View
          • P2P Capabilities
          • IPC SDK Automated Test Tool
          • IPC SDK Test Cases (Reference)
          • Error Codes
          • SDK Log
          • Changelog
        • Sweeper SDK
          • P2P Download from Robot Vacuums
          • Gyroscope and Visual Robot Vacuums
          • Laser Robot Vacuum
          • Voice Package Download
          • Changelog
          • Error Codes
          • Sample Code
        • Smart Lock SDK
          • Wi-Fi Smart Lock
          • Bluetooth Smart Lock
          • Wi-Fi Smart Lock Audio and Video Capabilities
          • Zigbee Lock
          • Smart Lock Basic API
          • Changelog
      • What is UI BizBundle SDK for iOS?
        • Preparation
        • Integrate with Framework
        • Home Management UI BizBundle
        • Device Pairing UI BizBundle
        • Generic Pairing BizBundle
        • Device Control UI BizBundle
        • Multi-Control Linkage UI BizBundle
        • Scene UI BizBundle
        • Group Management UI BizBundle
        • Device Details UI BizBundle
        • OTA UI BizBundle
        • IPC UI BizBundles
        • Cloud Storage UI BizBundle
        • Message Center UI BizBundle
        • FAQ UI BizBundle
        • Maps Service UI BizBundle
        • Voice Skills Account Linking UI BizBundle
        • Panel Multilingual BizBundle
        • Theme Color Configuration BizBundle
        • Sharing UI BizBundle
        • FAQ
      • Changelog
  1. Home
  2. Application Development Services
  3. Message Gateway
  4. Message Types

Message Types

Last Updated on: 2024-09-10 07:19:13

Data format

Message Types

Business data

Protocol number

Each protocol number stands for different features.

Protocol number Description
4 Report device status data
20 Make a device go online
20 Make a device go offline
20 Rename a device
20 Rename a data point
20 Bind a device with a user account
20 Remove a device
20 Update the device status
25 Run a scene
Report device status data
  • Description of data

    code Data type Description
    dataId String The unique ID of the reported data, which has no business meaning.
    devId String The device ID.
    productKey String The product ID of the device.
    status List<StatusItem> The list of the device status data reported this time.
  • Description of StatusItem

    code Data type Description
    code String The code of the specified device status.
    value Object The value of the status code reported by the specified device.
    t Long The 13-digit timestamp when the device status is reported.
    “{dpId}”:“{dpValue}” String:String “Data point ID (the data point ID in product definition)”: “Value of data point”, You can refer to the product definition.
  • Example

    {
    "dataId":"AAXI3c1i6xxx***",
    "devId":"6c95a93fd9xxx***",
    "productKey":"awgmk9pixxx***",
    "status":[
        {
            "code":"switch_1",
            "value":false,
            "t":1628229842692,
            "1":"false"
        }
    ]
    }
Make a device go online
  • Description of bizData

    code Data type Description
    time Long The timestamp.
  • Example

    {
      "devId": "002dj00118fe34d9****",
      "productKey": "The product key defined on the Tuya IoT Development Platform",
      "bizCode": "online",
      "bizData": {
        "time": 146052438362
      }
    }
Make a device go offline
  • Description of bizData

    code Data type Description
    time Long The timestamp.
  • Example

    {
        "devId": "002dj00118fe34d9****",
        "productKey": "The product key defined on the Tuya IoT Development Platform",
        "bizCode": "offline",
        "bizData": {
          "time": 146052438362
        }
      }
Rename a device
  • Description of bizData

    code Data type Description
    devId String The device ID.
    name String The device name.
  • Example

    {
      "devId": "002dj00118fe34d9****",
      "productKey": "The product key defined on the Tuya IoT Development Platform",
      "bizCode": "nameUpdate",
      "bizData": {
        "devId": "002dj00118fe34d9****",
        "name": "new name"
      }
    }
Rename a data point
  • Description of bizData

    code Data type Description
    devId String The device ID.
    name String The name of the specified data point.
    dpId String The ID of the specified data point.
  • Example

    {
      "devId": "002dj00118fe34d9****",
      "productKey": "The product key defined on the Tuya IoT Development Platform",
      "bizCode": "dpNameUpdate",
      "bizData": {
        "devId": "002dj00118fe34d9****",
        "name": "new name",
        "dpId": "dpId"
      }
    }
Bind a device with a user account
  • Description of bizData

    code Data type Description
    devId String The device ID.
    uuid String The universally unique identifier (UUID) of the specified device.
    uid String The ID of the user that is bound with a device.
    token String The device pairing token.
  • Example

    {
      "devId": "002dj00118fe34d9****",
      "productKey": "The product key defined on the Tuya IoT Development Platform",
      "bizCode": "bindUser",
      "bizData": {
        "devId": "002dj00118fe34d9****",
        "uuid": "06200043b4e618c1****",
        "uid":"ay1529485403390****",
        "token": "IIpQ****"
      }
    }
Remove a device
  • Description of bizData

    code Data type Description
    devId String The device ID.
    uid String The ID of the user that is bound with a device.
  • Example

    {
      "devId": "002dj00118fe34d9****",
      "productKey": "The product key defined on the Tuya IoT Development Platform",
      "bizCode": "delete",
      "bizData": {
        "devId": "002dj00118fe34d9****",
        "uid":"ay1529485403390S****"
      }
    }
Update the device status
  • Description of bizData

    code Data type Description
    devId String The device ID.
    moduleType Integer The type of the module. Valid values:
    • 0: Wi-Fi
    • 1: Bluetooth Low Energy
    • 2: GPRS
    upgradeStatus Integer The update status. Valid values:
    • 1: Prepare to update.
    • 2: Updating.
    • 3: Update is completed.
    • 4: An exception occurs during an update process.
    • 7: Timeout.
    description String The description of an update.
    oldVersion String The legacy version of the firmware.
    newVersion String The new version to which the firmware is updated.
  • Example

    {
        "bizCode":"upgradeStatus",
        "bizData": {
            "devId":"6ca8756d*****1b4ewsdn",
            "moduleType":0,
            "upgradeStatus":2,
            "description":"Update test",
            "oldVersion": "1.0.1",
            "newVersion": "1.0.2"
        },
        "devId":"6ca8756d*****1b4ewsdn",
        "productKey":"vFHpaEFwu8UD****",
        "ts":1562232522192
    }
Run a scene
  • Description of bizData

    code Data type Description
    name String The name of the specified scene.
    id String The ID of the specified scene.
    gid Long The ID of the specified home.
    uid String The user ID (UID) who adds a scene.
    ts Long The timestamp when a message was delivered.
    actions.entityId String The entity ID.
    actions.execStatus Integer The status of the action. Valid values:
    • -1: default
    • 0: failure
    • 1: success
    • 2: to be executed
    • 3: no execution is required
    actions.executeTime Long The timestamp when an action was executed.
    actions.id String The action ID.
    actions.errorMsg String The error message.
  • Example

    {
       "bizData":{
        "name":"Switch-On",
        "id":"azmQ2w8kPSCdcr***",
        "actions":[
            {
                "entityId":"02167073cc****",
                "execStatus":1,
                "executeTime":1625798044277,
                "id":"1jPxz3zaNdL****"
            }
        ]
      },
     "gid":37081***,
     "uid":"ay1622715182388N****",
     "ts":1625798044298
    }
  • Prev Doc Data Signature
  • Next Doc Best Practices
This page contains content