zigbee-herdsman-converters 14.0.524 → 14.0.527

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.
@@ -3,27 +3,31 @@ const fz = {...require('../converters/fromZigbee'), legacy: require('../lib/lega
3
3
  const tz = require('../converters/toZigbee');
4
4
  const ota = require('../lib/ota');
5
5
  const reporting = require('../lib/reporting');
6
- const extend = require('../lib/extend');
7
6
  const e = exposes.presets;
8
7
  const ea = exposes.access;
9
8
 
9
+ // Make sure extend.light_* is not used (hueExtend should be used instead)
10
+ const extendDontUse = require('../lib/extend');
11
+ const extend = {switch: extendDontUse.switch};
12
+
10
13
  const hueExtend = {
11
14
  light_onoff_brightness: (options={}) => ({
12
- ...extend.light_onoff_brightness(options),
13
- toZigbee: extend.light_onoff_brightness(options).toZigbee.concat([tz.hue_power_on_behavior, tz.hue_power_on_error]),
15
+ ...extendDontUse.light_onoff_brightness(options),
16
+ toZigbee: extendDontUse.light_onoff_brightness(options).toZigbee.concat([tz.hue_power_on_behavior, tz.hue_power_on_error]),
14
17
  }),
15
18
  light_onoff_brightness_colortemp: (options={}) => ({
16
- ...extend.light_onoff_brightness_colortemp(options),
17
- toZigbee: extend.light_onoff_brightness_colortemp(options).toZigbee.concat([tz.hue_power_on_behavior, tz.hue_power_on_error]),
19
+ ...extendDontUse.light_onoff_brightness_colortemp(options),
20
+ toZigbee: extendDontUse.light_onoff_brightness_colortemp(options).toZigbee
21
+ .concat([tz.hue_power_on_behavior, tz.hue_power_on_error]),
18
22
  }),
19
23
  light_onoff_brightness_color: (options={}) => ({
20
- ...extend.light_onoff_brightness_color({supportsHS: true, ...options}),
21
- toZigbee: extend.light_onoff_brightness_color({supportsHS: true, ...options}).toZigbee
24
+ ...extendDontUse.light_onoff_brightness_color({supportsHS: true, ...options}),
25
+ toZigbee: extendDontUse.light_onoff_brightness_color({supportsHS: true, ...options}).toZigbee
22
26
  .concat([tz.hue_power_on_behavior, tz.hue_power_on_error]),
23
27
  }),
24
28
  light_onoff_brightness_colortemp_color: (options={}) => ({
25
- ...extend.light_onoff_brightness_colortemp_color({supportsHS: true, ...options}),
26
- toZigbee: extend.light_onoff_brightness_colortemp_color({supportsHS: true, ...options})
29
+ ...extendDontUse.light_onoff_brightness_colortemp_color({supportsHS: true, ...options}),
30
+ toZigbee: extendDontUse.light_onoff_brightness_colortemp_color({supportsHS: true, ...options})
27
31
  .toZigbee.concat([tz.hue_power_on_behavior, tz.hue_power_on_error]),
28
32
  }),
29
33
  };
@@ -34,7 +38,7 @@ module.exports = [
34
38
  model: '929003055801',
35
39
  vendor: 'Philips',
36
40
  description: 'Hue white ambiance bathroom ceiling light Adore with Bluetooth',
37
- extend: extend.light_onoff_brightness_colortemp({colorTempRange: [153, 454]}),
41
+ extend: hueExtend.light_onoff_brightness_colortemp({colorTempRange: [153, 454]}),
38
42
  },
39
43
  {
40
44
  zigbeeModel: ['929003045301_01', '929003045301_02', '929003045301_03'],
@@ -69,7 +73,7 @@ module.exports = [
69
73
  vendor: 'Philips',
70
74
  description: 'Hue white A60 bulb B22 1055lm with Bluetooth',
71
75
  meta: {turnsOffAtBrightness1: true},
72
- extend: extend.light_onoff_brightness(),
76
+ extend: hueExtend.light_onoff_brightness(),
73
77
  ota: ota.zigbeeOTA,
74
78
  },
75
79
  {
@@ -117,6 +121,15 @@ module.exports = [
117
121
  extend: hueExtend.light_onoff_brightness_colortemp({colorTempRange: [153, 454]}),
118
122
  ota: ota.zigbeeOTA,
119
123
  },
124
+ {
125
+ zigbeeModel: ['915005996601'],
126
+ model: '915005996601',
127
+ vendor: 'Philips',
128
+ description: 'Hue white ambiance ceiling white Enrave M with Bluetooth',
129
+ meta: {turnsOffAtBrightness1: true},
130
+ extend: hueExtend.light_onoff_brightness_colortemp({colorTempRange: [153, 454]}),
131
+ ota: ota.zigbeeOTA,
132
+ },
120
133
  {
121
134
  zigbeeModel: ['915005996801', '915005996901'],
122
135
  model: '915005996901',
@@ -159,7 +172,7 @@ module.exports = [
159
172
  vendor: 'Philips',
160
173
  description: 'Hue Wellness table lamp',
161
174
  meta: {turnsOffAtBrightness1: true},
162
- extend: extend.light_onoff_brightness_colortemp({colorTempRange: [153, 454]}),
175
+ extend: hueExtend.light_onoff_brightness_colortemp({colorTempRange: [153, 454]}),
163
176
  ota: ota.zigbeeOTA,
164
177
  },
165
178
  {
@@ -168,7 +181,7 @@ module.exports = [
168
181
  vendor: 'Philips',
169
182
  description: 'Hue white ambiance suspension Cher with bluetooth 3000lm',
170
183
  meta: {turnsOffAtBrightness1: true},
171
- extend: extend.light_onoff_brightness_colortemp({colorTempRange: [153, 500]}),
184
+ extend: hueExtend.light_onoff_brightness_colortemp({colorTempRange: [153, 500]}),
172
185
  ota: ota.zigbeeOTA,
173
186
  },
174
187
  {
@@ -177,7 +190,7 @@ module.exports = [
177
190
  vendor: 'Philips',
178
191
  description: 'Hue White Ambiance Cher Pendant',
179
192
  meta: {turnsOffAtBrightness1: true},
180
- extend: extend.light_onoff_brightness_colortemp({colorTempRange: [153, 454]}),
193
+ extend: hueExtend.light_onoff_brightness_colortemp({colorTempRange: [153, 454]}),
181
194
  ota: ota.zigbeeOTA,
182
195
  },
183
196
  {
@@ -221,7 +234,7 @@ module.exports = [
221
234
  model: '3418931P6',
222
235
  vendor: 'Philips',
223
236
  description: 'Hue white ambiance Struana bathroom ceiling with bluetooth 2400lm',
224
- extend: extend.light_onoff_brightness_colortemp({colorTempRange: [153, 500]}),
237
+ extend: hueExtend.light_onoff_brightness_colortemp({colorTempRange: [153, 500]}),
225
238
  ota: ota.zigbeeOTA,
226
239
  },
227
240
  {
@@ -398,7 +411,15 @@ module.exports = [
398
411
  model: '929003055901',
399
412
  vendor: 'Philips',
400
413
  description: 'Hue white ambiance bathroom ceiling light Adore with Bluetooth',
401
- extend: extend.light_onoff_brightness_colortemp({colorTempRange: [153, 454]}),
414
+ extend: hueExtend.light_onoff_brightness_colortemp({colorTempRange: [153, 454]}),
415
+ ota: ota.zigbeeOTA,
416
+ },
417
+ {
418
+ zigbeeModel: ['7602031N6'],
419
+ model: '7602031N6',
420
+ vendor: 'Philips',
421
+ description: 'Hue Go portable light',
422
+ extend: hueExtend.light_onoff_brightness_colortemp({colorTempRange: [153, 500]}),
402
423
  ota: ota.zigbeeOTA,
403
424
  },
404
425
  {
@@ -465,7 +486,7 @@ module.exports = [
465
486
  ota: ota.zigbeeOTA,
466
487
  },
467
488
  {
468
- zigbeeModel: ['LCT026', '7602031P7', '7602031U7', '7602031N6'],
489
+ zigbeeModel: ['LCT026', '7602031P7', '7602031U7'],
469
490
  model: '7602031P7',
470
491
  vendor: 'Philips',
471
492
  description: 'Hue Go with Bluetooth',
@@ -747,7 +768,7 @@ module.exports = [
747
768
  vendor: 'Philips',
748
769
  description: 'Hue white A60 bulb E27 1050lm with Bluetooth',
749
770
  meta: {turnsOffAtBrightness1: true},
750
- extend: extend.light_onoff_brightness(),
771
+ extend: hueExtend.light_onoff_brightness(),
751
772
  ota: ota.zigbeeOTA,
752
773
  },
753
774
  {
@@ -1411,7 +1432,7 @@ module.exports = [
1411
1432
  model: '929003054101',
1412
1433
  vendor: 'Philips',
1413
1434
  description: 'Hue Wellner white ambiance E27 806lm with Bluetooth',
1414
- extend: extend.light_onoff_brightness_colortemp({colorTempRange: [153, 454]}),
1435
+ extend: hueExtend.light_onoff_brightness_colortemp({colorTempRange: [153, 454]}),
1415
1436
  },
1416
1437
  {
1417
1438
  zigbeeModel: ['3261330P6'],
@@ -2355,7 +2376,18 @@ module.exports = [
2355
2376
  model: '929003055201',
2356
2377
  vendor: 'Philips',
2357
2378
  description: 'Hue Being',
2358
- extend: extend.light_onoff_brightness_colortemp({colorTempRange: [153, 454]}),
2379
+ extend: hueExtend.light_onoff_brightness_colortemp({colorTempRange: [153, 454]}),
2380
+ ota: ota.zigbeeOTA,
2381
+ meta: {turnsOffAtBrightness1: true},
2382
+ },
2383
+ {
2384
+ zigbeeModel: ['4100448U9'],
2385
+ model: '4100448U9',
2386
+ vendor: 'Philips',
2387
+ description: 'Hue Being',
2388
+ extend: hueExtend.light_onoff_brightness_colortemp({colorTempRange: [153, 454]}),
2389
+ ota: ota.zigbeeOTA,
2390
+ meta: {turnsOffAtBrightness1: true},
2359
2391
  },
2360
2392
  {
2361
2393
  zigbeeModel: ['1743630P7', '1743630V7'],
@@ -2804,7 +2836,7 @@ module.exports = [
2804
2836
  vendor: 'Philips',
2805
2837
  description: 'Hue White & Color Ambiance Xamento M',
2806
2838
  meta: {turnsOffAtBrightness1: true},
2807
- extend: extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
2839
+ extend: hueExtend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
2808
2840
  ota: ota.zigbeeOTA,
2809
2841
  },
2810
2842
  {
@@ -2813,7 +2845,7 @@ module.exports = [
2813
2845
  vendor: 'Philips',
2814
2846
  description: 'Hue White & Color Ambiance Surimu square panel',
2815
2847
  meta: {turnsOffAtBrightness1: true},
2816
- extend: extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
2848
+ extend: hueExtend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
2817
2849
  ota: ota.zigbeeOTA,
2818
2850
  },
2819
2851
  {
@@ -2971,7 +3003,7 @@ module.exports = [
2971
3003
  vendor: 'Philips',
2972
3004
  description: 'Hue white ambiance GU10 with Bluetooth',
2973
3005
  meta: {turnsOffAtBrightness1: true},
2974
- extend: extend.light_onoff_brightness_colortemp({colorTempRange: [153, 454]}),
3006
+ extend: hueExtend.light_onoff_brightness_colortemp({colorTempRange: [153, 454]}),
2975
3007
  ota: ota.zigbeeOTA,
2976
3008
  },
2977
3009
  {
@@ -2980,7 +3012,7 @@ module.exports = [
2980
3012
  vendor: 'Philips',
2981
3013
  description: 'Hue white ambiance bathroom recessed downlight Adore with Bluetooth',
2982
3014
  meta: {turnsOffAtBrightness1: true},
2983
- extend: extend.light_onoff_brightness_colortemp({colorTempRange: [153, 454]}),
3015
+ extend: hueExtend.light_onoff_brightness_colortemp({colorTempRange: [153, 454]}),
2984
3016
  ota: ota.zigbeeOTA,
2985
3017
  },
2986
3018
  {
package/devices/tuya.js CHANGED
@@ -2373,5 +2373,37 @@ module.exports = [
2373
2373
  .withDescription('PIR keep time in seconds (refresh and update only while active)'),
2374
2374
  ],
2375
2375
  },
2376
-
2376
+ {
2377
+ fingerprint: [{modelID: 'TS004F', manufacturerName: '_TZ3000_kjfzuycl'}],
2378
+ model: 'ERS-10TZBVB-AA',
2379
+ vendor: 'TuYa',
2380
+ description: 'Smart button',
2381
+ fromZigbee: [
2382
+ fz.command_step, fz.command_on, fz.command_off, fz.command_move_to_color_temp, fz.command_move_to_level,
2383
+ fz.tuya_multi_action, fz.tuya_operation_mode, fz.battery,
2384
+ ],
2385
+ toZigbee: [tz.tuya_operation_mode],
2386
+ exposes: [
2387
+ e.action([
2388
+ 'single', 'double', 'hold', 'brightness_move_to_level', 'color_temperature_move',
2389
+ 'brightness_step_up', 'brightness_step_down', 'on', 'off',
2390
+ ]),
2391
+ e.battery(),
2392
+ exposes.enum('operation_mode', ea.ALL, ['command', 'event']).withDescription(
2393
+ 'Operation mode: "command" - for group control, "event" - for clicks'),
2394
+ ],
2395
+ configure: async (device, coordinatorEndpoint, logger) => {
2396
+ const endpoint = device.getEndpoint(1);
2397
+ await endpoint.read('genBasic', [0x0004, 0x000, 0x0001, 0x0005, 0x0007, 0xfffe]);
2398
+ await endpoint.write('genOnOff', {'tuyaOperationMode': 1});
2399
+ await endpoint.read('genOnOff', ['tuyaOperationMode']);
2400
+ try {
2401
+ await endpoint.read(0xE001, [0xD011]);
2402
+ } catch (err) {/* do nothing */}
2403
+ await endpoint.read('genPowerCfg', ['batteryVoltage', 'batteryPercentageRemaining']);
2404
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg']);
2405
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']);
2406
+ await reporting.batteryPercentageRemaining(endpoint);
2407
+ },
2408
+ },
2377
2409
  ];
package/lib/exposes.js CHANGED
@@ -327,7 +327,6 @@ class Cover extends Base {
327
327
  super();
328
328
  this.type = 'cover';
329
329
  this.features = [];
330
- this.features.push(new Enum('state', access.STATE_SET, ['OPEN', 'CLOSE', 'STOP']));
331
330
  }
332
331
 
333
332
  withPosition() {
@@ -341,6 +340,12 @@ class Cover extends Base {
341
340
  this.features.push(new Numeric('tilt', access.ALL).withValueMin(0).withValueMax(100).withDescription('Tilt of this cover'));
342
341
  return this;
343
342
  }
343
+
344
+ withState(property='state', access=a.STATE_SET, values=['OPEN', 'CLOSE', 'STOP']) {
345
+ assert(!this.endpoint, 'Cannot add feature after adding endpoint');
346
+ this.features.push(new Enum(property, access, values));
347
+ return this;
348
+ }
344
349
  }
345
350
 
346
351
  class Fan extends Base {
@@ -532,9 +537,9 @@ module.exports = {
532
537
  comfort_temperature: () => new Numeric('comfort_temperature', access.STATE_SET).withUnit('°C').withDescription('Comfort temperature').withValueMin(0).withValueMax(30),
533
538
  consumer_connected: () => new Binary('consumer_connected', access.STATE, true, false).withDescription('Indicates whether a plug is physically attached. Device does not have to pull power or even be connected electrically (state of this binary switch can be ON even if main power switch is OFF)'),
534
539
  contact: () => new Binary('contact', access.STATE, false, true).withDescription('Indicates if the contact is closed (= true) or open (= false)'),
535
- cover_position: () => new Cover().withPosition(),
536
- cover_position_tilt: () => new Cover().withPosition().withTilt(),
537
- cover_tilt: () => new Cover().withTilt(),
540
+ cover_position: () => new Cover().withState().withPosition(),
541
+ cover_position_tilt: () => new Cover().withState().withPosition().withTilt(),
542
+ cover_tilt: () => new Cover().withState().withTilt(),
538
543
  cpu_temperature: () => new Numeric('cpu_temperature', access.STATE).withUnit('°C').withDescription('Temperature of the CPU'),
539
544
  cube_side: (name) => new Numeric(name, access.STATE).withDescription('Side of the cube').withValueMin(0).withValueMax(6).withValueStep(1),
540
545
  current: () => new Numeric('current', access.STATE).withUnit('A').withDescription('Instantaneous measured electrical current'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zigbee-herdsman-converters",
3
- "version": "14.0.524",
3
+ "version": "14.0.527",
4
4
  "description": "Collection of device converters to be used with zigbee-herdsman",
5
5
  "main": "index.js",
6
6
  "files": [