All Products
Search
Document Center

Marketplace:Device Reporting Attributes

Last Updated:Mar 25, 2025

Important

DISCLAIMER

Please note that all content presented on this page is provided by Tuya (HK) Limited. Alibaba Cloud makes no representations and warranties, explicit or implied, as to the authenticity or accuracy of any such content, nor makes any guarantee to the condition, quality, durability, performance, reliability, merchantability or fitness for a particular purpose, or non-infringement of any products and/or services made available by Tuya (HK) Limited. 

Report Pass-through Attribute:

Device reports passthrough attributes or events:

image.png

Topic and data format (upstream):

Topic

Data Format

Request Topic: /sys/${productKey}/${deviceName}/thing/model/up_raw

The request data is the original packet reported by the device. Description ●Data transmitted through the MQTT Protocol is in hexadecimal format. ●The request method must be included in the report data that is passed through. method parameter. The value must be consistent with the corresponding request method defined in the data parsing script. For example Sample JavaScript scriptin the device uploads attribute data to the cloud ALINK_PROP_REPORT_METHOD value thing.event.property.post . Examples are as follows:

0x00002233441232013fa00000

Response Topic: /sys/${productKey}/${deviceName}/thing/model/up_raw_reply

The format of the data returned from the cloud is as follows: example of successful return:

{
    "code": 200,
    "data": {},
    "id": "123",
    "message": "success",
    "version": "1.0"
}

Failed return example:

{
    "code": 6813,
    "data": {},
    "id": "123",
    "message": "topic illegal",
    "version": "1.0"
}

Report Model Properties:

Device reports model attributes or events:

image.png

Topic and data format (upstream):

Topic

Data Format

Request Topic: /sys/${productKey}/${deviceName}/thing/event/property/post

Request data format:

{
    "id": "123",
    "version": "1.0",
    "sys":{
        "ack":0
    },
    "params": {
        "Power": {
            "value": "on",
            "time": 1524448722000
        },
        "WF": {
            "value": 23.6,
            "time": 1524448722000
        }
    },
    "method": "thing.event.property.post"
}

Response Topic: /sys/${productKey}/${deviceName}/thing/event/property/post_reply

The format of the data returned from the cloud is as follows: example of successful return:

{
    "code": 200,
    "data": {},
    "id": "123",
    "message": "success",
    "method": "thing.event.property.post",
    "version": "1.0"
}

Failed return example:

{
    "code": 6813,
    "data": {},
    "id": "123",
    "message": "The format of result is error!",
    "method": "thing.event.property.post",
    "version": "1.0"
}

Parameter description:

Parameters

Type

Description

ID

String

Message ID number. A number of the String type. The value range is from 0 to 4294967295, and each message ID is unique in the current device.

Version

String

The protocol version number. Currently, the only value of the protocol version number is 1.0.

SYS

Object

The parameter of the extended function, which contains each function field.

Description When you use the device SDK for development, if no extension function is set, this parameter is not set, and the related functions remain in the default configuration.

ACK

Integer

SYS indicates whether to return response data. ●1: The cloud returns response data. ●0: The cloud does not return response data.

Important if this function is not configured, this parameter is not used and the response data is returned by default.

Method

String

The request method. For example: thing.event.property.post .

Params

Object

Request parameters. As shown in the preceding example, the device reports information about two attributes, Power (Power) and WF (working Current). Specific attribute information, including attribute reporting time and attribute value. If only the attribute value is passed in, there is no need to upload the field. time and value , params examples are as follows:

"params": {
    "Power": "on",
    "WF": 23.6
}

If it is a custom module property, the property identifier format is${module identifier }:${ property identifier} (English colon in the middle). For example:

"test:Power": {
    "value": "on",
    "time": 1524448722000
}

Time

Long

The attribute reporting timestamp, which is of the UTC millisecond type. This parameter is an optional field. Determine whether the message contains a timestamp based on your business scenario. If messages are frequent, determine the message sequence based on the timestamp. We recommend that the message include a timestamp. ●If uploaded time , the upload time is saved in the cloud of the IoT platform as the attribute reporting time. ●If not uploaded time, the cloud of the IoT platform automatically generates and saves the attribute reporting time.

Value

Object

The attribute value reported. If not uploaded time , do not Upload value , upload the parameter values directly.

Response data format description:

Parameters

Type

Description

ID

String

The message ID is a String type number. The value range is 0 to 4294967295, and each message ID is unique in the current device.

Code

Integer

Result status code. Specific reference Common codes on devices.

Description IoT Platform verifies the attributes reported by the devices. Based on the TSL description of the product, determine whether the reported attributes conform to the defined attribute format. Unqualified attributes are filtered out and a failure error code is returned.

Data

Object

When the request is successful, the returned data is fixed to be empty.

Message

String

Returns the result information. If the request is successful, return success.

Method

String

The request method corresponding to the response data, in the request parameters. method same.

Version

String

The protocol version number, which corresponds to the request parameter version same.