Skip to content

Conversation

@cwtchhome
Copy link

This PR improves and extends Tuya TS0601 multi-gang switch support, fixing the existing two-gang implementation and adding proper support for three-gang and four-gang variants with backlight and LED indicator control.

All devices were verified via Tuya IoT Console (Device Log + Function List) and tested locally as external converters in Zigbee2MQTT 2.6.3 — all functions confirmed working 100 %.

Changes included

✅ Fixed existing 2-gang switch (ZN2S-RS02E / _TZE284_zpvusbtv)
• Changed DP15 indicator_mode from boolean to enum (supports "off", "on_off_status", "switch_position".)
• Added DP102 backlight numeric value (0–100 %).
• Kept DP16 backlight_switch, DP101 child_lock, DP103/104 LED colors, and countdown_1/2.
• Verified DP14 power_on_behavior and DP13 master state.
• Works correctly when setting via MQTT: {"indicator_mode":"off"}, {"backlight":10}, {"backlight_switch":"OFF"}

🆕 Added 3-gang switch (_TZE204_rkbxtclc)
• Added correct DP1–DP3 and countdown_1–_3 mappings.
• Implemented indicator_mode enum, backlight %, child_lock, and LED color DPs.
• Verified operation for all relays, indicator states, and backlight brightness.
• Fully functional in Zigbee2MQTT 2.6.3 as external converter.

🆕 Added 4-gang switch (_TZE204_7ytnacie)
• Added correct DP1–DP4 and countdown_1–_4 mappings.
• Implemented indicator_mode enum, backlight %, child_lock, and LED color DPs.
• Verified operation for all relays, indicator states, and backlight brightness.
• Fully functional in Zigbee2MQTT 2.6.3 as external converter.

Verified datapoints:
image

All DP logs confirmed via Tuya IoT Console (Device → Logs → Report / Publish events).

Screenshots / Logs

(Add Tuya IoT screenshots if needed — already verified through Device Log showing DP15, DP16, DP102, DP103, DP104 values changing correctly.)

image

Doing it: https://www.zigbee2mqtt.io/advanced/support-new-devices/03_find_tuya_data_points.html, I got this:

{"1":"Switch 1","2":"Switch 2","3":"Switch 3","7":"Timer 1","8":"Timer 2","9":"Timer 3","13":"Master Switch","14":"Restart Status","15":"Indicator Status","16":"Backlight Switch","19":"Delay-off Schedule","101":"Child Lock","102":"Backlight","103":"ON Color","104":"OFF Color","209":"Cycle Schedule","210":"Random Schedule"}

Notes for maintainers
• These additions follow existing Tuya TS0601 definitions and retain full backward compatibility.
• Structure uses extend: [tuya.modernExtend.tuyaBase({dp: true})] per current style.
• indicator_mode fix resolves user-reported issues where the LED indicator ignored "off" and "switch_position".
• All converters validated locally before submission.

Tested and confirmed working

✅ All switch relays (L1–L4)
✅ LED indicator behavior modes
✅ Backlight switch and brightness
✅ LED ON/OFF color control
✅ Countdown timers
✅ Child lock and power-on behavior

💬 Tested and verified by multiple users (see Tuya IoT logs attached). Ready for merge — adds full LED/backlight functionality to TS0601 multi-gang family.

cwtchhome and others added 2 commits November 12, 2025 16:14
…& 4-gang TS0601 switches)

- Fixed Tuya TS0601 two-gang (ZN2S-RS02E / _TZE284_zpvusbtv):
  • indicator_mode changed from boolean to enum (off / on_off_status / switch_position)
  • added backlight (DP102) brightness 0–100
  • kept countdown_1 and countdown_2
  • verified ON/OFF color, child_lock, power_on_behavior, backlight_switch

- Added support for TS0601 three-gang (_TZE204_rkbxtclc) and four-gang (_TZE204_7ytnacie):
  • included correct datapoints (countdown_1–_4)
  • added indicator_mode enum, backlight %, and all LED color DPs
  • tested successfully as external converters in Zigbee2MQTT 2.6.3 — working 100%

All definitions verified via Tuya IoT Device Log and API (DP15, DP16, DP102, DP103, DP104).
[16, "backlight_switch", tuya.valueConverter.onOff],
[101, "child_lock", tuya.valueConverter.onOff],

// ✅ Nuevo: backlight %
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove all non English text

model: "ZN2S-RS02E",
vendor: "Tuya",
description: "Two gang switch with colored backlight modes",
description: "Two gang switch with colored backlight modes (ZN2S-RS02E)",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: "Two gang switch with colored backlight modes (ZN2S-RS02E)",
description: "Two gang switch with colored backlight modes",

@Koenkk
Copy link
Owner

Koenkk commented Nov 16, 2025

Could you also submit a picture for the docs (guide)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants