zigbee-herdsman-converters 14.0.387 → 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'],
@@ -4362,6 +4392,14 @@ const converters = {
4362
4392
  convert: (model, msg, publis, options, meta) => {
4363
4393
  // Don't use in production!
4364
4394
  // Used in: https://www.zigbee2mqtt.io/how_tos/how_to_support_new_tuya_devices.html
4395
+ const getType = (datatype) => {
4396
+ const entry = Object.entries(tuya.dataTypes).find(([typeName, typeId]) => typeId === datatype);
4397
+ return (entry ? entry[0] : 'unknown');
4398
+ };
4399
+ const getAllDpIds = (dp) => {
4400
+ const entries = Object.entries(tuya.dataPoints).filter(([dpName, dpId]) => dpId === dp);
4401
+ return entries.map(([dpName, dpId]) => dpName);
4402
+ };
4365
4403
  const getHex = (value) => {
4366
4404
  let hex = value.toString(16);
4367
4405
  if (hex.length < 2) {
@@ -4372,6 +4410,11 @@ const converters = {
4372
4410
  const now = Date.now().toString();
4373
4411
  let dataStr = '';
4374
4412
  for (const [i, dpValue] of msg.data.dpValues.entries()) {
4413
+ const value = tuya.getDataValue(dpValue);
4414
+ meta.logger.info(`zigbee-herdsman-converters:tuya_data_point_dump: Received DP #${
4415
+ dpValue.dp} from ${meta.device.ieeeAddr} with raw data '${JSON.stringify(dpValue)}': type='${msg.type}', datatype='${
4416
+ getType(dpValue.datatype)}', value='${value}', known DP# usage: ${JSON.stringify(getAllDpIds(dpValue.dp))}`);
4417
+
4375
4418
  dataStr +=
4376
4419
  now + ' ' +
4377
4420
  meta.device.ieeeAddr + ' ' +
@@ -7614,6 +7657,57 @@ const converters = {
7614
7657
  return result;
7615
7658
  },
7616
7659
  },
7660
+ tuya_radar_sensor_fall: {
7661
+ cluster: 'manuSpecificTuya',
7662
+ type: ['commandDataResponse', 'commandDataReport'],
7663
+ convert: (model, msg, publish, options, meta) => {
7664
+ const dpValue = tuya.firstDpValue(msg, meta, 'tuya_radar_sensor_fall');
7665
+ const dp = dpValue.dp;
7666
+ const value = tuya.getDataValue(dpValue);
7667
+ let result = null;
7668
+ switch (dp) {
7669
+ case tuya.dataPoints.trsfPresenceState:
7670
+ result = {presence: {0: false, 1: true}[value]};
7671
+ break;
7672
+ case tuya.dataPoints.trsfMotionState:
7673
+ result = {occupancy: {1: false, 2: true}[value]};
7674
+ break;
7675
+ case tuya.dataPoints.trsfMotionSpeed:
7676
+ result = {motion_speed: value};
7677
+ break;
7678
+ case tuya.dataPoints.trsfMotionDirection:
7679
+ result = {motion_direction: tuya.tuyaRadar.motionDirection[value]};
7680
+ break;
7681
+ case tuya.dataPoints.trsfScene:
7682
+ result = {radar_scene: tuya.tuyaRadar.radarScene[value]};
7683
+ break;
7684
+ case tuya.dataPoints.trsfSensitivity:
7685
+ result = {radar_sensitivity: value};
7686
+ break;
7687
+ case tuya.dataPoints.trsfIlluminanceLux:
7688
+ result = {illuminance_lux: value};
7689
+ break;
7690
+ case tuya.dataPoints.trsfTumbleAlarmTime:
7691
+ result = {tumble_alarm_time: value+1};
7692
+ break;
7693
+ case tuya.dataPoints.trsfTumbleSwitch:
7694
+ result = {tumble_switch: {false: 'OFF', true: 'ON'}[value]};
7695
+ break;
7696
+ case tuya.dataPoints.trsfFallDownStatus:
7697
+ result = {fall_down_status: {0: false, 1: true}[value]};
7698
+ break;
7699
+ case tuya.dataPoints.trsfStaticDwellAlarm:
7700
+ result = {static_dwell_alarm: value};
7701
+ break;
7702
+ case tuya.dataPoints.trsfFallSensitivity:
7703
+ result = {fall_sensitivity: value};
7704
+ break;
7705
+ default:
7706
+ meta.logger.warn(`fromZigbee.tuya_radar_sensor_fall: NOT RECOGNIZED DP ${dp} with data ${JSON.stringify(dpValue)}`);
7707
+ }
7708
+ return result;
7709
+ },
7710
+ },
7617
7711
  tuya_smart_vibration_sensor: {
7618
7712
  cluster: 'manuSpecificTuya',
7619
7713
  type: ['commandGetData', 'commandDataResponse', 'raw'],
@@ -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
  }
@@ -1982,7 +1982,7 @@ const converters = {
1982
1982
  convertSet: async (entity, key, value, meta) => {
1983
1983
  const lookup = {'siren_led': 3, 'siren': 2, 'led': 1, 'nothing': 0};
1984
1984
  await entity.write('genBasic', {0x400a: {value: lookup[value], type: 32}},
1985
- {manufacturerCode: 0x1168, disableDefaultResponse: true, sendWhenActive: true});
1985
+ {manufacturerCode: 0x1168, disableDefaultResponse: true, sendWhen: 'active'});
1986
1986
  return {state: {alert_behaviour: value}};
1987
1987
  },
1988
1988
  },
@@ -6099,7 +6099,7 @@ const converters = {
6099
6099
  key: ['keypad_lockout'],
6100
6100
  convertSet: async (entity, key, value, meta) => {
6101
6101
  const keypadLockout = utils.getKey(constants.keypadLockoutMode, value, value, Number);
6102
- entity.write('hvacUserInterfaceCfg', {keypadLockout}, {sendWhenActive: true});
6102
+ entity.write('hvacUserInterfaceCfg', {keypadLockout}, {sendWhen: 'active'});
6103
6103
  entity.saveClusterAttributeKeyValue('hvacUserInterfaceCfg', {keypadLockout});
6104
6104
  return {state: {keypad_lockout: value}};
6105
6105
  },
@@ -6238,7 +6238,7 @@ const converters = {
6238
6238
  key: ['calibrate_valve'],
6239
6239
  convertSet: async (entity, key, value, meta) => {
6240
6240
  await entity.command('hvacThermostat', 'wiserSmartCalibrateValve', {},
6241
- {srcEndpoint: 11, disableDefaultResponse: true, sendWhenActive: true});
6241
+ {srcEndpoint: 11, disableDefaultResponse: true, sendWhen: 'active'});
6242
6242
  return {state: {'calibrate_valve': value}};
6243
6243
  },
6244
6244
  },
@@ -6260,7 +6260,7 @@ const converters = {
6260
6260
  key: ['local_temperature_calibration'],
6261
6261
  convertSet: (entity, key, value, meta) => {
6262
6262
  entity.write('hvacThermostat', {localTemperatureCalibration: Math.round(value * 10)},
6263
- {srcEndpoint: 11, disableDefaultResponse: true, sendWhenActive: true});
6263
+ {srcEndpoint: 11, disableDefaultResponse: true, sendWhen: 'active'});
6264
6264
  return {state: {local_temperature_calibration: value}};
6265
6265
  },
6266
6266
  },
@@ -6269,7 +6269,7 @@ const converters = {
6269
6269
  convertSet: async (entity, key, value, meta) => {
6270
6270
  const keypadLockout = utils.getKey(constants.keypadLockoutMode, value, value, Number);
6271
6271
  await entity.write('hvacUserInterfaceCfg', {keypadLockout},
6272
- {srcEndpoint: 11, disableDefaultResponse: true, sendWhenActive: true});
6272
+ {srcEndpoint: 11, disableDefaultResponse: true, sendWhen: 'active'});
6273
6273
  return {state: {keypad_lockout: value}};
6274
6274
  },
6275
6275
  },
@@ -6371,6 +6371,30 @@ const converters = {
6371
6371
  }
6372
6372
  },
6373
6373
  },
