zigbee-herdsman-converters 14.0.676 → 14.0.677

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.
@@ -677,6 +677,7 @@ const converters = {
677
677
  cluster: 'seMetering',
678
678
  type: ['attributeReport', 'readResponse'],
679
679
  convert: (model, msg, publish, options, meta) => {
680
+ if (utils.hasAlreadyProcessedMessage(msg, model)) return;
680
681
  const payload = {};
681
682
  const multiplier = msg.endpoint.getClusterAttributeValue('seMetering', 'multiplier');
682
683
  const divisor = msg.endpoint.getClusterAttributeValue('seMetering', 'divisor');
@@ -733,6 +734,7 @@ const converters = {
733
734
  options: [exposes.options.calibration('power', 'percentual'), exposes.options.calibration('current', 'percentual'),
734
735
  exposes.options.calibration('voltage', 'percentual')],
735
736
  convert: (model, msg, publish, options, meta) => {
737
+ if (utils.hasAlreadyProcessedMessage(msg, model)) return;
736
738
  const getFactor = (key) => {
737
739
  const multiplier = msg.endpoint.getClusterAttributeValue('haElectricalMeasurement', `${key}Multiplier`);
738
740
  const divisor = msg.endpoint.getClusterAttributeValue('haElectricalMeasurement', `${key}Divisor`);
@@ -2545,17 +2547,6 @@ const converters = {
2545
2547
  };
2546
2548
  },
2547
2549
  },
2548
- moes_power_on_behavior: {
2549
- cluster: 'genOnOff',
2550
- type: ['attributeReport', 'readResponse'],
2551
- convert: (model, msg, publish, options, meta) => {
2552
- const lookup = {0: 'off', 1: 'on', 2: 'previous'};
2553
- if (msg.data.hasOwnProperty('moesStartUpOnOff')) {
2554
- const property = postfixWithEndpointName('power_on_behavior', msg, model, meta);
2555
- return {[property]: lookup[msg.data['moesStartUpOnOff']]};
2556
- }
2557
- },
2558
- },
2559
2550
  moes_switch: {
2560
2551
  cluster: 'manuSpecificTuya',
2561
2552
  type: ['commandDataResponse', 'commandDataReport'],
@@ -2793,42 +2784,6 @@ const converters = {
2793
2784
  return result;
2794
2785
  },
2795
2786
  },
2796
- tuya_backlight_mode: {
2797
- cluster: 'genOnOff',
2798
- type: ['attributeReport', 'readResponse'],
2799
- convert: (model, msg, publish, options, meta) => {
2800
- if (msg.data.hasOwnProperty('tuyaBacklightMode')) {
2801
- const value = msg.data['tuyaBacklightMode'];
2802
- const backlightLookup = {0: 'LOW', 1: 'MEDIUM', 2: 'HIGH'};
2803
- return {backlight_mode: backlightLookup[value]};
2804
- }
2805
- },
2806
- },
2807
- ts011f_plug_indicator_mode: {
2808
- cluster: 'genOnOff',
2809
- type: ['attributeReport', 'readResponse'],
2810
- convert: (model, msg, publish, options, meta) => {
2811
- const property = 'tuyaBacklightMode'; // 0x8001 or 32769
2812
- if (msg.data.hasOwnProperty(property)) {
2813
- const value = msg.data[property];
2814
- const lookup = {0: 'off', 1: 'off/on', 2: 'on/off', 3: 'on'};
2815
- if (lookup.hasOwnProperty(value)) {
2816
- return {indicator_mode: lookup[value]};
2817
- }
2818
- }
2819
- },
2820
- },
2821
- ts011f_plug_child_mode: {
2822
- cluster: 'genOnOff',
2823
- type: ['attributeReport', 'readResponse'],
2824
- convert: (model, msg, publish, options, meta) => {
2825
- const property = (0x8000).toString(); // 32768
2826
- if (msg.data.hasOwnProperty(property)) {
2827
- const value = msg.data[property];
2828
- return {child_lock: value ? 'LOCK' : 'UNLOCK'};
2829
- }
2830
- },
2831
- },
2832
2787
  WSZ01_on_off_action: {
2833
2788
  cluster: 65029,
2834
2789
  type: 'raw',
@@ -4779,16 +4734,6 @@ const converters = {
4779
4734
  });
4780
4735
  },
4781
4736
  },
4782
- tuya_switch_type: {
4783
- cluster: 'manuSpecificTuya_3',
4784
- type: ['attributeReport', 'readResponse'],
4785
- convert: (model, msg, publish, options, meta) => {
4786
- const lookup = {0: 'toggle', 1: 'state', 2: 'momentary'};
4787
- if (msg.data.hasOwnProperty('switchType')) {
4788
- return {switch_type: lookup[msg.data['switchType']]};
4789
- }
4790
- },
4791
- },
4792
4737
  tuya_min_brightness: {
4793
4738
  cluster: 'genLevelCtrl',
4794
4739
  type: ['attributeReport', 'readResponse'],
@@ -7192,22 +7137,6 @@ const converters = {
7192
7137
  }
7193
7138
  },
7194
7139
  },
