zigbee-herdsman-converters 14.0.307 → 14.0.308

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.
package/README.md CHANGED
@@ -31,3 +31,4 @@ If any of those commands finish with an error your PR won't pass the tests and w
31
31
  - `battery`:
32
32
  - `{dontDividePercentage: true}`: prevents batteryPercentageRemainig from being divided (ZCL 200=100%, but some report 100=100%) (default: false)
33
33
  - `{voltageToPercentage: '3V_2100'}`: convert voltage to percentage using specified option. See utils.batteryVoltageToPercentage() (default: null, no voltage to percentage conversion)
34
+ - `fanStateOn`: value used for fan_mode when using fan_state="ON", the default is "on"
@@ -4841,7 +4841,7 @@ const converters = {
4841
4841
  }
4842
4842
 
4843
4843
  let buttonLookup = null;
4844
- if (['WXKG02LM_rev2', 'WXKG07LM'].includes(model.model)) buttonLookup = {1: 'left', 2: 'right', 3: 'both'};
4844
+ if (['WXKG02LM_rev2', 'WXKG07LM', 'WXKG17LM'].includes(model.model)) buttonLookup = {1: 'left', 2: 'right', 3: 'both'};
4845
4845
  if (['QBKG12LM', 'QBKG24LM'].includes(model.model)) buttonLookup = {5: 'left', 6: 'right', 7: 'both'};
4846
4846
  if (['QBKG25LM', 'QBKG26LM'].includes(model.model)) buttonLookup = {41: 'left', 42: 'center', 43: 'right'};
