From 90dc9e63739baafe94c9c7c2c33c157ca32a43df Mon Sep 17 00:00:00 2001 From: blakadder Date: Thu, 24 Oct 2019 14:36:00 +0200 Subject: [PATCH] Updated Tuya Protocols (markdown) --- Tuya-Protocols.md | 119 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 104 insertions(+), 15 deletions(-) diff --git a/Tuya-Protocols.md b/Tuya-Protocols.md index 65509836..1e119bc8 100644 --- a/Tuya-Protocols.md +++ b/Tuya-Protocols.md @@ -1,9 +1,24 @@ Common dpId's and what they're used for in Tuya devices -### Aromatherapy machine (Oil Diffuser) +### Switches or plugs/power strips +``` +| DP ID | Identifier | Data type | Function type | Properties | +|-------|-------------|--------------------|---------------|----------------------------------------------| +| 1 | switch_1 | Control and report | Boolean | | +| 2 | switch_2 | Control and report | Boolean | | +| 3 | switch_3 | Control and report | Boolean | | +| 4 | switch_4 | Control and report | Boolean | | +| 5 | switch_5 | Control and report | Boolean | | +| 9 | countdown_1 | Control and report | Integer | undefined0-86400, undefined1, Scale0, Unit:s | +| 10 | countdown_2 | Control and report | Integer | undefined0-86400, undefined1, Scale0, Unit:s | +| 11 | countdown_3 | Control and report | Integer | undefined0-86400, undefined1, Scale0, Unit:s | +| 12 | countdown_4 | Control and report | Integer | undefined0-86400, undefined1, Scale0, Unit:s | +| 13 | countdown_5 | Control and report | Integer | undefined0-86400, undefined1, Scale0, Unit:s | +``` +### Aromatherapy machine (Oil Diffuser) +``` | DP ID | Function points | Identifier | Data type | Function type | Properties -|-------|--|---|---|---|--| | 1 | Switch | Power | Issue and report | Boolean | | | 6 | Amount of fog | fog | Issue and report | Enum | Enumerated values:small, large| | 11 | Light | Light | Issue and report | Boolean | | @@ -11,12 +26,14 @@ Common dpId's and what they're used for in Tuya devices | 13 | Countdown | countdown | Issue and report | Enum | Enumerated values: 0, 1, 2, 3| | 14 | Countdown remaining time | countdown_left | Only report | Integer | Values range: 0-360, Pitch1, Scale0, Unit:min| | 101 | Light mode | work_mode | Issue and report | Enum | Enumerated values: white, colour, scene, scene1, scene2, scene3, scene4 | -| 102 | Color value | colour_data | Issue and report | Char type |data format of the lights is a string of 14 characters, for example, 00112233334455, where 00 indicates R, 11 indicates G, 22 indicates B, 3333 indicates the hue, 44 indicates the saturation, and 55 indicates the value. The initial value is saved by default. If you do not want to adjust the light, set the data to the maximum value 100% (0x64). The last four characters have fixed values.| +| 102 | Color value | colour_data | Issue and report | Char type | *see below | | 103 | Light mode | lightmode | Issue and report | Enum | Enumerated values: 1, 2, 3| | 104 | Brightness setting | setlight | Issue and report | Integer | Values range: 0-255, Pitch1, Scale0, Unit:\%| +``` +> Data format of the lights is a string of 14 characters, for example, 00112233334455, where 00 indicates R, 11 indicates G, 22 indicates B, 3333 indicates the hue, 44 indicates the saturation, and 55 indicates the value. The initial value is saved by default. If you do not want to adjust the light, set the data to the maximum value 100% (0x64). The last four characters have fixed values. ### Curtain motor - +``` | DP ID | Function points | Identifier | Data type | Function type | Properties | |-------|-----------------|---------------|------------------|---------------|-----------------------------------------------| | 1 | Percentage | percent_state | Only report | Integer | Values range:0-100, Pitch1, Scale0, Unit:% | @@ -24,8 +41,10 @@ Common dpId's and what they're used for in Tuya devices | 3 | Auto Power | auto_power | Issue and report | Boolean | | | 4 | Left time | countdown | Issue and report | Enum | Enumerated values:cancel, 1, 2, 3, 4 | | 5 | Total Time | time_total | Only report | Integer | Values range:0-120000, Pitch1, Scale0, Unit:m | +``` ### Power monitoring plug +``` | DP ID | Function points | Identifier | Data type | Function type | Properties | | | |-------|------------------------|-----------------|--------------------|---------------|-----------------------------------------------|---|---| | 1 | switch_1 | switch_1 | Control and report | Boolean | | | | @@ -40,15 +59,85 @@ Common dpId's and what they're used for in Tuya devices | 24 | power coefficient | power_coe | Data report | Integer | undefined0-1000000, undefined1, Scale0, Unit: | | | | 25 | statistics coefficient | electricity_coe | Data report | Integer | undefined0-1000000, undefined1, Scale0, Unit: | | | | 26 | warning | fault | Data report | Fault | Barrier values:ov_cr | | | +``` + +### Dehumidifier +``` +| DP ID | Function points | Identifier | Data type | Function type | Properties | +|-------|-----------------|-------------|------------------|---------------|----------------------------------------------------------| +| 1 | Switch | Switch | Issue and report | Boolean | | +| 2 | PM2.5 | PM25 | Only report | Integer | Values range:0-999, Pitch1, Scale0, Unit: | +| 3 | Work mode | Mode | Issue and report | Enum | Enumerated values:Manual, Auto, Sleep | +| 4 | Wind speed | Speed | Issue and report | Enum | Enumerated values:speed1, speed2, speed3, speed4, speed5 | +| 5 | Filter usage | Filter | Only report | Integer | Values range:0-100, Pitch1, Scale0, Unit:% | +| 6 | Fresh | Anion | Issue and report | Boolean | | +| 7 | Child lock | Lock | Issue and report | Boolean | | +| 9 | UV light | UV | Issue and report | Boolean | | +| 11 | Filter reset | FilterReset | Issue and report | Boolean | | +| 12 | indoor temp | Temp | Only report | Integer | Values range:-20-50, Pitch1, Scale0, Unit:℃ | +| 13 | Indoor humidity | Humidity | Only report | Integer | Values range:0-100, Pitch1, Scale0, Unit:% | +``` + +### Lighting +``` +| DP ID | Function points | Identifier | Data type | Function type | Properties | +|-------|-----------------|---------------|--------------------|---------------|----------------------------------------------------------------------------| +| 1 | Switch | led_switch | Control and report | Boolean | | +| 2 | Mode | work_mode | Control and report | Enum | Enumerated values:white, colour, scene, scene_1, scene_2, scene_3, scene_4 | +| 3 | Bright | bright_value | Control and report | Integer | undefined25-255, undefined1, Scale0, Unit: | +| 5 | Colour mode | colour_data | Control and report | Char type | | +| 6 | Scene | scene_data | Control and report | Char type | | +| 7 | Scene1 | flash_scene_1 | Control and report | Char type | | +| 8 | Scene2 | flash_scene_2 | Control and report | Char type | | +| 9 | Scene3 | flash_scene_3 | Control and report | Char type | | +| 10 | Scene4 | flash_scene_4 | Control and report | Char type | | +``` + +### Air purifier +``` +| DP ID | Function points | Identifier | Data type | Function type | Properties | +|-------|-----------------|-------------|------------------|---------------|----------------------------------------------------------| +| 1 | Switch | Switch | Issue and report | Boolean | | +| 2 | PM2.5 | PM25 | Only report | Integer | Values range:0-999, Pitch1, Scale0, Unit: | +| 3 | Work mode | Mode | Issue and report | Enum | Enumerated values:Manual, Auto, Sleep | +| 4 | Wind speed | Speed | Issue and report | Enum | Enumerated values:speed1, speed2, speed3, speed4, speed5 | +| 5 | Filter usage | Filter | Only report | Integer | Values range:0-100, Pitch1, Scale0, Unit:% | +| 6 | Fresh | Anion | Issue and report | Boolean | | +| 7 | Child lock | Lock | Issue and report | Boolean | | +| 9 | UV light | UV | Issue and report | Boolean | | +| 11 | Filter reset | FilterReset | Issue and report | Boolean | | +| 12 | indoor temp | Temp | Only report | Integer | Values range:-20-50, Pitch1, Scale0, Unit:℃ | +| 13 | Indoor humidity | Humidity | Only report | Integer | Values range:0-100, Pitch1, Scale0, Unit:% | +``` + +### Heater +``` +| DP ID | Function points | Identifier | Data type | Function type | Properties | +|-------|---------------------|-------------|------------------|---------------|--------------------------------------------| +| 1 | Switch | Power | Issue and report | Boolean | | +| 2 | Target temperature | TempSet | Issue and report | Integer | Values range:0-37, Pitch1, Scale0, Unit:℃ | +| 3 | Current Temperature | TempCurrent | Only report | Integer | Values range:-9-99, Pitch1, Scale0, Unit:℃ | +| 4 | Mode | Mode | Issue and report | Enum | Enumerated values:m, p | +| 5 | Fault alarm | Fault | Only report | Fault | Barrier values:1, 2, 3 | +| 6 | Gear position | gear | Issue and report | Enum | Enumerated values:low, mid, high, off | +| 7 | Conservation | eco_mode | Issue and report | Boolean | | +``` + +### Smart fan +``` +| DP ID | Function points | Identifier | Data type | Function type | Properties | +|-------|----------------------|----------------|------------------|---------------|-------------------------------------------| +| 1 | Switch | switch | Issue and report | Boolean | | +| 2 | Wind Speed Level | fan_speed | Issue and report | Enum | Enumerated values:1, 2, 3, 4 | +| 3 | Left-and-Right Swing | fan_horizontal | Issue and report | Enum | Enumerated values:on, off | +| 4 | Up-and-Down Swing | fan_vertical | Issue and report | Enum | Enumerated values:on, off | +| 5 | Fault Alarm | fault | Only report | Fault | Barrier values:1, 2 | +| 6 | Anion | anion | Issue and report | Boolean | | +| 7 | Humidify | humidifier | Issue and report | Boolean | | +| 8 | Oxygen | oxygan | Issue and report | Boolean | | +| 9 | Child Lock | lock | Issue and report | Boolean | | +| 10 | Cool | fan_cool | Issue and report | Boolean | | +| 11 | Set Temperate | temp | Issue and report | Integer | Values range:0-50, Pitch1, Scale0, Unit:℃ | +| 12 | Current Temperature | temp_current | Only report | Integer | Values range:0-50, Pitch1, Scale0, Unit:℃ | +``` -### 1-4 gang switch -| DP ID | Identifier | Data type | Function type | Properties | -|-------|-------------|--------------------|---------------|----------------------------------------------| -| 1 | switch_1 | Control and report | Boolean | | -| 2 | switch_2 | Control and report | Boolean | | -| 3 | switch_3 | Control and report | Boolean | | -| 4 | switch_4 | Control and report | Boolean | | -| 9 | countdown_1 | Control and report | Integer | undefined0-86400, undefined1, Scale0, Unit:s | -| 10 | countdown_2 | Control and report | Integer | undefined0-86400, undefined1, Scale0, Unit:s | -| 11 | countdown_3 | Control and report | Integer | undefined0-86400, undefined1, Scale0, Unit:s | -| 12 | countdown_4 | Control and report | Integer | undefined0-86400, undefined1, Scale0, Unit:s | \ No newline at end of file