7195
- tuya_switch_power_outage_memory: {
7196
- cluster: 'genOnOff',
7197
- type: ['attributeReport', 'readResponse'],
7198
- convert: (model, msg, publish, options, meta) => {
7199
- const property = 'moesStartUpOnOff';
7200
-
7201
- if (msg.data.hasOwnProperty(property)) {
7202
- const dict = {0x00: 'off', 0x01: 'on', 0x02: 'restore'};
7203
- const value = msg.data[property];
7204
-
7205
- if (dict.hasOwnProperty(value)) {
7206
- return {[postfixWithEndpointName('power_outage_memory', msg, model, meta)]: dict[value]};
7207
- }
7208
- }
7209
- },
7210
- },
7211
7140
  tuya_relay_din_led_indicator: {
7212
7141
  cluster: 'genOnOff',
7213
7142
  type: ['attributeReport', 'readResponse'],
@@ -3612,34 +3612,6 @@ const converters = {
3612
3612
  await tuya.sendDataPointBool(entity, tuya.dataPoints.state, value === 'cool');
3613
3613
  },
3614
3614
  },
3615
- tuya_switch_power_outage_memory: {
3616
- key: ['power_outage_memory'],
3617
- convertSet: async (entity, key, value, meta) => {
3618
- value = value.toLowerCase();
3619
- const lookup = {'off': 0x00, 'on': 0x01, 'restore': 0x02};
3620
- utils.validateValue(value, Object.keys(lookup));
3621
- const payload = lookup[value];
3622
- await entity.write('genOnOff', {moesStartUpOnOff: payload});
3623
- return {state: {power_outage_memory: value}};
3624
- },
3625
- convertGet: async (entity, key, meta) => {
3626
- await entity.read('genOnOff', ['moesStartUpOnOff']);
3627
- },
3628
- },
3629
- moes_power_on_behavior: {
3630
- key: ['power_on_behavior'],
3631
- convertSet: async (entity, key, value, meta) => {
3632
- value = value.toLowerCase();
3633
- const lookup = {'off': 0, 'on': 1, 'previous': 2};
3634
- utils.validateValue(value, Object.keys(lookup));
3635
- const pState = lookup[value];
3636
- await entity.write('genOnOff', {moesStartUpOnOff: pState});
3637
- return {state: {power_on_behavior: value}};
3638
- },
3639
- convertGet: async (entity, key, meta) => {
3640
- await entity.read('genOnOff', ['moesStartUpOnOff']);
3641
- },
3642
- },
3643
3615
  moes_switch: {
3644
3616
  key: ['power_on_behavior', 'indicate_light'],
3645
3617
  convertSet: async (entity, key, value, meta) => {
@@ -3915,19 +3887,6 @@ const converters = {
3915
3887
  return {state: {state: value.toUpperCase()}};
3916
3888
  },
3917
3889
  },
3918
- tuya_switch_type: {
3919
- key: ['switch_type'],
3920
- convertSet: async (entity, key, value, meta) => {
3921
- value = value.toLowerCase();
3922
- const lookup = {'toggle': 0, 'state': 1, 'momentary': 2};
3923
- utils.validateValue(value, Object.keys(lookup));
3924
- await entity.write('manuSpecificTuya_3', {'switchType': lookup[value]}, {disableDefaultResponse: true});
3925
- return {state: {switch_type: value}};
3926
- },
3927
- convertGet: async (entity, key, meta) => {
3928
- await entity.read('manuSpecificTuya_3', ['switchType']);
3929
- },
3930
- },
3931
3890
  tuya_min_brightness: {
3932
3891
  key: ['min_brightness'],
3933
3892
  convertSet: async (entity, key, value, meta) => {
@@ -6231,46 +6190,6 @@ const converters = {
6231
6190
  await entity.read('closuresWindowCovering', ['moesCalibrationTime']);
6232
6191
  },
6233
6192
  },
6234
- tuya_backlight_mode: {
6235
- key: ['backlight_mode'],
6236
- convertSet: async (entity, key, value, meta) => {
6237
- const lookup = {'LOW': 0, 'MEDIUM': 1, 'HIGH': 2};
6238
- value = value.toUpperCase();
6239
- utils.validateValue(value, Object.keys(lookup));
6240
- const backlight = lookup[value];
6241
- await entity.write('genOnOff', {tuyaBacklightMode: backlight});
6242
- return {state: {backlight_mode: value}};
6243
- },
6244
- convertGet: async (entity, key, meta) => {
6245
- await entity.read('genOnOff', ['tuyaBacklightMode']);
6246
- },
6247
- },
6248
- ts011f_plug_indicator_mode: {
6249
- key: ['indicator_mode'],
6250
- convertSet: async (entity, key, value, meta) => {
6251
- if (typeof value === 'string') {
6252
- value = value.toLowerCase();
6253
- const lookup = {'off': 0, 'off/on': 1, 'on/off': 2, 'on': 3};
6254
- utils.validateValue(value, Object.keys(lookup));
6255
- value = lookup[value];
6256
- }
6257
-
6258
- if (typeof value === 'number' && value >= 0 && value <= 3) {
6259
- await entity.write('genOnOff', {tuyaBacklightMode: value});
6260
- } else {
6261
- meta.logger.warn(`toZigbee.ts011f_plug_indicator_mode: Unsupported value ${value}`);
6262
- }
6263
- },
6264
- convertGet: async (entity, key, meta) => {
6265
- await entity.read('genOnOff', ['tuyaBacklightMode']);
6266
- },
6267
- },
6268
- ts011f_plug_child_mode: {
6269
- key: ['child_lock'],
6270
- convertSet: async (entity, key, value, meta) => {
6271
- await entity.write('genOnOff', {0x8000: {value: value === 'LOCK', type: 0x10}});
6272
- },
6273
- },
6274
6193
  hy_thermostat: {
6275
6194
  key: [
6276
6195
  'child_lock', 'current_heating_setpoint', 'local_temperature_calibration',
package/devices/alecto.js CHANGED
@@ -62,6 +62,7 @@ module.exports = [
62
62
  {
63
63
  fingerprint: [
64
64
  {modelID: 'daqwrsj\u0000', manufacturerName: '_TYST11_8daqwrsj'},
65
+ {modelID: 'TS0601', manufacturerName: '_TZE200_qtbrwrfv'},
65
66
  ],
66
67
  model: 'SMART-HEAT10',
67
68
  vendor: 'Alecto',
package/devices/girier.js CHANGED
@@ -1,8 +1,5 @@
1
- const fz = require('../converters/fromZigbee');
2
- const tz = require('../converters/toZigbee');
3
- const exposes = require('../lib/exposes');
1
+ const tuya = require('../lib/tuya');
4
2
  const reporting = require('../lib/reporting');
5
- const extend = require('../lib/extend');
6
3
 
7
4
  module.exports = [
8
5
  {
@@ -13,9 +10,7 @@ module.exports = [
13
10
  model: 'JR-ZDS01',
14
11
  vendor: 'Girier',
15
12
  description: '1 gang mini switch',
16
- toZigbee: extend.switch().toZigbee.concat([tz.moes_power_on_behavior, tz.tuya_switch_type]),
17
- fromZigbee: extend.switch().fromZigbee.concat([fz.moes_power_on_behavior, fz.tuya_switch_type]),
18
- exposes: extend.switch().exposes.concat([exposes.presets.power_on_behavior(), exposes.presets.switch_type_2()]),
13
+ extend: tuya.extend.switch({switchType: true}),
19
14
  configure: async (device, coordinatorEndpoint, logger) => {
20
15
  await reporting.bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff']);
21
16
  },
package/devices/lellki.js CHANGED
@@ -34,14 +34,11 @@ module.exports = [
34
34
  model: 'JZ-ZB-001',
35
35
  description: 'Smart plug (without power monitoring)',
36
36
  vendor: 'LELLKI',
37
- fromZigbee: [fz.on_off, fz.tuya_switch_power_outage_memory],
38
- toZigbee: [tz.on_off, tz.tuya_switch_power_outage_memory],
37
+ extend: tuya.extend.switch({powerOutageMemory: true}),
39
38
  configure: async (device, coordinatorEndpoint, logger) => {
40
39
  const endpoint = device.getEndpoint(1);
41
40
  await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']);
42
41
  },
43
- exposes: [e.switch(), exposes.enum('power_outage_memory', ea.ALL, ['on', 'off', 'restore'])
44
- .withDescription('Recover state after power outage')],
45
42
  },
46
43
  {
47
44
  zigbeeModel: ['JZ-ZB-003'],
@@ -88,9 +85,7 @@ module.exports = [
88
85
  model: 'XF-EU-S100-1-M',
89
86
  description: 'Touch switch 1 gang (with power monitoring)',
90
87
  vendor: 'LELLKI',
91
- extend: extend.switch(),
92
- fromZigbee: [fz.on_off, fz.electrical_measurement, fz.metering, fz.ignore_basic_report, fz.tuya_switch_power_outage_memory],
93
- toZigbee: [tz.on_off, tz.tuya_switch_power_outage_memory],
88
+ extend: tuya.extend.switch({powerOutageMemory: true, electricalMeasurements: true}),
94
89
  configure: async (device, coordinatorEndpoint, logger) => {
95
90
  const endpoint = device.getEndpoint(1);
96
91
  await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']);
@@ -99,9 +94,6 @@ module.exports = [
99
94
  device.save();
100
95
  },
101
96
  options: [exposes.options.measurement_poll_interval()],
102
- exposes: [e.switch(), e.power(), e.current(), e.voltage().withAccess(ea.STATE),
103
- e.energy(), exposes.enum('power_outage_memory', ea.ALL, ['on', 'off', 'restore'])
104
- .withDescription('Recover state after power outage')],
105
97
  onEvent: tuya.onEventMeasurementPoll,
106
98
  },
107
99
  {
@@ -109,8 +101,7 @@ module.exports = [
109
101
  model: 'WK34-EU',
110
102
  description: 'Power socket EU (with power monitoring)',
111
103
  vendor: 'LELLKI',
112
- fromZigbee: [fz.on_off, fz.electrical_measurement, fz.metering, fz.ignore_basic_report, fz.tuya_switch_power_outage_memory],
113
- toZigbee: [tz.on_off, tz.tuya_switch_power_outage_memory],
104
+ extend: tuya.extend.switch({powerOutageMemory: true, electricalMeasurements: true}),
114
105
  configure: async (device, coordinatorEndpoint, logger) => {
115
106
  const endpoint = device.getEndpoint(1);
116
107
  await tuya.configureMagicPacket(device, coordinatorEndpoint, logger);
@@ -120,9 +111,6 @@ module.exports = [
120
111
  device.save();
121
112
  },
122
113
  options: [exposes.options.measurement_poll_interval()],
123
- exposes: [e.switch(), e.power(), e.current(), e.voltage().withAccess(ea.STATE),
124
- e.energy(), exposes.enum('power_outage_memory', ea.ALL, ['on', 'off', 'restore'])
125
- .withDescription('Recover state after power outage')],
126
114
  onEvent: tuya.onEventMeasurementPoll,
127
115
  },
128
116
  {
@@ -132,8 +120,8 @@ module.exports = [
132
120
  vendor: 'LELLKI',
133
121
  extend: extend.switch(),
134
122
  fromZigbee: [fz.on_off_force_multiendpoint, fz.electrical_measurement, fz.metering, fz.ignore_basic_report,
135
- fz.tuya_switch_power_outage_memory],
136
- toZigbee: [tz.on_off, tz.tuya_switch_power_outage_memory],
123
+ tuya.fz.power_outage_memory],
124
+ toZigbee: [tz.on_off, tuya.tz.power_on_behavior],
137
125
  configure: async (device, coordinatorEndpoint, logger) => {
138
126
  const endpoint = device.getEndpoint(1);
139
127
  await tuya.configureMagicPacket(device, coordinatorEndpoint, logger);
package/devices/lidl.js CHANGED
@@ -8,7 +8,6 @@ const ea = exposes.access;
8
8
  const tuya = require('../lib/tuya');
9
9
  const globalStore = require('../lib/store');
10
10
  const ota = require('../lib/ota');
11
- const utils = require('../lib/utils');
12
11
 
13
12
  const tuyaLocal = {
14
13
  dataPoints: {
@@ -142,20 +141,6 @@ const fzLocal = {
142
141
  }
143
142
  },
144
143
  },
145
- metering_skip_duplicate: {
146
- ...fz.metering,
147
- convert: (model, msg, publish, options, meta) => {
148
- if (utils.hasAlreadyProcessedMessage(msg, model)) return;
149
- return fz.metering.convert(model, msg, publish, options, meta);
150
- },
151
- },
152
- electrical_measurement_skip_duplicate: {
153
- ...fz.electrical_measurement,
154
- convert: (model, msg, publish, options, meta) => {
155
- if (utils.hasAlreadyProcessedMessage(msg, model)) return;
156
- return fz.electrical_measurement.convert(model, msg, publish, options, meta);
157
- },
158
- },
159
144
  };
160
145
  const tzLocal = {
161
146
  zs_thermostat_child_lock: {
@@ -403,9 +388,7 @@ module.exports = [
403
388
  vendor: 'Lidl',
404
389
  description: 'Silvercrest smart plug with power monitoring (EU, FR)',
405
390
  ota: ota.zigbeeOTA,
406
- fromZigbee: [fz.on_off, fzLocal.electrical_measurement_skip_duplicate, fzLocal.metering_skip_duplicate, fz.ignore_basic_report,
407
- fz.tuya_switch_power_outage_memory, fz.ts011f_plug_indicator_mode, fz.ts011f_plug_child_mode],
408
- toZigbee: [tz.on_off, tz.tuya_switch_power_outage_memory, tz.ts011f_plug_indicator_mode, tz.ts011f_plug_child_mode],
391
+ extend: tuya.extend.switch({electricalMeasurements: true, powerOutageMemory: true, indicatorMode: true, childLock: true}),
409
392
  configure: async (device, coordinatorEndpoint, logger) => {
410
393
  const endpoint = device.getEndpoint(1);
411
394
  await tuya.configureMagicPacket(device, coordinatorEndpoint, logger);
@@ -419,11 +402,6 @@ module.exports = [
419
402
  device.save();
420
403
  },
421
404
  options: [exposes.options.measurement_poll_interval().withDescription('Only the energy value is polled for this device.')],
422
- exposes: [e.switch(), e.power(), e.current(), e.voltage().withAccess(ea.STATE),
423
- e.energy(), exposes.enum('power_outage_memory', ea.ALL, ['on', 'off', 'restore'])
424
- .withDescription('Recover state after power outage'),
425
- exposes.enum('indicator_mode', ea.ALL, ['off', 'off/on', 'on/off', 'on'])
426
- .withDescription('Plug LED indicator mode'), e.child_lock()],
427
405
  onEvent: (type, data, device, options) => tuya.onEventMeasurementPoll(type, data, device, options, false, true),
428
406
  },
429
407
  {
@@ -3,6 +3,7 @@ const fz = {...require('../converters/fromZigbee'), legacy: require('../lib/lega
3
3
  const tz = require('../converters/toZigbee');
4
4
  const reporting = require('../lib/reporting');
5
5
  const extend = require('../lib/extend');
6
+ const tuya = require('../lib/tuya');
6
7
  const utils = require('../lib/utils');
7
8
  const e = exposes.presets;
8
9
  const ea = exposes.access;
@@ -62,8 +63,9 @@ module.exports = [
62
63
  model: '11830304',
63
64
  vendor: 'Lonsonho',
64
65
  description: 'Curtain switch',
65
- fromZigbee: [fz.cover_position_tilt, fz.tuya_backlight_mode, fz.tuya_cover_options],
66
- toZigbee: [tz.cover_state, tz.cover_position_tilt, tz.tuya_cover_calibration, tz.tuya_cover_reversal, tz.tuya_backlight_mode],
66
+ fromZigbee: [fz.cover_position_tilt, tuya.fz.backlight_mode, fz.tuya_cover_options],
67
+ toZigbee: [tz.cover_state, tz.cover_position_tilt, tz.tuya_cover_calibration, tz.tuya_cover_reversal,
68
+ tuya.tz.backlight_indicator_mode],
67
69
  meta: {coverInverted: true},
68
70
  exposes: [e.cover_position(), exposes.enum('moving', ea.STATE, ['UP', 'STOP', 'DOWN']),
69
71
  exposes.binary('calibration', ea.ALL, 'ON', 'OFF'), exposes.binary('motor_reversal', ea.ALL, 'ON', 'OFF'),
@@ -271,9 +273,9 @@ module.exports = [
271
273
  vendor: 'Lonsonho',
272
274
  description: 'Zigbee smart dimmer module 2 gang with neutral',
273
275
  fromZigbee: extend.light_onoff_brightness({disablePowerOnBehavior: true, disableMoveStep: true, disableTransition: true})
274
- .fromZigbee.concat([fz.tuya_switch_power_outage_memory, fzLocal.TS110E_switch_type]),
276
+ .fromZigbee.concat([tuya.fz.power_outage_memory, fzLocal.TS110E_switch_type]),
275
277
  toZigbee: extend.light_onoff_brightness({disablePowerOnBehavior: true, disableMoveStep: true, disableTransition: true})
276
- .toZigbee.concat([tz.tuya_switch_power_outage_memory, tzLocal.TS110E_switch_type]),
278
+ .toZigbee.concat([tuya.tz.power_on_behavior, tzLocal.TS110E_switch_type]),
277
279
  meta: {multiEndpoint: true},
278
280
  exposes: [
279
281
  e.light_brightness().withEndpoint('l1'),
@@ -12,13 +12,11 @@ module.exports = [
12
12
  model: 'SPP04G',
13
13
  vendor: 'Mercator',
14
14
  description: 'Ikuü Quad Power Point',
15
- fromZigbee: [fz.on_off, fz.electrical_measurement, fz.metering, fz.ignore_basic_report, fz.tuya_switch_power_outage_memory],
16
- toZigbee: [tz.on_off, tz.tuya_switch_power_outage_memory],
15
+ extend: tuya.extend.switch({powerOutageMemory: true, electricalMeasurements: true, endpoints: ['left', 'right']}),
17
16
  exposes: [e.switch().withEndpoint('left'), e.switch().withEndpoint('right'),
18
17
  e.power().withEndpoint('left'), e.current().withEndpoint('left'),
19
18
  e.voltage().withEndpoint('left').withAccess(ea.STATE), e.energy(),
20
- exposes.enum('power_outage_memory', ea.ALL, ['on', 'off', 'restore'])
21
- .withDescription('Recover state after power outage')],
19
+ tuya.exposes.powerOutageMemory()],
22
20
  endpoint: (device) => {
23
21
  return {left: 1, right: 2};
24
22
  },
@@ -36,8 +34,7 @@ module.exports = [
36
34
  model: 'SPP02GIP',
37
35
  vendor: 'Mercator',
38
36
  description: 'Ikuü double outdoors power point',
39
- fromZigbee: [fz.on_off, fz.electrical_measurement, fz.metering, fz.ignore_basic_report, fz.tuya_switch_power_outage_memory],
40
- toZigbee: [tz.on_off],
37
+ extend: tuya.extend.switch({powerOutageMemory: true, electricalMeasurements: true, endpoints: ['left', 'right']}),
41
38
  exposes: [e.switch().withEndpoint('left'), e.switch().withEndpoint('right'),
42
39
  e.power().withEndpoint('left'), e.current().withEndpoint('left'),
43
40
  e.voltage().withEndpoint('left').withAccess(ea.STATE), e.energy()],
@@ -85,15 +82,11 @@ module.exports = [
85
82
  model: 'SPPUSB02',
86
83
  vendor: 'Mercator',
87
84
  description: 'Ikuü double power point with USB',
88
- fromZigbee: [fz.on_off, fz.electrical_measurement, fz.metering, fz.ignore_basic_report, fz.tuya_switch_power_outage_memory],
89
- toZigbee: [tz.on_off],
85
+ extend: tuya.extend.switch({powerOutageMemory: true, electricalMeasurements: true, endpoints: ['left', 'right']}),
90
86
  exposes: [
91
- e.switch().withEndpoint('left'),
92
- e.switch().withEndpoint('right'),
93
- e.power().withEndpoint('left'),
94
- e.current().withEndpoint('left'),
95
- e.voltage().withEndpoint('left').withAccess(ea.STATE),
96
- e.energy(),
87
+ e.switch().withEndpoint('left'), e.switch().withEndpoint('right'),
88
+ e.power().withEndpoint('left'), e.current().withEndpoint('left'), e.voltage().withEndpoint('left').withAccess(ea.STATE),
89
+ e.energy(), tuya.exposes.powerOutageMemory(),
97
90
  ],
98
91
  endpoint: (device) => {
99
92
  return {left: 1, right: 2};
package/devices/moes.js CHANGED
@@ -26,13 +26,7 @@ module.exports = [
26
26
  model: 'ZP-LZ-FR2U',
27
27
  vendor: 'Moes',
28
28
  description: 'Zigbee 3.0 dual USB wireless socket plug',
29
- fromZigbee: [fz.on_off, fz.tuya_switch_power_outage_memory, fz.ts011f_plug_indicator_mode, fz.ts011f_plug_child_mode],
30
- toZigbee: [tz.on_off, tz.tuya_switch_power_outage_memory, tz.ts011f_plug_indicator_mode, tz.ts011f_plug_child_mode],
31
- exposes: [e.switch().withEndpoint('l1'), e.switch().withEndpoint('l2'),
32
- exposes.enum('power_outage_memory', ea.ALL, ['on', 'off', 'restore'])
33
- .withDescription('Recover state after power outage'),
34
- exposes.enum('indicator_mode', ea.ALL, ['off', 'off/on', 'on/off', 'on'])
35
- .withDescription('Plug LED indicator mode'), e.child_lock()],
29
+ extend: tuya.extend.switch({powerOutageMemory: true, indicatorMode: true, childLock: true, endpoints: ['l1', 'l2']}),
36
30
  endpoint: (device) => {
37
31
  return {'l1': 1, 'l2': 2};
38
32
  },
@@ -51,12 +45,7 @@ module.exports = [
51
45
  model: 'MS-104Z',
52
46
  description: 'Smart light switch module (1 gang)',
53
47
  vendor: 'Moes',
54
- toZigbee: extend.switch().toZigbee.concat([tz.moes_power_on_behavior]),
55
- fromZigbee: extend.switch().fromZigbee.concat([fz.moes_power_on_behavior]),
56
- extend: extend.switch(),
57
- exposes: [e.switch(),
58
- exposes.enum('power_on_behavior', ea.ALL, ['on', 'off', 'previous'])
59
- .withDescription('Controls the behaviour when the device is powered on')],
48
+ extend: tuya.extend.switch({powerOnBehavior: true}),
60
49
  configure: async (device, coordinatorEndpoint, logger) => {
61
50
  const endpoint = device.getEndpoint(1);
62
51
  await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']);
@@ -74,13 +63,8 @@ module.exports = [
74
63
  model: 'MS-104BZ',
75
64
  description: 'Smart light switch module (2 gang)',
76
65
  vendor: 'Moes',
77
- toZigbee: extend.switch().toZigbee.concat([tz.moes_power_on_behavior]),
78
- fromZigbee: extend.switch().fromZigbee.concat([fz.moes_power_on_behavior]),
79
- extend: extend.switch(),
66
+ extend: tuya.extend.switch({endpoints: ['l1', 'l2']}),
80
67
  meta: {multiEndpoint: true},
81
- exposes: [e.switch().withEndpoint('l1'), e.switch().withEndpoint('l2'),
82
- exposes.enum('power_on_behavior', ea.ALL, ['on', 'off', 'previous'])
83
- .withDescription('Controls the behaviour when the device is powered on')],
84
68
  endpoint: (device) => {
85
69
  return {l1: 1, l2: 2};
86
70
  },
@@ -414,15 +398,7 @@ module.exports = [
414
398
  model: 'ZS-EUB_1gang',
415
399
  vendor: 'Moes',
416
400
  description: 'Wall light switch (1 gang)',
417
- toZigbee: extend.switch().toZigbee.concat([tz.moes_power_on_behavior, tz.tuya_switch_type, tz.tuya_backlight_mode]),
418
- fromZigbee: extend.switch().fromZigbee.concat([fz.moes_power_on_behavior, fz.tuya_switch_type, fz.tuya_backlight_mode]),
419
- exposes: [
420
- e.switch(),
421
- exposes.presets.power_on_behavior(),
422
- exposes.presets.switch_type_2(),
423
- exposes.enum('backlight_mode', ea.ALL, ['LOW', 'MEDIUM', 'HIGH'])
424
- .withDescription('Indicator light status: LOW: Off | MEDIUM: On| HIGH: Inverted'),
425
- ],
401
+ extend: tuya.extend.switch({backlightMode: true, switchType: true}),
426
402
  configure: async (device, coordinatorEndpoint, logger) => {
427
403
  await reporting.bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff']);
428
404
  device.powerSource = 'Mains (single phase)';
@@ -1345,7 +1345,7 @@ module.exports = [
1345
1345
  extend: hueExtend.light_onoff_brightness_colortemp({colorTempRange: [153, 454]}),
1346
1346
  },
1347
1347
  {
1348
- zigbeeModel: ['3261331P6'],
1348
+ zigbeeModel: ['3261331P6', '929003055301'],
1349
1349
  model: '3261331P6',
1350
1350
  vendor: 'Philips',
1351
1351
  description: 'Hue white ambiance Still',
@@ -2935,4 +2935,14 @@ module.exports = [
2935
2935
  description: 'Hue Festavia gradient light string 250',
2936
2936
  extend: hueExtend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
2937
2937
  },
2938
+ {
2939
+ zigbeeModel: ['915005987101'],
2940
+ model: '915005987101',
2941
+ vendor: 'Philips',
2942
+ description: 'Hue Gradient Signe floor lamp (white)',
2943
+ toZigbee: [tzLocal.gradient_scene, ...hueExtend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}).toZigbee],
2944
+ exposes: [exposes.enum('gradient_scene', ea.SET, Object.keys(gradientScenes)),
2945
+ ...hueExtend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}).exposes],
2946
+ extend: hueExtend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
2947
+ },
2938
2948
  ];
@@ -12,6 +12,7 @@ module.exports = [
12
12
  model: '3RSS009Z',
13
13
  vendor: 'Third Reality',
14
14
  description: 'Smart switch Gen3',
15
+ ota: ota.zigbeeOTA,
15
16
  fromZigbee: [fz.on_off, fz.battery],
16
17
  toZigbee: [tz.on_off, tz.ignore_transition],
17
18
  exposes: [e.switch(), e.battery_voltage()],
@@ -103,6 +104,7 @@ module.exports = [
103
104
  vendor: 'Third Reality',
104
105
  description: 'Zigbee / BLE smart plug',
105
106
  extend: extend.switch(),
107
+ ota: ota.zigbeeOTA,
106
108
  configure: async (device, coordinatorEndpoint, logger) => {
107
109
  const endpoint = device.getEndpoint(1);
108
110
  await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']);