zigbee-herdsman-converters 14.0.384 → 14.0.388

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.
@@ -5177,7 +5177,9 @@ const converters = {
5177
5177
  payload.voltage = value;
5178
5178
  payload.battery = batteryVoltageToPercentage(value, '3V_2100');
5179
5179
  } else if (index === 3) payload.temperature = calibrateAndPrecisionRoundOptions(value, options, 'temperature'); // 0x03
5180
- else if (index === 100) {
5180
+ else if (index === 5) {
5181
+ if (['JT-BZ-01AQ/A'].includes(model.model)) payload.power_outage_count = value;
5182
+ } else if (index === 100) {
5181
5183
  if (['QBKG19LM', 'QBKG20LM', 'QBKG39LM', 'QBKG41LM', 'QBCZ15LM'].includes(model.model)) {
5182
5184
  const mapping = model.model === 'QBCZ15LM' ? 'relay' : 'left';
5183
5185
  payload[`state_${mapping}`] = value === 1 ? 'ON' : 'OFF';
@@ -5198,15 +5200,37 @@ const converters = {
5198
5200
  } else if (index === 150) payload.voltage = precisionRound(value * 0.1, 1); // 0x96
5199
5201
  else if (index === 151) payload.current = precisionRound(value * 0.001, 4); // 0x97
5200
5202
  else if (index === 152) payload.power = precisionRound(value, 2); // 0x98
5203
+ else if (index === 159) payload.gas_sensitivity = {1: '15%LEL', 2: '10%LEL'}[value]; // JT-BZ-01AQ/A
5204
+ else if (index === 160) payload.gas = value === 1; // JT-BZ-01AQ/A
5205
+ else if (index === 161) payload.gas_density = value; // JT-BZ-01AQ/A
5206
+ else if (index === 162) payload.test = value === 1; // JT-BZ-01AQ/A
5207
+ else if (index === 163) payload.mute = value === 1; // JT-BZ-01AQ/A
5208
+ else if (index === 164) payload.state = value === 1 ? 'preparation' : 'work'; // JT-BZ-01AQ/A
5209
+ else if (index === 166) payload.linkage_alarm = value === 1; // JT-BZ-01AQ/A
5201
5210
  else if (meta.logger) meta.logger.debug(`${model.zigbeeModel}: unknown index ${index} with value ${value}`);
5202
5211
  }
5203
5212
  }
5204
5213
 
5205
5214
  if (msg.data.hasOwnProperty('0')) payload.detection_period = msg.data['0'];
5215
+ if (msg.data.hasOwnProperty('2')) {
5216
+ if (['JT-BZ-01AQ/A'].includes(model.model)) payload.power_outage_count = msg.data['2'];
5217
+ }
5206
5218
  if (msg.data.hasOwnProperty('4')) payload.mode_switch = {4: 'anti_flicker_mode', 1: 'quick_mode'}[msg.data['4']];
5207
5219
  if (msg.data.hasOwnProperty('10')) payload.switch_type = {1: 'toggle', 2: 'momentary'}[msg.data['10']];
5208
5220
  if (msg.data.hasOwnProperty('258')) payload.detection_interval = msg.data['258'];
5209
- if (msg.data.hasOwnProperty('268')) payload.motion_sensitivity = {1: 'low', 2: 'medium', 3: 'high'}[msg.data['268']];
5221
+ if (msg.data.hasOwnProperty('268')) {
5222
+ if (['RTCGQ13LM'].includes(model.model)) {
5223
+ payload.motion_sensitivity = {1: 'low', 2: 'medium', 3: 'high'}[msg.data['268']];
5224
+ } else if (['JT-BZ-01AQ/A'].includes(model.model)) {
5225
+ payload.gas_sensitivity = {1: '15%LEL', 2: '10%LEL'}[msg.data['268']];
5226
+ }
5227
+ }
5228
+ if (msg.data.hasOwnProperty('294')) payload.mute = msg.data['294'] === 1; // JT-BZ-01AQ/A
5229
+ if (msg.data.hasOwnProperty('295')) payload.test = msg.data['295'] === 1; // JT-BZ-01AQ/A
5230
+ if (msg.data.hasOwnProperty('313')) payload.state = msg.data['313'] === 1 ? 'preparation' : 'work'; // JT-BZ-01AQ/A
5231
+ if (msg.data.hasOwnProperty('314')) payload.gas = msg.data['314'] === 1; // JT-BZ-01AQ/A
5232
+ if (msg.data.hasOwnProperty('315')) payload.gas_density = msg.data['315']; // JT-BZ-01AQ/A
5233
+ if (msg.data.hasOwnProperty('331')) payload.linkage_alarm = msg.data['331'] === 1; // JT-BZ-01AQ/A
5210
5234
  if (msg.data.hasOwnProperty('512')) {
5211
5235
  if (['ZNCZ15LM', 'QBCZ14LM', 'QBCZ15LM'].includes(model.model)) {
5212
5236
  payload.button_lock = msg.data['512'] === 1 ? 'OFF' : 'ON';
@@ -7590,6 +7614,57 @@ const converters = {
7590
7614
  return result;
7591
7615
  },
7592
7616
  },
7617
+ tuya_radar_sensor_fall: {
7618
+ cluster: 'manuSpecificTuya',
7619
+ type: ['commandDataResponse', 'commandDataReport'],
7620
+ convert: (model, msg, publish, options, meta) => {
7621
+ const dpValue = tuya.firstDpValue(msg, meta, 'tuya_radar_sensor_fall');
7622
+ const dp = dpValue.dp;
7623
+ const value = tuya.getDataValue(dpValue);
7624
+ let result = null;
7625
+ switch (dp) {
7626
+ case tuya.dataPoints.trsfPresenceState:
7627
+ result = {presence: {0: false, 1: true}[value]};
7628
+ break;
7629
+ case tuya.dataPoints.trsfMotionState:
7630
+ result = {occupancy: {1: false, 2: true}[value]};
7631
+ break;
7632
+ case tuya.dataPoints.trsfMotionSpeed:
7633
+ result = {motion_speed: value};
7634
+ break;
7635
+ case tuya.dataPoints.trsfMotionDirection:
7636
+ result = {motion_direction: tuya.tuyaRadar.motionDirection[value]};
7637
+ break;
7638
+ case tuya.dataPoints.trsfScene:
7639
+ result = {radar_scene: tuya.tuyaRadar.radarScene[value]};
7640
+ break;
7641
+ case tuya.dataPoints.trsfSensitivity:
7642
+ result = {radar_sensitivity: value};
7643
+ break;
7644
+ case tuya.dataPoints.trsfIlluminanceLux:
7645
+ result = {illuminance_lux: value};
7646
+ break;
7647
+ case tuya.dataPoints.trsfTumbleAlarmTime:
7648
+ result = {tumble_alarm_time: value+1};
7649
+ break;
7650
+ case tuya.dataPoints.trsfTumbleSwitch:
7651
+ result = {tumble_switch: {false: 'OFF', true: 'ON'}[value]};
7652
+ break;
7653
+ case tuya.dataPoints.trsfFallDownStatus:
7654
+ result = {fall_down_status: {0: false, 1: true}[value]};
7655
+ break;
7656
+ case tuya.dataPoints.trsfStaticDwellAlarm:
7657
+ result = {static_dwell_alarm: value};
7658
+ break;
7659
+ case tuya.dataPoints.trsfFallSensitivity:
7660
+ result = {fall_sensitivity: value};
7661
+ break;
7662
+ default:
7663
+ meta.logger.warn(`fromZigbee.tuya_radar_sensor_fall: NOT RECOGNIZED DP ${dp} with data ${JSON.stringify(dpValue)}`);
7664
+ }
7665
+ return result;
7666
+ },
7667
+ },
7593
7668
  tuya_smart_vibration_sensor: {
7594
7669
  cluster: 'manuSpecificTuya',
7595
7670
  type: ['commandGetData', 'commandDataResponse', 'raw'],
@@ -7956,6 +8031,81 @@ const converters = {
7956
8031
  return {action};
7957
8032
  },
7958
8033
  },
8034
+ ZMAM02: {
8035
+ cluster: 'manuSpecificTuya',
8036
+ type: ['commandDataResponse', 'commandDataReport', 'commandSetDataresponse'],
8037
+ convert: (model, msg, publish, options, meta) => {
8038
+ const result = {};
8039
+ // let value = tuya.getDataValue(dpValue);
8040
+ // let result = null;
8041
+ for (const dpValue of msg.data.dpValues) {
8042
+ const value = tuya.getDataValue(dpValue);
8043
+ switch (dpValue.dp) {
8044
+ case tuya.dataPoints.AM02Control:
8045
+ result.control = tuya.ZMAM02.AM02Control[value];
8046
+ break;
8047
+ case tuya.dataPoints.AM02PercentControl:
8048
+ result.percent_control = value;
8049
+ break;
8050
+ case tuya.dataPoints.AM02ControlBackMode:
8051
+ result.control_back_mode = tuya.ZMAM02.AM02Direction[value];
8052
+ break;
8053
+ case tuya.dataPoints.AM02MotorWorkingMode:
8054
+ switch (value) {
8055
+ case 0: // continuous 1
8056
+ result.motor_working_mode = 'continuous';
8057
+ break;
8058
+ case 1: // intermittently
8059
+ result.motor_working_mode = 'intermittently';
8060
+ break;
8061
+ default:
8062
+ meta.logger.warn('zigbee-herdsman-converters:ZM_AM_02: ' +
8063
+ `Mode ${value} is not recognized.`);
8064
+ break;
8065
+ }
8066
+ break;
8067
+ case tuya.dataPoints.AM02Border:
8068
+ switch (value) {
8069
+ case 0: // up
8070
+ result.border = 'up';
8071
+ break;
8072
+ case 1: // down
8073
+ result.border = 'down';
8074
+ break;
8075
+ case 2: // down_delete
8076
+ result.border = 'down_delete';
8077
+ break;
8078
+ default:
8079
+ meta.logger.warn('zigbee-herdsman-converters:ZM_AM_02: ' +
8080
+ `Mode ${value} is not recognized.`);
8081
+ break;
8082
+ }
8083
+ break;
8084
+ case tuya.dataPoints.AM02PercentState:
8085
+ result.percent_state = value;
8086
+ break;
8087
+ case tuya.dataPoints.AM02Mode:
8088
+ switch (value) {
8089
+ case 0: // morning
8090
+ result.mode = 'morning';
8091
+ break;
8092
+ case 1: // night
8093
+ result.mode = 'night';
8094
+ break;
8095
+ default:
8096
+ meta.logger.warn('zigbee-herdsman-converters:ZM_AM_02: ' +
8097
+ `Mode ${value} is not recognized.`);
8098
+ break;
8099
+ }
8100
+ break;
8101
+ default:
8102
+ meta.logger.warn(`fromZigbee.Zemismart Shader Konverter (Zm_AM02): NOT RECOGNIZED ` +
8103
+ `DP #${dpValue.dp} with data ${JSON.stringify(dpValue)}`);
8104
+ }
8105
+ }
8106
+ return result;
8107
+ },
8108
+ },
7959
8109
  // #endregion
7960
8110
 
7961
8111
  // #region Ignore converters (these message dont need parsing).
@@ -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
  },
@@ -2419,6 +2419,72 @@ const converters = {
2419
2419
  await entity.write('ssIasZone', {0xFFF1: {value: 0x03010000, type: 0x23}}, options);
2420
2420
  },
2421
2421
  },
