Water Valve

Last Updated on : 2023-09-07 10:23:11download

Zigbee protocol version

Category Device ID Profile ID
Water valve 0x0000 0x0104

Supported clusters

Input clusters (server) Output clusters (client)
Basic (0x0000) OTA Upgrade (0x0019)
Power Configuration (0x0001) /
Identify (0x0003) /
Groups (0x0004) /
Scenes (0x0005) /
On/Off (0x0006) /
TUYA_ELECTRICIAN_PRIVATE_CLUSTER (0xE001) /

Supported attributes and commands

Attributes contain the basic information about a Zigbee device. A gateway can get this information through the Read Attributes and Write Attributes defined by Zigbee Cluster Library Specification.

Basic Cluster

Attributes:

ID Name Data type (ID) Range Default
0x0000 ZCLVersion uint8 (0x20) 0x00 to 0xff 0x03, used for connection to Tuya-enabled Zigbee gateways.
0x0001 ApplicationVersion uint8 (0x20) 0x00 to 0xff 0x40
0x40 in hex is 0100 0000 in binary. 0100 0000 represents version 1.0.0 so 0x40 represents 1.0.0.
0x0002 StackVersion uint8 (0x20) 0x00 to 0xff 0x02
0x0003 HWVersion uint8 (0x20) 0x00 to 0xff 0x01
0x0004 ManufacturerName string (0x42) 0 to 32 bytes For example, _TZ3000_l6web2ir.
The value of this attribute is 16 bytes in length, containing 8-byte prefix of capability value and 8-byte PID. The PID is the unique identifier of the Zigbee product you create on the Tuya IoT Development Platform. The capability value can be obtained from the Zigbee development documentation.
0x0005 ModelIdentifier string (0x42) 0 to 32 bytes TS0049, used for connection to Tuya-enabled Zigbee gateways.
0x0007 PowerSource enum8 (0x30) 0x00 to 0xff 0x03, used for connection to Tuya-enabled Zigbee gateways and representing low-power devices.
0xFFFD ClusterRevision uint16 (0x21) 0x0000 to 0xffff 0x0001

Commands:

ID Name Direction Description
0x00 Reset to Factory Defaults Client to server /

On/Off Cluster

Attributes:

ID Name Data type (ID) Range Default
0x0000 OnOff bool (0x10) 0x00: Off
0x01: On
0x00
0xFFFD ClusterRevision uint16 (0x21) 0x0000 to 0xffff 0x0001

Commands:

ID Name Direction Description
0x00 Off Client to server /
0x01 On Client to server /
0x02 Toggle Client to server /

Power configuration cluster

Attributes:

ID Name Data type (ID) Range Default
0x0021 BatteryPercentageRemaining uint8 (0x20) 0x00 to 0xff 0x00
0xFFFD ClusterRevision uint16 (0x21) 0x0000 to 0xffff 0x0001

TUYA_ELECTRICIAN_PRIVATE cluster

Attributes:

ID Name Data type (ID) Range Default
0xD040 Raw data transmission (Tuya-specific attribute) array / Byte 0: indicates DP ID.
Byte 1 to n: indicates DP data.
0xFFFD ClusterRevision uint16 (0x21) 0x0000 to 0xffff 0x0001

Commands:

ID Name Direction Description
0xFE Weather delay and irrigation time (Tuya-specific command) Client to server /
0xFD Cycle irrigation (Tuya-specific command) Client to server /
0xFC Scheduled irrigation (Tuya-specific command) Client to server /

Mapping between DPs and clusters

DP1 On/Off

The gateway sends the on/off command to the Zigbee device to turn on or off the device. The Zigbee device reports on/off status using the ZCL on/off attribute.

Direction Cluster ID Command/Attribute ID Value
Client to server 0x0006: On/Off
  • 0x00: Off
  • 0x01: On
  • 0x02: Toggle
/
Server to client 0x0006: On/Off 0x0000: On/Off
  • 0: Off
  • 1: On

DP7 Battery level

Direction Cluster ID Command/Attribute ID Value
Server to client 0x0001: Power Configuration 0x0021: BatteryPercentageRemaining /

DP4 Fault report

Direction Cluster ID Command/Attribute ID Value
Server to client 0xE001: TUYA_ELECTRICIAN_PRIVATE 0xD040: Tuya-specific attribute 1 byte: The DP.
1 byte: The fault value.
Valid values: 0 to 31

DP10 Weather delay

Direction Cluster ID Command/Attribute ID Value
Client to server 0xE001: TUYA_ELECTRICIAN_PRIVATE 0xFE: Tuya-specific command 1 byte: The DP.
1 byte: The enum value.
Valid values: 0, 1, 2, 3
Server to client 0xE001: TUYA_ELECTRICIAN_PRIVATE 0xD040: Tuya-specific attribute /

DP11 Irrigation time

Direction Cluster ID Command/Attribute ID Value
Client to server 0xE001: TUYA_ELECTRICIAN_PRIVATE 0xFE: Tuya-specific command 1 byte: The DP.
4 bytes: The time value.
Valid values: 0 to 86400.
In big-endian format.
Server to client 0xE001: TUYA_ELECTRICIAN_PRIVATE 0xD040: Tuya-specific attribute /

