Last Updated on : 2024-06-20 06:24:13download
Tuya’s IoT message queue is composed of messages generated by the cloud-based business data flow. Tuya defines bizCode
(action) to distinguish different messages. For example, the bizCode
of device property reporting is devicePropertyMessage
. This topic describes the transfer process of typical bizCode
and the detailed data format of all available bizCode
.
The data format of a message queue is divided into two layers:
protocol
: the protocol number.pv
: the protocol version number.t
: the system time pushed to you.data
: the business data pushed to you.sign
: the message signature used for anti-counterfeiting verification. The most critical protocol
is a classification with a coarser granularity than bizCode
, helping you complete preliminary message distribution.data
. This layer can be used only after you decrypt it, and you can get a key-value pair in JSON string format.The following figure shows the two-layer data format.
#msg
and the decrypted #msg.data
are in JSON format.#msg
and #msg.data
in JSON format. Make sure that your code processing logic is not affected when key-value pairs are added.In a message queue, each protocol
number stands for different features.
This topic lists two versions of protocol numbers.
IoT Core protocol number: Tuya upgraded the IoT Core service on June 20, 2023. For more information, see the API Adjustment Announcement. The new version includes common underlying APIs related to devices and space, and also provides a matching messaging protocol.
Legacy protocol numbers: including protocol numbers of messages for homes, assets, and some vertical fields.
For example, deviceOnline
sent by IoT Core protocol number 1001
and online
pushed by the legacy protocol number 20
both indicate that the device is online, but the content of the pushed data varies.
You can choose a messaging protocol based on the specific cloud service. Configuring two protocols might cause duplicate reception and processing. If you want to simultaneously use both versions of messages, see Set up messaging rules to configure message reception.
Service | Protocol number | bizCode | Scope of application |
---|---|---|---|
Device data reporting | 1000 |
|
IoT Core |
Device management | 1001 |
|
IoT Core |
Device OTA updates | 1002 |
|
IoT Core |
Space | 1010 |
|
IoT Core |
Group | 1020 |
|
IoT Core |
Linkage rule | 1030 |
|
IoT Core |
The legacy protocol numbers are for your reference.
Service | Protocol number | bizCode | Scope of application |
---|---|---|---|
Device data reporting | 4 |
|
Legacy version |
Device management | 20 |
|
Legacy version |
IoT SIM card | 43 |
|
Legacy version |
Third-party speaker | 45 |
|
Legacy version |
Automation | 25 |
|
Legacy version |
Automate an external action | 22 |
|
Legacy version |
Scene | 25 |
|
Legacy version |
Industrial asset | 13001 |
|
Legacy version |
Security device | 30 |
|
Legacy version |
Infrared product | 50 |
|
Legacy version |
Notification of device information | 20 |
|
Legacy version |
User property | 32 |
|
Legacy version |
Geofencing | 40 |
|
Legacy version |
User event | 54 |
|
Legacy version |
Home event | 35 |
|
Legacy version |
Room event | 34 |
|
Legacy version |
Report device properties
Description of bizData
code | Data type | Description |
---|---|---|
dataId | String | The unique ID of the reported data. This ID has no business meaning. |
devId | String | The device ID. |
productId | String | The product ID of the specified device. |
properties | List<PropertyItem> | The list of the device property data reported this time. |
Description of PropertyItem
code | Data type | Description |
---|---|---|
code | String | The code of the reported device property. |
value | String | The value of the reported device property. |
dpId | String | The ID of the specified data point. |
time | Long | The 13-digit timestamp when the device property was reported. |
Example
{
"bizCode": "devicePropertyMessage",
"bizData": {
"dataId": "1635186469981261***",
"devId": "263a15c90bc83eff35***",
"productId": "ejhcgtdtgtcuh***",
"properties": [
{
"code": "property",
"dpId": 101,
"time": 1678693809396,
"value": "red"
}
]
},
"ts": 1678693809396
}
Instruct device to report properties
Different from the action that a device regularly reports device properties, the cloud or mobile app actively sends an instruction to a device to trigger status reporting. After receiving the specified instruction, the device reports the required status.
Description of bizData
code | Data type | Description |
---|---|---|
dataId | String | The unique ID of the reported data. This ID has no business meaning. |
devId | String | The device ID. |
productId | String | The product ID of the specified device. |
properties | List<PropertyItem> | The list of the device property data reported this time. |
Description of PropertyItem
code | Data type | Description |
---|---|---|
code | String | The code of the reported device property. |
value | String | The value of the reported device property. |
dpId | String | The ID of the specified data point. |
time | Long | The 13-digit timestamp when the device property was reported. |
Example
{
"bizCode": "deviceQueryPropertyMessage",
"bizData": {
"dataId": "1635186469981261***",
"devId": "263a15c90bc83eff35***",
"productId": "ejhcgtdtgtcuh***",
"properties": [
{
"code": "property",
"dpId": 101,
"time": 1678693809396,
"value": "red"
}
]
},
"ts": 1678693809396
}
Report device events
Description of bizData
code | Data type | Description |
---|---|---|
dataId | String | The unique ID of the reported data. This ID has no business meaning. |
devId | String | The device ID. |
productId | String | The product ID of the specified device. |
eventCode | String | The code of the specified device event. |
time | Long | The 13-digit timestamp when the device event was reported. |
outputParams | List<OutputParamsItem> | The list of the device event data reported this time. |
Description of OutputParamsItem
code | Data type | Description |
---|---|---|
code | String | The name of the specified output parameter. |
value | String | The value of the specified output parameter. |
Example
{
"bizCode": "deviceEventMessage",
"bizData": {
"dataId": "1635186587996393***",
"devId": "263a15c90bc83eff35***",
"eventCode": "event",
"outputParams": [
{
"code": "event_1",
"value": "true"
}
],
"productId": "ejhcgtdtgtcuh***",
"time": 1678693837533
},
"ts": 1678693837789
}
Invoke device actions
Description of bizData
code | Data type | Description |
---|---|---|
dataId | String | The unique ID of the reported data. This ID has no business meaning. |
devId | String | The device ID. |
productId | String | The product ID of the specified device. |
actionCode | String | The code of the specified device action. |
time | Long | The 13-digit timestamp when the device action was invoked. |
responseCode | String | The returned result. Valid values:
|
status | String | The execution status of the specified action. Valid values:
|
Example
{
"bizCode": "deviceActionResponseMessage",
"bizData": {
"actionCode": "action_code",
"dataId": "1443433584600440***",
"devId": "263a15c90bc83eff35***",
"productId": "ejhcgtdtgtcuh***",
"responseCode": 0,
"status": "SUCCESS",
"time": 1678693877497
},
"ts": 1678693878088
}
Go online
Description of bizData
code | Data type | Description |
---|---|---|
devId | String | The device ID. |
productId | String | The product ID of the specified device. |
uid | String | The ID of the user who performs device pairing. |
time | Long | The 13-digit timestamp when the device went online. |
Example
{
"bizCode": "deviceOnline",
"bizData": {
"devId": "6c0946b2fff7b98d6em***",
"uid": "ay1638425579033A1***",
"productId": "jv19g49qohpo8***",
"time": 1678952060301
},
"ts": 1678952060418
}
Go offline
Description of bizData
code | Data type | Description |
---|---|---|
devId | String | The device ID. |
productId | String | The product ID of the specified device. |
uid | String | The ID of the user who performs device pairing. |
time | Long | The 13-digit timestamp when the device went offline. |
Example
{
"bizCode": "deviceOffline",
"bizData": {
"devId": "6c0946b2fff7b98d6em***",
"uid": "ay1638425579033A1***",
"productId": "jv19g49qohpo8***",
"time": 1678951891724
},
"ts": 1678951891733
}
Transfer a device
Description of bizData
code | Data type | Description |
---|---|---|
devId | String | The device ID. |
productId | String | The product ID of the specified device. |
spaceId | String | The ID of the specified target space. |
fromSpaceId | String | The ID of the specified source space. |
Example
{
"bizCode": "deviceTransfer",
"bizData": {
"devId": "6c0946b2fff7b98d6em***",
"spaceId": "151481***",
"productId": "jv19g49qohpo8***",
"fromSpaceId": "151482***"
},
"ts": 1678952218298
}
Freeze a device
Description of bizData
code | Data type | Description |
---|---|---|
devId | String | The device ID. |
productId | String | The product ID of the specified device. |
uid | String | The ID of the user who performs device pairing. |
spaceId | String | The ID of the specified space. |
Example
{
"bizCode": "deviceFreeze",
"bizData": {
"devId": "6c0946b2fff7b98d6em***",
"uid": "ay1638425579033A1***",
"spaceId": "151481***",
"productId": "jv19g49qohpo8***"
},
"ts": 1678952317535
}
Unfreeze a device
Description of bizData
code | Data type | Description |
---|---|---|
devId | String | The device ID. |
productId | String | The product ID of the specified device. |
uid | String | The ID of the user who performs device pairing. |
spaceId | String | The ID of the specified space. |
Example
{
"bizCode": "deviceUnFreeze",
"bizData": {
"devId": "6c0946b2fff7b98d6em***",
"uid": "ay1638425579033A1***",
"spaceId": "151481***",
"productId": "jv19g49qohpo8***"
},
"ts": 1678952314832
}
Bind a device
Description of bizData
code | Data type | Description |
---|---|---|
devId | String | The device ID. |
productId | String | The product ID of the specified device. |
uid | String | The ID of the user who performs device pairing. |
spaceId | String | The ID of the specified space. |
uuid | String | The universally unique identifier (UUID) of the specified device. |
token | String | The token for device pairing. |
Example
{
"bizCode": "deviceBindSpace",
"bizData": {
"devId": "6c0946b2fff7b98d6em***",
"uid": "ay1638425579033A1***",
"spaceId": "151481***",
"productId": "jv19g49qohpo8***",
"uuid": "ca4ad1cb06be1***",
"token": "RuUWe***"
},
"ts": 1678952059739
}
Unbind a device
Description of bizData
code | Data type | Description |
---|---|---|
devId | String | The device ID. |
productId | String | The product ID of the specified device. |
uid | String | The ID of the user who performs device pairing. |
spaceId | String | The ID of the specified space. |
sub | String | Specifies whether it is a sub-device. Valid values:
|
resetFactory | String | Specifies whether to restore factory defaults. |
uuid | String | The universally unique identifier (UUID) of the specified device. |
Example
{
"bizCode": "deviceUnbindSpace",
"bizData": {
"devId": "6c0946b2fff7b98d6em***",
"uid": "ay1638425579033A1***",
"spaceId": "151481***",
"sub": false,
"resetFactory": false,
"productId": "jv19g49qohpo8***",
"uuid": "ca4ad1cb06be1***"
},
"ts": 1678951891665
}
Rename a device
Description of bizData
code | Data type | Description |
---|---|---|
devId | String | The device ID. |
productId | String | The product ID of the specified device. |
uid | String | The ID of the user who performs device pairing. |
name | String | The name. |
uuid | String | The universally unique identifier (UUID) of the specified device. |
Example
{
"bizCode": "deviceNameUpdate",
"bizData": {
"devId": "6c0946b2fff7b98d6em***",
"uid": "ay1638425579033A1***",
"productId": "jv19g49qohpo8***",
"name": "Change name***",
"uuid": "ca4ad1cb06be1***"
},
"ts": 1678952636853
}
Device OTA update events
Description of bizData
code | Data type | Description |
---|---|---|
devId | String | The device ID. |
upgradeStatus | String | The update status. Valid values:
|
channel | String | The channel number. Valid values:
|
Example
{
"bizCode": "deviceOtaProgress",
"bizData": {
"devId": "6c622fa1f003b84e74i***",
"upgradeStatus": 2,
"channel": 0
},
"ts": 1678703050654
}
Create a space
Description of bizData
code | Data type | Description |
---|---|---|
spaceId | String | The ID of the specified space. |
name | String | The name. |
Example
{
"bizCode": "spaceCreate",
"bizData": {
"spaceId": 152082***,
"name": "Campus Space"
},
"ts": 1678691050625
}
Remove a space
Description of bizData
code | Data type | Description |
---|---|---|
spaceId | String | The ID of the specified space. |
Example
{
"bizCode": "spaceRemove",
"bizData": {
"spaceId": 152082***
},
"ts": 1678691097671
}
Rename a space
Description of bizData
code | Data type | Description |
---|---|---|
spaceId | String | The ID of the specified space. |
name | String | The name. |
Example
{
"bizCode": "spaceUpdate",
"bizData": {
"spaceId": 152082***,
"name": "Campus Space"
},
"ts": 1678691092910
}
Create Group
Description of bizData
code | Data type | Description |
---|---|---|
groupId | Long | The ID of the specified group. |
spaceId | String | The ID of the specified space. |
name | String | The name. |
time | Long | The 13-digit timestamp when the group was created. |
Example
{
"bizCode": "groupCreate",
"bizData": {
"spaceId": "151482***",
"groupId": "12898***",
"name": "Home Group",
"time": 1678950226742
},
"ts": 1678950226751
}
Delete Group
Description of bizData
code | Data type | Description |
---|---|---|
groupId | Long | The ID of the specified group. |
spaceId | String | The ID of the specified space. |
time | Long | The 13-digit timestamp when the group was removed. |
Example
{
"bizCode": "groupDelete",
"bizData": {
"spaceId": "151482***",
"groupId": "12898***",
"time": "1678950436076"
},
"ts": 1678950436087
}
Modify a group
Description of bizData
code | Data type | Description |
---|---|---|
groupId | Long | The ID of the specified group. |
spaceId | String | The ID of the specified space. |
name | String | The name. |
time | Long | The 13-digit timestamp when the group was modified. |
Example
{
"bizCode": "groupNameUpdate",
"bizData": {
"spaceId": "151482***",
"groupId": "12898***",
"name": "Home Group",
"time": "1678950411961"
},
"ts": 1678950411998
}
Add devices to a group
Description of bizData
code | Data type | Description |
---|---|---|
groupId | Long | The ID of the specified group. |
spaceId | String | The ID of the specified space. |
devIds | List |
Device list |
time | Long | The 13-digit timestamp when devices were added to the group. |
Example
{
"bizCode": "groupDeviceAdd",
"bizData": {
"spaceId": "151482***",
"groupId": "12898***",
"devIds": ["vdevo167756814561***"],
"time": "1678950226762"
},
"ts": 1678950226775
}
Remove devices from a group
Description of bizData
code | Data type | Description |
---|---|---|
groupId | Long | The ID of the specified group. |
spaceId | String | The ID of the specified space. |
devIds | List |
Device list |
time | Long | The 13-digit timestamp when devices were removed from the group. |
Example
{
"bizCode": "groupDeviceRemove",
"bizData": {
"spaceId": "151482***",
"groupId": "12898***",
"devIds": ["vdevo166382916152***"],
"time": "1678950430449"
},
"ts": 1678950430462
}
Modify a linkage rule
Description of bizData
code | Data type | Description |
---|---|---|
ruleId | Long | The ID of the specified rule. |
eventCode | String | The code of the specified event. Valid values:
|
time | Long | The 13-digit timestamp when the linkage rule was changed. |
eventData | EventData | The rule data. This parameter has a value when the value of eventCode is state . |
Description of EventData
code | Data type | Description |
---|---|---|
runMode | String | The operation type. Valid values:
|
Example
{
"bizCode": "linkageRuleChangeComplete",
"bizData": {
"eventCode": "add",
"time": 1678950742932,
"ruleId": "t7sFRCpcMOjsv***"
},
"ts": 1678950744321
}
eventCode: state
Example
{
"bizCode": "linkageRuleChangeComplete",
"bizData": {
"eventCode": "state",
"eventData": {
"runMode": "local"
},
"time": 1678950743000,
"ruleId": "t7sFRCpcMOjsv***"
},
"ts": 1678950744509
}
Execute a linkage rule
Description of bizData
code | Data type | Description |
---|---|---|
eventId | String | The unique ID of the reported data. This ID has no business meaning. |
ruleId | String | The ID of the specified rule. |
spaceId | String | The ID of the specified space. |
triggerEntityId | String | The ID of the specified user who triggers a rule. |
startTime | Long | The 13-digit timestamp when the execution of a linkage rule started. |
endTime | Long | The 13-digit timestamp when the execution of a linkage rule ended. |
status | Long | The status of the execution. Valid values:
|
Example
{
"bizCode": "linkageRuleExecuteComplete",
"bizData": {
"eventId": "6412c16547a0a2001f499***_t7sFRCpcMOjsv***",
"spaceId": "151482***",
"startTime": 1678950757833,
"endTime": 1678950757874,
"triggerEntityId": "bay1618908218427P***",
"ruleId": "t7sFRCpcMOjsv***",
"status": "success"
},
"ts": 1678950757902
}
Report device status data
Description of data
code | Data type | Description |
---|---|---|
dataId | String | The unique ID of the reported data. This ID has no business meaning. |
devId | String | The device ID. |
productKey | String | The product ID of the specified 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 reported. |
value | Object | The status value of the code reported by the specified device. |
t | Long | The 13-digit timestamp when the device status was reported. |
“{dpId}”:“{dpValue}” | String:String |
|
Example
{
"dataId":"AAXI3c1i6xxx***",
"devId":"6c95a93fd9xxx***",
"productKey":"awgmk9pixxx***",
"status":[
{
"code":"switch_1",
"value":false,
"t":1628229842692,
"1":"false"
}
]
}
Go online
Description of bizData
code | Data type | Description |
---|---|---|
time | Long | The timestamp. |
Example
{
"devId": "002dj00118fe34d9****",
"productKey": "The product key defined on the Tuya Developer Platform",
"bizCode": "online",
"bizData": {
"time": 146052438362
}
}
Go offline
Description of bizData
code | Data type | Description |
---|---|---|
time | Long | The timestamp. |
Example
{
"devId": "002dj00118fe34d9****",
"productKey": "The product key defined on the Tuya Developer 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 Developer 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 Developer 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 user ID bound with the device. |
token | String | The token for device pairing. |
Example
{
"devId": "002dj00118fe34d9****",
"productKey": "The product key defined on the Tuya Developer Platform",
"bizCode": "bindUser",
"bizData": {
"devId": "002dj00118fe34d9****",
"uuid": "06200043b4e618c1****",
"uid":"ay1529485403390****",
"token": "IIpQ****"
}
}
Delete 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 Developer 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 | Int | The module type. Valid values:
|
upgradeStatus | Int | The update status. Valid values:
|
description | String | The description of an update. |
oldVersion | String | The earlier firmware. |
newVersion | String | The later firmware. |
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
}
Suspend an IoT SIM card
Description of bizData
code | Data type | Description |
---|---|---|
iccid | String | The ID of the specified IoT SIM card. |
deviceId | String | The device ID. |
uid | String | The user ID. |
pid | String | The product ID. |
stopReason | String | Reasons for suspending the IoT SIM card. Valid values:
|
reportTime | Long | The timestamp when data was reported. |
Example
{
"bizCode":"simStop",
"bizData":{
"iccid": "****",
"deviceId": "****",
"uid": "****",
"pid": "****",
"stopReason": "FLOW_OUT",
"reportTime": 1620896040128
},
"ts":1625798044298
}
Send data usage alerts
Description of bizData
code | Data type | Description |
---|---|---|
iccid | String | The ID of the specified IoT SIM card. |
deviceId | String | The device ID. |
uid | String | The user ID. |
pid | String | The product ID. |
totalFlowAmount | String | The total available data amount. |
usedFlowAmount | String | The amount of used data. |
reportTime | Long | The timestamp when data was reported. |
Example
{
"bizCode":"simLimitAlarm",
"bizData":{
"iccid": "xxxx",
"deviceId": "xxxx",
"uid": "xxxx",
"pid": "xxxx",
"totalFlowAmount": 10240,
"usedFlowAmount": 1024,
"reportTime": 1620896040128
},
"ts":1625798044298
}
Send voice prompts
Description of bizData
code | Data type | Description |
---|---|---|
brandCode | String | The brand code of the specified speaker. |
voiceId | String | The device ID of the specified speaker. |
command | Array | The command. |
Description of command
code | Data type | Description |
---|---|---|
intent | String | The intention. For example, welcome can be used for showing welcome. |
content | Object | The conent of a command. |
Description of content
code | Data type | Description |
---|---|---|
value | String | The content for a voice prompt. |
Example
{
"bizCode":"textToSpeech",
"bizData":{
"brandCode":"abc*******",
"voiceId":"def*******",
"command": [{
"intent": "welcome",
"content":{
"value": "Welcome to this hotel"
}
}]
},
"ts":1636682568127
}
Reset a third-party speaker
Message description
This message is sent when a third-party speaker is unbound or a guest checks out. On receiving the message, the voice platform will clear the usage history or the cache.
Description of bizData
code | Data type | Description |
---|---|---|
brandCode | String | The brand code of the specified speaker. |
voiceId | String | The device ID of the specified speaker. |
Example
{
"bizCode":"reset",
"bizData":{
"brandCode":"abc*******",
"voiceId":"def*******"
},
"ts":1636682568127
}
Change custom Q&A data
Description of bizData
code | Data type | Description |
---|---|---|
spaceId | String | The ID of the specified space. |
brandCodeList | List | The list of the speaker brand codes. |
Example
{
"bizCode":"customQAChange",
"bizData":{
"spaceId":"123*********",
"brandCodeList":["abc*******","def*******"]
},
"ts":1636682568127
}
Run an automation task
Description of bizData
code | Data type | Description |
---|---|---|
gid | Long | The linkage ID. |
uid | String | The user ID. |
id | String | The rule code. |
name | String | The rule name. |
ts | Long | The timestamp. |
actions | List |
The list of actions. |
Description of Action
code | Data type | Description |
---|---|---|
id | String | The action ID. |
execStatus | Integer | The execution status. Valid values:
|
entityId | String | The entity ID. |
executeTime | Long | The 13-digit timestamp when the task was executed. |
Example
{
"bizCode":"automationExecute",
"bizData":{
"name": "If timer: 15:28 on June 20",
"id":"SnKfREPRAA1V****",
"actions":[
{
"entityId":"6c77824debdfd0ae55****",
"execStatus":1,
"executeTime":1687246080261,
"id":"nAawbkQwgYn5iAgA****"
}
]
},
"gid":4494****,
"ts":1687246080541,
"uid":"ay1638425579033A****"
}
Description of bizData
code | Data type | Description |
---|---|---|
automationId | String | The automation ID. |
bizData | JSON | The custom data, to be used with POST/v1.0/homes/{home_id}/automations/{automation_id}/conditions/trigger . |
Example
{
"automationId":"Rc5XAKLSmwpxH***",
"bizCode":"automationExternalAction",
"bizData":{
"code":"mode",
"value":2,
"operator":"=="
}
}
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 home ID. |
uid | String | The ID (UID) of the specified user 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:
|
actions.executeTime | Long | The timestamp when a scene was executed. |
actions.id | String | The action ID. |
actions.errorMsg | String | Error message |
Example
{
"bizData":{
"name":"Switch-On",
"id":"azmQ2w8kPSCdcr***",
"actions":[
{
"entityId":"02167073cc****",
"execStatus":1,
"executeTime":1625798044277,
"id":"1jPxz3zaNdL****"
}
]
},
"gid":37081***,
"uid":"ay1622715182388N****",
"ts":1625798044298
}
Bind a device with an industrial asset
Description of bizData
code | Data type | Description |
---|---|---|
devId | String | The device ID. |
assetId | String | The asset ID. |
uuid | String | The universally unique identifier (UUID) of the specified device. |
token | String | The token for device pairing. |
Example
{
"bizCode":"industryAssetDeviceBind",
"bizData":{
"devId":"vdevo16872466190****",
"assetId":"15845****",
"uuid":"vdevo16872466190****",
"token":""
},
"ts":1687246619772
}
Unbind a device from an industrial asset
Description of bizData
code | Data type | Description |
---|---|---|
devId | String | The device ID. |
assetId | String | The asset ID. |
uuid | String | The universally unique identifier (UUID) of the specified device. |
Example
{
"bizCode":"industryAssetDeviceUnbind",
"bizData":{
"devId":"vdevo16872466190****",
"assetId":"15845****",
"uuid":"vdevo16872466190****"
},
"ts":1687246961902
}
Change an industrial asset
Description of bizData
code | Data type | Description |
---|---|---|
assetId | String | The asset ID. |
eventTime | String | The 13-digit timestamp when the event occurred. |
assetName | String | The asset name. |
eventType | String | The event type. Valid values:
|
Example
{
"bizCode":"industryAssetChange",
"bizData":{
"assetId":"15845****",
"eventTime":1687247065523,
"assetName":"my asset",
"eventType":"add"
},
"ts":1687247065715
}
Unbind a device from an asset
Description of bizData
code | Data type | Description |
---|---|---|
devId | String | The device ID. |
eventType | String | The event type. Valid values:
|
learnCodeList | List<CodeItem> | The list of IR learning codes. |
Description of CodeItem
code | Data type | Description |
---|---|---|
id | Long | The primary key of the specified learning code. |
code | String | The learning code. |
keyName | String | The description of the specified key. |
name | String | The name of the specified key. |
Example
{
"bizCode":"infraredLearnMessage",
"bizData":{
"devId":"6c26d974ed10c1f894****",
"eventType":"INFRARED_LEARN",
"learnCodeList":{
"id":4416011,
"code":"015202f40172f401b****",
"keyName":"Power Supply",
"name":"power"
}
},
"ts":1620896040128
}
Geofencing alert
Description of bizData
code | Data type | Description |
---|---|---|
devId | String | The device ID. |
tag | String | The dimension tag. |
fenceId | Long | The ID of the specified geofence. |
fenceName | String | The name of the specified geofence. |
bindType | Integer | The binding type of the specified geofence. Valid values:
|
lat | Double | The latitude reported by the current device. |
lon | Double | The longitude reported by the current device. |
triggerType | String | The type of alert. Valid values:
|
reportTime | Long | The 13-digit timestamp when the data was reported. |
Example
{
"bizCode":"outdoorsFenceAlarm",
"bizData":{
"devId":"ay1617****",
"tag":"*******",
"fenceId":1000,
"fenceName":"MyFence",
"bindType":1,
"lat":121.234,
"lon":34.3478,
"triggerType":"1",
"reportTime":1620896040128
},
"ts":1620896040128
}
Register a user
Description of bizData
code | Data type | Description |
---|---|---|
uid | String | The user ID. |
regFrom | Integer | The source of registration. Valid values:
|
mobile | String | The mobile phone number. |
nickname | String | The nickname. |
phoneCode | String | The country code. |
timezoneId | String | The ID of the specified time zone. |
lang | String | The multilingual support. |
gmtCreate | Long | The time when the user was created. |
gmtModified | Long | The time when the user information was modified. |
headPic | String | The URL of an avatar. |
username | String | The username. |
lastLoginTime | Long | The last login time. |
Example
{
"bizCode": "userRegisterEvent",
"bizData": {
"uid": "ay1695****e66",
"regFrom": 9,
"mobile": "",
"nickname": "****",
"phoneCode": "86",
"timezoneId": "",
"lang": "",
"gmtCreate": 1695625445,
"gmtModified": 1695710138,
"headPic": "****",
"username": "****",
"lastLoginTime": 1695625445581
},
"ts": 1687246619772
}
Update a user
Description of bizData
code | Data type | Description |
---|---|---|
uid | String | The user ID. |
regFrom | Integer | The source of registration. Valid values:
|
mobile | String | The mobile phone number. |
nickname | String | The nickname. |
phoneCode | String | The country code. |
timezoneId | String | The ID of the specified time zone. |
lang | String | The multilingual support. |
gmtCreate | Long | The time when the user was created. |
gmtModified | Long | The time when the user information was modified. |
headPic | String | The URL of an avatar. |
username | String | The username. |
lastLoginTime | Long | The last login time. |
Example
{
"bizCode": "userUpdateEvent",
"bizData": {
"lastLoginTime": 1695625445581,
"uid": "ay1695****e66",
"regFrom": 9,
"gmtModified": 1695710138,
"mobile": "",
"nickname": "****",
"phoneCode": "86",
"timezoneId": "",
"lang": "",
"gmtCreate": 1695625445,
"headPic": "****",
"username": "****"
},
"ts": 1687246619772
}
Delete a user
Description of bizData
code | Data type | Description |
---|---|---|
uid | String | The user ID. |
Example
{
"bizCode": "userDeleteEvent",
"bizData": {
"uid": "ay1695****e66"
},
"ts": 1687246619772
}
Create a home
Description of bizData
code | Data type | Description |
---|---|---|
uid | String | The user ID. |
homeId | String | The home ID. |
homeName | String | The name of the specified home. |
Example
{
"bizCode": "homeCreate",
"bizData": {
"uid": "ay16957***0ZXwQ7",
"homeName": "My Home***",
"homeId": "***"
},
"ts": 1695712142936
}
Update a home
Description of bizData
code | Data type | Description |
---|---|---|
homeId | String | The home ID. |
homeName | String | The name of the specified home. |
lon | Double | The longitude. |
lat | Double | The latitude. |
Example
{
"bizCode": "homeUpdate",
"bizData": {
"lon": xxxx,
"lat": xxxx,
"homeName": "My Home***",
"homeId": "***"
},
"ts": 1695712142936
}
Delete a home
Description of bizData
code | Data type | Description |
---|---|---|
homeId | String | The home ID. |
homeName | String | The name of the specified home. |
memberIds | List<String> | The list of user IDs of home members. |
devices | List<String> | The list of device IDs of the specified home. |
reason | Integer | The reason why the specified home is deleted. Valid values:
|
Example
{
"bizCode": "homeDelete",
"bizData": {
"homeId": "***",
"homeName": "My Home***",
"memberIds": [],
"devices":[],
"reason": 1
},
"ts": 1695712142936
}
Invite a home member
Description of bizData
code | Data type | Description |
---|---|---|
homeId | String | The home ID. |
operatorUid | String | The user ID of the specified inviter or operator. |
memberUid | String | The user ID with the status changed. |
eventType | String | The event type. Valid values:
|
Example
{
"bizCode": "homeMemberSharing",
"bizData": {
"uid": "ay1695****e66",
"homeId": "***",
"operatorUid": "***",
"memberUid": "***",
"eventType": "agreeForMember"
},
"ts": 1687246619772
}
Modify a home member
Description of bizData
code | Data type | Description |
---|---|---|
homeId | String | The home ID. |
operatorUid | String | The user ID of the specified inviter or operator. |
memberUid | String | The user ID with the status changed. |
role | String | Modify the user to the specified role. Valid values:
|
Example
{
"bizCode": "homeMemberUpdate",
"bizData": {
"uid": "ay1695****e66",
"memberName": "***",
"memberUid": "***",
"role": "member"
},
"ts": 1687246619772
}
Delete a home member
Description of bizData
code | Data type | Description |
---|---|---|
homeId | String | The home ID. |
memberUid | String | The user ID with the status changed. |
role | String | Modify the user to the specified role. Valid values:
|
dealType | String | Specifies how to deal with the operation. Valid values:
|
Example
{
"bizCode": "homeMemberDelete",
"bizData": {
"homeId": "1****2",
"memberUid": "***",
"role": "****",
"dealType": "declineInvitation"
},
"ts": 1687246619772
}
Create a room
Description of bizData
code | Data type | Description |
---|---|---|
uid | String | The user ID. |
roomId | Long | The room ID. |
roomName | String | The room name. |
homeId | String | The home ID. |
Example
{
"bizCode": "roomCreate",
"bizData": {
"roomId": 12***,
"roomName": "Bedroom",
"homeId": "1**2**",
"uid":"ay16957***0ZXwQ7"
},
"ts": 1687246619772
}
Create rooms in bulk
Description of bizData
code | Data type | Description |
---|---|---|
uid | String | The user ID. |
homeId | String | The home ID. |
rooms | List<RoomVO> | The list of rooms that are created. |
Description of RoomVO
Code | Data type | Description |
---|---|---|
uid | String | The user ID. |
roomId | Long | The room ID. |
roomName | String | The room name. |
homeId | String | The home ID. |
Example
{
"bizCode": "roomBatchCreate",
"bizData": {
"homeId": "1***2",
"uid": "ay16957***0ZXwQ7",
"rooms": []
},
"ts": 1687246619772
}
Delete a room
Description of bizData
code | Data type | Description |
---|---|---|
homeId | String | The home ID. |
roomId | Long | The room ID. |
Example
{
"bizCode": "roomDelete",
"bizData": {
"homeId": "xxx",
"roomId": 12
},
"ts": 1687246619772
}
Sort a room
Description of bizData
code | Data type | Description |
---|---|---|
homeId | String | The home ID. |
rooms | List<RoomVO> | The list of rooms. |
Description of RoomVO
code | Data type | Description |
---|---|---|
roomId | Long | The room ID. |
order | Integer | The sorting value. The smaller the value, the higher order it is displayed. |
Example
{
"bizCode": "roomSort",
"bizData": {
"homeId": "xxx",
"rooms": [{
"roomId": 21,
"order": 1
}, {
"roomId": 11,
"order": 2
}]
},
"ts": 1687246619772
}
Rename a room
Description of bizData
code | Data type | Description |
---|---|---|
homeId | String | The home ID. |
roomId | Long | The room ID. |
roomName | String | The room name. |
Example
{
"bizCode": "roomNameUpdate",
"bizData": {
"homeId": "xxx",
"roomId": 12xx,
"roomName": "Bedroom"
},
"ts": 1687246619772
}
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback