zigbee-herdsman-converters 14.0.583 → 14.0.584

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.
@@ -1544,6 +1544,8 @@ const converters = {
1544
1544
  if (msg.data.hasOwnProperty('currentPositionLiftPercentage') && msg.data['currentPositionLiftPercentage'] <= 100) {
1545
1545
  const value = msg.data['currentPositionLiftPercentage'];
1546
1546
  result[postfixWithEndpointName('position', msg, model, meta)] = invert ? value : 100 - value;
1547
+ result[postfixWithEndpointName('state', msg, model, meta)] =
1548
+ invert ? (value > 0 ? 'CLOSE' : 'OPEN') : (value > 0 ? 'OPEN' : 'CLOSE');
1547
1549
  }
1548
1550
  if (msg.data.hasOwnProperty('currentPositionTiltPercentage') && msg.data['currentPositionTiltPercentage'] <= 100) {
1549
1551
  const value = msg.data['currentPositionTiltPercentage'];
@@ -115,7 +115,7 @@ module.exports = [
115
115
  model: '5128.10',
116
116
  vendor: 'Iluminize',
117
117
  description: 'Zigbee 3.0 switch shutter SW with level control',
118
- fromZigbee: [fz.cover_position_via_brightness, fz.cover_state_via_onoff],
118
+ fromZigbee: [fz.cover_position_via_brightness, fz.cover_state_via_onoff, fz.cover_position_tilt],
119
119
  toZigbee: [tz.cover_state, tz.cover_via_brightness],
120
120
  exposes: [e.cover_position()],
121
121
  ota: ota.zigbeeOTA,
@@ -3,6 +3,8 @@ 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 globalStore = require('../lib/store');
7
+ const utils = require('../lib/utils');
6
8
  const e = exposes.presets;
7
9
  const ea = exposes.access;
8
10
 
@@ -40,6 +42,48 @@ const hueExtend = {
40
42
  }),
41
43
  };
42
44
 
45
+ const fzLocal = {
46
+ hue_tap_dial: {
47
+ cluster: 'manuSpecificPhilips',
48
+ type: 'commandHueNotification',
49
+ options: [exposes.options.simulated_brightness()],
50
+ convert: (model, msg, publish, options, meta) => {
51
+ const buttonLookup = {1: 'button_1', 2: 'button_2', 3: 'button_3', 4: 'button_4', 20: 'dial'};
52
+ const button = buttonLookup[msg.data['button']];
53
+ const typeLookup = {0: 'press', 1: 'hold', 2: 'press_release', 3: 'hold_release'};
54
+ const type = typeLookup[msg.data['type']];
55
+ const direction = msg.data['unknown2'] <127 ? 'right' : 'left';
56
+ const time = msg.data['time'];
57
+ const payload = {};
58
+
59
+ if (button === 'dial') {
60
+ const adjustedTime = direction === 'right' ? time : 256 - time;
61
+ const dialType = 'rotate';
62
+ const speed = adjustedTime <= 25 ? 'step' : adjustedTime <= 75 ? 'slow' : 'fast';
63
+ payload.action = `${button}_${dialType}_${direction}_${speed}`;
64
+
65
+ // simulated brightness
66
+ if (options.simulated_brightness) {
67
+ const opts = options.simulated_brightness;
68
+ const deltaOpts = typeof opts === 'object' && opts.hasOwnProperty('delta') ? opts.delta : 35;
69
+ const delta = direction === 'right' ? deltaOpts : deltaOpts * -1;
70
+ const brightness = globalStore.getValue(msg.endpoint, 'brightness', 255) + delta;
71
+ payload.brightness = utils.numberWithinRange(brightness, 0, 255);
72
+ globalStore.putValue(msg.endpoint, 'brightness', payload.brightness);
73
+ }
74
+ } else {
75
+ payload.action = `${button}_${type}`;
76
+ // duration
77
+ if (type === 'press') globalStore.putValue(msg.endpoint, 'press_start', Date.now());
78
+ else if (type === 'hold' || type === 'hold_release') {
79
+ payload.action_duration = (Date.now() - globalStore.getValue(msg.endpoint, 'press_start')) / 1000;
80
+ }
81
+ }
82
+ return payload;
83
+ },
84
+ },
85
+ };
86
+
43
87
  module.exports = [
44
88
  {
45
89
  zigbeeModel: ['929003055801'],
@@ -2313,6 +2357,29 @@ module.exports = [
2313
2357
  description: 'Hue White and Color Ambiance A19 1100 lumen',
2314
2358
  extend: hueExtend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
2315
2359
  },
2360
+ {
2361
+ zigbeeModel: ['RDM002'],
2362
+ model: '8719514440937/8719514440999',
2363
+ vendor: 'Philips',
2364
+ description: 'Hue Tap dial switch',
2365
+ fromZigbee: [fz.ignore_command_step, fzLocal.hue_tap_dial, fz.battery],
2366
+ toZigbee: [],
2367
+ exposes: [e.battery(), e.action(['button_1_press', 'button_1_press_release', 'button_1_hold', 'button_1_hold_release',
2368
+ 'button_2_press', 'button_2_press_release', 'button_2_hold', 'button_2_hold_release',
2369
+ 'button_3_press', 'button_3_press_release', 'button_3_hold', 'button_3_hold_release',
2370
+ 'button_4_press', 'button_4_press_release', 'button_4_hold', 'button_4_hold_release',
2371
+ 'dial_rotate_left_step', 'dial_rotate_left_slow', 'dial_rotate_left_fast',
2372
+ 'dial_rotate_right_step', 'dial_rotate_right_slow', 'dial_rotate_right_fast']),
2373
+ ],
2374
+ configure: async (device, coordinatorEndpoint, logger) => {
2375
+ const endpoint = device.getEndpoint(1);
2376
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl', 'manuSpecificPhilips', 'genPowerCfg']);
2377
+ const options = {manufacturerCode: 0x100B, disableDefaultResponse: true};
2378
+ await endpoint.write('genBasic', {0x0031: {value: 0x000B, type: 0x19}}, options);
2379
+ await reporting.batteryPercentageRemaining(endpoint);
2380
+ },
2381
+ ota: ota.zigbeeOTA,
2382
+ },
2316
2383
  {
2317
2384
  fingerprint: [{modelID: 'GreenPower_2', ieeeAddr: /^0x00000000004.....$/}],
2318
2385
  model: '8718696743133',
@@ -3,18 +3,27 @@ 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
 
8
+ // Make sure extend.ldight_* is not used (sengledExtend should be used instead)
9
+ const extendDontUse = require('../lib/extend');
10
+ const extend = {switch: extendDontUse.switch};
11
+ const sengledExtend = {
12
+ light_onoff_brightness: (options={}) => extendDontUse.light_onoff_brightness({disableEffect: true, ...options}),
13
+ light_onoff_brightness_colortemp: (options={}) => extendDontUse.light_onoff_brightness_colortemp({disableEffect: true, ...options}),
14
+ light_onoff_brightness_colortemp_color: (options={}) =>
15
+ extendDontUse.light_onoff_brightness_colortemp_color({disableEffect: true, ...options}),
16
+ };
17
+
9
18
  module.exports = [
10
19
  {
11
20
  zigbeeModel: ['E13-N11'],
12
21
  model: 'E13-N11',
13
22
  vendor: 'Sengled',
14
23
  description: 'Flood light with motion sensor light outdoor',
15
- fromZigbee: extend.light_onoff_brightness().fromZigbee.concat([fz.ias_occupancy_alarm_1]),
16
- toZigbee: extend.light_onoff_brightness().toZigbee,
17
- exposes: extend.light_onoff_brightness().exposes.concat([e.occupancy()]),
24
+ fromZigbee: sengledExtend.light_onoff_brightness().fromZigbee.concat([fz.ias_occupancy_alarm_1]),
25
+ toZigbee: sengledExtend.light_onoff_brightness().toZigbee,
26
+ exposes: sengledExtend.light_onoff_brightness().exposes.concat([e.occupancy()]),
18
27
  ota: ota.zigbeeOTA,
19
28
  },
20
29
  {
@@ -22,7 +31,7 @@ module.exports = [
22
31
  model: 'E21-N13A',
23
32
  vendor: 'Sengled',
24
33
  description: 'Smart LED (A19)',
25
- extend: extend.light_onoff_brightness(),
34
+ extend: sengledExtend.light_onoff_brightness(),
26
35
  ota: ota.zigbeeOTA,
27
36
  },
28
37
  {
@@ -30,12 +39,12 @@ module.exports = [
30
39
  model: 'E21-N1EA',
31
40
  vendor: 'Sengled',
32
41
  description: 'Smart LED multicolor A19 bulb',
33
- fromZigbee: extend.light_onoff_brightness_colortemp_color({colorTempRange: [154, 500]}).fromZigbee.concat([fz.metering]),
34
- toZigbee: extend.light_onoff_brightness_colortemp_color({colorTempRange: [154, 500]}).toZigbee,
35
- exposes: extend.light_onoff_brightness_colortemp_color({colorTempRange: [154, 500]}).exposes.concat([e.power(), e.energy()]),
42
+ fromZigbee: sengledExtend.light_onoff_brightness_colortemp_color({colorTempRange: [154, 500]}).fromZigbee.concat([fz.metering]),
43
+ toZigbee: sengledExtend.light_onoff_brightness_colortemp_color({colorTempRange: [154, 500]}).toZigbee,
44
+ exposes: sengledExtend.light_onoff_brightness_colortemp_color({colorTempRange: [154, 500]}).exposes.concat([e.power(), e.energy()]),
36
45
  ota: ota.zigbeeOTA,
37
46
  configure: async (device, coordinatorEndpoint, logger) => {
38
- await extend.light_onoff_brightness_colortemp_color({colorTempRange: [154, 500]})
47
+ await sengledExtend.light_onoff_brightness_colortemp_color({colorTempRange: [154, 500]})
39
48
  .configure(device, coordinatorEndpoint, logger);
40
49
  device.powerSource = 'Mains (single phase)';
41
50
  device.save();
@@ -52,7 +61,7 @@ module.exports = [
52
61
  model: 'E12-N1E',
53
62
  vendor: 'Sengled',
54
63
  description: 'Smart LED multicolor (BR30)',
55
- extend: extend.light_onoff_brightness_colortemp_color(),
64
+ extend: sengledExtend.light_onoff_brightness_colortemp_color(),
56
65
  ota: ota.zigbeeOTA,
57
66
  },
58
67
  {
@@ -60,7 +69,7 @@ module.exports = [
60
69
  model: 'E1G-G8E',
61
70
  vendor: 'Sengled',
62
71
  description: 'Multicolor light strip (2M)',
63
- extend: extend.light_onoff_brightness_colortemp_color(),
72
+ extend: sengledExtend.light_onoff_brightness_colortemp_color(),
64
73
  ota: ota.zigbeeOTA,
65
74
  },
66
75
  {
@@ -68,7 +77,7 @@ module.exports = [
68
77
  model: 'E11-U21U31',
69
78
  vendor: 'Sengled',
70
79
  description: 'Element touch (A19)',
71
- extend: extend.light_onoff_brightness(),
80
+ extend: sengledExtend.light_onoff_brightness(),
72
81
  ota: ota.zigbeeOTA,
73
82
  },
74
83
  {
@@ -76,11 +85,11 @@ module.exports = [
76
85
  model: 'E11-G13',
77
86
  vendor: 'Sengled',
78
87
  description: 'Element classic (A19)',
79
- fromZigbee: extend.light_onoff_brightness().fromZigbee.concat([fz.metering]),
80
- toZigbee: extend.light_onoff_brightness().toZigbee,
88
+ fromZigbee: sengledExtend.light_onoff_brightness().fromZigbee.concat([fz.metering]),
89
+ toZigbee: sengledExtend.light_onoff_brightness().toZigbee,
81
90
  ota: ota.zigbeeOTA,
82
91
  configure: async (device, coordinatorEndpoint, logger) => {
83
- await extend.light_onoff_brightness().configure(device, coordinatorEndpoint, logger);
92
+ await sengledExtend.light_onoff_brightness().configure(device, coordinatorEndpoint, logger);
84
93
  device.powerSource = 'Mains (single phase)';
85
94
  device.save();
86
95
 
@@ -90,14 +99,14 @@ module.exports = [
90
99
  await reporting.currentSummDelivered(endpoint);
91
100
  await reporting.instantaneousDemand(endpoint);
92
101
  },
93
- exposes: extend.light_onoff_brightness().exposes.concat([e.power(), e.energy()]),
102
+ exposes: sengledExtend.light_onoff_brightness().exposes.concat([e.power(), e.energy()]),
94
103
  },
95
104
  {
96
105
  zigbeeModel: ['E11-G23', 'E11-G33'],
97
106
  model: 'E11-G23/E11-G33',
98
107
  vendor: 'Sengled',
99
108
  description: 'Element classic (A60)',
100
- extend: extend.light_onoff_brightness(),
109
+ extend: sengledExtend.light_onoff_brightness(),
101
110
  ota: ota.zigbeeOTA,
102
111
  },
103
112
  {
@@ -105,7 +114,7 @@ module.exports = [
105
114
  model: 'E11-N13/E11-N13A/E11-N14/E11-N14A',
106
115
  vendor: 'Sengled',
107
116
  description: 'Element extra bright (A19)',
108
- extend: extend.light_onoff_brightness(),
117
+ extend: sengledExtend.light_onoff_brightness(),
109
118
  ota: ota.zigbeeOTA,
110
119
  },
111
120
  {
@@ -113,7 +122,7 @@ module.exports = [
113
122
  model: 'Z01-CIA19NAE26',
114
123
  vendor: 'Sengled',
115
124
  description: 'Element touch (A19)',
116
- extend: extend.light_onoff_brightness(),
125
+ extend: sengledExtend.light_onoff_brightness(),
117
126
  ota: ota.zigbeeOTA,
118
127
  },
119
128
  {
@@ -121,7 +130,7 @@ module.exports = [
121
130
  model: 'Z01-A19NAE26',
122
131
  vendor: 'Sengled',
123
132
  description: 'Element plus (A19)',
124
- extend: extend.light_onoff_brightness_colortemp(),
133
+ extend: sengledExtend.light_onoff_brightness_colortemp(),
125
134
  ota: ota.zigbeeOTA,
126
135
  },
127
136
  {
@@ -129,7 +138,7 @@ module.exports = [
129
138
  model: 'Z01-A60EAE27',
130
139
  vendor: 'Sengled',
131
140
  description: 'Element Plus (A60)',
132
- extend: extend.light_onoff_brightness_colortemp(),
141
+ extend: sengledExtend.light_onoff_brightness_colortemp(),
133
142
  ota: ota.zigbeeOTA,
134
143
  },
135
144
  {
@@ -137,11 +146,11 @@ module.exports = [
137
146
  model: 'E11-N1EA',
138
147
  vendor: 'Sengled',
139
148
  description: 'Element plus color (A19)',
140
- fromZigbee: extend.light_onoff_brightness().fromZigbee.concat([fz.metering]),
141
- toZigbee: extend.light_onoff_brightness().toZigbee,
149
+ fromZigbee: sengledExtend.light_onoff_brightness().fromZigbee.concat([fz.metering]),
150
+ toZigbee: sengledExtend.light_onoff_brightness().toZigbee,
142
151
  ota: ota.zigbeeOTA,
143
152
  configure: async (device, coordinatorEndpoint, logger) => {
144
- await extend.light_onoff_brightness().configure(device, coordinatorEndpoint, logger);
153
+ await sengledExtend.light_onoff_brightness().configure(device, coordinatorEndpoint, logger);
145
154
  device.powerSource = 'Mains (single phase)';
146
155
  device.save();
147
156
 
@@ -151,14 +160,14 @@ module.exports = [
151
160
  await reporting.currentSummDelivered(endpoint);
152
161
  await reporting.instantaneousDemand(endpoint);
153
162
  },
154
- exposes: extend.light_onoff_brightness().exposes.concat([e.power(), e.energy()]),
163
+ exposes: sengledExtend.light_onoff_brightness().exposes.concat([e.power(), e.energy()]),
155
164
  },
156
165
  {
157
166
  zigbeeModel: ['E11-U2E'],
158
167
  model: 'E11-U2E',
159
168
  vendor: 'Sengled',
160
169
  description: 'Element color plus E27',
161
- extend: extend.light_onoff_brightness_colortemp_color(),
170
+ extend: sengledExtend.light_onoff_brightness_colortemp_color(),
162
171
  ota: ota.zigbeeOTA,
163
172
  },
164
173
  {
@@ -166,7 +175,7 @@ module.exports = [
166
175
  model: 'E11-U3E',
167
176
  vendor: 'Sengled',
168
177
  description: 'Element color plus B22',
169
- extend: extend.light_onoff_brightness_colortemp_color(),
178
+ extend: sengledExtend.light_onoff_brightness_colortemp_color(),
170
179
  ota: ota.zigbeeOTA,
171
180
  },
172
181
  {
@@ -174,12 +183,12 @@ module.exports = [
174
183
  model: 'E1F-N5E',
175
184
  vendor: 'Sengled',
176
185
  description: 'Element color plus E12',
177
- fromZigbee: extend.light_onoff_brightness_colortemp_color({colorTempRange: [154, 500]}).fromZigbee.concat([fz.metering]),
178
- toZigbee: extend.light_onoff_brightness_colortemp_color({colorTempRange: [154, 500]}).toZigbee,
179
- exposes: extend.light_onoff_brightness_colortemp_color({colorTempRange: [154, 500]}).exposes.concat([e.power(), e.energy()]),
186
+ fromZigbee: sengledExtend.light_onoff_brightness_colortemp_color({colorTempRange: [154, 500]}).fromZigbee.concat([fz.metering]),
187
+ toZigbee: sengledExtend.light_onoff_brightness_colortemp_color({colorTempRange: [154, 500]}).toZigbee,
188
+ exposes: sengledExtend.light_onoff_brightness_colortemp_color({colorTempRange: [154, 500]}).exposes.concat([e.power(), e.energy()]),
180
189
  ota: ota.zigbeeOTA,
181
190
  configure: async (device, coordinatorEndpoint, logger) => {
182
- await extend.light_onoff_brightness_colortemp_color({colorTempRange: [154, 500]})
191
+ await sengledExtend.light_onoff_brightness_colortemp_color({colorTempRange: [154, 500]})
183
192
  .configure(device, coordinatorEndpoint, logger);
184
193
  device.powerSource = 'Mains (single phase)';
185
194
  device.save();
@@ -196,7 +205,7 @@ module.exports = [
196
205
  model: 'E12-N14',
197
206
  vendor: 'Sengled',
198
207
  description: 'Element Classic (BR30)',
199
- extend: extend.light_onoff_brightness(),
208
+ extend: sengledExtend.light_onoff_brightness(),
200
209
  ota: ota.zigbeeOTA,
201
210
  },
202
211
  {
@@ -204,7 +213,7 @@ module.exports = [
204
213
  model: 'E1ACA4ABE38A',
205
214
  vendor: 'Sengled',
206
215
  description: 'Element downlight smart LED bulb',
207
- extend: extend.light_onoff_brightness(),
216
+ extend: sengledExtend.light_onoff_brightness(),
208
217
  ota: ota.zigbeeOTA,
209
218
  },
210
219
  {
@@ -261,7 +270,7 @@ module.exports = [
261
270
  model: 'E11-N1G',
262
271
  vendor: 'Sengled',
263
272
  description: 'Vintage LED edison bulb (ST19)',
264
- extend: extend.light_onoff_brightness(),
273
+ extend: sengledExtend.light_onoff_brightness(),
265
274
  ota: ota.zigbeeOTA,
266
275
  },
267
276
  {
@@ -269,7 +278,7 @@ module.exports = [
269
278
  model: 'E1F-N9G',
270
279
  vendor: 'Sengled',
271
280
  description: 'Smart LED filament candle (E12)',
272
- extend: extend.light_onoff_brightness(),
281
+ extend: sengledExtend.light_onoff_brightness(),
273
282
  ota: ota.zigbeeOTA,
274
283
  },
275
284
  ];
package/devices/tuya.js CHANGED
@@ -2202,13 +2202,20 @@ module.exports = [
2202
2202
  vendor: 'TuYa',
2203
2203
  description: 'Smart light switch - 3 gang without neutral wire',
2204
2204
  extend: extend.switch(),
2205
- exposes: [e.switch().withEndpoint('left'), e.switch().withEndpoint('center'), e.switch().withEndpoint('right')],
2205
+ toZigbee: extend.switch().toZigbee.concat([tz.moes_power_on_behavior, tz.tuya_backlight_mode]),
2206
+ fromZigbee: extend.switch().fromZigbee.concat([fz.moes_power_on_behavior, fz.tuya_backlight_mode]),
2207
+ exposes: [e.switch().withEndpoint('left'), e.switch().withEndpoint('center'), e.switch().withEndpoint('right'),
2208
+ exposes.enum('power_on_behavior', ea.ALL, Object.values(tuya.moesSwitch.powerOnBehavior)),
2209
+ exposes.enum('backlight_mode', ea.ALL, ['LOW', 'MEDIUM', 'HIGH'])
2210
+ .withDescription('Indicator light status: LOW: Off | MEDIUM: On| HIGH: Inverted')],
2206
2211
  endpoint: (device) => {
2207
2212
  return {'left': 1, 'center': 2, 'right': 3};
2208
2213
  },
2209
2214
  whiteLabel: [{vendor: 'TUYATEC', model: 'GDKES-03TZXD'}],
2210
2215
  meta: {multiEndpoint: true},
2211
2216
  configure: async (device, coordinatorEndpoint, logger) => {
2217
+ await device.getEndpoint(1).read('genBasic',
2218
+ ['manufacturerName', 'zclVersion', 'appVersion', 'modelId', 'powerSource', 0xfffe]);
2212
2219
  try {
2213
2220
  for (const ID of [1, 2, 3]) {
2214
2221
  const endpoint = device.getEndpoint(ID);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zigbee-herdsman-converters",
3
- "version": "14.0.583",
3
+ "version": "14.0.584",
4
4
  "description": "Collection of device converters to be used with zigbee-herdsman",
5
5
  "main": "index.js",
6
6
  "files": [