From d53fc37b5e201a79936eadfa748fe5fa4f444723 Mon Sep 17 00:00:00 2001 From: lcheng33775823 Date: Tue, 27 Feb 2024 13:55:32 +0800 Subject: [PATCH 1/4] Added valveOpeningDegree and valveClosingDegree to TRVZB --- src/devices/sonoff.ts | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/devices/sonoff.ts b/src/devices/sonoff.ts index 9393165e462e2..546c16fac6de0 100644 --- a/src/devices/sonoff.ts +++ b/src/devices/sonoff.ts @@ -622,6 +622,32 @@ const definitions: Definition[] = [ unit: 'mV', access: 'STATE_GET', }), + numeric({ + name: 'valve_opening_degree(version >= v1.1.4)', + cluster: 0xFC11, + attribute: {ID: 0x600B, type: 0x20}, + description: 'Valve open position (percentage) control. ' + + 'If the opening degree is set to 100%, the valve is fully open when it is opened. If the opening degree is set to 0%, the valve is fully closed when it is opened, ' + + 'and the default value is 100%, ' + + 'The valve opening degree should be greater than or equal to the valve closing degree.', + valueMin: 0.0, + valueMax: 100.0, + valueStep: 1.0, + unit: '%', + }), + numeric({ + name: 'valve_closing_degree(version >= v1.1.4)', + cluster: 0xFC11, + attribute: {ID: 0x600C, type: 0x20}, + description: 'Valve closed position (percentage) control. ' + + 'If the closing degree is set to 100%, the valve is fully closed when it is closed. If the closing degree is set to 0%, the valve is fully opened when it is closed, ' + + 'and the default value is 100%. ' + + 'The valve opening degree should be greater than or equal to the valve closing degree.', + valueMin: 0.0, + valueMax: 100.0, + valueStep: 1.0, + unit: '%', + }), sonoffExtend.weeklySchedule(), customTimeResponse('1970_UTC'), ], @@ -632,7 +658,7 @@ const definitions: Definition[] = [ await reporting.thermostatOccupiedHeatingSetpoint(endpoint); await reporting.thermostatSystemMode(endpoint); await endpoint.read('hvacThermostat', ['localTemperatureCalibration']); - await endpoint.read(0xFC11, [0x0000, 0x6000, 0x6002, 0x6003, 0x6004, 0x6005, 0x6006, 0x6007]); + await endpoint.read(0xFC11, [0x0000, 0x6000, 0x6002, 0x6003, 0x6004, 0x6005, 0x6006, 0x6007, 0x600B, 0x600C]); }, }, { From 885ccf8ef9909875381d0b3173184200ef7262b3 Mon Sep 17 00:00:00 2001 From: lcheng33775823 Date: Tue, 27 Feb 2024 18:23:08 +0800 Subject: [PATCH 2/4] cancel readAtt --- src/devices/sonoff.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/devices/sonoff.ts b/src/devices/sonoff.ts index 546c16fac6de0..ce83ee3308b79 100644 --- a/src/devices/sonoff.ts +++ b/src/devices/sonoff.ts @@ -658,7 +658,7 @@ const definitions: Definition[] = [ await reporting.thermostatOccupiedHeatingSetpoint(endpoint); await reporting.thermostatSystemMode(endpoint); await endpoint.read('hvacThermostat', ['localTemperatureCalibration']); - await endpoint.read(0xFC11, [0x0000, 0x6000, 0x6002, 0x6003, 0x6004, 0x6005, 0x6006, 0x6007, 0x600B, 0x600C]); + await endpoint.read(0xFC11, [0x0000, 0x6000, 0x6002, 0x6003, 0x6004, 0x6005, 0x6006, 0x6007]); }, }, { From 187d7848d669c6777f40fc6fe458e1d86160b05e Mon Sep 17 00:00:00 2001 From: lcheng33775823 Date: Wed, 28 Feb 2024 10:58:09 +0800 Subject: [PATCH 3/4] fix rule errors --- src/devices/sonoff.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/devices/sonoff.ts b/src/devices/sonoff.ts index ce83ee3308b79..edbc017db43e8 100644 --- a/src/devices/sonoff.ts +++ b/src/devices/sonoff.ts @@ -626,8 +626,9 @@ const definitions: Definition[] = [ name: 'valve_opening_degree(version >= v1.1.4)', cluster: 0xFC11, attribute: {ID: 0x600B, type: 0x20}, - description: 'Valve open position (percentage) control. ' + - 'If the opening degree is set to 100%, the valve is fully open when it is opened. If the opening degree is set to 0%, the valve is fully closed when it is opened, ' + + description: 'Valve open position (percentage) control. ' + + 'If the opening degree is set to 100%, the valve is fully open when it is opened. ' + + 'If the opening degree is set to 0%, the valve is fully closed when it is opened, ' + 'and the default value is 100%, ' + 'The valve opening degree should be greater than or equal to the valve closing degree.', valueMin: 0.0, @@ -639,8 +640,9 @@ const definitions: Definition[] = [ name: 'valve_closing_degree(version >= v1.1.4)', cluster: 0xFC11, attribute: {ID: 0x600C, type: 0x20}, - description: 'Valve closed position (percentage) control. ' + - 'If the closing degree is set to 100%, the valve is fully closed when it is closed. If the closing degree is set to 0%, the valve is fully opened when it is closed, ' + + description: 'Valve closed position (percentage) control. ' + + 'If the closing degree is set to 100%, the valve is fully closed when it is closed. ' + + 'If the closing degree is set to 0%, the valve is fully opened when it is closed, ' + 'and the default value is 100%. ' + 'The valve opening degree should be greater than or equal to the valve closing degree.', valueMin: 0.0, From 220c31c6a49643bff789ea6c7a21e6f23eddda68 Mon Sep 17 00:00:00 2001 From: lcheng33775823 <1055446591@qq.com> Date: Wed, 17 Apr 2024 11:05:23 +0800 Subject: [PATCH 4/4] Change the description of TRVZB valve opening degree and closing degree --- src/devices/sonoff.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/devices/sonoff.ts b/src/devices/sonoff.ts index edbc017db43e8..48cccebcaf265 100644 --- a/src/devices/sonoff.ts +++ b/src/devices/sonoff.ts @@ -623,28 +623,28 @@ const definitions: Definition[] = [ access: 'STATE_GET', }), numeric({ - name: 'valve_opening_degree(version >= v1.1.4)', + name: 'valve_opening_degree', cluster: 0xFC11, attribute: {ID: 0x600B, type: 0x20}, description: 'Valve open position (percentage) control. ' + 'If the opening degree is set to 100%, the valve is fully open when it is opened. ' + 'If the opening degree is set to 0%, the valve is fully closed when it is opened, ' + - 'and the default value is 100%, ' + - 'The valve opening degree should be greater than or equal to the valve closing degree.', + 'and the default value is 100%. ' + + 'Note: only version v1.1.4 or higher is supported.', valueMin: 0.0, valueMax: 100.0, valueStep: 1.0, unit: '%', }), numeric({ - name: 'valve_closing_degree(version >= v1.1.4)', + name: 'valve_closing_degree', cluster: 0xFC11, attribute: {ID: 0x600C, type: 0x20}, description: 'Valve closed position (percentage) control. ' + 'If the closing degree is set to 100%, the valve is fully closed when it is closed. ' + 'If the closing degree is set to 0%, the valve is fully opened when it is closed, ' + 'and the default value is 100%. ' + - 'The valve opening degree should be greater than or equal to the valve closing degree.', + 'Note: Only version v1.1.4 or higher is supported.', valueMin: 0.0, valueMax: 100.0, valueStep: 1.0,