Multi-Gang Switch

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

Zigbee protocol version

Device ID Profile ID
0x0100 0x0104

Endpoint

Endpoint Description
1 The first gang.
2 The second gang.
3 The third gang.
4 The fourth gang.

Supported clusters

Input clusters (server) Output clusters (client)
Basic (0x0000) OTA Upgrade (0x0019)
Identify (0x0003) /
Groups (0x0004) /
Scenes (0x0005) /
On/Off (0x0006) /
Tuya private cluster 0 (0xE000) /
Tuya private cluster 1 (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 For example, 0b 01 00 0001 indicates 1.0.1, that is, 0x41 represents version 1.0.1. This attribute is used for OTA updates. When an OTA update is initiated, the gateway reads the version number of the update and pushes it to the Zigbee device. After the Zigbee device is restarted after the update, the gateway reads the current version to check for the update result. The firmware can only be updated to a higher version. This attribute is used for connection to Tuya-enabled Zigbee gateways.
0x0002 StackVersion uint8 (0x20) 0x00 to 0xff 0x02
0x0003 HWVersion uint8 (0x20) 0x00 to 0xff 0x01
0x0004 ManufacturerName string (0x42) 0 to 32 bytes The value of this attribute is 16 bytes in length, consisting of 8-byte prefix and 8-byte PID.
0 to 7 bytes: TZ3000.
8 to 16 bytes: The PID, the unique identifier of the Zigbee product you create on the Tuya IoT Development Platform. This field determines the UI and feature display on the mobile app. You can use the default PID if you do not require a custom one. This attribute is used for connection to Tuya-enabled Zigbee gateways.
0x0005 ModelIdentifier string (0x42) 0 to 32 bytes SM000x represents switch (with neutral). SM001x represents switch (no neutral). x represents the number of channels. For example, SM0003 and SM0013 represent 3-gang switch (with neutral) and 3-gang switch (no neutral) respectively. This attribute is used for connection to Tuya-enabled Zigbee gateways.
0x0007 PowerSource enum8 (0x30) 0x00 to 0xff
  • 0x01: Represents switch (with neutral). This attribute is used for connection to Tuya-enabled Zigbee gateways.
  • 0x03: Represents switch (no neutral). This attribute is used for connection to Tuya-enabled Zigbee gateways.
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) Value
  • 0: Off
  • 1: On
0x00
0x4001 OnTime uint16 (0x21) 0 to 43200 0x0000
0x4002 OffWaitTime uint16 (0x21) 0 to 43200 0x0000
0x8002 Restart status (main control) (Tuya-specific attribute) enum8 (0x30) Value
  • 0: Off
  • 1: On
  • 2: Last on/off state
0x00
0x8001 Indicator status (Tuya-specific attribute) enum8 (0x30) Value
  • 0: Off
  • 1: Indicates status. The indicator comes on when the switch is turned on.
  • 2: Indicates position. The indicator comes on when the switch is turned off.
0x00
0x5000 Backlight switch (Tuya-specific attribute) enum8 (0x30) Value
  • 0: Off
  • 1: On
0x00

Commands

ID name Direction Description
0x00 Off Client to Server /
0x01 On Client to Server /
0x02 Toggle Client to Server /
0x42 On With Timed Off Client to Server /

Tuya private cluster 0

Attributes

ID Name Data type (ID) Range Default
0xD001 Random timing (Tuya-specific attribute) array (0x48) / /
0xD002 Cycle timing (Tuya-specific attribute) array (0x48) / /
0xD003 Inching switch (Tuya-specific attribute) array (0x48) / /

Commands

ID name Direction Description
0xF7 Random timing (Tuya-specific command) Client to Server For more information about the data format, see the following section of DP210 Random timing.
0xF8 Cycle timing (Tuya-specific command) Client to Server For more information about the data format, see the following section of DP209 Cycle timing.
0xFB Inching switch (Tuya-specific attribute) Client to Server For more information about the data format, see the following section of DP19 Inching switch.

Tuya private cluster 1

Attributes

ID Name Data type (ID) Range Default
0xD010 Restart status (individual control) enum8 (0x30) Value
  • 0: Off
  • 1: On
  • 2: Last on/off state
0x00

Mapping between DPs and clusters

DPID DP description Standard command Endpoint
1 Switch 1 Yes 1
2 Switch 2 Yes 2
3 Switch 3 Yes 3
4 Switch 4 Yes 4
7 Countdown of switch 1 Yes 1
8 Countdown of switch 2 Yes 2
9 Countdown of switch 3 Yes 3
10 Countdown of switch 4 Yes 4
14 Restart status (main control) No 1
15 Indicator state No 1
16 Backlight on/off No 1
29 Relay status 1 No 1
30 Relay status 2 No 2
31 Relay status 3 No 3
32 Relay status 4 No 4
19 Inching switch No 1
209 Cycle timing No 1
210 Random timing No 1

DPs 1 to 4 Switch 1 to 4

