From 594b7516fb73f86c1e313a368064aa66119809f1 Mon Sep 17 00:00:00 2001 From: Gergo Date: Tue, 18 Aug 2026 17:24:30 +0200 Subject: [PATCH] Add TS0041 signature variant for Tesla Smart TSL-SEN-BUTTON (_TZ3000_ajsypttg) The Tesla Smart TSL-SEN-BUTTON (a Tuya TS0041 rebrand) reports device_type=0x0401 (IAS_ANCILLARY_CONTROL) in its simple descriptor instead of 0x0000 (ON_OFF_SWITCH), so none of the existing TS0041 signatures match and the remote is unsupported. Add a variant of TuyaSmartRemote0041TI with the IAS ancillary device type. --- tests/test_tuya.py | 1 + zhaquirks/tuya/ts0041.py | 44 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/tests/test_tuya.py b/tests/test_tuya.py index f2b1c5c2bf..29fada7a88 100644 --- a/tests/test_tuya.py +++ b/tests/test_tuya.py @@ -1508,6 +1508,7 @@ async def async_success(*args, **kwargs): (zhaquirks.tuya.ts0041.TuyaSmartRemote0041TI, "_TZ3000_awgcnkrh"), (zhaquirks.tuya.ts0041.TuyaSmartRemote0041TI, "_TZ3400_deyjhapk"), (zhaquirks.tuya.ts0041.TuyaSmartRemote0041TI, "_some_random_manuf"), + (zhaquirks.tuya.ts0041.TuyaSmartRemote0041TIIAS, "_TZ3000_ajsypttg"), (zhaquirks.tuya.ts0041.TuyaSmartRemote0041TO, "_TZ3000_pwgcnkrh"), (zhaquirks.tuya.ts0041.TuyaSmartRemote0041TO, "_TZ3400_leyjhapk"), (zhaquirks.tuya.ts0041.TuyaSmartRemote0041TO, "_some_random_manuf"), diff --git a/zhaquirks/tuya/ts0041.py b/zhaquirks/tuya/ts0041.py index 088080dbe3..8d33cddb08 100644 --- a/zhaquirks/tuya/ts0041.py +++ b/zhaquirks/tuya/ts0041.py @@ -118,6 +118,50 @@ class TuyaSmartRemote0041TI(CustomDevice): } +class TuyaSmartRemote0041TIIAS(CustomDevice): + """Tuya 1-button remote device with time on in and IAS ancillary device type.""" + + signature = { + # SizePrefixedSimpleDescriptor(endpoint=1, profile=260, device_type=1025, device_version=1, input_clusters=[0, 1, 6, 10], output_clusters=[25])) + # Tesla Smart TSL-SEN-BUTTON (_TZ3000_ajsypttg) + MODEL: "TS0041", + ENDPOINTS: { + 1: { + PROFILE_ID: zha.PROFILE_ID, + DEVICE_TYPE: zha.DeviceType.IAS_ANCILLARY_CONTROL, + INPUT_CLUSTERS: [ + Basic.cluster_id, + PowerConfiguration.cluster_id, + OnOff.cluster_id, + Time.cluster_id, + ], + OUTPUT_CLUSTERS: [Ota.cluster_id], + }, + }, + } + replacement = { + ENDPOINTS: { + 1: { + PROFILE_ID: zha.PROFILE_ID, + DEVICE_TYPE: zha.DeviceType.REMOTE_CONTROL, + INPUT_CLUSTERS: [ + Basic.cluster_id, + TuyaNoBindPowerConfigurationCluster, + TuyaSmartRemoteOnOffCluster, + Time.cluster_id, + ], + OUTPUT_CLUSTERS: [Ota.cluster_id], + }, + }, + } + + device_automation_triggers = { + (SHORT_PRESS, BUTTON_1): {ENDPOINT_ID: 1, COMMAND: SHORT_PRESS}, + (LONG_PRESS, BUTTON_1): {ENDPOINT_ID: 1, COMMAND: LONG_PRESS}, + (DOUBLE_PRESS, BUTTON_1): {ENDPOINT_ID: 1, COMMAND: DOUBLE_PRESS}, + } + + class TuyaSmartRemote0041TOPlusA(CustomDevice): """Tuya 1-button remote device with time on out cluster."""