From 190d0265fc5552c8211d5a0aaa3acdb59bde51b7 Mon Sep 17 00:00:00 2001 From: asgothian <45667167+asgothian@users.noreply.github.com> Date: Thu, 26 Dec 2024 10:25:28 +0100 Subject: [PATCH 01/10] Latest Converters + Aqara Tests --- main.js | 2 +- package-lock.json | 2 +- package.json | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/main.js b/main.js index f6b86dde..8cfc35e2 100644 --- a/main.js +++ b/main.js @@ -765,7 +765,7 @@ class Zigbee extends utils.Adapter { const epName = stateDesc.epname !== undefined ? stateDesc.epname : (stateDesc.prop || stateDesc.id); const key = stateDesc.prop || stateDesc.id || stateDesc.setattr; this.log.debug(`convert ${key}, ${safeJsonStringify(preparedValue)}, ${safeJsonStringify(preparedOptions)}`); - if (has_elevated_debug) this.log.warn(`ELEVATED: convert ${key}, ${safeJsonStringify(preparedValue)}, ${safeJsonStringify(preparedOptions)} for device ${deviceId}`); + if (has_elevated_debug) this.log.warn(`ELEVATED: convert ${key}, ${safeJsonStringify(preparedValue)}, ${safeJsonStringify(preparedOptions)} for device ${deviceId} with Endpoint ${epName}`); let target; if (model === 'group') { diff --git a/package-lock.json b/package-lock.json index 736e06f2..3d37b2a4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "typescript": "^5.6.3", "uri-js": "^4.4.1", "zigbee-herdsman": "2.1.4", - "zigbee-herdsman-converters": "20.28.0" + "zigbee-herdsman-converters": "21.9.2" }, "devDependencies": { "@alcalzone/release-script": "^3.8.0", diff --git a/package.json b/package.json index 4f28d820..5ba78191 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "iobroker.zigbee", - "version": "1.10.13", + "version": "1.10.14", "author": { "name": "Kirov Ilya", "email": "kirovilya@gmail.com" @@ -29,7 +29,7 @@ "uri-js": "^4.4.1", "typescript": "^5.6.3", "zigbee-herdsman": "2.1.9", - "zigbee-herdsman-converters": "20.58.0" + "zigbee-herdsman-converters": "21.9.2" }, "description": "Zigbee devices", "devDependencies": { From 3c78551a90cd9d09cd546eb0a4d5d6670020d7ba Mon Sep 17 00:00:00 2001 From: asgothian <45667167+asgothian@users.noreply.github.com> Date: Thu, 26 Dec 2024 10:41:20 +0100 Subject: [PATCH 02/10] moreLogging --- main.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.js b/main.js index 8cfc35e2..f7514106 100644 --- a/main.js +++ b/main.js @@ -772,7 +772,9 @@ class Zigbee extends utils.Adapter { target = entity.mapped; } else { target = await this.zbController.resolveEntity(deviceId, epName); + if (has_elevated_debug) this.log.warn(`ELEVATED: Resolved target: ${safeJsonStringify(target)}`); target = target.endpoint; + if (has_elevated_debug) this.log.warn(`ELEVATED: selected endpoint of resolved Target: ${safeJsonStringify(target)}`); } this.log.debug(`target: ${safeJsonStringify(target)}`); From 0cca40ffa6101ba892ec0a4672d9a11ee47c6b04 Mon Sep 17 00:00:00 2001 From: asgothian <45667167+asgothian@users.noreply.github.com> Date: Thu, 26 Dec 2024 11:07:20 +0100 Subject: [PATCH 03/10] bugfix --- main.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index f7514106..10014af3 100644 --- a/main.js +++ b/main.js @@ -772,9 +772,12 @@ class Zigbee extends utils.Adapter { target = entity.mapped; } else { target = await this.zbController.resolveEntity(deviceId, epName); - if (has_elevated_debug) this.log.warn(`ELEVATED: Resolved target: ${safeJsonStringify(target)}`); + const targetID = (target.device ? target.device.ID : '-1'); target = target.endpoint; - if (has_elevated_debug) this.log.warn(`ELEVATED: selected endpoint of resolved Target: ${safeJsonStringify(target)}`); + const epID = (target.ID ? target.ID : '-1') + const epIEEE = (target.deviceIeeeAddress ? target.deviceIeeeAddress : '0x0') + if (has_elevated_debug) + this.log.warn(`ELEVATED: Target device ${epIEEE} (ID:${targetID}), EP ${epID}`); } this.log.debug(`target: ${safeJsonStringify(target)}`); From 6dfa0bf5c702ce3bb52dc7308134dcdf89873186 Mon Sep 17 00:00:00 2001 From: asgothian <45667167+asgothian@users.noreply.github.com> Date: Thu, 26 Dec 2024 21:40:19 +0100 Subject: [PATCH 04/10] Fix Lumi Button states Fix lumi button states for converters 21 --- lib/states.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/states.js b/lib/states.js index f4b6eb9f..6fa79cba 100644 --- a/lib/states.js +++ b/lib/states.js @@ -4937,7 +4937,7 @@ const states = { read: true, type: 'boolean', isEvent: true, - getter: payload => (payload.action === 'left') ? true : undefined, + getter: payload => (payload.action === 'left' || payload.action === 'single_left') ? true : undefined, }, lumi_right_click: { id: 'right_click', @@ -4949,7 +4949,7 @@ const states = { read: true, type: 'boolean', isEvent: true, - getter: payload => (payload.action === 'right') ? true : undefined, + getter: payload => (payload.action === 'right' || payload.action === 'single_right') ? true : undefined, }, lumi_both_click: { id: 'both_click', @@ -4961,7 +4961,7 @@ const states = { read: true, type: 'boolean', isEvent: true, - getter: payload => (payload.action === 'both') ? true : undefined, + getter: payload => (payload.action === 'both' || payload.action === 'single_both') ? true : undefined, }, lumi_left_click_long: { id: 'left_click_long', @@ -4973,7 +4973,7 @@ const states = { read: true, type: 'boolean', isEvent: true, - getter: payload => (payload.action === 'left_long') ? true : undefined, + getter: payload => (payload.action === 'left_long' || payload.action === 'hold_left') ? true : undefined, }, lumi_right_click_long: { id: 'right_click_long', @@ -4985,7 +4985,7 @@ const states = { read: true, type: 'boolean', isEvent: true, - getter: payload => (payload.action === 'right_long') ? true : undefined, + getter: payload => (payload.action === 'right_long' || payload.action === 'hold_right') ? true : undefined, }, lumi_left_click_double: { id: 'left_click_double', @@ -4997,7 +4997,7 @@ const states = { read: true, type: 'boolean', isEvent: true, - getter: payload => (payload.action === 'left_double') ? true : undefined, + getter: payload => (payload.action === 'left_double' || payload.action === 'double_left') ? true : undefined, }, lumi_right_click_double: { id: 'right_click_double', @@ -5009,7 +5009,7 @@ const states = { read: true, type: 'boolean', isEvent: true, - getter: payload => (payload.action === 'right_double') ? true : undefined, + getter: payload => (payload.action === 'right_double' || payload.action === 'double_right') ? true : undefined, }, lumi_both_click_long: { id: 'both_click_long', @@ -5021,7 +5021,7 @@ const states = { read: true, type: 'boolean', isEvent: true, - getter: payload => (payload.action === 'both_long') ? true : undefined, + getter: payload => (payload.action === 'both_long' || payload.action === 'hold_both') ? true : undefined, }, lumi_both_click_double: { id: 'both_click_double', @@ -5033,7 +5033,7 @@ const states = { read: true, type: 'boolean', isEvent: true, - getter: payload => (payload.action === 'both_double') ? true : undefined, + getter: payload => (payload.action === 'both_double' || payload.action === 'double_both') ? true : undefined, }, plug_summdelivered: { id: 'energy', From 993e6b8895d389404ced2090cc8850847cd6bec8 Mon Sep 17 00:00:00 2001 From: asgothian <45667167+asgothian@users.noreply.github.com> Date: Sat, 28 Dec 2024 15:43:45 +0100 Subject: [PATCH 05/10] fix hue_calibration --- lib/exposes.js | 1 + main.js | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/exposes.js b/lib/exposes.js index 3b2b150f..a7ad5db6 100644 --- a/lib/exposes.js +++ b/lib/exposes.js @@ -492,6 +492,7 @@ function createFromExposes(model, def) { hue_correction: hue_correction_table }; } + delete options.hue_calibration; } return {...options, transition: transitionTime}; }, diff --git a/main.js b/main.js index 10014af3..f36f79a3 100644 --- a/main.js +++ b/main.js @@ -752,6 +752,10 @@ class Zigbee extends utils.Adapter { const preparedValue = (stateDesc.setter) ? stateDesc.setter(value, options) : value; const preparedOptions = (stateDesc.setterOpt) ? stateDesc.setterOpt(value, options) : {}; + if (preparedOptions.hasOwnProperty('hue_calibration')) { + delete preparedOptions.hue_calibration; + } + let syncStateList = []; if (stateModel && stateModel.syncStates) { stateModel.syncStates.forEach(syncFunct => { @@ -782,7 +786,7 @@ class Zigbee extends utils.Adapter { this.log.debug(`target: ${safeJsonStringify(target)}`); - const meta = { + const meta = { endpoint_name: epName, options: preparedOptions, device: entity.device, From 1dbf7324ba1256a62d5d55bc43e5286796ea048c Mon Sep 17 00:00:00 2001 From: asgothian <45667167+asgothian@users.noreply.github.com> Date: Sun, 29 Dec 2024 15:04:32 +0100 Subject: [PATCH 06/10] Revert "fix hue_calibration" This reverts commit 993e6b8895d389404ced2090cc8850847cd6bec8. --- lib/exposes.js | 1 - main.js | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/exposes.js b/lib/exposes.js index a7ad5db6..3b2b150f 100644 --- a/lib/exposes.js +++ b/lib/exposes.js @@ -492,7 +492,6 @@ function createFromExposes(model, def) { hue_correction: hue_correction_table }; } - delete options.hue_calibration; } return {...options, transition: transitionTime}; }, diff --git a/main.js b/main.js index f36f79a3..10014af3 100644 --- a/main.js +++ b/main.js @@ -752,10 +752,6 @@ class Zigbee extends utils.Adapter { const preparedValue = (stateDesc.setter) ? stateDesc.setter(value, options) : value; const preparedOptions = (stateDesc.setterOpt) ? stateDesc.setterOpt(value, options) : {}; - if (preparedOptions.hasOwnProperty('hue_calibration')) { - delete preparedOptions.hue_calibration; - } - let syncStateList = []; if (stateModel && stateModel.syncStates) { stateModel.syncStates.forEach(syncFunct => { @@ -786,7 +782,7 @@ class Zigbee extends utils.Adapter { this.log.debug(`target: ${safeJsonStringify(target)}`); - const meta = { + const meta = { endpoint_name: epName, options: preparedOptions, device: entity.device, From c5998e7f4ae0fbc92aa7ff98293c746eb65b4dea Mon Sep 17 00:00:00 2001 From: asgothian <45667167+asgothian@users.noreply.github.com> Date: Sun, 29 Dec 2024 15:06:03 +0100 Subject: [PATCH 07/10] Revert "bugfix" This reverts commit 0cca40ffa6101ba892ec0a4672d9a11ee47c6b04. --- main.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/main.js b/main.js index 10014af3..f7514106 100644 --- a/main.js +++ b/main.js @@ -772,12 +772,9 @@ class Zigbee extends utils.Adapter { target = entity.mapped; } else { target = await this.zbController.resolveEntity(deviceId, epName); - const targetID = (target.device ? target.device.ID : '-1'); + if (has_elevated_debug) this.log.warn(`ELEVATED: Resolved target: ${safeJsonStringify(target)}`); target = target.endpoint; - const epID = (target.ID ? target.ID : '-1') - const epIEEE = (target.deviceIeeeAddress ? target.deviceIeeeAddress : '0x0') - if (has_elevated_debug) - this.log.warn(`ELEVATED: Target device ${epIEEE} (ID:${targetID}), EP ${epID}`); + if (has_elevated_debug) this.log.warn(`ELEVATED: selected endpoint of resolved Target: ${safeJsonStringify(target)}`); } this.log.debug(`target: ${safeJsonStringify(target)}`); From 17c29522e6b78237a0b13e99db3b667e293bb83b Mon Sep 17 00:00:00 2001 From: asgothian <45667167+asgothian@users.noreply.github.com> Date: Sun, 29 Dec 2024 15:07:36 +0100 Subject: [PATCH 08/10] Revert "moreLogging" This reverts commit 3c78551a90cd9d09cd546eb0a4d5d6670020d7ba. --- main.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/main.js b/main.js index f7514106..8cfc35e2 100644 --- a/main.js +++ b/main.js @@ -772,9 +772,7 @@ class Zigbee extends utils.Adapter { target = entity.mapped; } else { target = await this.zbController.resolveEntity(deviceId, epName); - if (has_elevated_debug) this.log.warn(`ELEVATED: Resolved target: ${safeJsonStringify(target)}`); target = target.endpoint; - if (has_elevated_debug) this.log.warn(`ELEVATED: selected endpoint of resolved Target: ${safeJsonStringify(target)}`); } this.log.debug(`target: ${safeJsonStringify(target)}`); From 9d77c9bf4e1e1845d9685af74726ef194ed3f7d5 Mon Sep 17 00:00:00 2001 From: asgothian <45667167+asgothian@users.noreply.github.com> Date: Sun, 29 Dec 2024 15:09:07 +0100 Subject: [PATCH 09/10] Revert "Latest Converters + Aqara Tests" This reverts commit 190d0265fc5552c8211d5a0aaa3acdb59bde51b7. --- main.js | 2 +- package-lock.json | 2 +- package.json | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/main.js b/main.js index 8cfc35e2..f6b86dde 100644 --- a/main.js +++ b/main.js @@ -765,7 +765,7 @@ class Zigbee extends utils.Adapter { const epName = stateDesc.epname !== undefined ? stateDesc.epname : (stateDesc.prop || stateDesc.id); const key = stateDesc.prop || stateDesc.id || stateDesc.setattr; this.log.debug(`convert ${key}, ${safeJsonStringify(preparedValue)}, ${safeJsonStringify(preparedOptions)}`); - if (has_elevated_debug) this.log.warn(`ELEVATED: convert ${key}, ${safeJsonStringify(preparedValue)}, ${safeJsonStringify(preparedOptions)} for device ${deviceId} with Endpoint ${epName}`); + if (has_elevated_debug) this.log.warn(`ELEVATED: convert ${key}, ${safeJsonStringify(preparedValue)}, ${safeJsonStringify(preparedOptions)} for device ${deviceId}`); let target; if (model === 'group') { diff --git a/package-lock.json b/package-lock.json index 3d37b2a4..736e06f2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "typescript": "^5.6.3", "uri-js": "^4.4.1", "zigbee-herdsman": "2.1.4", - "zigbee-herdsman-converters": "21.9.2" + "zigbee-herdsman-converters": "20.28.0" }, "devDependencies": { "@alcalzone/release-script": "^3.8.0", diff --git a/package.json b/package.json index 5ba78191..4f28d820 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "iobroker.zigbee", - "version": "1.10.14", + "version": "1.10.13", "author": { "name": "Kirov Ilya", "email": "kirovilya@gmail.com" @@ -29,7 +29,7 @@ "uri-js": "^4.4.1", "typescript": "^5.6.3", "zigbee-herdsman": "2.1.9", - "zigbee-herdsman-converters": "21.9.2" + "zigbee-herdsman-converters": "20.58.0" }, "description": "Zigbee devices", "devDependencies": { From 25d89b0f9d85eff21a9e76571cffb973bac8a718 Mon Sep 17 00:00:00 2001 From: asgothian <45667167+asgothian@users.noreply.github.com> Date: Sun, 29 Dec 2024 15:11:18 +0100 Subject: [PATCH 10/10] Revert "Fix Lumi Button states" This reverts commit 6dfa0bf5c702ce3bb52dc7308134dcdf89873186. --- lib/states.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/states.js b/lib/states.js index 6fa79cba..f4b6eb9f 100644 --- a/lib/states.js +++ b/lib/states.js @@ -4937,7 +4937,7 @@ const states = { read: true, type: 'boolean', isEvent: true, - getter: payload => (payload.action === 'left' || payload.action === 'single_left') ? true : undefined, + getter: payload => (payload.action === 'left') ? true : undefined, }, lumi_right_click: { id: 'right_click', @@ -4949,7 +4949,7 @@ const states = { read: true, type: 'boolean', isEvent: true, - getter: payload => (payload.action === 'right' || payload.action === 'single_right') ? true : undefined, + getter: payload => (payload.action === 'right') ? true : undefined, }, lumi_both_click: { id: 'both_click', @@ -4961,7 +4961,7 @@ const states = { read: true, type: 'boolean', isEvent: true, - getter: payload => (payload.action === 'both' || payload.action === 'single_both') ? true : undefined, + getter: payload => (payload.action === 'both') ? true : undefined, }, lumi_left_click_long: { id: 'left_click_long', @@ -4973,7 +4973,7 @@ const states = { read: true, type: 'boolean', isEvent: true, - getter: payload => (payload.action === 'left_long' || payload.action === 'hold_left') ? true : undefined, + getter: payload => (payload.action === 'left_long') ? true : undefined, }, lumi_right_click_long: { id: 'right_click_long', @@ -4985,7 +4985,7 @@ const states = { read: true, type: 'boolean', isEvent: true, - getter: payload => (payload.action === 'right_long' || payload.action === 'hold_right') ? true : undefined, + getter: payload => (payload.action === 'right_long') ? true : undefined, }, lumi_left_click_double: { id: 'left_click_double', @@ -4997,7 +4997,7 @@ const states = { read: true, type: 'boolean', isEvent: true, - getter: payload => (payload.action === 'left_double' || payload.action === 'double_left') ? true : undefined, + getter: payload => (payload.action === 'left_double') ? true : undefined, }, lumi_right_click_double: { id: 'right_click_double', @@ -5009,7 +5009,7 @@ const states = { read: true, type: 'boolean', isEvent: true, - getter: payload => (payload.action === 'right_double' || payload.action === 'double_right') ? true : undefined, + getter: payload => (payload.action === 'right_double') ? true : undefined, }, lumi_both_click_long: { id: 'both_click_long', @@ -5021,7 +5021,7 @@ const states = { read: true, type: 'boolean', isEvent: true, - getter: payload => (payload.action === 'both_long' || payload.action === 'hold_both') ? true : undefined, + getter: payload => (payload.action === 'both_long') ? true : undefined, }, lumi_both_click_double: { id: 'both_click_double', @@ -5033,7 +5033,7 @@ const states = { read: true, type: 'boolean', isEvent: true, - getter: payload => (payload.action === 'both_double' || payload.action === 'double_both') ? true : undefined, + getter: payload => (payload.action === 'both_double') ? true : undefined, }, plug_summdelivered: { id: 'energy',