From d3a2328ddb1895d2a9638039c9ed2d695ec872c2 Mon Sep 17 00:00:00 2001 From: Backup7750 <132698671+Backup7750@users.noreply.github.com> Date: Tue, 20 Jun 2023 22:36:57 +0200 Subject: [PATCH 1/5] add support for phoscon hive please review, this is my first addon for zigbee2mqtt and my first commit in github. (worked for me as external addon in zigbee2mqtt) --- src/devices/dresden_elektronik.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/devices/dresden_elektronik.ts b/src/devices/dresden_elektronik.ts index a8aab1668d2fe..3a4369753e781 100644 --- a/src/devices/dresden_elektronik.ts +++ b/src/devices/dresden_elektronik.ts @@ -32,6 +32,13 @@ const definitions: Definition[] = [ extend: extend.light_onoff_brightness(), ota: ota.zigbeeOTA, }, + { + zigbeeModel: ['Hive'], // The model ID from: Device with modelID 'lumi.sens' is not supported. + model: 'Hive', // Vendor model number, look on the device for a model number + vendor: 'Phoscon', // Vendor of the device (only used for documentation and startup logging) + description: 'Phoscon Hive battery powered smart LED light', // Description of the device, copy from vendor site. (only used for documentation and startup logging) + extend: extend.light_onoff_brightness_colortemp_color(), + }, { zigbeeModel: ['FLS-A lp (1-10V)'], model: 'BN-600078', From bc762245e610e890e1ca916845f8ee928f7e88d4 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Fri, 23 Jun 2023 17:38:04 +0200 Subject: [PATCH 2/5] Update dresden_elektronik.ts --- src/devices/dresden_elektronik.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/devices/dresden_elektronik.ts b/src/devices/dresden_elektronik.ts index 3a4369753e781..f5667feb6f7ba 100644 --- a/src/devices/dresden_elektronik.ts +++ b/src/devices/dresden_elektronik.ts @@ -33,10 +33,10 @@ const definitions: Definition[] = [ ota: ota.zigbeeOTA, }, { - zigbeeModel: ['Hive'], // The model ID from: Device with modelID 'lumi.sens' is not supported. - model: 'Hive', // Vendor model number, look on the device for a model number - vendor: 'Phoscon', // Vendor of the device (only used for documentation and startup logging) - description: 'Phoscon Hive battery powered smart LED light', // Description of the device, copy from vendor site. (only used for documentation and startup logging) + zigbeeModel: ['Hive'], + model: 'Hive', + vendor: 'Phoscon', + description: 'Battery powered smart LED light', extend: extend.light_onoff_brightness_colortemp_color(), }, { From fe41ff9b8b8b4f59bb67f1d6a8f1e2de9b716b27 Mon Sep 17 00:00:00 2001 From: Backup7750 <132698671+Backup7750@users.noreply.github.com> Date: Sun, 25 Jun 2023 12:21:19 +0200 Subject: [PATCH 3/5] add color Temperature add the physical color temp range to phoscon Hive Read result of 'lightingColorCtrl': {"colorTempPhysicalMin":153,"colorTempPhysicalMax":370} --- src/devices/dresden_elektronik.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/devices/dresden_elektronik.ts b/src/devices/dresden_elektronik.ts index f5667feb6f7ba..56bbfae27bb09 100644 --- a/src/devices/dresden_elektronik.ts +++ b/src/devices/dresden_elektronik.ts @@ -37,7 +37,7 @@ const definitions: Definition[] = [ model: 'Hive', vendor: 'Phoscon', description: 'Battery powered smart LED light', - extend: extend.light_onoff_brightness_colortemp_color(), + extend: extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 370]}), }, { zigbeeModel: ['FLS-A lp (1-10V)'], From 69850d30f24caf1c140aecb8281dcf8c0e8fb463 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sun, 25 Jun 2023 15:14:00 +0200 Subject: [PATCH 4/5] Update dresden_elektronik.ts --- src/devices/dresden_elektronik.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/devices/dresden_elektronik.ts b/src/devices/dresden_elektronik.ts index 56bbfae27bb09..495b8367264e8 100644 --- a/src/devices/dresden_elektronik.ts +++ b/src/devices/dresden_elektronik.ts @@ -1,6 +1,8 @@ import {Definition} from '../lib/types'; import * as exposes from '../lib/exposes'; +import * as fz from '../converters/fromZigbee'; import * as ota from '../lib/ota'; +import * as reporting from '../lib/reporting'; import extend from '../lib/extend'; const e = exposes.presets; @@ -37,7 +39,13 @@ const definitions: Definition[] = [ model: 'Hive', vendor: 'Phoscon', description: 'Battery powered smart LED light', - extend: extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 370]}), + ota: ota.zigbeeOTA, + extend: extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 370], fromZigbee: [fz.battery], exposes: [e.battery()]}), + configure: async (device, coordinatorEndpoint, logger) => { + const endpoint = device.getEndpoint(1); + await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg']); + await reporting.batteryPercentageRemaining(endpoint); + }, }, { zigbeeModel: ['FLS-A lp (1-10V)'], From 6122d789938c10fa613571eb710600036f275e9a Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sun, 25 Jun 2023 19:33:56 +0200 Subject: [PATCH 5/5] Update dresden_elektronik.ts --- src/devices/dresden_elektronik.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/devices/dresden_elektronik.ts b/src/devices/dresden_elektronik.ts index 495b8367264e8..9174750670a6f 100644 --- a/src/devices/dresden_elektronik.ts +++ b/src/devices/dresden_elektronik.ts @@ -40,8 +40,10 @@ const definitions: Definition[] = [ vendor: 'Phoscon', description: 'Battery powered smart LED light', ota: ota.zigbeeOTA, - extend: extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 370], fromZigbee: [fz.battery], exposes: [e.battery()]}), + extend: extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 370], fromZigbee: [fz.battery], exposes: [e.battery()], + noConfigure: true}), configure: async (device, coordinatorEndpoint, logger) => { + await extend.light_onoff_brightness_colortemp_color().configure(device, coordinatorEndpoint, logger); const endpoint = device.getEndpoint(1); await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg']); await reporting.batteryPercentageRemaining(endpoint);