Last Updated on : 2024-06-21 04:04:30download
The Tuya Developer Platform allows you to define functions with six data types, including Boolean, value, enum, fault, string, and raw. For more information, see Data Types.
DP | Identifier | Data transfer type | Data type | Property |
---|---|---|---|---|
On/Off | switch_led | Send and report (read-write) |
Boolean | / |
Mode | work_mode | Send and report (read-write) |
Enum | Enum values:
|
Brightness | bright_value | Send and report (read-write) |
Value |
|
Color temperature | temp_value | Send and report (read-write) |
Value |
|
Colorful | colour_data | Send and report (read-write) |
String | / |
Scene | scene_data | Send and report (read-write) |
String | / |
Timer | countdown | Send and report (read-write) |
Value |
|
Music sync | music_data | Send only (write-only) |
String | / |
Real-time adjustment | control_data | Send only (write-only) |
String | / |
Gamma debug | debug_data | Send only (write-only) |
String | / |
Biorhythm | rhythm_mode | Send and report (read-write) |
Raw | / |
Light to sleep | sleep_mode | Send and report (read-write) |
Raw | / |
Light to wake | wakeup_mode | Send and report (read-write) |
Raw | / |
Power-off memory | power_memory | Send and report (read-write) |
Raw | / |
Do not disturb | do_not_disturb | Send and report (read-write) |
Boolean | / |
Cycle timing | cycle_timing | Send and report (read-write) |
Raw | / |
Vacation timing | random_timing | Send and report (read-write) |
Raw | / |
Data type | Valid values | Example |
---|---|---|
Boolean |
|
{“20”:true} |
Data type | Valid values | Example |
---|---|---|
Enum |
|
{“21”:“scene”} |
The presence of the in-app menu bars for white light, colored light, scene, and music light depends on if you have added the required DPs for your product.
Menus | Determinants |
---|---|
White | Required DPs: mode and brightness |
Color | Required DPs: mode and color |
Scene | Required DPs: mode and scene |
Music | Required DPs: mode and music |
Timer | Required DPs: timer |
Schedule | Cloud timing provided by the advanced functions. |
Data type | Valid values | Example |
---|---|---|
Value | 10 to 1000
|
{"22":670 "} |
Data type | Valid values | Example |
---|---|---|
Value | 0 to 1000
|
{"23":797"} |
Data type | Valid values | Example |
---|---|---|
String | 000011112222
|
{"24":"00DC004B004E"} HSV value is 00DC, 004B, 004E in hex format. After converting them to the decimal format, you will get 220°, 75%, 78%. |
Color values are output in HSV format. Alternatively, you can convert values to the RGB format. For more information, visit color conversion.
Data type | Valid values | Example |
---|---|---|
Value | 0011223344445555666677778888
|
{"25":"010b0a02000003e803e800000000 0b0a02007603e803e800000000..."}
|
Data type | Valid values | Example |
---|---|---|
Value | 0 to 86400, in seconds.
|
{"26":"120"} |
Data type | Valid values | Example |
---|---|---|
String | 011112222333344445555
|
{“27”:“1007603e803e800120025”}
|
This DP and the DP mode
together determine whether the music light is available for users.
Data type | Valid values | Example |
---|---|---|
String | 011112222333344445555
|
{“28”:“1007603e803e800120025”}
|
This DP is used to receive commands from the cloud when users control the light on the mobile app.
Used for gamma calibration only.
Data type | Valid values | Example |
---|---|---|
String | 011112222333344445555
|
{“29”:“1007603e803e800120025”}
|
This DP is used along with a specific debugging panel to perform gamma calibration.
Data type
Fields
Fields | Length |
---|---|
Version number | 1 byte: 0x00 |
Task on/off | 1 byte |
Mode | 1 byte |
Specified date | 1 byte |
The number of nodes | 1 byte |
Node 1 | 9 bytes |
... | ... |
Node N | 9 bytes |
The field of parameter mode is added in the following version.
Fields | Lengrh |
---|---|
Version number | 1 byte: 0x01 |
Task on/off | 1 byte |
Mode | 1 byte |
Specified date | 1 byte |
Parameter mode | 1 byte
|
The number of nodes | 1 byte |
Node 1 | 5 to 9 bytes |
... | ... |
Node N | 5 to 9 bytes |
Field description
Field | Sequence number | Node | Length | Description |
---|---|---|---|---|
Version number | 1 | / | 1 byte | 0x00: the initial version |
Task on/off | 2 | / | 1 byte |
|
Mode selection | 3 | / | 1 byte |
|
Specified date | 4 | / | 1 byte | 1 indicates a day of a week is scheduled to execute the task. |
The number of nodes | 5 | / | 1 byte | 0x01: one time node Value range: 1 to 8 |
Time node switch | 6 | Node 1 | 1 byte | The biorhythm switch is prioritized over the time node switch. Determining the switch status of the time node is necessary only when the biorhythm switch is on.
|
Hour(s) | 6 | Node 1 | 1 byte | 0x10: a value in hexadecimal format. Value range: 0 to 23. |
Minute(s) | 6 | Node 1 | 1 byte | 0x10: a value in hexadecimal format. Value range: 0 to 59. |
Hue | 6 | Node 1 | 2 bytes | 0x03 and 0x10: values in hexadecimal format, big endian. The first byte indicates hundreds. The second byte indicates tens and ones. Value range: 0 to 360. |
Saturation (%) | 6 | Node 1 | 1 byte | 0x10: a value in hexadecimal format. Value range: 0 to 100. |
Value (%) | 6 | Node 1 | 1 byte | 0x10: a value in hexadecimal format. Value range: 1 to 100. |
Brightness (%) | 6 | Node 1 | 1 byte | 0x10: a value in hexadecimal format. Value range: 1 to 100. |
Color temperature (%) | 6 | Node 1 | 1 byte | 0x10: a value in hexadecimal format. Value range: 0 to 100. |
/ | 7 | Node 2 | / | / |
… | … | … | … | … |
/ | 13 | Node 8 | / | / |
Description of schedule setting
If all the bits are 0
, it indicates a one-time task. If a bit is set to 1
, it indicates the task is enabled on that day of a week.
Reserved | Saturday | Friday | Thursday | Wednesday | Tuesday | Monday | Sunday |
---|---|---|---|---|---|---|---|
bit7 | bit6 | bit5 | bit4 | bit3 | bit2 | bit1 | bit0 |
Field description
Field | Sequence number | Node | Length | Description |
---|---|---|---|---|
Version number | 1 | / | 1 byte | 0x00: the initial version |
The number of nodes | 2 | / | 1 byte |
|
Task on/off | 3 | Node 1 | 1 byte |
|
Specified date | 3 | Node 1 | 1 byte | 1 indicates a day of a week is scheduled to execute the task. |
Gradient steps | 3 | Node 1 | 1 byte | 0x10: a value in hexadecimal format. The step size is five minutes. Value range: 1 to 24. |
The start hour | 3 | Node 1 | 1 byte | 0x10: a value in hexadecimal format. Value range: 0 to 23. |
The start minute | 3 | Node 1 | 1 byte | 0x10: a value in hexadecimal format. Value range: 0 to 59. |
Hue | 3 | Node 1 | 2 bytes | 0x03 and 0x10: values in hexadecimal format, big endian. The first byte indicates hundreds. The second byte indicates tens and ones. Value range: 0 to 360. |
Saturation (%) | 3 | Node 1 | 1 byte | 0x10: a value in hexadecimal format. Value range: 0 to 100. |
Value (%) | 3 | Node 1 | 1 byte | 0x10: a value in hexadecimal format. Value range: 1 to 100. |
Brightness (%) | 3 | Node 1 | 1 byte | 0x10: a value in hexadecimal format. Value range: 1 to 100. |
Color temperature (%) | 3 | Node 1 | 1 byte | 0x10: a value in hexadecimal format. Value range: 0 to 100. |
/ | 4 | Node 2 | / | / |
… | … | … | … | … |
/ | 6 | Node 4 | / | / |
Description of schedule setting
If all the bits are 0
, it indicates a one-time task. If a bit is set to 1
, it indicates the task is enabled on that day of a week.
Reserved | Saturday | Friday | Thursday | Wednesday | Tuesday | Monday | Sunday |
---|---|---|---|---|---|---|---|
bit7 | bit6 | bit5 | bit4 | bit3 | bit2 | bit1 | bit0 |
Field description
Field | Sequence number | Node | Length | Description |
---|---|---|---|---|
Version number | 1 | / | 1 byte | 0x00: the initial version |
The number of nodes | 2 | / | 1 byte | |
Task on/off | 3 | Node 1 | 1 byte | |
Specified date | 3 | Node 1 | 1 byte | 1 indicates a day of a week is scheduled to execute the task. |
Gradient steps | 3 | Node 1 | 1 byte | 0x10: a value in hexadecimal format. The step size is five minutes. Value range: 1 to 24. |
The start hour | 3 | Node 1 | 1 byte | 0x10: a value in hexadecimal format. Value range: 0 to 23. |
The start minute | 3 | Node 1 | 1 byte | 0x10: a value in hexadecimal format. Value range: 0 to 59. |
Hue | 3 | Node 1 | 2 bytes | 0x03 and 0x10: values in hexadecimal format, big endian. The first byte indicates hundreds. The second byte indicates tens and ones. Value range: 0 to 360. |
Saturation (%) | 3 | Node 1 | 1 byte | 0x10: a value in hexadecimal format. Value range: 0 to 100. |
Value (%) | 3 | Node 1 | 1 byte | 0x10: a value in hexadecimal format. Value range: 1 to 100. |
Brightness (%) | 3 | Node 1 | 1 byte | 0x10: a value in hexadecimal format. Value range: 1 to 100. |
Color temperature (%) | 3 | Node 1 | 1 byte | 0x10: a value in hexadecimal format. Value range: 0 to 100. |
Time duration | 3 | Node 1 | 1 byte | 0x10: a value in hexadecimal format. The step size is five minutes. It is used to set how long the light stays on after it reaches full brightness. Value range: 0 to 24. 0 means the light stays on. 24 means the light comes off in 120 minutes. |
/ | 4 | Node 2 | / | / |
… | … | … | … | … |
/ | 6 | Node 4 | / | / |
Description of schedule setting
If all the bits are 0
, it indicates a one-time task. If a bit is set to 1
, it indicates the task is enabled on that day of a week.
Reserved | Saturday | Friday | Thursday | Wednesday | Tuesday | Monday | Sunday |
---|---|---|---|---|---|---|---|
bit7 | bit6 | bit5 | bit4 | bit3 | bit2 | bit1 | bit0 |
Used to set the state in which the light comes on.
Fields
Field | Length | Description |
---|---|---|
Version number | 1 byte | 0x00: the initial version |
Mode | 1 byte |
|
H | 2 bytes | Hue |
S | 2 bytes | Saturation |
V | 2 bytes | Value |
Bright | 2 bytes | Brightness |
Temperature | 2 bytes | Temperature |
Applies to areas where a power outage happens quite often. With this feature enabled, if users have turned off the light by using the mobile app, they need to turn the light on and off twice consecutively to switch it on.
Data type | Valid values | Example |
---|---|---|
Boolean | {“34”:true} |
Used to schedule lights to switch on and off to automate light routines such as for plant grow lights.
Field description
Sequence number | Field | Node | Length (byte) | Description |
---|---|---|---|---|
1 | Version number | / | 1 | 0x00: the initial version. |
2 | Node length | / | 1 | The data length of a single node is up to 255 bytes. |
3 | Switch + channel ID | Node 1 | 1 | |
4 | The day of week | Node 1 | 1 | Specifies the recurring days. If a bit is set to 1 , it means that the task will recur on this specified day weekly. |
5 | The start time | Node 1 | 2 | The value is in minutes. The maximum value is 1439. |
6 | The end time | Node 1 | 2 | The value is in minutes. The maximum value is 1439. |
7 | The ON state duration | Node 1 | 2 | The value is in minutes. The maximum value is 1439. |
8 | The OFF state duration | Node 1 | 2 | The value is in minutes. The maximum value is 1439. |
9 | Hue | Node 1 | 2 | 0x03 and 0x10: values in hexadecimal format, big endian. The first byte indicates hundreds. The second byte indicates tens and ones. Value range: 0 to 360. |
10 | Saturation (%) | Node 1 | 1 | 0x10: a value in hexadecimal format. Value range: 0 to 100. |
11 | Value (%) | Node 1 | 1 | 0x10: a value in hexadecimal format. Value range: 0 to 100. |
12 | Brightness (%) | Node 1 | 1 | 0x10: a value in hexadecimal format. Value range: 0 to 100. |
13 | Color temperature (%) | Node 1 | 1 | 0x10: a value in hexadecimal format. Value range: 0 to 100. |
… | … | … | … | … |
If multiple time nodes are set, fields from sequence No. 3 to 13 are duplicated.
Description of schedule setting
If all the bits are 0
, it indicates a one-time task. If a bit is set to 1
, it indicates the task is enabled on that day of a week.
Reserved | Saturday | Friday | Thursday | Wednesday | Tuesday | Monday | Sunday |
---|---|---|---|---|---|---|---|
bit7 | bit6 | bit5 | bit4 | bit3 | bit2 | bit1 | bit0 |
Used to make smart lights turn on and off at random intervals, creating the illusion that someone is at home while you are away from home.
Field description
Sequence number | Field | Node | Length (byte) | Description |
---|---|---|---|---|
1 | Version number | / | 1 | 0x00: the initial version. |
2 | Node length | / | 1 | The data length of a single node is up to 255 bytes. |
3 | Switch + channel ID | Node 1 | 1 | bit0: the on/off state of this node. bit1 to bit7: the applied channels. |
4 | The day of week | Node 1 | 1 | Specifies the recurring days. If a bit is set to 1 , it means that the task will recur on this specified day weekly. |
5 | The start time | Node 1 | 2 | The value is in minutes. The maximum value is 1439. |
6 | The end time | Node 1 | 2 | The value is in minutes. The maximum value is 1439. |
7 | Hue | Node 1 | 2 | 0x03 and 0x10: values in hexadecimal format, big endian. The first byte indicates hundreds. The second byte indicates tens and ones. Value range: 0 to 360. |
8 | Saturation (%) | Node 1 | 1 | 0x10: a value in hexadecimal format. Value range: 0 to 100. |
9 | Value (%) | Node 1 | 1 | 0x10: a value in hexadecimal format. Value range: 0 to 100. |
10 | Brightness (%) | Node 1 | 1 | 0x10: a value in hexadecimal format. Value range: 0 to 100. |
11 | Color temperature (%) | Node 1 | 1 | 0x10: a value in hexadecimal format. Value range: 0 to 100. |
… | … | … | … | … |
If multiple time nodes are set, fields from sequence No. 3 to 13 are duplicated.
Description of schedule setting
If all the bits are 0
, it indicates a one-time task. If a bit is set to 1
, it indicates the task is enabled on that day of a week.
Reserved | Saturday | Friday | Thursday | Wednesday | Tuesday | Monday | Sunday |
---|---|---|---|---|---|---|---|
bit7 | bit6 | bit5 | bit4 | bit3 | bit2 | bit1 | bit0 |
You can add custom functions that are not supported by standard functions. For more information, see Custom Functions.
Cloud function supports cloud timing and jumping page. For more information, see Cloud Functions.
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback