zigbee-herdsman-converters 14.0.409 → 14.0.410

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5168,8 +5168,16 @@ const converters = {
5168
5168
  aqara_opple: {
5169
5169
  cluster: 'aqaraOpple',
5170
5170
  type: ['attributeReport', 'readResponse'],
5171
- options: [exposes.options.precision('temperature'), exposes.options.calibration('temperature'),
5172
- exposes.options.precision('illuminance'), exposes.options.calibration('illuminance', 'percentual')],
5171
+ options: (definition) => {
5172
+ const result = [];
5173
+ if (definition.exposes.find((e) => e.name === 'temperature')) {
5174
+ result.push(exposes.options.precision('temperature'), exposes.options.calibration('temperature'));
5175
+ }
5176
+ if (definition.exposes.find((e) => e.name === 'illuminance')) {
5177
+ result.push(exposes.options.precision('illuminance'), exposes.options.calibration('illuminance', 'percentual'));
5178
+ }
5179
+ return result;
5180
+ },
5173
5181
  convert: (model, msg, publish, options, meta) => {
5174
5182
  const payload = {};
5175
5183
  if (msg.data.hasOwnProperty('247')) {
@@ -62,7 +62,7 @@ const gledoptoExtend = {
62
62
  }),
63
63
  };
64
64
 
65
- const configureReadModelID = async (device, coordinatorEndpoint, logger) => {
65
+ const configureReadModelID = async (device) => {
66
66
  // https://github.com/Koenkk/zigbee-herdsman-converters/issues/3016#issuecomment-1027726604
67
67
  const endpoint = device.endpoints[0];
68
68
  await endpoint.read('genBasic', ['modelId']);
@@ -122,8 +122,11 @@ module.exports = [
122
122
  vendor: 'Gledopto',
123
123
  ota: ota.zigbeeOTA,
124
124
  description: 'Zigbee LED Controller WW/CW (pro)',
125
- extend: gledoptoExtend.light_onoff_brightness_colortemp(),
126
- configure: configureReadModelID,
125
+ extend: gledoptoExtend.light_onoff_brightness_colortemp({noConfigure: true}),
126
+ configure: async (device, coordinatorEndpoint, logger) => {
127
+ await extend.light_onoff_brightness_colortemp().configure(device, coordinatorEndpoint, logger);
128
+ await configureReadModelID(device);
129
+ },
127
130
  },
128
131
  {
129
132
  fingerprint: [
@@ -186,8 +189,11 @@ module.exports = [
186
189
  vendor: 'Gledopto',
187
190
  ota: ota.zigbeeOTA,
188
191
  description: 'Zigbee LED Controller RGBW (pro)',
189
- extend: gledoptoExtend.light_onoff_brightness_colortemp_color(),
190
- configure: configureReadModelID,
192
+ extend: gledoptoExtend.light_onoff_brightness_colortemp_color({noConfigure: true}),
193
+ configure: async (device, coordinatorEndpoint, logger) => {
194
+ await extend.light_onoff_brightness_colortemp_color().configure(device, coordinatorEndpoint, logger);
195
+ await configureReadModelID(device);
196
+ },
191
197
  },
192
198
  {
193
199
  fingerprint: [
@@ -245,8 +251,11 @@ module.exports = [
245
251
  vendor: 'Gledopto',
246
252
  ota: ota.zigbeeOTA,
247
253
  description: 'Zigbee LED Controller RGB (pro)',
248
- extend: gledoptoExtend.light_onoff_brightness_color(),
249
- configure: configureReadModelID,
254
+ extend: gledoptoExtend.light_onoff_brightness_color({noConfigure: true}),
255
+ configure: async (device, coordinatorEndpoint, logger) => {
256
+ await extend.light_onoff_brightness_color().configure(device, coordinatorEndpoint, logger);
257
+ await configureReadModelID(device);
258
+ },
250
259
  },
251
260
  {
252
261
  zigbeeModel: ['GL-C-008P'],
@@ -254,9 +263,12 @@ module.exports = [
254
263
  vendor: 'Gledopto',
255
264
  ota: ota.zigbeeOTA,
256
265
  description: 'Zigbee LED Controller RGB+CCT (pro)',
257
- extend: gledoptoExtend.light_onoff_brightness_colortemp_color({colorTempRange: [158, 495]}),
266
+ extend: gledoptoExtend.light_onoff_brightness_colortemp_color({colorTempRange: [158, 495], noConfigure: true}),
258
267
  meta: {disableDefaultResponse: true},
259
- configure: configureReadModelID,
268
+ configure: async (device, coordinatorEndpoint, logger) => {
269
+ await extend.light_onoff_brightness_colortemp_color().configure(device, coordinatorEndpoint, logger);
270
+ await configureReadModelID(device);
271
+ },
260
272
  },
261
273
  {
262
274
  zigbeeModel: ['GL-C-009'],
@@ -277,8 +289,11 @@ module.exports = [
277
289
  vendor: 'Gledopto',
278
290
  ota: ota.zigbeeOTA,
279
291
  description: 'Zigbee LED Controller W (pro)',
280
- extend: gledoptoExtend.light_onoff_brightness(),
281
- configure: configureReadModelID,
292
+ extend: gledoptoExtend.light_onoff_brightness({noConfigure: true}),
293
+ configure: async (device, coordinatorEndpoint, logger) => {
294
+ await extend.light_onoff_brightness().configure(device, coordinatorEndpoint, logger);
295
+ await configureReadModelID(device);
296
+ },
282
297
  },
283
298
  {
284
299
  zigbeeModel: ['GL-C-009S'],
@@ -29,7 +29,7 @@ module.exports = [
29
29
  description: 'Smart power strip',
30
30
  extend: extend.switch(),
31
31
  configure: async (device, coordinatorEndpoint, logger) => {
32
- const endpoint = device.getEndpoint(11);
32
+ const endpoint = device.getEndpoint(11) || device.getEndpoint(1);
33
33
  await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']);
34
34
  await reporting.onOff(endpoint);
35
35
  },
@@ -96,7 +96,8 @@ module.exports = [
96
96
  toZigbee: extend.light_onoff_brightness_colortemp_color().toZigbee.concat([tz.tint_scene]),
97
97
  },
98
98
  {
99
- zigbeeModel: ['ZBT-Remote-ALL-RGBW'],
99
+ fingerprint: [{manufacturerName: '_TZ3000_bdbb0fon'}],
100
+ zigbeeModel: ['ZBT-Remote-ALL-RGBW', 'TS1001'],
100
101
  model: 'MLI-404011',
101
102
  description: 'Tint remote control',
102
103
  vendor: 'Müller Licht',
@@ -45,4 +45,11 @@ module.exports = [
45
45
  description: 'LED bulb GU10 350 lumen, dimmable, color, white 2700-6500K',
46
46
  extend: extend.light_onoff_brightness_colortemp({colorTempRange: [153, 370]}),
47
47
  },
48
+ {
49
+ zigbeeModel: ['ZBT-DIMLight-GU100800'],
50
+ model: 'HAL400',
51
+ vendor: 'Schwaiger',
52
+ description: 'LED Schwaiger HAL400 GU10 dimmable, warm white',
53
+ extend: extend.light_onoff_brightness(),
54
+ },
48
55
  ];
@@ -60,13 +60,20 @@ module.exports = [
60
60
  model: 'E11-G13',
61
61
  vendor: 'Sengled',
62
62
  description: 'Element classic (A19)',
63
- extend: extend.light_onoff_brightness({noConfigure: true}),
64
- ota: ota.zigbeeOTA,
63
+ fromZigbee: extend.light_onoff_brightness().fromZigbee.concat([fz.metering]),
64
+ toZigbee: extend.light_onoff_brightness().toZigbee,
65
65
  configure: async (device, coordinatorEndpoint, logger) => {
66
66
  await extend.light_onoff_brightness().configure(device, coordinatorEndpoint, logger);
67
67
  device.powerSource = 'Mains (single phase)';
68
68
  device.save();
69
+
70
+ const endpoint = device.getEndpoint(1);
71
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'seMetering']);
72
+ await reporting.readMeteringMultiplierDivisor(endpoint);
73
+ await reporting.currentSummDelivered(endpoint);
74
+ await reporting.instantaneousDemand(endpoint);
69
75
  },
76
+ exposes: [e.power(), e.energy(), e.light_brightness()],
70
77
  },
71
78
  {
72
79
  zigbeeModel: ['E11-G23', 'E11-G33'],
@@ -103,7 +103,7 @@ module.exports = [
103
103
  },
104
104
  },
105
105
  {
106
- zigbeeModel: ['ON/OFF', 'ZIGBEE-SWITCH'],
106
+ zigbeeModel: ['ON/OFF -M', 'ON/OFF', 'ZIGBEE-SWITCH'],
107
107
  model: 'ZG9101SAC-HP-Switch',
108
108
  vendor: 'Sunricher',
109
109
  description: 'Zigbee AC in wall switch',
package/devices/tuya.js CHANGED
@@ -12,7 +12,7 @@ const utils = require('../lib/utils');
12
12
 
13
13
  const TS011Fplugs = ['_TZ3000_5f43h46b', '_TZ3000_cphmq0q7', '_TZ3000_dpo1ysak', '_TZ3000_ew3ldmgx', '_TZ3000_gjnozsaz',
14
14
  '_TZ3000_jvzvulen', '_TZ3000_mraovvmm', '_TZ3000_nfnmi125', '_TZ3000_ps3dmato', '_TZ3000_w0qqde0g', '_TZ3000_u5u4cakc',
15
- '_TZ3000_rdtixbnu', '_TZ3000_typdpbpg'];
15
+ '_TZ3000_rdtixbnu', '_TZ3000_typdpbpg', '_TZ3000_2xlvlnez'];
16
16
 
17
17
  const tzLocal = {
18
18
  TS0504B_color: {
package/devices/xiaomi.js CHANGED
@@ -1174,8 +1174,8 @@ module.exports = [
1174
1174
  exposes.enum('mute_buzzer', ea.SET, ['Mute']).withDescription('Mute the buzzer for 10 minutes (buzzer cannot be ' +
1175
1175
  'pre-muted, because this function only works when the alarm is triggered)'),
1176
1176
  exposes.binary('mute', ea.STATE_GET, true, false).withDescription('Buzzer muted'),
1177
- exposes.switch().withState('linkage_alarm', true, 'After being turned on, one of the devices triggers the ' +
1178
- 'natural gas leakage alarm, and other devices with linkage turned on', ea.ALL, true, false),
1177
+ exposes.binary('linkage_alarm', ea.ALL, true, false).withDescription('When this option is enabled and a gas leak ' +
1178
+ 'is detected, other detectors with this option enabled will also sound the alarm buzzer'),
1179
1179
  exposes.binary('state', ea.STATE_GET, 'preparation', 'work').withDescription('"Preparation" or "work" ' +
1180
1180
  '(measurement of the gas concentration value and triggering of an alarm are only performed in the "work" state)'),
1181
1181
  exposes.numeric('power_outage_count', ea.STATE_GET).withDescription('Number of power outages (since last pairing)')],
@@ -1289,7 +1289,7 @@ module.exports = [
1289
1289
  model: 'LLKZMK11LM',
1290
1290
  vendor: 'Xiaomi',
1291
1291
  description: 'Aqara wireless relay controller',
1292
- fromZigbee: [fz.xiaomi_switch_basic, fz.xiaomi_power, fz.ignore_multistate_report, fz.on_off],
1292
+ fromZigbee: [fz.xiaomi_switch_basic, fz.xiaomi_power, fz.ignore_multistate_report, fz.on_off, fz.aqara_opple],
1293
1293
  meta: {multiEndpoint: true},
1294
1294
  toZigbee: [tz.on_off, tz.LLKZMK11LM_interlock, tz.xiaomi_power],
1295
1295
  endpoint: (device) => {
@@ -1597,7 +1597,8 @@ module.exports = [
1597
1597
  e.battery(), e.battery_voltage(), e.action([
1598
1598
  'single_left', 'single_right', 'single_both',
1599
1599
  'double_left', 'double_right', 'double_both',
1600
- 'triple_left', 'triple_right', 'triple_both']),
1600
+ 'triple_left', 'triple_right', 'triple_both',
1601
+ 'hold_left', 'hold_right', 'hold_both']),
1601
1602
  exposes.enum('click_mode', ea.ALL, ['fast', 'multi'])
1602
1603
  .withDescription('Click mode, fast: only supports single click which will be send immediately after clicking.' +
1603
1604
  'multi: supports more events like double and hold'),
package/index.js CHANGED
@@ -62,7 +62,7 @@ function addDefinition(definition) {
62
62
  const {extend, ...definitionWithoutExtend} = definition;
63
63
  if (extend) {
64
64
  if (extend.hasOwnProperty('configure') && definition.hasOwnProperty('configure')) {
65
- console.log(`'${definition.model}' has configure in extend and device, this is not allowed`);
65
+ assert.fail(`'${definition.model}' has configure in extend and device, this is not allowed`);
66
66
  }
67
67
 
68
68
  definition = {
@@ -89,7 +89,8 @@ function addDefinition(definition) {
89
89
  const optionKeys = definition.options.map((o) => o.name);
90
90
  for (const converter of [...definition.toZigbee, ...definition.fromZigbee]) {
91
91
  if (converter.options) {
92
- for (const option of converter.options) {
92
+ const options = typeof converter.options === 'function' ? converter.options(definition) : converter.options;
93
+ for (const option of options) {
93
94
  if (!optionKeys.includes(option.name)) {
94
95
  definition.options.push(option);
95
96
  optionKeys.push(option.name);
package/lib/extend.js CHANGED
@@ -58,12 +58,14 @@ const extend = {
58
58
  tz.light_brightness_step, tz.level_config, tz.power_on_behavior, tz.light_hue_saturation_move,
59
59
  tz.light_hue_saturation_step, tz.light_color_options, tz.light_color_mode, ...(!options.disableEffect ? [tz.effect] : [])];
60
60
 
61
- return {
62
- exposes, fromZigbee, toZigbee,
63
- configure: async (device, coordinatorEndpoint, logger) => {
61
+ const result = {exposes, fromZigbee, toZigbee};
62
+ if (!options.noConfigure) {
63
+ result.configure = async (device, coordinatorEndpoint, logger) => {
64
64
  await light.configure(device, coordinatorEndpoint, logger, false);
65
- },
66
- };
65
+ };
66
+ }
67
+
68
+ return result;
67
69
  },
68
70
  light_onoff_brightness_colortemp_color: (options={}) => {
69
71
  options = {disableEffect: false, supportsHS: false, disableColorTempStartup: false, preferHS: false, ...options};
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zigbee-herdsman-converters",
3
- "version": "14.0.409",
3
+ "version": "14.0.410",
4
4
  "lockfileVersion": 1,
5
5
  "requires": true,
6
6
  "dependencies": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zigbee-herdsman-converters",
3
- "version": "14.0.409",
3
+ "version": "14.0.410",
4
4
  "description": "Collection of device converters to be used with zigbee-herdsman",
5
5
  "main": "index.js",
6
6
  "files": [