Skip to content

Commit

Permalink
Tuya dual dimmer module QS-Zigbee-D02-TRIAC-2C-LN
Browse files Browse the repository at this point in the history
  • Loading branch information
tcharp38 committed Nov 26, 2023
1 parent ca68ca4 commit 70b29de
Show file tree
Hide file tree
Showing 4 changed files with 169 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
{
"TS110F__TYZB01_v8gtiaed": {
"manufacturer": "Tuya",
"model": "QS-Zigbee-D02-TRIAC-2C-LN",
"type": "Tuya dual dimmer switch module",
"timeout": "60",
"category": {
"light": "1"
},
"configuration": {
"icon": "Tuya-QS-Zigbee-D02-TRIAC-2C-LN",
"mainEP": "01"
},
"commands": {
"On 1": {
"use": "act_zbCmdC-0006-On",
"params": "ep=01",
"isVisible": "1"
},
"Off 1": {
"use": "act_zbCmdC-0006-Off",
"params": "ep=01",
"isVisible": "1"
},
"Toggle 1": {
"use": "act_zbCmdC-0006-Toggle",
"params": "ep=01"
},
"Status 1": {
"use": "inf_zbAttr-0006-OnOff",
"params": "ep=01",
"isVisible": "1",
"nextLine": "after"
},
"Get Status 1": {
"use": "act_zbReadAttribute",
"params": "ep=01&clustId=0006&attrId=0000"
},
"Bind 01-0006-ToZigate": {
"use": "act_zbBindToZigate",
"params": "ep=01&clustId=0006",
"execAtCreation": "yes"
},
"SetReporting 01-0006": {
"use": "act_zbConfigureReporting2",
"params": "ep=01&clustId=0006&attrType=10&attrId=0000",
"execAtCreation": "yes"
},
"On 2": {
"use": "act_zbCmdC-0006-On",
"params": "ep=02",
"isVisible": "1"
},
"Off 2": {
"use": "act_zbCmdC-0006-Off",
"params": "ep=02",
"isVisible": "1"
},
"Toggle 2": {
"use": "act_zbCmdC-0006-Toggle",
"params": "ep=02"
},
"Status 2": {
"use": "inf_zbAttr-0006-OnOff",
"params": "ep=02",
"isVisible": "1",
"nextLine": "after"
},
"Get Status 2": {
"use": "act_zbReadAttribute",
"params": "ep=02&clustId=0006&attrId=0000"
},
"Bind 02-0006-ToZigate": {
"use": "act_zbBindToZigate",
"params": "ep=02&clustId=0006",
"execAtCreation": "yes"
},
"SetReporting 02-0006": {
"use": "act_zbConfigureReporting2",
"params": "ep=02&clustId=0006&attrType=10&attrId=0000",
"execAtCreation": "yes"
},
"Set Level 1": {
"use": "act_setLevel-Light",
"params": "ep=01",
"isVisible": "1"
},
"Level 1": {
"use": "inf_zbAttr-0008-CurrentLevel",
"params": "ep=01",
"isVisible": "1",
"nextLine": "after"
},
"Get Level 1": {
"use": "act_zbReadAttribute",
"params": "ep=01&clustId=0008&attrId=0000"
},
"Bind 01-0008-ToZigate": {
"use": "act_zbBindToZigate",
"params": "ep=01&clustId=0008",
"execAtCreation": "yes"
},
"SetReporting 01-0008-0000": {
"use": "act_zbConfigureReporting2",
"params": "ep=01&clustId=0008&attrType=10&attrId=0000",
"execAtCreation": "yes"
},
"Set Level 2": {
"use": "act_setLevel-Light",
"params": "ep=02",
"isVisible": "1"
},
"Level 2": {
"use": "inf_zbAttr-0008-CurrentLevel",
"params": "ep=02",
"isVisible": "1",
"nextLine": "after"
},
"Get Level 2": {
"use": "act_zbReadAttribute",
"params": "ep=02&clustId=0008&attrId=0000"
},
"Bind 02-0008-ToZigate": {
"use": "act_zbBindToZigate",
"params": "ep=02&clustId=0008",
"execAtCreation": "yes"
},
"SetReporting 02-0008-0000": {
"use": "act_zbConfigureReporting2",
"params": "ep=02&clustId=0008&attrType=10&attrId=0000",
"execAtCreation": "yes"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"epCount":2,"endPoints":{"01":{"servClusters":{"0000":{"attributes":{"0000":{"dataType":"20","access":"05","value":3},"0001":{"dataType":"20","access":"05","value":65},"0002":{"dataType":"20","access":"05","value":0},"0003":{"dataType":"20","access":"05","value":1},"0004":{"value":"_TYZB01_v8gtiaed","dataType":"42","access":"05"},"0005":{"value":"TS110F","dataType":"42","access":"05"},"0006":{"dataType":"42","access":"05","value":""},"0007":{"dataType":"30","access":"05","value":1},"FFDE":{"dataType":"20","access":"07","value":11},"FFFD":{"dataType":"21","access":"05","value":2},"FFFE":{"dataType":"30","access":"05","value":0},"FFE0":{"dataType":"48","access":"05","value":"74BDFC8BF2D4144A0D3817392F1DF9477F966DE1264FCEE83F8642FD229A2654A4308CD131A6FBDB28"},"FFE1":{"dataType":"48","access":"05","value":"005E74DD8E2357C7D07220389338F733AE2C1E0C9C9C430AB9A17FEF0DE36B7DBFF69165163B16BC28"},"FFE2":{"dataType":"20","access":"05","value":31},"FFE3":{"dataType":"48","access":"05","value":"00"}},"commandsGenerated":"UNSUPPORTED","commandsReceived":"UNSUPPORTED"},"0004":{"attributes":{"0000":{"dataType":"18","access":"05","value":0},"FFFD":{"dataType":"21","access":"05","value":2}},"commandsReceived":"UNSUPPORTED","commandsGenerated":"UNSUPPORTED"},"0005":{"attributes":{"0000":{"dataType":"20","access":"05","value":0},"0001":{"dataType":"20","access":"05","value":0},"0002":{"dataType":"21","access":"05","value":0},"0003":{"dataType":"10","access":"05","value":0},"0004":{"dataType":"18","access":"05","value":0},"FFFD":{"dataType":"21","access":"05","value":2}},"commandsReceived":"UNSUPPORTED","commandsGenerated":"UNSUPPORTED"},"0006":{"attributes":{"4001":{"dataType":"21","access":"07","value":0},"4002":{"dataType":"21","access":"07","value":0},"0000":{"dataType":"10","access":"05","value":0}},"commandsReceived":"UNSUPPORTED","commandsGenerated":"UNSUPPORTED"},"0008":{"attributes":{"0000":{"dataType":"20","access":"07","value":255},"FC00":{"dataType":"21","access":"07","value":1023},"FFFD":{"dataType":"21","access":"05","value":1}},"commandsGenerated":"UNSUPPORTED","commandsReceived":"UNSUPPORTED"},"0019":{"attributes":{}},"000A":{"attributes":{}}},"cliClusters":{"0019":{"attributes":{"0000":{},"0001":{},"0006":{},"FFFD":{}}},"000A":{"attributes":{"FFFD":{}}}}},"02":{"servClusters":{"0004":{"attributes":{"0000":{"dataType":"18","access":"05","value":0},"FFFD":{"dataType":"21","access":"05","value":2}},"commandsReceived":"UNSUPPORTED","commandsGenerated":"UNSUPPORTED"},"0005":{"attributes":{"0000":{"dataType":"20","access":"05","value":0},"0001":{"dataType":"20","access":"05","value":0},"0002":{"dataType":"21","access":"05","value":0},"0003":{"dataType":"10","access":"05","value":0},"0004":{"dataType":"18","access":"05","value":0},"FFFD":{"dataType":"21","access":"05","value":2}},"commandsReceived":"UNSUPPORTED","commandsGenerated":"UNSUPPORTED"},"0006":{"attributes":{"4001":{"dataType":"21","access":"07","value":0},"4002":{"dataType":"21","access":"07","value":0},"0000":{"dataType":"10","access":"05","value":1}},"commandsReceived":"UNSUPPORTED","commandsGenerated":"UNSUPPORTED"},"0008":{"attributes":{"0000":{"dataType":"20","access":"07","value":3},"FC00":{"dataType":"21","access":"07","value":1023},"FFFD":{"dataType":"21","access":"05","value":1}},"commandsReceived":"UNSUPPORTED","commandsGenerated":"UNSUPPORTED"}},"cliClusters":{"":{}}}},"powerSource":"mains","fileSignature":"Abeille discovery file"}
56 changes: 32 additions & 24 deletions desktop/php/AbeilleEqAssist.php
Original file line number Diff line number Diff line change
Expand Up @@ -818,24 +818,26 @@ function sameZCmdInOtherEP(epId, clustId, cmdName) {
return false;
}

/* Check if clustId exists in another EP.
/* Check if clustId exists in several EP.
Purpose is to give a unique Jeedom command name.
Returns: true is exists, else false */
function sameClustInOtherEP(epId, clustId) {
for (var epIdx = 0; epIdx < zigbee.endPoints.length; epIdx++) {
ep = zigbee.endPoints[epIdx];
if (ep.id == epId)
continue; // Current EP
for (var clustIdx = 0; clustIdx < ep.servClustList.length; clustIdx++) {
clust = ep.servClustList[clustIdx];
if (clust.id != clustId)
continue;
function sameClustInSeveralEP(clustId) {
foundNb = 0;
endPoints = zigbee.endPoints;
for (var epId in endPoints) {
// console.log("EP "+epId);
ep = endPoints[epId];

/* Coresponding cluster in a different EP found. */
return true; // FOUND !
}
if (!isset(ep.servClusters))
continue;

if (isset(ep.servClusters[clustId]))
foundNb++;
}
return false;
if (foundNb > 1)
return true;
else
return false;
}

function newCmd($use, $params = "", $exec = "") {
Expand Down Expand Up @@ -933,16 +935,16 @@ function zigbeeToModel() {

/* 0006/OnOff cluster on all EP */
onOffIdx = 1; // Used if multiple 0006 clusters
multipleCluster = sameClustInOtherEP(epId, "0006");
multipleCluster = sameClustInSeveralEP("0006");
clustIdx = '';
for (var epId in endPoints) {
// console.log("EP "+epId);
ep = endPoints[epId];
// console.log("EP"+epId+"=", ep);

if (!isset(ep.servClusters))
continue;

if (multipleCluster)
if (multipleCluster) // If multiple clusters adding index in name
clustIdx = " "+onOffIdx;
if (isset(ep.servClusters["0006"]) && isset(ep.servClusters["0006"]['attributes'])) {
attributes = ep.servClusters["0006"]['attributes'];
Expand All @@ -965,27 +967,33 @@ function zigbeeToModel() {
onOffIdx++;
}

/* 0008/Level cluster on all EP */
levelIdx = 1; // Used if multiple 0008 clusters
multipleCluster = sameClustInSeveralEP("0008");
clustIdx = '';
for (var epId in endPoints) {
// console.log("EP "+epId);
ep = endPoints[epId];

if (!isset(ep.servClusters))
continue;

/* 0008/Level cluster */
if (multipleCluster) // If multiple clusters adding index in name
clustIdx = " "+levelIdx;
if (isset(ep.servClusters["0008"]) && isset(ep.servClusters["0008"]['attributes'])) {
attributes = ep.servClusters["0008"]['attributes'];
// Note: If device is a light bulb, need to use 'act_setLevel-Light'
cmds["Set Level"] = newCmd("act_setLevel-Light", "ep="+epId);
cmds["Set Level"]["isVisible"] = 1;
cmds["Set Level"+clustIdx] = newCmd("act_setLevel-Light", "ep="+epId);
cmds["Set Level"+clustIdx]["isVisible"] = 1;

cmds["Level"] = newCmd("inf_zbAttr-0008-CurrentLevel", "ep="+epId);
cmds["Level"]["isVisible"] = 1;
cmds["Level"]["nextLine"] = "after";
cmds["Get Level"] = newCmd("act_zbReadAttribute", "ep="+epId+"&clustId=0008&attrId=0000");
cmds["Level"+clustIdx] = newCmd("inf_zbAttr-0008-CurrentLevel", "ep="+epId);
cmds["Level"+clustIdx]["isVisible"] = 1;
cmds["Level"+clustIdx]["nextLine"] = "after";
cmds["Get Level"+clustIdx] = newCmd("act_zbReadAttribute", "ep="+epId+"&clustId=0008&attrId=0000");
cmds["Bind "+epId+"-0008-ToZigate"] = newCmd("act_zbBindToZigate", "ep="+epId+"&clustId=0008", "yes");
cmds["SetReporting "+epId+"-0008-0000"] = newCmd("act_zbConfigureReporting2", "ep="+epId+"&clustId=0008&attrType=10&attrId=0000", "yes");
}
levelIdx++;
}

for (var epId in endPoints) {
Expand Down
1 change: 1 addition & 0 deletions docs/fr_FR/Changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ChangeLog
- Interne: Normalisation infos modèle: forcedByUser => modelForced
- eTRV0103: Mise-à-jour du modèle.
- Legrand micromodule switch: Mise-à-jour du modèle (2663).
- Tuya double dimmer module QS-Zigbee-D02-TRIAC-2C-LN: Ajout support préliminaire (2664).

231124-BETA-2
-------------
Expand Down

0 comments on commit 70b29de

Please sign in to comment.