2422
+ JTBZ01AQA_gas: {
2423
+ key: ['gas'],
2424
+ convertGet: async (entity, key, meta) => {
2425
+ await entity.read('aqaraOpple', [0x013a], manufacturerOptions.xiaomi);
2426
+ },
2427
+ },
2428
+ JTBZ01AQA_gas_density: {
2429
+ key: ['gas_density'],
2430
+ convertGet: async (entity, key, meta) => {
2431
+ await entity.read('aqaraOpple', [0x013b], manufacturerOptions.xiaomi);
2432
+ },
2433
+ },
2434
+ JTBZ01AQA_gas_sensitivity: {
2435
+ key: ['gas_sensitivity'],
2436
+ convertSet: async (entity, key, value, meta) => {
2437
+ value = value.toLowerCase();
2438
+ const lookup = {'15%lel': 1, '10%lel': 2};
2439
+ await entity.write('aqaraOpple', {0x010c: {value: lookup[value], type: 0x20}}, manufacturerOptions.xiaomi);
2440
+ return {state: {gas_sensitivity: value}};
2441
+ },
2442
+ convertGet: async (entity, key, meta) => {
2443
+ await entity.read('aqaraOpple', [0x010c], manufacturerOptions.xiaomi);
2444
+ },
2445
+ },
2446
+ JTBZ01AQA_selftest: {
2447
+ key: ['selftest'],
2448
+ convertSet: async (entity, key, value, meta) => {
2449
+ await entity.write('aqaraOpple', {0x0127: {value: true, type: 0x10}}, manufacturerOptions.xiaomi);
2450
+ },
2451
+ },
2452
+ JTBZ01AQA_mute_buzzer: {
2453
+ key: ['mute_buzzer'],
2454
+ convertSet: async (entity, key, value, meta) => {
2455
+ await entity.write('aqaraOpple', {0x013f: {value: 15360, type: 0x23}}, manufacturerOptions.xiaomi);
2456
+ await entity.write('aqaraOpple', {0x0126: {value: 1, type: 0x20}}, manufacturerOptions.xiaomi);
2457
+ },
2458
+ },
2459
+ JTBZ01AQA_mute: {
2460
+ key: ['mute'],
2461
+ convertGet: async (entity, key, meta) => {
2462
+ await entity.read('aqaraOpple', [0x0126], manufacturerOptions.xiaomi);
2463
+ },
2464
+ },
2465
+ JTBZ01AQA_linkage_alarm: {
2466
+ key: ['linkage_alarm'],
2467
+ convertSet: async (entity, key, value, meta) => {
2468
+ const lookup = {true: 1, false: 0};
2469
+ await entity.write('aqaraOpple', {0x014b: {value: lookup[value], type: 0x20}}, manufacturerOptions.xiaomi);
2470
+ return {state: {linkage_alarm: value}};
2471
+ },
2472
+ convertGet: async (entity, key, meta) => {
2473
+ await entity.read('aqaraOpple', [0x014b], manufacturerOptions.xiaomi);
2474
+ },
2475
+ },
2476
+ JTBZ01AQA_state: {
2477
+ key: ['state'],
2478
+ convertGet: async (entity, key, meta) => {
2479
+ await entity.read('aqaraOpple', [0x0139], manufacturerOptions.xiaomi);
2480
+ },
2481
+ },
2482
+ aqara_power_outage_count: {
2483
+ key: ['power_outage_count'],
2484
+ convertGet: async (entity, key, meta) => {
2485
+ await entity.read('aqaraOpple', [0x0002], manufacturerOptions.xiaomi);
2486
+ },
2487
+ },
2422
2488
  LLKZMK11LM_interlock: {
2423
2489
  key: ['interlock'],
2424
2490
  convertSet: async (entity, key, value, meta) => {
@@ -6033,7 +6099,7 @@ const converters = {
6033
6099
  key: ['keypad_lockout'],
6034
6100
  convertSet: async (entity, key, value, meta) => {
6035
6101
  const keypadLockout = utils.getKey(constants.keypadLockoutMode, value, value, Number);
6036
- entity.write('hvacUserInterfaceCfg', {keypadLockout}, {sendWhenActive: true});
6102
+ entity.write('hvacUserInterfaceCfg', {keypadLockout}, {sendWhen: 'active'});
6037
6103
  entity.saveClusterAttributeKeyValue('hvacUserInterfaceCfg', {keypadLockout});
6038
6104
  return {state: {keypad_lockout: value}};
6039
6105
  },
@@ -6172,7 +6238,7 @@ const converters = {
6172
6238
  key: ['calibrate_valve'],
6173
6239
  convertSet: async (entity, key, value, meta) => {
6174
6240
  await entity.command('hvacThermostat', 'wiserSmartCalibrateValve', {},
6175
- {srcEndpoint: 11, disableDefaultResponse: true, sendWhenActive: true});
6241
+ {srcEndpoint: 11, disableDefaultResponse: true, sendWhen: 'active'});
6176
6242
  return {state: {'calibrate_valve': value}};
6177
6243
  },
6178
6244
  },
@@ -6194,7 +6260,7 @@ const converters = {
6194
6260
  key: ['local_temperature_calibration'],
6195
6261
  convertSet: (entity, key, value, meta) => {
6196
6262
  entity.write('hvacThermostat', {localTemperatureCalibration: Math.round(value * 10)},
6197
- {srcEndpoint: 11, disableDefaultResponse: true, sendWhenActive: true});
6263
+ {srcEndpoint: 11, disableDefaultResponse: true, sendWhen: 'active'});
6198
6264
  return {state: {local_temperature_calibration: value}};
6199
6265
  },
6200
6266
  },
@@ -6203,7 +6269,7 @@ const converters = {
6203
6269
  convertSet: async (entity, key, value, meta) => {
6204
6270
  const keypadLockout = utils.getKey(constants.keypadLockoutMode, value, value, Number);
6205
6271
  await entity.write('hvacUserInterfaceCfg', {keypadLockout},
6206
- {srcEndpoint: 11, disableDefaultResponse: true, sendWhenActive: true});
6272
+ {srcEndpoint: 11, disableDefaultResponse: true, sendWhen: 'active'});
6207
6273
  return {state: {keypad_lockout: value}};
6208
6274
  },
6209
6275
  },
