zigbee-herdsman-converters 14.0.537 → 14.0.538

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.
@@ -6,6 +6,37 @@ const extend = require('../lib/extend');
6
6
  const e = exposes.presets;
7
7
  const ea = exposes.access;
8
8
 
9
+ const tzLocal = {
10
+ node_config: {
11
+ key: ['report_delay'],
12
+ convertSet: async (entity, key, rawValue, meta) => {
13
+ const lookup = {'OFF': 0x00, 'ON': 0x01};
14
+ const value = lookup.hasOwnProperty(rawValue) ? lookup[rawValue] : parseInt(rawValue, 10);
15
+ const payloads = {
16
+ report_delay: ['genPowerCfg', {0x0201: {value, type: 0x21}}],
17
+ };
18
+ await entity.write(payloads[key][0], payloads[key][1]);
19
+ return {
20
+ state: {[key]: rawValue},
21
+ };
22
+ },
23
+ },
24
+ };
25
+
26
+ const fzLocal = {
27
+ node_config: {
28
+ cluster: 'genPowerCfg',
29
+ type: ['attributeReport', 'readResponse'],
30
+ convert: (model, msg, publish, options, meta) => {
31
+ const result = {};
32
+ if (msg.data.hasOwnProperty(0x0201)) {
33
+ result.report_delay = msg.data[0x0201];
34
+ }
35
+ return result;
36
+ },
37
+ },
38
+ };
39
+
9
40
  module.exports = [
10
41
  {
11
42
  zigbeeModel: ['ti.router'],
@@ -257,17 +288,15 @@ module.exports = [
257
288
  model: 'EFEKTA_miniPWS',
258
289
  vendor: 'Custom devices (DiY)',
259
290
  description: '[Mini plant wattering sensor](http://efektalab.com/miniPWS)',
260
- fromZigbee: [fz.soil_moisture, fz.battery],
261
- toZigbee: [tz.factory_reset],
291
+ fromZigbee: [fz.soil_moisture, fz.battery, fzLocal.node_config],
292
+ toZigbee: [tz.factory_reset, tzLocal.node_config],
262
293
  configure: async (device, coordinatorEndpoint, logger) => {
263
294
  const firstEndpoint = device.getEndpoint(1);
264
295
  await reporting.bind(firstEndpoint, coordinatorEndpoint, ['genPowerCfg', 'msSoilMoisture']);
265
- const overides = {min: 0, max: 21600, change: 0};
266
- await reporting.batteryVoltage(firstEndpoint, overides);
267
- await reporting.batteryPercentageRemaining(firstEndpoint, overides);
268
- await reporting.soil_moisture(firstEndpoint, overides);
269
296
  },
270
- exposes: [e.soil_moisture(), e.battery()],
297
+ exposes: [e.soil_moisture(), e.battery(),
298
+ exposes.numeric('report_delay', ea.STATE_SET).withUnit('min').withDescription('Adjust Report Delay, by default 60 minutes')
299
+ .withValueMin(1).withValueMax(180)],
271
300
  },
272
301
  {
273
302
  zigbeeModel: ['EFEKTA_eON213wz'],
@@ -10,14 +10,15 @@ module.exports = [
10
10
  model: 'V3-BTZB/V3-BTZBE',
11
11
  vendor: 'Danalock',
12
12
  description: 'BT/ZB smartlock',
13
- fromZigbee: [fz.lock, fz.lock_operation_event, fz.battery],
14
- toZigbee: [tz.lock],
13
+ fromZigbee: [fz.lock, fz.lock_operation_event, fz.battery, fz.lock_programming_event, fz.lock_pin_code_response],
14
+ toZigbee: [tz.lock, tz.pincode_lock, tz.lock_userstatus],
15
+ meta: {pinCodeCount: 20},
15
16
  configure: async (device, coordinatorEndpoint, logger) => {
16
17
  const endpoint = device.getEndpoint(1);
17
18
  await reporting.bind(endpoint, coordinatorEndpoint, ['closuresDoorLock', 'genPowerCfg']);
18
19
  await reporting.lockState(endpoint);
19
20
  await reporting.batteryPercentageRemaining(endpoint);
20
21
  },
21
- exposes: [e.lock(), e.battery(), e.lock_action(), e.lock_action_source_name(), e.lock_action_source_user()],
22
+ exposes: [e.lock(), e.battery(), e.pincode(), e.lock_action(), e.lock_action_source_name(), e.lock_action_source_user()],
22
23
  },
23
24
  ];
package/devices/heiman.js CHANGED
@@ -117,6 +117,15 @@ module.exports = [
117
117
  toZigbee: [],
118
118
  exposes: [e.gas(), e.battery_low(), e.tamper()],
119
119
  },
120
+ {
121
+ zigbeeModel: ['RH3070'],
122
+ model: 'HS1CG',
123
+ vendor: 'Heiman',
124
+ description: 'Smart combustible gas sensor',
125
+ fromZigbee: [fz.ias_gas_alarm_1],
126
+ toZigbee: [],
127
+ exposes: [e.gas(), e.battery_low(), e.tamper()],
128
+ },
120
129
  {
121
130
  zigbeeModel: ['GAS_V15'],
122
131
  model: 'HS1CG_M',
package/devices/ikea.js CHANGED
@@ -36,10 +36,10 @@ const bulbOnEvent = async (type, data, device, options, state) => {
36
36
 
37
37
  // NOTE: execute_if_off default is false
38
38
  // we only restore if true, to save unneeded network writes
39
- if (state.color_options !== undefined && state.color_options.execute_if_off === true) {
39
+ if (state !== undefined && state.color_options !== undefined && state.color_options.execute_if_off === true) {
40
40
  device.endpoints[0].write('lightingColorCtrl', {'options': 1});
41
41
  }
42
- if (state.level_config !== undefined && state.level_config.execute_if_off === true) {
42
+ if (state !== undefined && state.level_config !== undefined && state.level_config.execute_if_off === true) {
43
43
  device.endpoints[0].write('genLevelCtrl', {'options': 1});
44
44
  }
45
45
  }
@@ -155,6 +155,10 @@ module.exports = [
155
155
  exposes: [e.action(['on', 'off', 'brightness_step_up', 'brightness_step_down', 'brightness_move_up', 'brightness_move_down',
156
156
  'brightness_stop', 'color_temperature_move'])],
157
157
  toZigbee: [],
158
+ configure: async (device, coordinatorEndpoint, logger) => {
159
+ device.powerSource = 'Battery';
160
+ device.save();
161
+ },
158
162
  },
159
163
  {
160
164
  zigbeeModel: ['tint-ColorTemperature', 'tint-ColorTemperature2'],
package/devices/niko.js CHANGED
@@ -219,4 +219,13 @@ module.exports = [
219
219
  exposes.enum('operation_mode', ea.ALL, ['control_relay', 'decoupled']).withEndpoint('l2'),
220
220
  ],
221
221
  },
222
+ {
223
+ zigbeeModel: ['Connectable dimmer,3-200W,2-wire'],
224
+ model: '552-72201',
225
+ vendor: 'Niko',
226
+ description: 'Connectable dimmer',
227
+ fromZigbee: [fz.on_off, fz.brightness, fz.level_config, fz.command_move, fz.command_stop],
228
+ toZigbee: [tz.light_onoff_brightness, tz.level_config],
229
+ exposes: [e.light_brightness().withLevelConfig()],
230
+ },
222
231
  ];
package/devices/tuya.js CHANGED
@@ -43,6 +43,20 @@ const tzLocal = {
43
43
  }
44
44
  },
45
45
  },
46
+ power_on_behavior: {
47
+ key: ['power_on_behavior'],
48
+ convertSet: async (entity, key, value, meta) => {
49
+ value = value.toLowerCase();
50
+ const lookup = {'off': 0, 'on': 1, 'previous': 2};
51
+ utils.validateValue(value, Object.keys(lookup));
52
+ const pState = lookup[value];
53
+ await entity.write('manuSpecificTuya_3', {'powerOnBehavior': pState}, {disableDefaultResponse: true});
54
+ return {state: {power_on_behavior: value}};
55
+ },
56
+ convertGet: async (entity, key, meta) => {
57
+ await entity.read('manuSpecificTuya_3', ['powerOnBehavior']);
58
+ },
59
+ },
46
60
  zb_sm_cover: {
47
61
  key: ['state', 'position', 'reverse_direction', 'top_limit', 'bottom_limit', 'favorite_position', 'goto_positon', 'report'],
48
62
  convertSet: async (entity, key, value, meta) => {
@@ -166,6 +180,19 @@ const fzLocal = {
166
180
  }
167
181
  },
168
182
  },
183
+ power_on_behavior: {
184
+ cluster: 'manuSpecificTuya_3',
185
+ type: ['attributeReport', 'readResponse'],
186
+ convert: (model, msg, publish, options, meta) => {
187
+ const attribute = 'powerOnBehavior';
188
+ const lookup = {0: 'off', 1: 'on', 2: 'previous'};
189
+
190
+ if (msg.data.hasOwnProperty(attribute)) {
191
+ const property = utils.postfixWithEndpointName('power_on_behavior', msg, model);
192
+ return {[property]: lookup[msg.data[attribute]]};
193
+ }
194
+ },
195
+ },
169
196
  zb_sm_cover: {
170
197
  cluster: 'manuSpecificTuya',
171
198
  type: ['commandDataReport', 'commandDataResponse'],
@@ -523,6 +550,7 @@ module.exports = [
523
550
  {modelID: 'TS0202', manufacturerName: '_TZ3000_otvn3lne'},
524
551
  {modelID: 'TS0202', manufacturerName: '_TZ3000_tiwq83wk'},
525
552
  {modelID: 'TS0202', manufacturerName: '_TZ3000_ykwcwxmz'},
553
+ {modelID: 'TS0202', manufacturerName: '_TZ3000_hgu1dlak'},
526
554
  {modelID: 'WHD02', manufacturerName: '_TZ3000_hktqahrq'}],
527
555
  model: 'TS0202',
528
556
  vendor: 'TuYa',
@@ -1931,9 +1959,11 @@ module.exports = [
1931
1959
  model: 'TS0004',
1932
1960
  vendor: 'TuYa',
1933
1961
  description: 'Smart light switch - 4 gang with neutral wire',
1934
- extend: extend.switch(),
1935
- exposes: [e.switch().withEndpoint('l1'), e.switch().withEndpoint('l2'), e.switch().withEndpoint('l3'),
1936
- e.switch().withEndpoint('l4')],
1962
+ fromZigbee: [fz.on_off, fzLocal.power_on_behavior, fz.ignore_basic_report],
1963
+ toZigbee: [tz.on_off, tzLocal.power_on_behavior],
1964
+ exposes: [e.switch().withEndpoint('l1'), e.power_on_behavior().withEndpoint('l1'), e.switch().withEndpoint('l2'),
1965
+ e.power_on_behavior().withEndpoint('l2'), e.switch().withEndpoint('l3'), e.power_on_behavior().withEndpoint('l3'),
1966
+ e.switch().withEndpoint('l4'), e.power_on_behavior().withEndpoint('l4')],
1937
1967
  endpoint: (device) => {
1938
1968
  return {'l1': 1, 'l2': 2, 'l3': 3, 'l4': 4};
1939
1969
  },
package/devices/xiaomi.js CHANGED
@@ -1538,14 +1538,14 @@ module.exports = [
1538
1538
  model: 'GZCGQ01LM',
1539
1539
  vendor: 'Xiaomi',
1540
1540
  description: 'MiJia light intensity sensor',
1541
- fromZigbee: [fz.battery, fz.illuminance],
1541
+ fromZigbee: [fz.battery, fz.illuminance, fz.aqara_opple],
1542
1542
  toZigbee: [],
1543
1543
  meta: {battery: {voltageToPercentage: '3V_2850_3000_log'}},
1544
1544
  configure: async (device, coordinatorEndpoint, logger) => {
1545
1545
  const endpoint = device.getEndpoint(1);
1546
- await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg', 'msIlluminanceMeasurement']);
1547
- await reporting.batteryVoltage(endpoint);
1546
+ await reporting.bind(endpoint, coordinatorEndpoint, ['msIlluminanceMeasurement']);
1548
1547
  await reporting.illuminance(endpoint, {min: 15, max: constants.repInterval.HOUR, change: 500});
1548
+ await endpoint.read('genPowerCfg', ['batteryVoltage']);
1549
1549
  },
1550
1550
  exposes: [e.battery(), e.battery_voltage(), e.illuminance(), e.illuminance_lux()],
1551
1551
  },
@@ -189,6 +189,30 @@ module.exports = [
189
189
  toZigbee: [tz.tuya_cover_control, tz.tuya_cover_options, tz.tuya_data_point_test],
190
190
  exposes: [e.cover_position().setAccess('position', ea.STATE_SET)],
191
191
  },
192
+ {
193
+ fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_1n2kyphz'}],
194
+ model: 'TB26-4',
195
+ vendor: 'Zemismart',
196
+ description: '4-gang smart wall switch',
197
+ exposes: [e.switch().withEndpoint('l1').setAccess('state', ea.STATE_SET),
198
+ e.switch().withEndpoint('l2').setAccess('state', ea.STATE_SET),
199
+ e.switch().withEndpoint('l3').setAccess('state', ea.STATE_SET),
200
+ e.switch().withEndpoint('l4').setAccess('state', ea.STATE_SET)],
201
+ fromZigbee: [fz.ignore_basic_report, fz.tuya_switch],
202
+ toZigbee: [tz.tuya_switch_state],
203
+ meta: {multiEndpoint: true},
204
+ endpoint: (device) => {
205
+ return {'l1': 1, 'l2': 1, 'l3': 1, 'l4': 1};
206
+ },
207
+ configure: async (device, coordinatorEndpoint, logger) => {
208
+ await reporting.bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff']);
209
+ if (device.getEndpoint(2)) await reporting.bind(device.getEndpoint(2), coordinatorEndpoint, ['genOnOff']);
210
+ if (device.getEndpoint(3)) await reporting.bind(device.getEndpoint(3), coordinatorEndpoint, ['genOnOff']);
211
+ if (device.getEndpoint(4)) await reporting.bind(device.getEndpoint(4), coordinatorEndpoint, ['genOnOff']);
212
+ device.powerSource = 'Mains (single phase)';
213
+ device.save();
214
+ },
215
+ },
192
216
  {
193
217
  fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_9mahtqtg'}],
194
218
  model: 'TB26-6',
package/devices/zen.js CHANGED
@@ -15,7 +15,8 @@ module.exports = [
15
15
  tz.thermostat_unoccupied_heating_setpoint, tz.thermostat_setpoint_raise_lower, tz.thermostat_running_state,
16
16
  tz.thermostat_remote_sensing, tz.thermostat_control_sequence_of_operation, tz.thermostat_system_mode,
17
17
  tz.thermostat_weekly_schedule, tz.thermostat_clear_weekly_schedule, tz.thermostat_relay_status_log],
18
- exposes: [exposes.climate().withSetpoint('occupied_heating_setpoint', 10, 30, 0.5).withLocalTemperature()
18
+ exposes: [exposes.climate().withSetpoint('occupied_heating_setpoint', 10, 30, 0.5)
19
+ .withSetpoint('occupied_cooling_setpoint', 10, 31, 0.5).withLocalTemperature()
19
20
  .withSystemMode(['off', 'auto', 'heat', 'cool']).withRunningState(['idle', 'heat', 'cool'])
20
21
  .withLocalTemperatureCalibration(-30, 30, 0.1).withPiHeatingDemand()],
21
22
  configure: async (device, coordinatorEndpoint, logger) => {
package/lib/xiaomi.js CHANGED
@@ -158,7 +158,7 @@ const numericAttributes2Payload = (msg, meta, model, options, dataObject) => {
158
158
  }
159
159
  break;
160
160
  case '3':
161
- if (['WXCJKG11LM', 'WXCJKG12LM', 'WXCJKG13LM', 'MCCGQ14LM'].includes(model.model)) {
161
+ if (['WXCJKG11LM', 'WXCJKG12LM', 'WXCJKG13LM', 'MCCGQ14LM', 'GZCGQ01LM'].includes(model.model)) {
162
162
  // The temperature value is constant 25 °C and does not change, so we ignore it
163
163
  // https://github.com/Koenkk/zigbee2mqtt/issues/11126
164
164
  // https://github.com/Koenkk/zigbee-herdsman-converters/pull/3585
@@ -225,6 +225,9 @@ const numericAttributes2Payload = (msg, meta, model, options, dataObject) => {
225
225
  // payload.water_leak = value === 1;
226
226
  } else if (['JTYJ-GD-01LM/BW'].includes(model.model)) {
227
227
  payload.smoke_density = value;
228
+ } else if (['GZCGQ01LM'].includes(model.model)) {
229
+ // DEPRECATED: change illuminance_lux -> illuminance
230
+ payload.illuminance_lux = calibrateAndPrecisionRoundOptions(value, options, 'illuminance_lux');
228
231
  } else {
229
232
  payload.state = value === 1 ? 'ON' : 'OFF';
230
233
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zigbee-herdsman-converters",
3
- "version": "14.0.537",
3
+ "version": "14.0.538",
4
4
  "description": "Collection of device converters to be used with zigbee-herdsman",
5
5
  "main": "index.js",
6
6
  "files": [