From c0fd591b34103f8968875dd9bd9d1f971183ea03 Mon Sep 17 00:00:00 2001 From: www-data Date: Sat, 4 Nov 2023 20:32:27 +0000 Subject: [PATCH] Change name to TRV06, added lock/unlock command and lock status. Remove a force value line of code for testing. --- core/class/AbeilleCmdProcess.class.php | 7 +- .../TS0601__TZE200_p3dbf6qs.json | 84 +++++++++++++----- ...ad.png => node_TRV06-ThermostaticHead.png} | Bin 3 files changed, 66 insertions(+), 25 deletions(-) rename images/{node_KETOTEK-ThermostaticHead.png => node_TRV06-ThermostaticHead.png} (100%) diff --git a/core/class/AbeilleCmdProcess.class.php b/core/class/AbeilleCmdProcess.class.php index 3d319afe2e..5abb2329ac 100755 --- a/core/class/AbeilleCmdProcess.class.php +++ b/core/class/AbeilleCmdProcess.class.php @@ -5124,8 +5124,9 @@ function processCmd($Command) { $fcf = "11"; // Frame Control Field $sqn = $this->genSqn(); $cmdId = "00"; // TY_DATA_REQUEST, 0x00, The gateway sends data to the Zigbee module. - // cmdLog2('debug', $addr, ' BEN: '.json_encode($Command) ); + cmdLog2('debug', $addr, ' BEN: '.json_encode($Command) ); $dp = tuyaCmd2Dp($Command); + cmdLog2('debug', $addr, ' BEN: '.json_encode($dp) ); if ($dp === false) { return; } @@ -5141,9 +5142,7 @@ function processCmd($Command) { $dpId = $dp['id']; $dpLen = sprintf("%04X", $dpLen); - $dpId = "04"; $dpType= "02"; $dpData = $dp['data']; - - cmdLog2('debug', $addr, ' '.$Command['cmd'].': tSqn='.$tSqn.', dpId='.$dpId.', dpType='.$dpType.', dpData='.$dpData); + cmdLog2('debug', $addr, ' BEN: '.$Command['cmd'].': tSqn='.$tSqn.', dpId='.$dpId.', dpType='.$dpType.', dpData='.$dpData); $data2 = $fcf.$sqn.$cmdId.$tSqn.$dpId.$dpType.$dpLen.$dpData; } $dataLen2 = sprintf("%02X", strlen($data2) / 2); diff --git a/core/config/devices_local/TS0601__TZE200_p3dbf6qs/TS0601__TZE200_p3dbf6qs.json b/core/config/devices_local/TS0601__TZE200_p3dbf6qs/TS0601__TZE200_p3dbf6qs.json index 3b5d60962f..ca3c2e4101 100755 --- a/core/config/devices_local/TS0601__TZE200_p3dbf6qs/TS0601__TZE200_p3dbf6qs.json +++ b/core/config/devices_local/TS0601__TZE200_p3dbf6qs/TS0601__TZE200_p3dbf6qs.json @@ -2,27 +2,32 @@ "TS0601__TZE200_p3dbf6qs": { "manufacturer": "_TZE200_p3dbf6qs", "model": "TS0601", - "type": "Thermostatic head", + "type": "TRV06 Thermostatic head", "genericType": "Thermostat", "timeout": "60", "category": { "heating": "1" }, "configuration": { - "icon": "KETOTEK-ThermostaticHead", + "icon": "TRV06-ThermostaticHead", "mainEP": "01", "batteryType": "2x1.5 AA" }, "commands": { - "Groups": { - "use": "Group-Membership" - }, "Battery percent": { "use": "inf_zbAttr-0001-BatteryPercent" }, "Local temp": { "use": "inf_zbAttr-0402-MeasuredValue", "genericType": "THERMOSTAT_TEMPERATURE", + "isVisible": 1 + }, + "Chauffage": { + "use": "inf_generic-NumericBadge", + "logicalId": "01-chauffage", + "minValue": 0, + "maxValue": 1, + "unit": "", "isVisible": 1, "nextLine": "after" }, @@ -36,17 +41,52 @@ "isVisible": 1, "nextLine": "after" }, - "ECO mode": { + + "Mode": { + "use": "inf_generic-NumericBadge", + "logicalId": "01-Mode", + "isVisible": 1, + "nextLine": "after" + }, + "Auto": { "use": "act_tuyaEF00-SetValue", - "params": "dpId=6A&data=1", + "params": "dpId=02&data=00", "genericType": "THERMOSTAT_SET_MODE", - "isVisible": 0 + "isVisible": 1 }, - "ECO temp": { - "use": "inf_zbAttr-0402-MeasuredValue", - "logicalId": "01-ECO-temp", - "isVisible": 0 + "Heat": { + "use": "act_tuyaEF00-SetValue", + "params": "dpId=02&data=01", + "genericType": "THERMOSTAT_SET_MODE", + "isVisible": 1 }, + "OFF": { + "use": "act_tuyaEF00-SetValue", + "params": "dpId=02&data=02", + "genericType": "THERMOSTAT_SET_MODE", + "isVisible": 1, + "nextLine": "after" + }, + + "Locked": { + "use": "inf_generic-NumericBadge", + "logicalId": "01-Lock", + "isVisible": 1, + "nextLine": "after" + }, + "Lock": { + "use": "act_tuyaEF00-SetBool", + "params": "dpId=07&data=01", + "isVisible": 1 + }, + "UnLock": { + "use": "act_tuyaEF00-SetBool", + "params": "dpId=07&data=00", + "isVisible": 1, + "nextLine": "after" + }, + + "Set ECO temp": { "use": "act_tuyaEF00-Set-Setpoint", "params": "dpId=6B", @@ -54,7 +94,7 @@ "nextLine": "after" }, "Window-Detection": { - "use": "attr-Door-Status", + "use": "inf_Door-Status", "logicalId": "01-windowDetectionStatus", "nextLine": "after", "invertBinary": 0, @@ -68,18 +108,15 @@ "maxValue": 100, "unit": "%", "isVisible": 0 - }, - "Chauffage": { - "use": "inf_generic-NumericBadge", - "logicalId": "01-chauffage", - "minValue": 0, - "maxValue": 1, - "unit": "", - "isVisible": 1 } }, "tuyaEF00": { "fromDevice": { + "02": { + "function": "rcvThermostat-Mode", + "info": "01-Mode", + "comment": "Mode" + }, "03": { "function": "rcvValue0Is1", "info": "01-chauffage", @@ -95,6 +132,11 @@ "div": 10, "info": "0402-01-0000" }, + "07": { + "function": "rcvValue", + "info": "01-Lock", + "comment": "Kid Lock Status" + }, "09": { "function": "rcvValue", "info": "01-windowDetectionStatus" diff --git a/images/node_KETOTEK-ThermostaticHead.png b/images/node_TRV06-ThermostaticHead.png similarity index 100% rename from images/node_KETOTEK-ThermostaticHead.png rename to images/node_TRV06-ThermostaticHead.png