@@ -6305,6 +6371,30 @@ const converters = {
6305
6371
  }
6306
6372
  },
6307
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
+ },
6308
6398
  javis_microwave_sensor: {
6309
6399
  key: [
6310
6400
  'illuminance_calibration', 'led_enable',
@@ -6592,6 +6682,33 @@ const converters = {
6592
6682
  }
6593
6683
  },
6594
6684
  },
6685
+ ZMAM02: {
6686
+ key: ['control', 'percent_control', 'mode', 'control_back_mode', 'border', 'motor_working_mode'],
6687
+ convertSet: async (entity, key, value, meta) => {
6688
+ switch (key) {
6689
+ case 'control':
6690
+ await tuya.sendDataPointEnum(entity, tuya.dataPoints.AM02Control, utils.getKey(tuya.ZMAM02.AM02Control, value));
6691
+ break;
6692
+ case 'percent_control':
6693
+ await tuya.sendDataPointValue(entity, tuya.dataPoints.AM02PercentState, value);
6694
+ break;
6695
+ case 'mode':
6696
+ await tuya.sendDataPointEnum(entity, tuya.dataPoints.AM02Mode, utils.getKey(tuya.ZMAM02.AM02Mode, value));
6697
+ break;
6698
+ case 'control_back_mode':
6699
+ await tuya.sendDataPointEnum(entity, tuya.dataPoints.AM02ControlBackMode, utils.getKey(tuya.ZMAM02.AM02Direction, value));
6700
+ break;
6701
+ case 'border':
6702
+ await tuya.sendDataPointEnum(entity, tuya.dataPoints.AM02Border, utils.getKey(tuya.ZMAM02.AM02Border, value));
6703
+ break;
6704
+ case 'motor_working_mode':
6705
+ await tuya.sendDataPointEnum(entity, tuya.dataPoints.AM02MotorWorkingMode, utils.getKey(tuya.ZMAM02.AM02MotorMode, value));
6706
+ break;
6707
+ default: // Unknown Key
6708
+ meta.logger.warn(`toZigbee.ZMAM02: Unhandled Key ${key}`);
6709
+ }
6710
+ },
6711
+ },
6595
6712
  // #endregion