The gateway sends the On, Off, or Toggle command to the Zigbee 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

DPs 7 to 10 Timer 1 to 4

Direction Cluster ID Command/Attribute ID Value
Client to server 0x0006: On/Off 0x42: On With Timed Off Payload
Server to client 0x0006: On/Off
  • 0x4001: On Time
  • 0x4002: Off Wait Time
0 to 43200

Format of payload: On/off Control: 0x00. On time and Off Wait Time must be set to the same value. Example: To send a command of a local countdown for 60s, the payload contains the following settings:

On/off Control: 0x00

On Time: 0x003c

Off Wait Time: 0x003c

DP14 Restart status (main control)

Direction Cluster ID Command/Attribute ID Value
Client to server 0x0006: On/Off 0x8002 (Tuya-specific attribute) Value
  • 0: Off
  • 1: On
  • 2: Last on/off state
Server to client 0x0006: On/Off 0x8002 (Tuya-specific attribute) Value
  • 0: Off
  • 1: On
  • 2: Last on/off state

DP15 Indicator status

Direction Cluster ID Command/Attribute ID Value
Client to server 0x0006: On/Off 0x8001 (Tuya-specific attribute) Value
  • 0: Off
  • 1: Indicates status. The indicator comes on when the switch is turned on.
  • 2: Indicates position. The indicator comes on when the switch is turned off.
Server to client 0x0006: On/Off 0x8001 (Tuya-specific attribute) Value
  • 0: Off
  • 1: Indicates status. The indicator comes on when the switch is turned on.
  • 2: Indicates position. The indicator comes on when the switch is turned off.

DP16 Backlight switch

Direction Cluster ID Command/Attribute ID Value
Client to server 0x0006: On/Off 0x5000 (Tuya-specific attribute) Value
  • 0: Off
  • 1: On
Server to client 0x0006: On/Off 0x5000 (Tuya-specific attribute) Value
  • 0: Off
  • 1: On

DPs 29 to 32 Restart status 1 to 4

Direction Cluster ID Command/Attribute ID Value
Client to server 0xE001 (Tuya private cluster 1) 0xD010 (Tuya-specific attribute) Value
  • 0: Off
  • 1: On
  • 2: Last on/off state
Server to client 0xE001 (Tuya private cluster 1) 0xD010 (Tuya-specific attribute) Value
  • 0: Off
  • 1: On
  • 2: Last on/off state

DP19 Inching switch

Direction Cluster ID Command/Attribute ID Value
Client to server 0xE000 (Tuya private cluster 0) 0xFB: Tuya-specific command Payload
Server to client 0xE000 (Tuya private cluster 0) 0xD003: Tuya-specific attribute Payload

Payload format: 3 × n (n ≤ 6) Fields from the On/Off are specified for a single time node.

Feature Length Description
Channel ID + bit for enablement 1 byte Bit 0:
  • 0: Enable
  • 1: Disable

Bits 7 to 1: Channel ID.
Inching duration 2 bytes 00 3C is 0x003c in hex, representing 60 seconds.

Example:
1-gang switch: 01 00 3C indicates the first gang is enabled, with an inching duration of 60 seconds.
Multi-gang switch: 00 00 3C 03 00 3C indicates the first gang is disabled, with an inching duration of 60 seconds, and the second gang is enabled, with an inching duration of 60 seconds.

DP209 Cycle timing

Direction Cluster ID Command/Attribute ID Value
Client to server 0xE000 (Tuya private cluster 0) 0xF8: Tuya-specific command Payload
Server to client 0xE000 (Tuya private cluster 0) 0xD002: Tuya-specific attribute Payload

Payload format: 2 + 10 × n (n ≤ 6) Fields from the On/Off are specified for a single time node.

Feature Length Description
Version number 1 byte 0x00
Node length 1 byte 0x0A
Switch 1 byte Bit 0: used to turn on or off the node.
0: Off.
1: On.
Bit 1 to bit 7: indicates the channel ID.
Day(s) of the week 1 byte 0x00: One-time task. The current date and time is used. 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.

Weekly schedule

Reserved Saturday Friday Thursday Wednesday Tuesday Monday Sunday
Bit 7 = 0 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

DP210 Random timing

Direction Cluster ID Command/Attribute ID Value
Client to server 0xE000 (Tuya private cluster 0) 0xF7: Tuya-specific command Payload
Server to client 0xE000 (Tuya private cluster 0) 0xD001: Tuya-specific attribute Payload

Payload format: 2 + 6 × n (n ≤ 10) Fields from the On/Off are specified for a single time node.

Feature Length Description
Version number 1 byte 0x00
Node length 1 byte 0x06
Switch 1 byte Bit 0: used to turn on or off the node.
0: Off.
1: On.
Bits 1 to 7 are reserved.
Day(s) of the week 1 byte 0x00: One-time task. The current date and time is used. 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.

Weekly schedule

Reserved Saturday Friday Thursday Wednesday Tuesday Monday Sunday
Bit 7 = 0 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0