4847
4847
  if (['QBKG39LM', 'QBKG41LM', 'WS-EUK02', 'WS-EUK04', 'QBKG20LM', 'QBKG31LM'].includes(model.model)) {
@@ -1192,6 +1192,9 @@ const converters = {
1192
1192
  fan_mode: {
1193
1193
  key: ['fan_mode', 'fan_state'],
1194
1194
  convertSet: async (entity, key, value, meta) => {
1195
+ if (key == 'fan_state' && value.toLowerCase() == 'on') {
1196
+ value = utils.getMetaValue(entity, meta.mapped, 'fanStateOn', 'allEqual', 'on');
1197
+ }
1195
1198
  const fanMode = constants.fanMode[value.toLowerCase()];
1196
1199
  await entity.write('hvacFanCtrl', {fanMode});
1197
1200
  return {state: {fan_mode: value.toLowerCase(), fan_state: value.toLowerCase() === 'off' ? 'OFF' : 'ON'}};
@@ -6114,6 +6117,14 @@ const converters = {
6114
6117
  await endpoint.read('genOnOff', ['tuyaOperationMode']);
6115
6118
  },
6116
6119
  },
6120
+ xiaomi_switch_click_mode: {
6121
+ key: ['click_mode'],
6122
+ convertSet: async (entity, key, value, meta) => {
6123
+ const lookupState = {'fast': 0x1, 'multi': 0x02};
6124
+ await entity.write('aqaraOpple', {0x0125: {value: lookupState[value], type: 0x20}}, manufacturerOptions.xiaomi);
6125
+ return {state: {click_mode: value}};
6126
+ },
6127
+ },
6117
6128
  // #endregion
6118
6129
 
6119
6130
  // #region Ignore converters
@@ -1,5 +1,7 @@
1
1
  const reporting = require('../lib/reporting');
2
2
  const extend = require('../lib/extend');
3
+ const exposes = require('zigbee-herdsman-converters/lib/exposes');
4
+ const e = exposes.presets;
3
5
 
4
6
  module.exports = [
5
7
  {
@@ -26,4 +28,20 @@ module.exports = [
26
28
  await reporting.bind(endpoint, coordinatorEndpoint, ['genBasic', 'genIdentify', 'genOnOff']);
27
29
  },
28
30
  },
31
+ {
32
+ zigbeeModel: ['2CH-ZG-BOX-RELAY'],
33
+ model: '2CH-ZG-BOX-RELAY',
34
+ vendor: 'Envilar',
35
+ description: '2 channel box relay',
36
+ extend: extend.switch(),
37
+ exposes: [e.switch().withEndpoint('l1'), e.switch().withEndpoint('l2')],
38
+ endpoint: (device) => {
39
+ return {'l1': 1, 'l2': 2};
40
+ },
41
+ meta: {multiEndpoint: true},
42
+ configure: async (device, coordinatorEndpoint, logger) => {
43
+ await reporting.bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff']);
44
+ await reporting.bind(device.getEndpoint(2), coordinatorEndpoint, ['genOnOff']);
45
+ },
46
+ },
29
47
  ];
package/devices/ikea.js CHANGED
@@ -446,8 +446,8 @@ module.exports = [
446
446
  model: 'E1812',
447
447
  vendor: 'IKEA',
448
448
  description: 'TRADFRI shortcut button',
449
- fromZigbee: [fz.command_on, fz.command_move, fz.command_stop, fz.battery],
450
- exposes: [e.battery(), e.action(['on', 'brightness_move_up', 'brightness_stop'])],
449
+ fromZigbee: [fz.command_on, fz.command_off, fz.command_move, fz.command_stop, fz.battery],
450
+ exposes: [e.battery(), e.action(['on', 'off', 'brightness_move_up', 'brightness_stop'])],
451
451
  toZigbee: [],
452
452
  ota: ota.tradfri,
453
453
  meta: {disableActionGroup: true, battery: {dontDividePercentage: true}},
@@ -625,7 +625,8 @@ module.exports = [
625
625
  model: 'E2007',
626
626
  vendor: 'IKEA',
627
627
  description: 'STARKVIND air purifier',
628
- exposes: [e.fan().withModes(['off', 'low', 'medium', 'high', 'on', 'auto'])],
628
+ exposes: [e.fan().withModes(['off', 'low', 'medium', 'high', 'auto'])],
629
+ meta: {fanStateOn: 'auto'},
629
630
  fromZigbee: [fz.fan],
630
631
  toZigbee: [tz.fan_mode],
631
632
  configure: async (device, coordinatorEndpoint, logger) => {
package/devices/xiaomi.js CHANGED
@@ -1769,4 +1769,24 @@ module.exports = [
1769
1769
  await endpoint1.write('aqaraOpple', {'mode': 1}, {manufacturerCode: 0x115f, disableResponse: true});
1770
1770
  },
1771
1771
  },
1772
+ {
1773
+ zigbeeModel: ['lumi.remote.acn004'],
1774
+ model: 'WXKG17LM',
1775
+ vendor: 'Xiaomi',
1776
+ description: 'Aqara E1 double key wireless switch',
1777
+ meta: {battery: {voltageToPercentage: '3V_2100'}},
1778
+ exposes: [e.battery(), e.battery_voltage(),
1779
+ e.action(['single_left', 'single_right', 'single_both', 'double_left', 'double_right', 'hold_left', 'hold_right']),
1780
+ // eslint-disable-next-line max-len
1781
+ exposes.enum('click_mode', ea.SET, ['fast', 'multi']).withDescription('Click mode, fast: only supports single click which will be send immediately after clicking, multi: supports more events like double and hold'),
1782
+ ],
1783
+ fromZigbee: [fz.xiaomi_multistate_action, fz.aqara_opple_report],
1784
+ toZigbee: [tz.xiaomi_switch_click_mode],
1785
+ onEvent: preventReset,
1786
+ configure: async (device, coordinatorEndpoint, logger) => {
1787
+ const endpoint1 = device.getEndpoint(1);
1788
+ // set multiclick mode
1789
+ await endpoint1.write('aqaraOpple', {0x0125: {value: 0x02, type: 0x20}}, {manufacturerCode: 0x115f});
1790
+ },
1791
+ },
1772
1792
  ];
package/lib/exposes.js CHANGED
@@ -477,8 +477,8 @@ module.exports = {
477
477
  expose_pin: () => new Binary(`expose_pin`, access.SET, true, false).withDescription(`Expose pin of this lock in the published payload (default false).`),
478
478
  occupancy_timeout: () => new Numeric(`occupancy_timeout`, access.SET).withValueMin(0).withDescription('Time in seconds after which occupancy is cleared after detecting it (default 90 seconds).'),
479
479
  vibration_timeout: () => new Numeric(`vibration_timeout`, access.SET).withValueMin(0).withDescription('Time in seconds after which vibration is cleared after detecting it (default 90 seconds).'),
480
- simulated_brightness: () => new Composite('simulated_brightness', 'simulated_brightness')
481
- .withDescription('Simulate a brightness value. If this device provides a brightness_move_up or brightness_move_down action it is possible to specify the update interval and delta.')
480
+ simulated_brightness: (extraNote='') => new Composite('simulated_brightness', 'simulated_brightness')
481
+ .withDescription(`Simulate a brightness value. If this device provides a brightness_move_up or brightness_move_down action it is possible to specify the update interval and delta.${extraNote}`)
482
482
  .withFeature(new Numeric('delta', access.SET).withValueMin(0).withDescription('Delta per interval, 20 by default'))
483
483
  .withFeature(new Numeric('interval', access.SET).withValueMin(0).withUnit('ms').withDescription('Interval duration')),
484
484
  no_occupancy_since: () => new List(`no_occupancy_since`, access.SET).withDescription('Sends a message the last time occupancy was detected. When setting this for example to [10, 60] a `{"no_occupancy_since": 10}` will be send after 10 seconds and a `{"no_occupancy_since": 60}` after 60 seconds.'),
package/lib/legacy.js CHANGED
@@ -885,7 +885,7 @@ const fromZigbee = {
885
885
  cmd_move: {
886
886
  cluster: 'genLevelCtrl',
887
887
  type: 'commandMove',
888
- options: [exposes.options.legacy()],
888
+ options: [exposes.options.legacy(), exposes.options.simulated_brightness(' Note: will only work when legacy: false is set.')],
889
889
  convert: (model, msg, publish, options, meta) => {
890
890
  if (hasAlreadyProcessedMessage(msg)) return;
891
891
  if (isLegacyEnabled(options)) {
@@ -900,7 +900,7 @@ const fromZigbee = {
900
900
  cmd_move_with_onoff: {
901
901
  cluster: 'genLevelCtrl',
902
902
  type: 'commandMoveWithOnOff',
903
- options: [exposes.options.legacy()],
903
+ options: [exposes.options.legacy(), exposes.options.simulated_brightness(' Note: will only work when legacy: false is set.')],
904
904
  convert: (model, msg, publish, options, meta) => {
905
905
  if (isLegacyEnabled(options)) {
906
906
  ictcg1(model, msg, publish, options, 'move');
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zigbee-herdsman-converters",
3
- "version": "14.0.307",
3
+ "version": "14.0.308",
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.307",
3
+ "version": "14.0.308",
4
4
  "description": "Collection of device converters to be used with zigbee-herdsman",
5
5
  "main": "index.js",
6
6
  "files": [