6596
6713
 
6597
6714
  // #region Ignore converters
package/devices/cleode.js CHANGED
@@ -1,8 +1,7 @@
1
1
  const exposes = require('../lib/exposes');
2
- const fz = {...require('../converters/fromZigbee'), legacy: require('../lib/legacy').fromZigbee};
3
- const tz = require('../converters/toZigbee');
4
2
  const reporting = require('../lib/reporting');
5
3
  const e = exposes.presets;
4
+ const extend = require('../lib/extend');
6
5
 
7
6
  module.exports = [
8
7
  {
@@ -10,8 +9,7 @@ module.exports = [
10
9
  model: 'ZPLUG_Boost',
11
10
  vendor: 'CLEODE',
12
11
  description: 'ZPlug boost',
13
- fromZigbee: [fz.on_off],
14
- toZigbee: [tz.on_off],
12
+ extend: extend.switch(),
15
13
  exposes: [e.switch(), e.power()],
16
14
  configure: async (device, coordinatorEndpoint, logger) => {
17
15
  const endpoint = device.getEndpoint(1);
package/devices/ikea.js CHANGED
@@ -252,7 +252,7 @@ module.exports = [
252
252
  extend: tradfriExtend.light_onoff_brightness_colortemp(),
253
253
  },
254
254
  {
255
- zigbeeModel: ['TRADFRI bulb E27 WS clear 950lm', 'TRADFRI bulb E26 WS clear 950lm'],
255
+ zigbeeModel: ['TRADFRI bulb E27 WS clear 950lm', 'TRADFRI bulb E26 WS clear 950lm', 'TRADFRI bulb E27 WS\uFFFDclear 950lm'],
256
256
  model: 'LED1546G12',
257
257
  vendor: 'IKEA',
258
258
  description: 'TRADFRI LED bulb E26/E27 950 lumen, dimmable, white spectrum, clear',
@@ -91,7 +91,7 @@ module.exports = [
91
91
  zigbeeModel: ['LEDVANCE DIM'],
92
92
  model: '4058075208421',
93
93
  vendor: 'LEDVANCE',
94
- description: 'SMART+ candle E14 tunable white',
94
+ description: 'SMART+ candle E14 dimmable white',
95
95
  extend: extend.ledvance.light_onoff_brightness(),
96
96
  ota: ota.ledvance,
97
97
  },
@@ -4,6 +4,7 @@ const tz = require('../converters/toZigbee');
4
4
  const e = exposes.presets;
5
5
  const ea = exposes.access;
6
6
  const extend = require('../lib/extend');
7
+ const tuya = require('../lib/tuya');
7
8
 
8
9
  module.exports = [
9
10
  {
@@ -21,11 +22,13 @@ module.exports = [
21
22
  ],
22
23
  },
23
24
  {
24
- fingerprint: [{modelID: 'TS0501B', manufacturerName: '_TZ3210_dxroobu3'}],
25
+ fingerprint: [{modelID: 'TS0501B', manufacturerName: '_TZ3210_dxroobu3'},
26
+ {modelID: 'TS0501B', manufacturerName: '_TZ3210_dbilpfqk'}],
25
27
  model: 'FUT036Z',
26
28
  description: 'Single color LED controller',
27
29
  vendor: 'Miboxer',
28
30
  extend: extend.light_onoff_brightness(),
31
+ onEvent: tuya.onEventSetTime,
29
32
  },
30
33
  {
31
34
  fingerprint: [{modelID: 'TS0502B', manufacturerName: '_TZ3210_frm6149r'}],
package/devices/moes.js CHANGED
@@ -9,6 +9,27 @@ const e = exposes.presets;
9
9
  const ea = exposes.access;
10
10
 
11
11
  module.exports = [
12
+ {
13
+ fingerprint: [{modelID: 'TS011F', manufacturerName: '_TZ3000_cymsnfvf'}],
14
+ model: 'ZP-LZ-FR2U',
15
+ vendor: 'Moes',
16
+ description: 'Zigbee 3.0 dual USB wireless socket plug',
17
+ fromZigbee: [fz.on_off, fz.tuya_switch_power_outage_memory],
18
+ toZigbee: [tz.on_off, tz.tuya_switch_power_outage_memory],
19
+ exposes: [e.switch().withEndpoint('l1'), e.switch().withEndpoint('l2'),
20
+ exposes.enum('power_outage_memory', ea.STATE_SET, ['on', 'off', 'restore'])
21
+ .withDescription('Recover state after power outage')],
22
+ endpoint: (device) => {
23
+ return {'l1': 1, 'l2': 2};
24
+ },
25
+ meta: {multiEndpoint: true},
26
+ configure: async (device, coordinatorEndpoint, logger) => {
27
+ await reporting.bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff']);
28
+ await reporting.bind(device.getEndpoint(2), coordinatorEndpoint, ['genOnOff']);
29
+ await reporting.onOff(device.getEndpoint(1));
30
+ await reporting.onOff(device.getEndpoint(2));
31
+ },
32
+ },
12
33
  {
13
34
  fingerprint: [{modelID: 'TS0121', manufacturerName: '_TYZB01_iuepbmpv'}, {modelID: 'TS011F', manufacturerName: '_TZ3000_zmy1waw6'},
14
35
  {modelID: 'TS011F', manufacturerName: '_TZ3000_bkfe0bab'}],
@@ -1543,6 +1543,15 @@ module.exports = [
1543
1543
  extend: hueExtend.light_onoff_brightness_colortemp_color(),
1544
1544
  ota: ota.zigbeeOTA,
1545
1545
  },
1546
+ {
1547
+ zigbeeModel: ['LCF003', '4080248P7'],
1548
+ model: '4080248P7',
1549
+ vendor: 'Philips',
1550
+ description: 'Hue Signe floor light',
1551
+ meta: {turnsOffAtBrightness1: true},
1552
+ extend: hueExtend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
1553
+ ota: ota.zigbeeOTA,
1554
+ },
1546
1555
  {
1547
1556
  zigbeeModel: ['4080248U9'],
1548
1557
  model: '4080248U9',
package/devices/tuya.js CHANGED
@@ -845,7 +845,6 @@ module.exports = [
845
845
  {modelID: 'TS0601', manufacturerName: '_TZE200_fzo2pocs'},
846
846
  {modelID: 'TS0601', manufacturerName: '_TZE200_5sbebbzs'},
847
847
  {modelID: 'TS0601', manufacturerName: '_TZE200_zuz7f94z'},
848
- {modelID: 'TS0601', manufacturerName: '_TZE200_iossyxra'},
849
848
  ],
850
849
  model: 'TS0601_cover',
851
850
  vendor: 'TuYa',
@@ -1127,7 +1126,6 @@ module.exports = [
1127
1126
  {
1128
1127
  fingerprint: [
1129
1128
  {modelID: 'TS011F', manufacturerName: '_TZ3000_hyfvrar3'},
1130
- {modelID: 'TS011F', manufacturerName: '_TZ3000_cymsnfvf'},
1131
1129
  {modelID: 'TS011F', manufacturerName: '_TZ3000_bfn1w0mm'}],
1132
1130
  model: 'TS011F_plug_2',
1133
1131
  description: 'Smart plug (without power monitoring)',
@@ -1718,9 +1716,7 @@ module.exports = [
1718
1716
  ],
1719
1717
  },
1720
1718
  {
1721
- fingerprint: [
1722
- {modelID: 'TS0601', manufacturerName: '_TZE200_vrfecyku'},
1723
- {modelID: 'TS0601', manufacturerName: '_TZE200_lu01t0zl'}],
1719
+ fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_vrfecyku'}],
1724
1720
  model: 'MIR-HE200-TY',
1725
1721
  vendor: 'TuYa',
1726
1722
  description: 'Human presence sensor',
@@ -1737,6 +1733,35 @@ module.exports = [
1737
1733
  .withDescription('presets for sensitivity for presence and movement'),
1738
1734
  ],
1739
1735
  },
1736
+ {
1737
+ fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_lu01t0zl'}],
1738
+ model: 'MIR-HE200-TY_fall',
1739
+ vendor: 'TuYa',
1740
+ description: 'Human presence sensor with fall function',
1741
+ fromZigbee: [fz.tuya_radar_sensor_fall],
1742
+ toZigbee: [tz.tuya_radar_sensor_fall],
1743
+ exposes: [
1744
+ e.illuminance_lux(), e.presence(), e.occupancy(),
1745
+ exposes.numeric('motion_speed', ea.STATE).withDescription('Speed of movement'),
1746
+ exposes.enum('motion_direction', ea.STATE, Object.values(tuya.tuyaRadar.motionDirection))
1747
+ .withDescription('direction of movement from the point of view of the radar'),
1748
+ exposes.numeric('radar_sensitivity', ea.STATE_SET).withValueMin(0).withValueMax(10).withValueStep(1)
1749
+ .withDescription('sensitivity of the radar'),
1750
+ exposes.enum('radar_scene', ea.STATE_SET, Object.values(tuya.tuyaRadar.radarScene))
1751
+ .withDescription('presets for sensitivity for presence and movement'),
1752
+ exposes.enum('tumble_switch', ea.STATE_SET, ['ON', 'OFF']).withDescription('Tumble status switch'),
1753
+ exposes.numeric('fall_sensitivity', ea.STATE_SET).withValueMin(1).withValueMax(10).withValueStep(1)
1754
+ .withDescription('fall sensitivity of the radar'),
1755
+ exposes.numeric('tumble_alarm_time', ea.STATE_SET).withValueMin(1).withValueMax(5).withValueStep(1)
1756
+ .withUnit('min').withDescription('tumble alarm time'),
1757
+ exposes.binary('fall_down_status', ea.STATE).withDescription('fall down status'),
1758
+ exposes.text('static_dwell_alarm', ea.STATE).withDescription('static dwell alarm'),
1759
+ ],
1760
+ configure: async (device, coordinatorEndpoint, logger) => {
1761
+ const endpoint = device.getEndpoint(1);
1762
+ await tuya.sendDataPointEnum(endpoint, tuya.dataPoints.trsfTumbleSwitch, false);
1763
+ },
1764
+ },
1740
1765
  {
1741
1766
  fingerprint: [{modelID: 'TS004F', manufacturerName: '_TZ3000_pcqjmcud'}],
1742
1767
  model: 'YSR-MINI-Z',
package/devices/xiaomi.js CHANGED
@@ -81,11 +81,11 @@ module.exports = [
81
81
  model: 'ZNLDP12LM',
82
82
  vendor: 'Xiaomi',
83
83
  description: 'Aqara smart LED bulb',
84
- toZigbee: xiaomiExtend.light_onoff_brightness_colortemp().toZigbee.concat([
84
+ toZigbee: xiaomiExtend.light_onoff_brightness_colortemp({colorTempRange: [153, 370]}).toZigbee.concat([
85
85
  tz.xiaomi_light_power_outage_memory]),
86
- fromZigbee: xiaomiExtend.light_onoff_brightness_colortemp().fromZigbee,
86
+ fromZigbee: xiaomiExtend.light_onoff_brightness_colortemp({colorTempRange: [153, 370]}).fromZigbee,
87
87
  // power_on_behavior 'toggle' does not seem to be supported
88
- exposes: xiaomiExtend.light_onoff_brightness_colortemp().exposes.concat([
88
+ exposes: xiaomiExtend.light_onoff_brightness_colortemp({colorTempRange: [153, 370]}).exposes.concat([
89
89
  e.power_outage_memory().withAccess(ea.STATE_SET)]),
90
90
  ota: ota.zigbeeOTA,
91
91
  },
@@ -1133,6 +1133,41 @@ module.exports = [
1133
1133
  exposes.numeric('gas_density', ea.STATE), exposes.enum('selftest', ea.SET, ['']),
1134
1134
  ],
1135
1135
  },
1136
+ {
1137
+ zigbeeModel: ['lumi.sensor_gas.acn02'],
1138
+ model: 'JT-BZ-01AQ/A',
1139
+ vendor: 'Xiaomi',
1140
+ description: 'Aqara smart natural gas detector',
1141
+ fromZigbee: [fz.aqara_opple],
1142
+ toZigbee: [tz.JTBZ01AQA_gas, tz.JTBZ01AQA_gas_density, tz.JTBZ01AQA_gas_sensitivity, tz.JTBZ01AQA_selftest,
1143
+ tz.JTBZ01AQA_mute_buzzer, tz.JTBZ01AQA_mute, tz.JTBZ01AQA_linkage_alarm, tz.JTBZ01AQA_state, tz.aqara_power_outage_count],
1144
+ exposes: [e.gas().withAccess(ea.STATE_GET),
1145
+ exposes.numeric('gas_density', ea.STATE_GET).withUnit('%LEL').withDescription('Value of gas concentration'),
1146
+ exposes.enum('gas_sensitivity', ea.ALL, ['10%LEL', '15%LEL']).withDescription('Gas concentration value at which ' +
1147
+ 'an alarm is triggered ("10%LEL" is more sensitive than "15%LEL")'),
1148
+ exposes.enum('selftest', ea.SET, ['Test']).withDescription('Starts the self-test process (checking the indicator ' +
1149
+ 'light and buzzer work properly)'),
1150
+ exposes.binary('test', ea.STATE, true, false).withDescription('Self-test in progress'),
1151
+ exposes.enum('mute_buzzer', ea.SET, ['Mute']).withDescription('Mute the buzzer for 10 minutes (buzzer cannot be ' +
1152
+ 'pre-muted, because this function only works when the alarm is triggered)'),
1153
+ exposes.binary('mute', ea.STATE_GET, true, false).withDescription('Buzzer muted'),
1154
+ exposes.switch().withState('linkage_alarm', true, 'After being turned on, one of the devices triggers the ' +
1155
+ 'natural gas leakage alarm, and other devices with linkage turned on', ea.ALL, true, false),
1156
+ exposes.binary('state', ea.STATE_GET, 'preparation', 'work').withDescription('"Preparation" or "work" ' +
1157
+ '(measurement of the gas concentration value and triggering of an alarm are only performed in the "work" state)'),
1158
+ exposes.numeric('power_outage_count', ea.STATE_GET).withDescription('Number of power outages (since last pairing)')],
1159
+ configure: async (device, coordinatorEndpoint, logger) => {
1160
+ const endpoint = device.getEndpoint(1);
1161
+ await endpoint.read('aqaraOpple', [0x013a], {manufacturerCode: 0x115f});
1162
+ await endpoint.read('aqaraOpple', [0x013b], {manufacturerCode: 0x115f});
1163
+ await endpoint.read('aqaraOpple', [0x0126], {manufacturerCode: 0x115f});
1164
+ await endpoint.read('aqaraOpple', [0x0139], {manufacturerCode: 0x115f});
1165
+ await endpoint.read('aqaraOpple', [0x010c], {manufacturerCode: 0x115f});
1166
+ await endpoint.read('aqaraOpple', [0x014b], {manufacturerCode: 0x115f});
1167
+ await endpoint.read('aqaraOpple', [0x0002], {manufacturerCode: 0x115f});
1168
+ },
1169
+ ota: ota.zigbeeOTA,
1170
+ },
1136
1171
  {
1137
1172
  zigbeeModel: ['lumi.lock.v1'],
1138
1173
  model: 'A6121',
@@ -124,4 +124,26 @@ module.exports = [
124
124
  await reporting.onOff(device.getEndpoint(2));
125
125
  },
126
126
  },
127
+ {
128
+ fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_iossyxra'}],
129
+ model: 'ZM-AM02',
130
+ vendor: 'Zemismart',
131
+ description: 'Zigbee/RF curtain converter',
132
+ fromZigbee: [fz.ZMAM02],
133
+ toZigbee: [tz.ZMAM02],
134
+ exposes: [exposes.enum('motor_working_mode', ea.STATE_SET, Object.values(tuya.ZMAM02.AM02MotorMode)),
135
+ exposes.enum('control', ea.STATE_SET, Object.values(tuya.ZMAM02.AM02Control)),
136
+ exposes.numeric('percent_state', ea.STATE).withValueMin(0).withValueMax(100).withValueStep(1).withUnit('%'),
137
+ exposes.enum('mode', ea.STATE_SET, Object.values(tuya.ZMAM02.AM02Mode)),
138
+ exposes.enum('control_back_mode', ea.STATE_SET, Object.values(tuya.ZMAM02.AM02Direction)),
139
+ exposes.enum('border', ea.STATE_SET, Object.values(tuya.ZMAM02.AM02Border)),
140
+ // ---------------------------------------------------------------------------------
141
+ // DP exists, but not used at the moment
142
+ // exposes.numeric('percent_control', ea.STATE_SET).withValueMin(0).withValueMax(100).withValueStep(1).withUnit('%'),
143
+ // exposes.enum('work_state', ea.STATE, Object.values(tuya.ZMAM02.AM02WorkState)),
144
+ // exposes.numeric('countdown_left', ea.STATE).withUnit('s'),
145
+ // exposes.numeric('time_total', ea.STATE).withUnit('ms'),
146
+ // exposes.enum('situation_set', ea.STATE, Object.values(tuya.ZMAM02.AM02Situation)),
147
+ ],
148
+ },
127
149
  ];
package/lib/ota/common.js CHANGED
@@ -385,11 +385,9 @@ 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);
391
- resolve();
392
- }, 90 * 1000);
388
+ logger.debug(`Update succeeded`);
389
+ onProgress(100, null);
390
+ resolve();
393
391
  },
394
392
  (e) => {
395
393
  const message = `Upgrade end reponse failed (${e.message})`;