zigbee-herdsman-converters 14.0.387 → 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.
- package/converters/fromZigbee.js +51 -0
- package/converters/toZigbee.js +29 -5
- package/devices/tuya.js +30 -3
- package/lib/ota/common.js +3 -5
- package/lib/tuya.js +13 -0
- package/npm-shrinkwrap.json +1 -1
- package/package.json +1 -1
package/converters/fromZigbee.js
CHANGED
|
@@ -7614,6 +7614,57 @@ const converters = {
|
|
|
7614
7614
|
return result;
|
|
7615
7615
|
},
|
|
7616
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
|
+
},
|
|
7617
7668
|
tuya_smart_vibration_sensor: {
|
|
7618
7669
|
cluster: 'manuSpecificTuya',
|
|
7619
7670
|
type: ['commandGetData', 'commandDataResponse', 'raw'],
|
package/converters/toZigbee.js
CHANGED
|
@@ -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,
|
|
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}, {
|
|
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,
|
|
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,
|
|
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,
|
|
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',
|
package/devices/tuya.js
CHANGED
|
@@ -1716,9 +1716,7 @@ module.exports = [
|
|
|
1716
1716
|
],
|
|
1717
1717
|
},
|
|
1718
1718
|
{
|
|
1719
|
-
fingerprint: [
|
|
1720
|
-
{modelID: 'TS0601', manufacturerName: '_TZE200_vrfecyku'},
|
|
1721
|
-
{modelID: 'TS0601', manufacturerName: '_TZE200_lu01t0zl'}],
|
|
1719
|
+
fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_vrfecyku'}],
|
|
1722
1720
|
model: 'MIR-HE200-TY',
|
|
1723
1721
|
vendor: 'TuYa',
|
|
1724
1722
|
description: 'Human presence sensor',
|
|
@@ -1735,6 +1733,35 @@ module.exports = [
|
|
|
1735
1733
|
.withDescription('presets for sensitivity for presence and movement'),
|
|
1736
1734
|
],
|
|
1737
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
|
+
},
|
|
1738
1765
|
{
|
|
1739
1766
|
fingerprint: [{modelID: 'TS004F', manufacturerName: '_TZ3000_pcqjmcud'}],
|
|
1740
1767
|
model: 'YSR-MINI-Z',
|
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
|
|
389
|
-
|
|
390
|
-
|
|
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})`;
|
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,
|
package/npm-shrinkwrap.json
CHANGED