zigbee-herdsman-converters 14.0.390 → 14.0.391

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.
@@ -1860,6 +1860,36 @@ const converters = {
1860
1860
  }
1861
1861
  },
1862
1862
  },
1863
+ tuya_illuminance_sensor: {
1864
+ cluster: `manuSpecificTuya`,
1865
+ type: [`commandDataReport`, `commandDataResponse`],
1866
+ options: [exposes.options.precision('illuminance_lux'),
1867
+ exposes.options.calibration('illuminance_lux', 'percentual')],
1868
+ convert: (() => {
1869
+ const brightnessState = {
1870
+ 0: 'low',
1871
+ 1: 'middle',
1872
+ 2: 'high',
1873
+ 3: 'strong',
1874
+ };
1875
+ return (model, msg, publish, options, meta) => {
1876
+ const dpValue = tuya.firstDpValue(msg, meta, `tuya_illuminance_sensor`);
1877
+ const dp = dpValue.dp;
1878
+ const value = tuya.getDataValue(dpValue);
1879
+ switch (dp) {
1880
+ case tuya.dataPoints.state:
1881
+ return {brightness_state: brightnessState[value]};
1882
+ case tuya.dataPoints.tIlluminanceLux:
1883
+ return {illuminance_lux: calibrateAndPrecisionRoundOptions(value, options, 'illuminance_lux')};
1884
+ default:
1885
+ meta.logger.warn(
1886
+ `zigbee-herdsman-converters:tuya_illuminance_sensor: NOT RECOGNIZED ` +
1887
+ `DP #${dp} with data ${JSON.stringify(dpValue)}`,
1888
+ );
1889
+ }
1890
+ };
1891
+ })(),
1892
+ },
1863
1893
  ts0201_temperature_humidity_alarm: {
1864
1894
  cluster: 'manuSpecificTuya_2',
1865
1895
  type: ['attributeReport', 'readResponse'],
@@ -1270,7 +1270,7 @@ const converters = {
1270
1270
  convertSet: async (entity, key, value, meta) => {
1271
1271
  let result;
1272
1272
  if (meta.options.thermostat_unit === 'fahrenheit') {
1273
- result = utils.normalizeCelsiusVersionOfFahrenheit(value) * 100;
1273
+ result = Math.round(utils.normalizeCelsiusVersionOfFahrenheit(value) * 100);
1274
1274
  } else {
1275
1275
  result = (Math.round((value * 2).toFixed(1)) / 2).toFixed(1) * 100;
1276
1276
  }
@@ -1287,7 +1287,7 @@ const converters = {
1287
1287
  convertSet: async (entity, key, value, meta) => {
1288
1288
  let result;
1289
1289
  if (meta.options.thermostat_unit === 'fahrenheit') {
1290
- result = utils.normalizeCelsiusVersionOfFahrenheit(value) * 100;
1290
+ result = Math.round(utils.normalizeCelsiusVersionOfFahrenheit(value) * 100);
1291
1291
  } else {
1292
1292
  result = (Math.round((value * 2).toFixed(1)) / 2).toFixed(1) * 100;
1293
1293
  }
@@ -1304,7 +1304,7 @@ const converters = {
1304
1304
  convertSet: async (entity, key, value, meta) => {
1305
1305
  let result;
1306
1306
  if (meta.options.thermostat_unit === 'fahrenheit') {
1307
- result = utils.normalizeCelsiusVersionOfFahrenheit(value) * 100;
1307
+ result = Math.round(utils.normalizeCelsiusVersionOfFahrenheit(value) * 100);
1308
1308
  } else {
1309
1309
  result = (Math.round((value * 2).toFixed(1)) / 2).toFixed(1) * 100;
1310
1310
  }
@@ -1321,7 +1321,7 @@ const converters = {
1321
1321
  convertSet: async (entity, key, value, meta) => {
1322
1322
  let result;
1323
1323
  if (meta.options.thermostat_unit === 'fahrenheit') {
1324
- result = utils.normalizeCelsiusVersionOfFahrenheit(value) * 100;
1324
+ result = Math.round(utils.normalizeCelsiusVersionOfFahrenheit(value) * 100);
1325
1325
  } else {
1326
1326
  result = (Math.round((value * 2).toFixed(1)) / 2).toFixed(1) * 100;
1327
1327
  }
@@ -1356,7 +1356,7 @@ const converters = {
1356
1356
  convertSet: async (entity, key, value, meta) => {
1357
1357
  let result;
1358
1358
  if (meta.options.thermostat_unit === 'fahrenheit') {
1359
- result = utils.normalizeCelsiusVersionOfFahrenheit(value) * 100;
1359
+ result = Math.round(utils.normalizeCelsiusVersionOfFahrenheit(value) * 100);
1360
1360
  } else {
1361
1361
  result = (Math.round((value * 2).toFixed(1)) / 2).toFixed(1) * 100;
1362
1362
  }
@@ -1372,7 +1372,7 @@ const converters = {
1372
1372
  convertSet: async (entity, key, value, meta) => {
1373
1373
  let result;
1374
1374
  if (meta.options.thermostat_unit === 'fahrenheit') {
1375
- result = utils.normalizeCelsiusVersionOfFahrenheit(value) * 100;
1375
+ result = Math.round(utils.normalizeCelsiusVersionOfFahrenheit(value) * 100);
1376
1376
  } else {
1377
1377
  result = (Math.round((value * 2).toFixed(1)) / 2).toFixed(1) * 100;
1378
1378
  }
@@ -100,4 +100,17 @@ module.exports = [
100
100
  await reporting.onOff(endpoint);
101
101
  },
102
102
  },
103
+ {
104
+ zigbeeModel: ['43096'],
105
+ model: '43096',
106
+ vendor: 'Enbrighten',
107
+ description: 'Zigbee plug-in smart dimmer with dual controlled outlets',
108
+ extend: extend.light_onoff_brightness({noConfigure: true}),
109
+ configure: async (device, coordinatorEndpoint, logger) => {
110
+ await extend.light_onoff_brightness().configure(device, coordinatorEndpoint, logger);
111
+ const endpoint = device.getEndpoint(1);
112
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl']);
113
+ await reporting.onOff(endpoint);
114
+ },
115
+ },
103
116
  ];
package/devices/ikea.js CHANGED
@@ -64,6 +64,12 @@ const tradfriExtend = {
64
64
  ota: ota.tradfri,
65
65
  onEvent: bulbOnEvent,
66
66
  }),
67
+ light_onoff_brightness_color: (options = {}) => ({
68
+ ...extend.light_onoff_brightness_color(options),
69
+ exposes: extend.light_onoff_brightness_color(options).exposes.concat(e.power_on_behavior()),
70
+ ota: ota.tradfri,
71
+ onEvent: bulbOnEvent,
72
+ }),
67
73
  };
68
74
 
69
75
  const manufacturerOptions = {manufacturerCode: herdsman.Zcl.ManufacturerCode.IKEA_OF_SWEDEN};
@@ -369,7 +375,7 @@ module.exports = [
369
375
  model: 'LED1624G9',
370
376
  vendor: 'IKEA',
371
377
  description: 'TRADFRI LED bulb E14/E26/E27 600 lumen, dimmable, color, opal white',
372
- extend: tradfriExtend.light_onoff_brightness_colortemp_color({colorTempRange: [250, 454]}),
378
+ extend: tradfriExtend.light_onoff_brightness_color(),
373
379
  meta: {supportsHueAndSaturation: false},
374
380
  },
375
381
  {
@@ -1194,12 +1194,12 @@ module.exports = [
1194
1194
  ota: ota.zigbeeOTA,
1195
1195
  },
1196
1196
  {
1197
- zigbeeModel: ['3261031P6'],
1197
+ zigbeeModel: ['3261031P6', '929003055001'],
1198
1198
  model: '3261031P6',
1199
1199
  vendor: 'Philips',
1200
1200
  description: 'Hue Being white',
1201
1201
  meta: {turnsOffAtBrightness1: true},
1202
- extend: hueExtend.light_onoff_brightness_colortemp(),
1202
+ extend: hueExtend.light_onoff_brightness_colortemp({colorTempRange: [153, 454]}),
1203
1203
  ota: ota.zigbeeOTA,
1204
1204
  },
1205
1205
  {
@@ -2619,4 +2619,12 @@ module.exports = [
2619
2619
  extend: hueExtend.light_onoff_brightness(),
2620
2620
  ota: ota.zigbeeOTA,
2621
2621
  },
2622
+ {
2623
+ zigbeeModel: ['915005997501'],
2624
+ model: '915005997501',
2625
+ vendor: 'Philips',
2626
+ description: 'Hue Bluetooth white & color ambiance ceiling lamp Infuse large',
2627
+ extend: hueExtend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
2628
+ ota: ota.zigbeeOTA,
2629
+ },
2622
2630
  ];
package/devices/tuya.js CHANGED
@@ -1902,4 +1902,13 @@ module.exports = [
1902
1902
  toZigbee: [],
1903
1903
  exposes: [e.contact(), e.battery(), e.vibration()],
1904
1904
  },
1905
+ {
1906
+ fingerprint: [{modelID: `TS0601`, manufacturerName: `_TZE200_yi4jtqq1`}],
1907
+ model: `XFY-CGQ-ZIGB`,
1908
+ vendor: `TuYa`,
1909
+ description: `Illuminance sensor`,
1910
+ fromZigbee: [fz.tuya_illuminance_sensor],
1911
+ toZigbee: [],
1912
+ exposes: [e.illuminance_lux(), e.brightness_state()],
1913
+ },
1905
1914
  ];
@@ -0,0 +1,12 @@
1
+ const extend = require('../lib/extend');
2
+
3
+ module.exports = [
4
+ {
5
+ fingerprint: [{modelID: 'TS0505B', manufacturerName: '_TZ3210_dn5higyl'}],
6
+ model: 'TH008L10RGBCCT',
7
+ vendor: 'UR Lighting',
8
+ description: '10W RGB+CCT downlight',
9
+ meta: {applyRedFix: true, enhancedHue: false},
10
+ extend: extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
11
+ },
12
+ ];
package/lib/exposes.js CHANGED
@@ -543,6 +543,7 @@ module.exports = {
543
543
  humidity: () => new Numeric('humidity', access.STATE).withUnit('%').withDescription('Measured relative humidity'),
544
544
  illuminance: () => new Numeric('illuminance', access.STATE).withDescription('Raw measured illuminance'),
545
545
  illuminance_lux: () => new Numeric('illuminance_lux', access.STATE).withUnit('lx').withDescription('Measured illuminance in lux'),
546
+ brightness_state: () => new Enum('brightness_state', access.STATE, ['low', 'middle', 'high', 'strong']).withDescription('Brightness state'),
546
547
  keypad_lockout: () => new Enum('keypad_lockout', access.ALL, ['unlock', 'lock1', 'lock2']).withDescription('Enables/disables physical input on the device'),
547
548
  led_disabled_night: () => new Binary('led_disabled_night', access.ALL, true, false).withDescription('Enable/disable the LED at night'),
548
549
  light_brightness: () => new Light().withBrightness(),
package/lib/tuya.js CHANGED
@@ -537,6 +537,7 @@ const dataPoints = {
537
537
  // TUYA / HUMIDITY/ILLUMINANCE/TEMPERATURE SENSOR
538
538
  thitBatteryPercentage: 3,
539
539
  thitIlluminanceLux: 7,
540
+ tIlluminanceLux: 2,
540
541
  thitHumidity: 9,
541
542
  thitTemperature: 8,
542
543
  // TUYA SMART VIBRATION SENSOR
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zigbee-herdsman-converters",
3
- "version": "14.0.390",
3
+ "version": "14.0.391",
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.390",
3
+ "version": "14.0.391",
4
4
  "description": "Collection of device converters to be used with zigbee-herdsman",
5
5
  "main": "index.js",
6
6
  "files": [