DP12 Work state

Direction Cluster ID Command/Attribute ID Value
Server to client 0xE001: TUYA_ELECTRICIAN_PRIVATE 0xD040: Tuya-specific attribute 1 byte: The DP.
1 byte: The enum value.
Valid values: 0, 1, 2

DP15 Once using time

Direction Cluster ID Command/Attribute ID Value
Server to client 0xE001: TUYA_ELECTRICIAN_PRIVATE 0xD040: Tuya-specific attribute 1 byte: The DP.
4 bytes: The time value.
Valid values: 0 to 86400.
In big-endian format.

DP16 Cycle irrigation

Direction Cluster ID Command/Attribute ID Value
Client to server 0xE001: TUYA_ELECTRICIAN_PRIVATE 0xFD: Tuya-specific command /
Server to client 0xE001: TUYA_ELECTRICIAN_PRIVATE 0xD040: Tuya-specific attribute /

Data format

Feature Length Description
Version number 1 byte 0x00
Commands 1 byte
  • 01: Query
    Zigbee module to MCU: Protocol version + Command 0X01
    MCU to Zigbee module: Protocol version + Scheduled task.
  • 02: Modify
    Zigbee module to MCU: Protocol version + Command 0X02 + Schedule ID + Schedule data
    MCU to Zigbee module: Protocol version + Scheduled task.
  • 02: Add
    Zigbee module to MCU: Protocol version + Command 0X03 + Schedule data
    MCU to Zigbee module: Protocol version + Scheduled task (with the ID of the added schedule).
  • 04: Delete
    Zigbee module to MCU: Protocol version + Command 0X04 + Schedule ID
    MCU to Zigbee module: Protocol version + Schedule list (the updated list after deletion operation).
Schedule ID 1 byte 0x00: The number represents the schedule ID.
On/Off 1 byte
  • Bit 0: indicates the on or off state.
  • Bit 1 to bit 7: indicates the channel ID, defaulting to 1 channel.
Day(s) of the week 1 byte 0x00: One-time task.
Other values: Schedule the task to run on specific days of the week. For more information, see the following table for Weekly schedule.
The start time 2 bytes The value is in minutes. The maximum value is 1439.
The end time 2 bytes The value is in minutes. The maximum value is 1439.
The ON state duration 2 bytes The value is in minutes. The maximum value is 1439.
The OFF state duration 2 bytes The value is in minutes. The maximum value is 1439.
Water flow 1 byte Water flow adjustment (%)

Weekly schedule

Sunday Monday Tuesday Wednesday Thursday Friday Saturday
Data Bit 0 Bit 1 Bit 2 Bit 3 Bit 4 Bit 5 Bit 6

DP17 Scheduled irrigation

Direction Cluster ID Command/Attribute ID Value
Client to server 0xE001: TUYA_ELECTRICIAN_PRIVATE 0xFC: Tuya-specific command /
Server to client 0xE001: TUYA_ELECTRICIAN_PRIVATE 0xD040: Tuya-specific attribute /

Data format

Feature Length Description
Version number 1 byte 0x00
Commands 1 byte
  • 01: Query
    Zigbee module to MCU: Protocol version + Command 0X01
    MCU to Zigbee module: Protocol version + Scheduled task.
  • 02: Modify
    Zigbee module to MCU: Protocol version + Command 0X02 + Schedule ID + Schedule data
    MCU to Zigbee module: Protocol version + Scheduled task.
  • 02: Add
    Zigbee module to MCU: Protocol version + Command 0X03 + Schedule data
    MCU to Zigbee module: Protocol version + Scheduled task (with the ID of the added schedule).
  • 04: Delete
    Zigbee module to MCU: Protocol version + Command 0X04 + Schedule ID
    MCU to Zigbee module: Protocol version + Schedule list (the updated list after deletion operation).
Schedule ID 1 byte 0x00: The number represents the schedule ID.
The start time 2 bytes In units of minutes. For example, 02:30 PM is 14 × 60 + 30 = 870, which is converted to hex for transmission.
Irrigation time 2 bytes The value is in minutes. The maximum value is 1439.
Weekly schedule 1 byte 0xFF indicates weekly schedule.
Water flow 1 byte Water flow adjustment (%)
Schedule setting 1 byte Schedule setting and on/off state
  • 0b 0000: Indicate the recurrence pattern (Bits 4 to 7).
    0000: Repeat weekly.
    0001: Repeat on odd days
    0010: Repeat on even days.
    0100: Repeat every n number of days.
  • 0b 00: On/Off state of a schedule. (Bits 0 to 1)
    00: Off
    01: On
  • Run every other day 5 bytes
    • The start date
      • The year: 2 bytes
      • The month: 1 byte
      • The day: 1 byte
    • Repeat every n number of days.
      1 byte in length. The n can be a value from 1 to 31. The first four bytes indicate the year, month, and day. The fifth byte indicates the recurrence pattern.
      For example, starting from December 2, 2021, run a task every five days.
      The data is 07e5 000c 0002 0005.