6374
+ tuya_radar_sensor_fall: {
6375
+ key: ['radar_scene', 'radar_sensitivity', 'tumble_alarm_time', 'tumble_switch', 'fall_sensitivity'],
6376
+ convertSet: async (entity, key, value, meta) => {
6377
+ switch (key) {
6378
+ case 'radar_scene':
6379
+ await tuya.sendDataPointEnum(entity, tuya.dataPoints.trsfScene, utils.getKey(tuya.tuyaRadar.radarScene, value));
6380
+ break;
6381
+ case 'radar_sensitivity':
6382
+ await tuya.sendDataPointValue(entity, tuya.dataPoints.trsfSensitivity, value);
6383
+ break;
6384
+ case 'tumble_switch':
6385
+ await tuya.sendDataPointEnum(entity, tuya.dataPoints.trsfTumbleSwitch, {'on': true, 'off': false}[value.toLowerCase()]);
6386
+ break;
6387
+ case 'tumble_alarm_time':
6388
+ await tuya.sendDataPointEnum(entity, tuya.dataPoints.trsfTumbleAlarmTime, value-1);
6389
+ break;
6390
+ case 'fall_sensitivity':
6391
+ await tuya.sendDataPointValue(entity, tuya.dataPoints.trsfFallSensitivity, value);
6392
+ break;
6393
+ default: // Unknown Key
6394
+ meta.logger.warn(`toZigbee.tuya_radar_sensor_fall: Unhandled Key ${key}`);
6395
+ }
6396
+ },
6397
+ },
6374
6398
  javis_microwave_sensor: {
6375
6399
  key: [
6376
6400
  'illuminance_calibration', 'led_enable',
@@ -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
  {
package/devices/lidl.js CHANGED
@@ -485,6 +485,17 @@ module.exports = [
485
485
  device.getEndpoint(1).saveClusterAttributeKeyValue('lightingColorCtrl', {colorCapabilities: 29});
486
486
  },
487
487
  },
488
+ {
489
+ fingerprint: [{modelID: 'TS0505B', manufacturerName: '_TZ3210_r0xgkft5'}],
490
+ model: '14156506L',
491
+ vendor: 'Lidl',
492
+ description: 'Livarno Lux smart LED mood light',
493
+ ...extend.light_onoff_brightness_colortemp_color({disableColorTempStartup: true, colorTempRange: [153, 500]}),
494
+ meta: {applyRedFix: true, enhancedHue: false},
495
+ configure: async (device, coordinatorEndpoint, logger) => {
496
+ device.getEndpoint(1).saveClusterAttributeKeyValue('lightingColorCtrl', {colorCapabilities: 29});
497
+ },
498
+ },
488
499
  {
489
500
  fingerprint: [{modelID: 'TS0505B', manufacturerName: '_TZ3000_quqaeew6'}],
490
501
  model: 'HG07834A',
@@ -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
@@ -926,6 +926,7 @@ module.exports = [
926
926
  {modelID: 'TS0601', manufacturerName: '_TZE200_hue3yfsn'}, /* model: 'TV02-Zigbee', vendor: 'TuYa' */
927
927
  {modelID: 'TS0601', manufacturerName: '_TZE200_e9ba97vf'}, /* model: 'TV01-ZB', vendor: 'Moes' */
928
928
  {modelID: 'TS0601', manufacturerName: '_TZE200_husqqvux'}, /* model: 'TSL-TRV-TV01ZG', vendor: 'Tesla Smart' */
929
+ {modelID: 'TS0601', manufacturerName: '_TZE200_lllliz3p'}, /* model: 'TV02-Zigbee', vendor: 'TuYa' */
929
930
  ],
930
931
  model: 'TV02-Zigbee',
931
932
  vendor: 'TuYa',
@@ -1716,9 +1717,7 @@ module.exports = [
1716
1717
  ],
1717
1718
  },
1718
1719
  {
1719
- fingerprint: [
1720
- {modelID: 'TS0601', manufacturerName: '_TZE200_vrfecyku'},
1721
- {modelID: 'TS0601', manufacturerName: '_TZE200_lu01t0zl'}],
1720
+ fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_vrfecyku'}],
1722
1721
  model: 'MIR-HE200-TY',
1723
1722
  vendor: 'TuYa',
1724
1723
  description: 'Human presence sensor',
@@ -1735,6 +1734,35 @@ module.exports = [
1735
1734
  .withDescription('presets for sensitivity for presence and movement'),
1736
1735
  ],
1737
1736
  },
1737
+ {
1738
+ fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_lu01t0zl'}],
1739
+ model: 'MIR-HE200-TY_fall',
1740
+ vendor: 'TuYa',
1741
+ description: 'Human presence sensor with fall function',
1742
+ fromZigbee: [fz.tuya_radar_sensor_fall],
1743
+ toZigbee: [tz.tuya_radar_sensor_fall],
1744
+ exposes: [
1745
+ e.illuminance_lux(), e.presence(), e.occupancy(),
1746
+ exposes.numeric('motion_speed', ea.STATE).withDescription('Speed of movement'),
1747
+ exposes.enum('motion_direction', ea.STATE, Object.values(tuya.tuyaRadar.motionDirection))
1748
+ .withDescription('direction of movement from the point of view of the radar'),
1749
+ exposes.numeric('radar_sensitivity', ea.STATE_SET).withValueMin(0).withValueMax(10).withValueStep(1)
1750
+ .withDescription('sensitivity of the radar'),
1751
+ exposes.enum('radar_scene', ea.STATE_SET, Object.values(tuya.tuyaRadar.radarScene))
1752
+ .withDescription('presets for sensitivity for presence and movement'),
1753
+ exposes.enum('tumble_switch', ea.STATE_SET, ['ON', 'OFF']).withDescription('Tumble status switch'),
1754
+ exposes.numeric('fall_sensitivity', ea.STATE_SET).withValueMin(1).withValueMax(10).withValueStep(1)
1755
+ .withDescription('fall sensitivity of the radar'),
1756
+ exposes.numeric('tumble_alarm_time', ea.STATE_SET).withValueMin(1).withValueMax(5).withValueStep(1)
1757
+ .withUnit('min').withDescription('tumble alarm time'),
1758
+ exposes.binary('fall_down_status', ea.STATE).withDescription('fall down status'),
1759
+ exposes.text('static_dwell_alarm', ea.STATE).withDescription('static dwell alarm'),
1760
+ ],
1761
+ configure: async (device, coordinatorEndpoint, logger) => {
1762
+ const endpoint = device.getEndpoint(1);
1763
+ await tuya.sendDataPointEnum(endpoint, tuya.dataPoints.trsfTumbleSwitch, false);
1764
+ },
1765
+ },
1738
1766
  {
1739
1767
  fingerprint: [{modelID: 'TS004F', manufacturerName: '_TZ3000_pcqjmcud'}],
1740
1768
  model: 'YSR-MINI-Z',
@@ -1874,4 +1902,13 @@ module.exports = [
1874
1902
  toZigbee: [],
1875
1903
  exposes: [e.contact(), e.battery(), e.vibration()],
1876
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
+ },
1877
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/ota/common.js CHANGED
@@ -385,11 +385,18 @@ async function updateToLatest(device, logger, onProgress, getNewImage, getImageM
385
385
 
386
386
  endpoint.commandResponse('genOta', 'upgradeEndResponse', payload).then(
387
387
  () => {
388
- logger.debug(`Update succeeded, waiting for device to restart`);
389
- setTimeout(() => {
390
- onProgress(100, null);
388
+ logger.debug(`Update succeeded, waiting for device announce`);
389
+ onProgress(100, null);
390
+
391
+ let timer = null;
392
+ const cb = () => {
393
+ logger.debug('Got device announce or timed out, call resolve');
394
+ clearInterval(timer);
395
+ device.removeListener('deviceAnnounce', cb);
391
396
  resolve();
392
- }, 90 * 1000);
397
+ };
398
+ timer = setTimeout(cb, 120 * 1000); // timeout after 2 minutes
399
+ device.once('deviceAnnounce', cb);
393
400
  },
394
401
  (e) => {
395
402
  const message = `Upgrade end reponse failed (${e.message})`;
package/lib/tuya.js CHANGED
@@ -426,6 +426,19 @@ const dataPoints = {
426
426
  trsScene: 112,
427
427
  trsMotionDirection: 114,
428
428
  trsMotionSpeed: 115,
429
+ // TuYa Radar Sensor with fall function
430
+ trsfPresenceState: 1,
431
+ trsfSensitivity: 2,
432
+ trsfMotionState: 102,
433
+ trsfIlluminanceLux: 103,
434
+ trsfTumbleSwitch: 105,
435
+ trsfTumbleAlarmTime: 106,
436
+ trsfScene: 112,
437
+ trsfMotionDirection: 114,
438
+ trsfMotionSpeed: 115,
439
+ trsfFallDownStatus: 116,
440
+ trsfStaticDwellAlarm: 117,
441
+ trsfFallSensitivity: 118,
429
442
  // Human Presence Sensor AIR
430
443
  msVSensitivity: 101,
431
444
  msOSensitivity: 102,
@@ -524,6 +537,7 @@ const dataPoints = {
524
537
  // TUYA / HUMIDITY/ILLUMINANCE/TEMPERATURE SENSOR
525
538
  thitBatteryPercentage: 3,
526
539
  thitIlluminanceLux: 7,
540
+ tIlluminanceLux: 2,
527
541
  thitHumidity: 9,
528
542
  thitTemperature: 8,
529
543
  // TUYA SMART VIBRATION SENSOR
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zigbee-herdsman-converters",
3
- "version": "14.0.387",
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.387",
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": [