zigbee-herdsman-converters 14.0.413 → 14.0.414
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 +74 -64
- package/converters/toZigbee.js +41 -15
- package/devices/custom_devices_diy.js +19 -0
- package/devices/moes.js +6 -6
- package/devices/xiaomi.js +34 -34
- package/devices/zemismart.js +13 -8
- package/lib/exposes.js +1 -1
- package/lib/tuya.js +5 -4
- package/lib/utils.js +2 -0
- package/npm-shrinkwrap.json +1 -1
- package/package.json +1 -1
package/converters/fromZigbee.js
CHANGED
|
@@ -8335,79 +8335,89 @@ const converters = {
|
|
|
8335
8335
|
return {action};
|
|
8336
8336
|
},
|
|
8337
8337
|
},
|
|
8338
|
-
|
|
8338
|
+
ZMAM02_cover: {
|
|
8339
8339
|
cluster: 'manuSpecificTuya',
|
|
8340
|
-
type: ['
|
|
8340
|
+
type: ['commandDataReport', 'commandDataResponse'],
|
|
8341
|
+
options: [exposes.options.invert_cover()],
|
|
8341
8342
|
convert: (model, msg, publish, options, meta) => {
|
|
8342
|
-
const
|
|
8343
|
-
|
|
8344
|
-
|
|
8345
|
-
|
|
8346
|
-
|
|
8347
|
-
|
|
8348
|
-
|
|
8349
|
-
|
|
8350
|
-
|
|
8351
|
-
|
|
8352
|
-
|
|
8343
|
+
const dpValue = tuya.firstDpValue(msg, meta, 'ZMAM02_cover');
|
|
8344
|
+
const dp = dpValue.dp;
|
|
8345
|
+
const value = tuya.getDataValue(dpValue);
|
|
8346
|
+
switch (dp) {
|
|
8347
|
+
case tuya.dataPoints.coverPosition: // Started moving to position (triggered from Zigbee)
|
|
8348
|
+
case tuya.dataPoints.coverArrived: { // Arrived at position
|
|
8349
|
+
const running = dp === tuya.dataPoints.coverArrived ? false : true;
|
|
8350
|
+
const invert = tuya.isCoverInverted(meta.device.manufacturerName) ? !options.invert_cover : options.invert_cover;
|
|
8351
|
+
const position = invert ? 100 - (value & 0xFF) : (value & 0xFF);
|
|
8352
|
+
if (position > 0 && position <= 100) {
|
|
8353
|
+
return {running, position, state: 'OPEN'};
|
|
8354
|
+
} else if (position == 0) { // Report fully closed
|
|
8355
|
+
return {running, position, state: 'CLOSE'};
|
|
8356
|
+
} else {
|
|
8357
|
+
return {running}; // Not calibrated yet, no position is available
|
|
8358
|
+
}
|
|
8359
|
+
}
|
|
8360
|
+
case tuya.dataPoints.coverSpeed: // Cover is reporting its current speed setting
|
|
8361
|
+
return {motor_speed: value};
|
|
8362
|
+
case tuya.dataPoints.state: // Ignore the cover state, it's not reliable between different covers!
|
|
8363
|
+
case tuya.dataPoints.coverChange: // Ignore manual cover change, it's not reliable between different covers!
|
|
8364
|
+
break;
|
|
8365
|
+
case tuya.dataPoints.config: // Returned by configuration set; ignore
|
|
8366
|
+
break;
|
|
8367
|
+
case tuya.dataPoints.AM02MotorWorkingMode:
|
|
8368
|
+
switch (value) {
|
|
8369
|
+
case 0: // continuous 1
|
|
8370
|
+
return {motor_working_mode: 'continuous'};
|
|
8371
|
+
case 1: // intermittently
|
|
8372
|
+
return {motor_working_mode: 'intermittently'};
|
|
8373
|
+
default:
|
|
8374
|
+
meta.logger.warn('ZMAM02: ' +
|
|
8375
|
+
`Mode ${value} is not recognized.`);
|
|
8353
8376
|
break;
|
|
8354
|
-
|
|
8355
|
-
|
|
8377
|
+
}
|
|
8378
|
+
break;
|
|
8379
|
+
case tuya.dataPoints.AM02Border:
|
|
8380
|
+
switch (value) {
|
|
8381
|
+
case 0: // up
|
|
8382
|
+
return {border: 'up'};
|
|
8383
|
+
case 1: // down
|
|
8384
|
+
return {border: 'down'};
|
|
8385
|
+
case 2: // down_delete
|
|
8386
|
+
return {border: 'down_delete'};
|
|
8387
|
+
default:
|
|
8388
|
+
meta.logger.warn('zigbee-herdsman-converters:ZM_AM_02: ' +
|
|
8389
|
+
`Mode ${value} is not recognized.`);
|
|
8356
8390
|
break;
|
|
8357
|
-
|
|
8358
|
-
|
|
8359
|
-
|
|
8360
|
-
|
|
8361
|
-
|
|
8362
|
-
|
|
8363
|
-
|
|
8364
|
-
|
|
8365
|
-
|
|
8366
|
-
|
|
8367
|
-
|
|
8368
|
-
break;
|
|
8369
|
-
}
|
|
8391
|
+
}
|
|
8392
|
+
break;
|
|
8393
|
+
case tuya.dataPoints.AM02Direction:
|
|
8394
|
+
switch (value) {
|
|
8395
|
+
case 0:
|
|
8396
|
+
return {motor_direction: 'forward'};
|
|
8397
|
+
case 1:
|
|
8398
|
+
return {motor_direction: 'back'};
|
|
8399
|
+
default:
|
|
8400
|
+
meta.logger.warn('ZMAM02: ' +
|
|
8401
|
+
`Mode ${value} is not recognized.`);
|
|
8370
8402
|
break;
|
|
8371
|
-
|
|
8372
|
-
|
|
8373
|
-
|
|
8374
|
-
|
|
8375
|
-
|
|
8376
|
-
|
|
8377
|
-
|
|
8378
|
-
|
|
8379
|
-
|
|
8380
|
-
|
|
8381
|
-
break;
|
|
8382
|
-
default:
|
|
8383
|
-
meta.logger.warn('zigbee-herdsman-converters:ZM_AM_02: ' +
|
|
8403
|
+
}
|
|
8404
|
+
break;
|
|
8405
|
+
case tuya.dataPoints.AM02Mode:
|
|
8406
|
+
switch (value) {
|
|
8407
|
+
case 0: // morning
|
|
8408
|
+
return {mode: 'morning'};
|
|
8409
|
+
case 1: // night
|
|
8410
|
+
return {mode: 'night'};
|
|
8411
|
+
default:
|
|
8412
|
+
meta.logger.warn('zigbee-herdsman-converters:ZM_AM_02: ' +
|
|
8384
8413
|
`Mode ${value} is not recognized.`);
|
|
8385
|
-
break;
|
|
8386
|
-
}
|
|
8387
|
-
break;
|
|
8388
|
-
case tuya.dataPoints.AM02PercentState:
|
|
8389
|
-
result.percent_state = value;
|
|
8390
|
-
break;
|
|
8391
|
-
case tuya.dataPoints.AM02Mode:
|
|
8392
|
-
switch (value) {
|
|
8393
|
-
case 0: // morning
|
|
8394
|
-
result.mode = 'morning';
|
|
8395
|
-
break;
|
|
8396
|
-
case 1: // night
|
|
8397
|
-
result.mode = 'night';
|
|
8398
|
-
break;
|
|
8399
|
-
default:
|
|
8400
|
-
meta.logger.warn('zigbee-herdsman-converters:ZM_AM_02: ' +
|
|
8401
|
-
`Mode ${value} is not recognized.`);
|
|
8402
|
-
break;
|
|
8403
|
-
}
|
|
8404
8414
|
break;
|
|
8405
|
-
default:
|
|
8406
|
-
meta.logger.warn(`fromZigbee.Zemismart Shader Konverter (Zm_AM02): NOT RECOGNIZED ` +
|
|
8407
|
-
`DP #${dpValue.dp} with data ${JSON.stringify(dpValue)}`);
|
|
8408
8415
|
}
|
|
8416
|
+
break;
|
|
8417
|
+
default: // Unknown code
|
|
8418
|
+
meta.logger.warn(`ZMAM02_cover: Unhandled DP #${dp} for ${meta.device.manufacturerName}:
|
|
8419
|
+
${JSON.stringify(dpValue)}`);
|
|
8409
8420
|
}
|
|
8410
|
-
return result;
|
|
8411
8421
|
},
|
|
8412
8422
|
},
|
|
8413
8423
|
// #endregion
|
package/converters/toZigbee.js
CHANGED
|
@@ -6924,30 +6924,56 @@ const converters = {
|
|
|
6924
6924
|
}
|
|
6925
6925
|
},
|
|
6926
6926
|
},
|
|
6927
|
-
|
|
6928
|
-
key: ['
|
|
6927
|
+
ZMAM02_cover: {
|
|
6928
|
+
key: ['state', 'position', 'mode', 'motor_direction', 'border', 'motor_working_mode'],
|
|
6929
|
+
options: [exposes.options.invert_cover()],
|
|
6929
6930
|
convertSet: async (entity, key, value, meta) => {
|
|
6931
|
+
if (key === 'position') {
|
|
6932
|
+
if (value >= 0 && value <= 100) {
|
|
6933
|
+
const invert = tuya.isCoverInverted(meta.device.manufacturerName) ?
|
|
6934
|
+
!meta.options.invert_cover : meta.options.invert_cover;
|
|
6935
|
+
|
|
6936
|
+
value = invert ? 100 - value : value;
|
|
6937
|
+
await tuya.sendDataPointValue(entity, tuya.dataPoints.coverPosition, value);
|
|
6938
|
+
} else {
|
|
6939
|
+
throw new Error('TuYa_cover_control: Curtain motor position is out of range');
|
|
6940
|
+
}
|
|
6941
|
+
} else if (key === 'state') {
|
|
6942
|
+
const stateEnums = tuya.getCoverStateEnums(meta.device.manufacturerName);
|
|
6943
|
+
meta.logger.debug(`ZMAM02: Using state enums for ${meta.device.manufacturerName}:
|
|
6944
|
+
${JSON.stringify(stateEnums)}`);
|
|
6945
|
+
value = value.toLowerCase();
|
|
6946
|
+
switch (value) {
|
|
6947
|
+
case 'close':
|
|
6948
|
+
await tuya.sendDataPointEnum(entity, tuya.dataPoints.AM02Control, stateEnums.close);
|
|
6949
|
+
break;
|
|
6950
|
+
case 'open':
|
|
6951
|
+
await tuya.sendDataPointEnum(entity, tuya.dataPoints.AM02Control, stateEnums.open);
|
|
6952
|
+
break;
|
|
6953
|
+
case 'stop':
|
|
6954
|
+
await tuya.sendDataPointEnum(entity, tuya.dataPoints.AM02Control, stateEnums.stop);
|
|
6955
|
+
break;
|
|
6956
|
+
default:
|
|
6957
|
+
throw new Error('ZMAM02: Invalid command received');
|
|
6958
|
+
}
|
|
6959
|
+
}
|
|
6930
6960
|
switch (key) {
|
|
6931
|
-
case 'control':
|
|
6932
|
-
await tuya.sendDataPointEnum(entity, tuya.dataPoints.AM02Control, utils.getKey(tuya.ZMAM02.AM02Control, value));
|
|
6933
|
-
break;
|
|
6934
|
-
case 'percent_control':
|
|
6935
|
-
await tuya.sendDataPointValue(entity, tuya.dataPoints.AM02PercentState, value);
|
|
6936
|
-
break;
|
|
6937
6961
|
case 'mode':
|
|
6938
|
-
await tuya.sendDataPointEnum(entity, tuya.dataPoints.AM02Mode, utils.getKey(tuya.
|
|
6962
|
+
await tuya.sendDataPointEnum(entity, tuya.dataPoints.AM02Mode, utils.getKey(tuya.ZMLookups.AM02Mode, value));
|
|
6939
6963
|
break;
|
|
6940
|
-
case '
|
|
6941
|
-
await tuya.sendDataPointEnum(entity, tuya.dataPoints.
|
|
6964
|
+
case 'motor_direction':
|
|
6965
|
+
await tuya.sendDataPointEnum(entity, tuya.dataPoints.AM02Direction, utils.getKey(tuya.ZMLookups.AM02Direction, value));
|
|
6942
6966
|
break;
|
|
6943
6967
|
case 'border':
|
|
6944
|
-
await tuya.sendDataPointEnum(entity, tuya.dataPoints.AM02Border, utils.getKey(tuya.
|
|
6968
|
+
await tuya.sendDataPointEnum(entity, tuya.dataPoints.AM02Border, utils.getKey(tuya.ZMLookups.AM02Border, value));
|
|
6945
6969
|
break;
|
|
6946
6970
|
case 'motor_working_mode':
|
|
6947
|
-
await tuya.sendDataPointEnum(
|
|
6971
|
+
await tuya.sendDataPointEnum(
|
|
6972
|
+
entity,
|
|
6973
|
+
tuya.dataPoints.AM02MotorWorkingMode,
|
|
6974
|
+
utils.getKey(tuya.ZMLookups.AM02MotorWorkingMode,
|
|
6975
|
+
value));
|
|
6948
6976
|
break;
|
|
6949
|
-
default: // Unknown Key
|
|
6950
|
-
meta.logger.warn(`toZigbee.ZMAM02: Unhandled Key ${key}`);
|
|
6951
6977
|
}
|
|
6952
6978
|
},
|
|
6953
6979
|
},
|
|
@@ -396,4 +396,23 @@ module.exports = [
|
|
|
396
396
|
},
|
|
397
397
|
exposes: [e.soil_moisture(), e.battery(), e.illuminance(), e.temperature(), e.humidity()],
|
|
398
398
|
},
|
|
399
|
+
{
|
|
400
|
+
zigbeeModel: ['EFEKTA_eTH102'],
|
|
401
|
+
model: 'EFEKTA_eTH102',
|
|
402
|
+
vendor: 'Custom devices (DiY)',
|
|
403
|
+
description: '[Mini digital thermometer & hygrometer with e-ink1.02](http://efektalab.com/eTH102)',
|
|
404
|
+
fromZigbee: [fz.temperature, fz.humidity, fz.battery],
|
|
405
|
+
toZigbee: [tz.factory_reset],
|
|
406
|
+
configure: async (device, coordinatorEndpoint, logger) => {
|
|
407
|
+
const endpoint = device.getEndpoint(1);
|
|
408
|
+
await reporting.bind(endpoint, coordinatorEndpoint, [
|
|
409
|
+
'genPowerCfg', 'msTemperatureMeasurement', 'msRelativeHumidity']);
|
|
410
|
+
const overides = {min: 0, max: 21600, change: 0};
|
|
411
|
+
await reporting.batteryVoltage(endpoint, overides);
|
|
412
|
+
await reporting.batteryPercentageRemaining(endpoint, overides);
|
|
413
|
+
await reporting.temperature(endpoint, overides);
|
|
414
|
+
await reporting.humidity(endpoint, overides);
|
|
415
|
+
},
|
|
416
|
+
exposes: [e.battery(), e.temperature(), e.humidity()],
|
|
417
|
+
},
|
|
399
418
|
];
|
package/devices/moes.js
CHANGED
|
@@ -119,9 +119,9 @@ module.exports = [
|
|
|
119
119
|
vendor: 'Moes',
|
|
120
120
|
description: 'Wall touch light switch (1 gang)',
|
|
121
121
|
exposes: [e.switch().setAccess('state', ea.STATE_SET),
|
|
122
|
-
exposes.enum('indicate_light', ea.STATE_SET,
|
|
122
|
+
exposes.enum('indicate_light', ea.STATE_SET, Object.values(tuya.moesSwitch.indicateLight))
|
|
123
123
|
.withDescription('Indicator light status'),
|
|
124
|
-
exposes.enum('power_on_behavior', ea.STATE_SET,
|
|
124
|
+
exposes.enum('power_on_behavior', ea.STATE_SET, Object.values(tuya.moesSwitch.powerOnBehavior))
|
|
125
125
|
.withDescription('Controls the behavior when the device is powered on')],
|
|
126
126
|
fromZigbee: [fz.tuya_switch, fz.moes_switch],
|
|
127
127
|
toZigbee: [tz.tuya_switch_state, tz.moes_switch],
|
|
@@ -140,9 +140,9 @@ module.exports = [
|
|
|
140
140
|
description: 'Wall touch light switch (2 gang)',
|
|
141
141
|
exposes: [e.switch().withEndpoint('l1').setAccess('state', ea.STATE_SET),
|
|
142
142
|
e.switch().withEndpoint('l2').setAccess('state', ea.STATE_SET),
|
|
143
|
-
exposes.enum('indicate_light', ea.STATE_SET,
|
|
143
|
+
exposes.enum('indicate_light', ea.STATE_SET, Object.values(tuya.moesSwitch.indicateLight))
|
|
144
144
|
.withDescription('Indicator light status'),
|
|
145
|
-
exposes.enum('power_on_behavior', ea.STATE_SET,
|
|
145
|
+
exposes.enum('power_on_behavior', ea.STATE_SET, Object.values(tuya.moesSwitch.powerOnBehavior))
|
|
146
146
|
.withDescription('Controls the behavior when the device is powered on')],
|
|
147
147
|
fromZigbee: [fz.ignore_basic_report, fz.tuya_switch, fz.moes_switch],
|
|
148
148
|
toZigbee: [tz.tuya_switch_state, tz.moes_switch],
|
|
@@ -168,9 +168,9 @@ module.exports = [
|
|
|
168
168
|
exposes: [e.switch().withEndpoint('l1').setAccess('state', ea.STATE_SET),
|
|
169
169
|
e.switch().withEndpoint('l2').setAccess('state', ea.STATE_SET),
|
|
170
170
|
e.switch().withEndpoint('l3').setAccess('state', ea.STATE_SET),
|
|
171
|
-
exposes.enum('indicate_light', ea.STATE_SET,
|
|
171
|
+
exposes.enum('indicate_light', ea.STATE_SET, Object.values(tuya.moesSwitch.indicateLight))
|
|
172
172
|
.withDescription('Indicator light status'),
|
|
173
|
-
exposes.enum('power_on_behavior', ea.STATE_SET,
|
|
173
|
+
exposes.enum('power_on_behavior', ea.STATE_SET, Object.values(tuya.moesSwitch.powerOnBehavior))
|
|
174
174
|
.withDescription('Controls the behavior when the device is powered on')],
|
|
175
175
|
fromZigbee: [fz.ignore_basic_report, fz.tuya_switch, fz.moes_switch],
|
|
176
176
|
toZigbee: [tz.tuya_switch_state, tz.moes_switch],
|
package/devices/xiaomi.js
CHANGED
|
@@ -152,7 +152,7 @@ module.exports = [
|
|
|
152
152
|
model: 'WXKG01LM',
|
|
153
153
|
vendor: 'Xiaomi',
|
|
154
154
|
description: 'MiJia wireless switch',
|
|
155
|
-
meta: {battery: {voltageToPercentage: '
|
|
155
|
+
meta: {battery: {voltageToPercentage: '3V_2850_3200'}},
|
|
156
156
|
fromZigbee: [fz.xiaomi_battery, fz.xiaomi_WXKG01LM_action, fz.legacy.WXKG01LM_click],
|
|
157
157
|
exposes: [e.battery(), e.action(['single', 'double', 'triple', 'quadruple', 'hold', 'release', 'many']), e.battery_voltage()],
|
|
158
158
|
toZigbee: [],
|
|
@@ -162,7 +162,7 @@ module.exports = [
|
|
|
162
162
|
model: 'WXKG11LM',
|
|
163
163
|
vendor: 'Xiaomi',
|
|
164
164
|
description: 'Aqara wireless switch',
|
|
165
|
-
meta: {battery: {voltageToPercentage: '
|
|
165
|
+
meta: {battery: {voltageToPercentage: '3V_2850_3200'}},
|
|
166
166
|
exposes: [e.battery(), e.battery_voltage(), e.action(['single', 'double', 'triple', 'quadruple', 'hold', 'release'])],
|
|
167
167
|
fromZigbee: [fz.xiaomi_multistate_action, fz.xiaomi_WXKG11LM_action, fz.xiaomi_battery,
|
|
168
168
|
fz.legacy.WXKG11LM_click, fz.legacy.xiaomi_action_click_multistate],
|
|
@@ -173,7 +173,7 @@ module.exports = [
|
|
|
173
173
|
model: 'WXKG12LM',
|
|
174
174
|
vendor: 'Xiaomi',
|
|
175
175
|
description: 'Aqara wireless switch (with gyroscope)',
|
|
176
|
-
meta: {battery: {voltageToPercentage: '
|
|
176
|
+
meta: {battery: {voltageToPercentage: '3V_2850_3200'}},
|
|
177
177
|
exposes: [e.battery(), e.action(['single', 'double', 'hold', 'release', 'shake']), e.battery_voltage()],
|
|
178
178
|
fromZigbee: [fz.xiaomi_battery, fz.xiaomi_multistate_action, fz.legacy.WXKG12LM_action_click_multistate],
|
|
179
179
|
toZigbee: [],
|
|
@@ -183,7 +183,7 @@ module.exports = [
|
|
|
183
183
|
model: 'WXKG03LM_rev1',
|
|
184
184
|
vendor: 'Xiaomi',
|
|
185
185
|
description: 'Aqara single key wireless wall switch (2016 model)',
|
|
186
|
-
meta: {battery: {voltageToPercentage: '
|
|
186
|
+
meta: {battery: {voltageToPercentage: '3V_2850_3200'}},
|
|
187
187
|
exposes: [e.battery(), e.action(['single']), e.battery_voltage()],
|
|
188
188
|
fromZigbee: [fz.xiaomi_on_off_action, fz.xiaomi_battery, fz.legacy.WXKG03LM_click],
|
|
189
189
|
toZigbee: [],
|
|
@@ -194,7 +194,7 @@ module.exports = [
|
|
|
194
194
|
model: 'WXKG03LM_rev2',
|
|
195
195
|
vendor: 'Xiaomi',
|
|
196
196
|
description: 'Aqara single key wireless wall switch (2018 model)',
|
|
197
|
-
meta: {battery: {voltageToPercentage: '
|
|
197
|
+
meta: {battery: {voltageToPercentage: '3V_2850_3200'}},
|
|
198
198
|
exposes: [e.battery(), e.action(['single', 'double', 'hold']), e.battery_voltage()],
|
|
199
199
|
fromZigbee: [fz.xiaomi_on_off_action, fz.xiaomi_multistate_action, fz.xiaomi_battery,
|
|
200
200
|
fz.legacy.WXKG03LM_click, fz.legacy.xiaomi_action_click_multistate],
|
|
@@ -212,7 +212,7 @@ module.exports = [
|
|
|
212
212
|
e.action(['single', 'double', 'hold']),
|
|
213
213
|
e.battery_voltage()],
|
|
214
214
|
onEvent: preventReset,
|
|
215
|
-
meta: {battery: {voltageToPercentage: '
|
|
215
|
+
meta: {battery: {voltageToPercentage: '3V_2850_3200'}},
|
|
216
216
|
configure: async (device, coordinatorEndpoint, logger) => {
|
|
217
217
|
try {
|
|
218
218
|
const endpoint = device.endpoints[1];
|
|
@@ -227,7 +227,7 @@ module.exports = [
|
|
|
227
227
|
model: 'WXKG02LM_rev1',
|
|
228
228
|
vendor: 'Xiaomi',
|
|
229
229
|
description: 'Aqara double key wireless wall switch (2016 model)',
|
|
230
|
-
meta: {battery: {voltageToPercentage: '
|
|
230
|
+
meta: {battery: {voltageToPercentage: '3V_2850_3200'}},
|
|
231
231
|
exposes: [e.battery(), e.action(['single_left', 'single_right', 'single_both']), e.battery_voltage()],
|
|
232
232
|
fromZigbee: [fz.xiaomi_on_off_action, fz.xiaomi_battery, fz.legacy.WXKG02LM_click],
|
|
233
233
|
toZigbee: [],
|
|
@@ -238,7 +238,7 @@ module.exports = [
|
|
|
238
238
|
model: 'WXKG02LM_rev2',
|
|
239
239
|
vendor: 'Xiaomi',
|
|
240
240
|
description: 'Aqara double key wireless wall switch (2018 model)',
|
|
241
|
-
meta: {battery: {voltageToPercentage: '
|
|
241
|
+
meta: {battery: {voltageToPercentage: '3V_2850_3200'}},
|
|
242
242
|
exposes: [e.battery(), e.action(['single_left', 'single_right', 'single_both', 'double_left', 'double_right', 'double_both',
|
|
243
243
|
'hold_left', 'hold_right', 'hold_both']), e.battery_voltage()],
|
|
244
244
|
fromZigbee: [fz.xiaomi_on_off_action, fz.xiaomi_multistate_action, fz.xiaomi_battery,
|
|
@@ -534,7 +534,7 @@ module.exports = [
|
|
|
534
534
|
model: 'WXKG07LM',
|
|
535
535
|
vendor: 'Xiaomi',
|
|
536
536
|
description: 'Aqara D1 double key wireless wall switch',
|
|
537
|
-
meta: {battery: {voltageToPercentage: '
|
|
537
|
+
meta: {battery: {voltageToPercentage: '3V_2850_3200'}},
|
|
538
538
|
fromZigbee: [fz.xiaomi_battery, fz.legacy.xiaomi_on_off_action, fz.legacy.xiaomi_multistate_action],
|
|
539
539
|
toZigbee: [],
|
|
540
540
|
endpoint: (device) => {
|
|
@@ -811,7 +811,7 @@ module.exports = [
|
|
|
811
811
|
model: 'WSDCGQ01LM',
|
|
812
812
|
vendor: 'Xiaomi',
|
|
813
813
|
description: 'MiJia temperature & humidity sensor',
|
|
814
|
-
meta: {battery: {voltageToPercentage: '
|
|
814
|
+
meta: {battery: {voltageToPercentage: '3V_2850_3200'}},
|
|
815
815
|
fromZigbee: [fz.xiaomi_battery, fz.WSDCGQ01LM_WSDCGQ11LM_interval, fz.xiaomi_temperature, fz.humidity],
|
|
816
816
|
toZigbee: [],
|
|
817
817
|
exposes: [e.battery(), e.temperature(), e.humidity(), e.battery_voltage()],
|
|
@@ -821,7 +821,7 @@ module.exports = [
|
|
|
821
821
|
model: 'WSDCGQ11LM',
|
|
822
822
|
vendor: 'Xiaomi',
|
|
823
823
|
description: 'Aqara temperature, humidity and pressure sensor',
|
|
824
|
-
meta: {battery: {voltageToPercentage: '
|
|
824
|
+
meta: {battery: {voltageToPercentage: '3V_2850_3200'}},
|
|
825
825
|
fromZigbee: [fz.xiaomi_battery, fz.xiaomi_temperature, fz.humidity, fz.pressure, fz.WSDCGQ01LM_WSDCGQ11LM_interval],
|
|
826
826
|
toZigbee: [],
|
|
827
827
|
exposes: [e.battery(), e.temperature(), e.humidity(), e.pressure(), e.battery_voltage()],
|
|
@@ -837,7 +837,7 @@ module.exports = [
|
|
|
837
837
|
description: 'Aqara T1 temperature, humidity and pressure sensor',
|
|
838
838
|
fromZigbee: [fz.xiaomi_battery, fz.temperature, fz.humidity, fz.pressure],
|
|
839
839
|
toZigbee: [],
|
|
840
|
-
meta: {battery: {voltageToPercentage: '
|
|
840
|
+
meta: {battery: {voltageToPercentage: '3V_2850_3200'}},
|
|
841
841
|
configure: async (device, coordinatorEndpoint, logger) => {
|
|
842
842
|
const endpoint = device.getEndpoint(1);
|
|
843
843
|
const binds = ['msTemperatureMeasurement', 'msRelativeHumidity', 'msPressureMeasurement'];
|
|
@@ -850,7 +850,7 @@ module.exports = [
|
|
|
850
850
|
model: 'RTCGQ01LM',
|
|
851
851
|
vendor: 'Xiaomi',
|
|
852
852
|
description: 'MiJia human body movement sensor',
|
|
853
|
-
meta: {battery: {voltageToPercentage: '
|
|
853
|
+
meta: {battery: {voltageToPercentage: '3V_2850_3200'}},
|
|
854
854
|
fromZigbee: [fz.xiaomi_battery, fz.occupancy_with_timeout],
|
|
855
855
|
toZigbee: [],
|
|
856
856
|
exposes: [e.battery(), e.occupancy(), e.battery_voltage()],
|
|
@@ -860,7 +860,7 @@ module.exports = [
|
|
|
860
860
|
model: 'RTCGQ11LM',
|
|
861
861
|
vendor: 'Xiaomi',
|
|
862
862
|
description: 'Aqara human body movement and illuminance sensor',
|
|
863
|
-
meta: {battery: {voltageToPercentage: '
|
|
863
|
+
meta: {battery: {voltageToPercentage: '3V_2850_3200'}},
|
|
864
864
|
fromZigbee: [fz.xiaomi_battery, fz.occupancy_with_timeout, fz.RTCGQ11LM_illuminance, fz.RTCGQ11LM_interval],
|
|
865
865
|
toZigbee: [],
|
|
866
866
|
exposes: [e.battery(), e.occupancy(), e.temperature(), e.battery_voltage(), e.illuminance_lux().withProperty('illuminance'),
|
|
@@ -876,7 +876,7 @@ module.exports = [
|
|
|
876
876
|
exposes: [e.occupancy(), e.illuminance().withUnit('lx').withDescription('Measured illuminance in lux'),
|
|
877
877
|
exposes.numeric('detection_interval', ea.ALL).withValueMin(2).withValueMax(65535).withUnit('s')
|
|
878
878
|
.withDescription('Time interval for detecting actions'), e.battery()],
|
|
879
|
-
meta: {battery: {voltageToPercentage: '
|
|
879
|
+
meta: {battery: {voltageToPercentage: '3V_2850_3200'}},
|
|
880
880
|
configure: async (device, coordinatorEndpoint, logger) => {
|
|
881
881
|
const endpoint = device.getEndpoint(1);
|
|
882
882
|
await endpoint.read('genPowerCfg', ['batteryVoltage']);
|
|
@@ -894,7 +894,7 @@ module.exports = [
|
|
|
894
894
|
exposes: [e.occupancy(), exposes.enum('motion_sensitivity', ea.ALL, ['low', 'medium', 'high']),
|
|
895
895
|
exposes.numeric('detection_interval', ea.ALL).withValueMin(2).withValueMax(65535).withUnit('s')
|
|
896
896
|
.withDescription('Time interval for detecting actions'), e.battery()],
|
|
897
|
-
meta: {battery: {voltageToPercentage: '
|
|
897
|
+
meta: {battery: {voltageToPercentage: '3V_2850_3200'}},
|
|
898
898
|
configure: async (device, coordinatorEndpoint, logger) => {
|
|
899
899
|
const endpoint = device.getEndpoint(1);
|
|
900
900
|
await endpoint.read('genPowerCfg', ['batteryVoltage']);
|
|
@@ -932,7 +932,7 @@ module.exports = [
|
|
|
932
932
|
model: 'MCCGQ01LM',
|
|
933
933
|
vendor: 'Xiaomi',
|
|
934
934
|
description: 'MiJia door & window contact sensor',
|
|
935
|
-
meta: {battery: {voltageToPercentage: '
|
|
935
|
+
meta: {battery: {voltageToPercentage: '3V_2850_3200'}},
|
|
936
936
|
fromZigbee: [fz.xiaomi_battery, fz.xiaomi_contact],
|
|
937
937
|
toZigbee: [],
|
|
938
938
|
exposes: [e.battery(), e.contact(), e.battery_voltage()],
|
|
@@ -942,7 +942,7 @@ module.exports = [
|
|
|
942
942
|
model: 'MCCGQ11LM',
|
|
943
943
|
vendor: 'Xiaomi',
|
|
944
944
|
description: 'Aqara door & window contact sensor',
|
|
945
|
-
meta: {battery: {voltageToPercentage: '
|
|
945
|
+
meta: {battery: {voltageToPercentage: '3V_2850_3200'}},
|
|
946
946
|
fromZigbee: [fz.xiaomi_battery, fz.xiaomi_contact, fz.xiaomi_contact_interval],
|
|
947
947
|
toZigbee: [],
|
|
948
948
|
exposes: [e.battery(), e.contact(), e.temperature(), e.battery_voltage()],
|
|
@@ -956,7 +956,7 @@ module.exports = [
|
|
|
956
956
|
model: 'SJCGQ11LM',
|
|
957
957
|
vendor: 'Xiaomi',
|
|
958
958
|
description: 'Aqara water leak sensor',
|
|
959
|
-
meta: {battery: {voltageToPercentage: '
|
|
959
|
+
meta: {battery: {voltageToPercentage: '3V_2850_3200'}},
|
|
960
960
|
fromZigbee: [fz.xiaomi_battery, fz.ias_water_leak_alarm_1, fz.SJCGQ11LM_temperature],
|
|
961
961
|
toZigbee: [],
|
|
962
962
|
exposes: [e.battery(), e.water_leak(), e.battery_low(), e.battery_voltage(), e.temperature()],
|
|
@@ -966,7 +966,7 @@ module.exports = [
|
|
|
966
966
|
model: 'SJCGQ12LM',
|
|
967
967
|
vendor: 'Xiaomi',
|
|
968
968
|
description: 'Aqara T1 water leak sensor',
|
|
969
|
-
meta: {battery: {voltageToPercentage: '
|
|
969
|
+
meta: {battery: {voltageToPercentage: '3V_2850_3200'}},
|
|
970
970
|
fromZigbee: [fz.xiaomi_battery, fz.ias_water_leak_alarm_1],
|
|
971
971
|
toZigbee: [],
|
|
972
972
|
exposes: [e.battery(), e.water_leak(), e.battery_low(), e.tamper(), e.battery_voltage()],
|
|
@@ -977,7 +977,7 @@ module.exports = [
|
|
|
977
977
|
model: 'MFKZQ01LM',
|
|
978
978
|
vendor: 'Xiaomi',
|
|
979
979
|
description: 'Mi/Aqara smart home cube',
|
|
980
|
-
meta: {battery: {voltageToPercentage: '
|
|
980
|
+
meta: {battery: {voltageToPercentage: '3V_2850_3200'}},
|
|
981
981
|
fromZigbee: [fz.xiaomi_battery, fz.MFKZQ01LM_action_multistate, fz.MFKZQ01LM_action_analog],
|
|
982
982
|
exposes: [e.battery(), e.battery_voltage(), e.angle('action_angle'),
|
|
983
983
|
e.cube_side('action_from_side'), e.cube_side('action_side'), e.cube_side('action_to_side'),
|
|
@@ -1135,7 +1135,7 @@ module.exports = [
|
|
|
1135
1135
|
model: 'JTYJ-GD-01LM/BW',
|
|
1136
1136
|
description: 'MiJia Honeywell smoke detector',
|
|
1137
1137
|
vendor: 'Xiaomi',
|
|
1138
|
-
meta: {battery: {voltageToPercentage: '
|
|
1138
|
+
meta: {battery: {voltageToPercentage: '3V_2850_3200'}},
|
|
1139
1139
|
fromZigbee: [fz.xiaomi_battery, fz.JTYJGD01LMBW_smoke, fz.JTYJGD01LMBW_smoke_density],
|
|
1140
1140
|
toZigbee: [tz.JTQJBF01LMBW_JTYJGD01LMBW_sensitivity, tz.JTQJBF01LMBW_JTYJGD01LMBW_selfest],
|
|
1141
1141
|
exposes: [
|
|
@@ -1205,7 +1205,7 @@ module.exports = [
|
|
|
1205
1205
|
model: 'DJT11LM',
|
|
1206
1206
|
vendor: 'Xiaomi',
|
|
1207
1207
|
description: 'Aqara vibration sensor',
|
|
1208
|
-
meta: {battery: {voltageToPercentage: '
|
|
1208
|
+
meta: {battery: {voltageToPercentage: '3V_2850_3200'}},
|
|
1209
1209
|
fromZigbee: [fz.xiaomi_battery, fz.DJT11LM_vibration],
|
|
1210
1210
|
toZigbee: [tz.DJT11LM_vibration_sensitivity],
|
|
1211
1211
|
exposes: [
|
|
@@ -1377,7 +1377,7 @@ module.exports = [
|
|
|
1377
1377
|
]), exposes.enum('operation_mode', ea.ALL, ['command', 'event'])
|
|
1378
1378
|
.withDescription('Operation mode, select "command" to enable bindings (wake up the device before changing modes!)')],
|
|
1379
1379
|
toZigbee: [tz.aqara_opple_operation_mode],
|
|
1380
|
-
meta: {battery: {voltageToPercentage: '
|
|
1380
|
+
meta: {battery: {voltageToPercentage: '3V_2850_3200'}},
|
|
1381
1381
|
configure: async (device, coordinatorEndpoint, logger) => {
|
|
1382
1382
|
const endpoint = device.getEndpoint(1);
|
|
1383
1383
|
await endpoint.write('aqaraOpple', {'mode': 1}, {manufacturerCode: 0x115f});
|
|
@@ -1399,7 +1399,7 @@ module.exports = [
|
|
|
1399
1399
|
]), exposes.enum('operation_mode', ea.ALL, ['command', 'event'])
|
|
1400
1400
|
.withDescription('Operation mode, select "command" to enable bindings (wake up the device before changing modes!)')],
|
|
1401
1401
|
toZigbee: [tz.aqara_opple_operation_mode],
|
|
1402
|
-
meta: {battery: {voltageToPercentage: '
|
|
1402
|
+
meta: {battery: {voltageToPercentage: '3V_2850_3200'}},
|
|
1403
1403
|
configure: async (device, coordinatorEndpoint, logger) => {
|
|
1404
1404
|
const endpoint = device.getEndpoint(1);
|
|
1405
1405
|
await endpoint.write('aqaraOpple', {'mode': 1}, {manufacturerCode: 0x115f});
|
|
@@ -1425,7 +1425,7 @@ module.exports = [
|
|
|
1425
1425
|
]), exposes.enum('operation_mode', ea.ALL, ['command', 'event'])
|
|
1426
1426
|
.withDescription('Operation mode, select "command" to enable bindings (wake up the device before changing modes!)')],
|
|
1427
1427
|
toZigbee: [tz.aqara_opple_operation_mode],
|
|
1428
|
-
meta: {battery: {voltageToPercentage: '
|
|
1428
|
+
meta: {battery: {voltageToPercentage: '3V_2850_3200'}},
|
|
1429
1429
|
configure: async (device, coordinatorEndpoint, logger) => {
|
|
1430
1430
|
const endpoint = device.getEndpoint(1);
|
|
1431
1431
|
await endpoint.write('aqaraOpple', {'mode': 1}, {manufacturerCode: 0x115f});
|
|
@@ -1441,7 +1441,7 @@ module.exports = [
|
|
|
1441
1441
|
description: 'MiJia light intensity sensor',
|
|
1442
1442
|
fromZigbee: [fz.battery, fz.illuminance],
|
|
1443
1443
|
toZigbee: [],
|
|
1444
|
-
meta: {battery: {voltageToPercentage: '
|
|
1444
|
+
meta: {battery: {voltageToPercentage: '3V_2850_3200'}},
|
|
1445
1445
|
configure: async (device, coordinatorEndpoint, logger) => {
|
|
1446
1446
|
const endpoint = device.getEndpoint(1);
|
|
1447
1447
|
await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg', 'msIlluminanceMeasurement']);
|
|
@@ -1592,7 +1592,7 @@ module.exports = [
|
|
|
1592
1592
|
description: 'Aqara wireless remote switch H1 (double rocker)',
|
|
1593
1593
|
fromZigbee: [fz.battery, fz.xiaomi_multistate_action, fz.aqara_opple, fz.command_toggle],
|
|
1594
1594
|
toZigbee: [tz.xiaomi_switch_click_mode, tz.aqara_opple_operation_mode],
|
|
1595
|
-
meta: {battery: {voltageToPercentage: '
|
|
1595
|
+
meta: {battery: {voltageToPercentage: '3V_2850_3200'}, multiEndpoint: true},
|
|
1596
1596
|
exposes: [
|
|
1597
1597
|
e.battery(), e.battery_voltage(), e.action([
|
|
1598
1598
|
'single_left', 'single_right', 'single_both',
|
|
@@ -1679,7 +1679,7 @@ module.exports = [
|
|
|
1679
1679
|
description: 'Aqara TVOC air quality monitor',
|
|
1680
1680
|
fromZigbee: [fz.xiaomi_tvoc, fz.battery, fz.temperature, fz.humidity],
|
|
1681
1681
|
toZigbee: [],
|
|
1682
|
-
meta: {battery: {voltageToPercentage: '
|
|
1682
|
+
meta: {battery: {voltageToPercentage: '3V_2850_3200'}},
|
|
1683
1683
|
exposes: [e.battery(), e.temperature(), e.humidity(), e.voc()],
|
|
1684
1684
|
configure: async (device, coordinatorEndpoint, logger) => {
|
|
1685
1685
|
const endpoint = device.getEndpoint(1);
|
|
@@ -1758,7 +1758,7 @@ module.exports = [
|
|
|
1758
1758
|
model: 'WXKG13LM',
|
|
1759
1759
|
vendor: 'Xiaomi',
|
|
1760
1760
|
description: 'Aqara T1 wireless mini switch',
|
|
1761
|
-
meta: {battery: {voltageToPercentage: '
|
|
1761
|
+
meta: {battery: {voltageToPercentage: '3V_2850_3200'}},
|
|
1762
1762
|
fromZigbee: [fz.battery, fz.aqara_opple_multistate, fz.aqara_opple],
|
|
1763
1763
|
toZigbee: [],
|
|
1764
1764
|
exposes: [e.battery(), e.battery_voltage(), e.action(['single', 'double', 'triple', 'quintuple', 'hold', 'release', 'many'])],
|
|
@@ -1774,7 +1774,7 @@ module.exports = [
|
|
|
1774
1774
|
description: 'Aqara T1 light intensity sensor',
|
|
1775
1775
|
fromZigbee: [fz.battery, fz.illuminance, fz.aqara_opple],
|
|
1776
1776
|
toZigbee: [tz.GZCGQ11LM_detection_period],
|
|
1777
|
-
meta: {battery: {voltageToPercentage: '
|
|
1777
|
+
meta: {battery: {voltageToPercentage: '3V_2850_3200'}},
|
|
1778
1778
|
exposes: [e.battery(), e.battery_voltage(), e.illuminance(), e.illuminance_lux(),
|
|
1779
1779
|
exposes.numeric('detection_period', exposes.access.ALL).withValueMin(1).withValueMax(59).withUnit('s')
|
|
1780
1780
|
.withDescription('Time interval in seconds to report after light changes')],
|
|
@@ -1813,7 +1813,7 @@ module.exports = [
|
|
|
1813
1813
|
description: 'Aqara T1 door & window contact sensor',
|
|
1814
1814
|
fromZigbee: [fz.xiaomi_contact, fz.battery],
|
|
1815
1815
|
toZigbee: [],
|
|
1816
|
-
meta: {battery: {voltageToPercentage: '
|
|
1816
|
+
meta: {battery: {voltageToPercentage: '3V_2850_3200'}},
|
|
1817
1817
|
exposes: [e.contact(), e.battery(), e.battery_voltage()],
|
|
1818
1818
|
configure: async (device, coordinatorEndpoint, logger) => {
|
|
1819
1819
|
const endpoint = device.getEndpoint(1);
|
|
@@ -1842,7 +1842,7 @@ module.exports = [
|
|
|
1842
1842
|
model: 'ZNXNKG02LM',
|
|
1843
1843
|
vendor: 'Xiaomi',
|
|
1844
1844
|
description: 'Aqara knob H1 (wireless)',
|
|
1845
|
-
meta: {battery: {voltageToPercentage: '
|
|
1845
|
+
meta: {battery: {voltageToPercentage: '3V_2850_3200'}},
|
|
1846
1846
|
exposes: [e.battery(), e.battery_voltage(),
|
|
1847
1847
|
e.action(['single', 'double', 'hold', 'release', 'start_rotating', 'rotation', 'stop_rotating']),
|
|
1848
1848
|
exposes.enum('operation_mode', ea.ALL, ['event', 'command']).withDescription('Button mode'),
|
|
@@ -1880,7 +1880,7 @@ module.exports = [
|
|
|
1880
1880
|
model: 'WXKG17LM',
|
|
1881
1881
|
vendor: 'Xiaomi',
|
|
1882
1882
|
description: 'Aqara E1 double key wireless switch',
|
|
1883
|
-
meta: {battery: {voltageToPercentage: '
|
|
1883
|
+
meta: {battery: {voltageToPercentage: '3V_2850_3200'}},
|
|
1884
1884
|
exposes: [e.battery(), e.battery_voltage(),
|
|
1885
1885
|
e.action(['single_left', 'single_right', 'single_both', 'double_left', 'double_right', 'hold_left', 'hold_right']),
|
|
1886
1886
|
// eslint-disable-next-line max-len
|
package/devices/zemismart.js
CHANGED
|
@@ -126,17 +126,22 @@ module.exports = [
|
|
|
126
126
|
},
|
|
127
127
|
{
|
|
128
128
|
fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_iossyxra'}],
|
|
129
|
-
model: 'ZM-
|
|
129
|
+
model: 'ZM-AM02_cover',
|
|
130
130
|
vendor: 'Zemismart',
|
|
131
131
|
description: 'Zigbee/RF curtain converter',
|
|
132
|
-
fromZigbee: [fz.
|
|
133
|
-
toZigbee: [tz.
|
|
134
|
-
exposes: [
|
|
135
|
-
exposes.
|
|
132
|
+
fromZigbee: [fz.ZMAM02_cover],
|
|
133
|
+
toZigbee: [tz.ZMAM02_cover],
|
|
134
|
+
exposes: [e.cover_position().setAccess('position', ea.STATE_SET),
|
|
135
|
+
exposes.composite('options', 'options')
|
|
136
|
+
.withFeature(exposes.numeric('motor_speed', ea.STATE_SET)
|
|
137
|
+
.withValueMin(0)
|
|
138
|
+
.withValueMax(255)
|
|
139
|
+
.withDescription('Motor speed')),
|
|
140
|
+
exposes.enum('motor_working_mode', ea.STATE_SET, Object.values(tuya.ZMLookups.AM02MotorWorkingMode)),
|
|
136
141
|
exposes.numeric('percent_state', ea.STATE).withValueMin(0).withValueMax(100).withValueStep(1).withUnit('%'),
|
|
137
|
-
exposes.enum('mode', ea.STATE_SET, Object.values(tuya.
|
|
138
|
-
exposes.enum('
|
|
139
|
-
exposes.enum('border', ea.STATE_SET, Object.values(tuya.
|
|
142
|
+
exposes.enum('mode', ea.STATE_SET, Object.values(tuya.ZMLookups.AM02Mode)),
|
|
143
|
+
exposes.enum('motor_direction', ea.STATE_SET, Object.values(tuya.ZMLookups.AM02Direction)),
|
|
144
|
+
exposes.enum('border', ea.STATE_SET, Object.values(tuya.ZMLookups.AM02Border)),
|
|
140
145
|
// ---------------------------------------------------------------------------------
|
|
141
146
|
// DP exists, but not used at the moment
|
|
142
147
|
// exposes.numeric('percent_control', ea.STATE_SET).withValueMin(0).withValueMax(100).withValueStep(1).withUnit('%'),
|
package/lib/exposes.js
CHANGED
|
@@ -484,7 +484,7 @@ module.exports = {
|
|
|
484
484
|
precision: (name) => new Numeric(`${name}_precision`, access.SET).withValueMin(0).withValueMax(3).withDescription(`Number of digits after decimal point for ${name}, takes into effect on next report of device.`),
|
|
485
485
|
invert_cover: () => new Binary(`invert_cover`, access.SET, true, false).withDescription(`Inverts the cover position, false: open=100,close=0, true: open=0,close=100 (default false).`),
|
|
486
486
|
color_sync: () => new Binary(`color_sync`, access.SET, true, false).withDescription(`When enabled colors will be synced, e.g. if the light supports both color x/y and color temperature a conversion from color x/y to color temperature will be done when setting the x/y color (default true).`),
|
|
487
|
-
thermostat_unit: () => new Enum('thermostat_unit', access.SET, ['celsius', 'fahrenheit']).withDescription('Controls the temperature unit of the
|
|
487
|
+
thermostat_unit: () => new Enum('thermostat_unit', access.SET, ['celsius', 'fahrenheit']).withDescription('Controls the temperature unit of the thermostat (default celsius).'),
|
|
488
488
|
expose_pin: () => new Binary(`expose_pin`, access.SET, true, false).withDescription(`Expose pin of this lock in the published payload (default false).`),
|
|
489
489
|
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).'),
|
|
490
490
|
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).'),
|
package/lib/tuya.js
CHANGED
|
@@ -565,7 +565,7 @@ const dataPoints = {
|
|
|
565
565
|
AM02PercentControl: 2,
|
|
566
566
|
AM02PercentState: 3,
|
|
567
567
|
AM02Mode: 4,
|
|
568
|
-
|
|
568
|
+
AM02Direction: 5,
|
|
569
569
|
AM02WorkState: 7,
|
|
570
570
|
AM02CountdownLeft: 9,
|
|
571
571
|
AM02TimeTotal: 10,
|
|
@@ -700,7 +700,7 @@ const tvThermostatPreset = {
|
|
|
700
700
|
3: 'holiday',
|
|
701
701
|
};
|
|
702
702
|
// Zemismart ZM_AM02 Roller Shade Converter
|
|
703
|
-
const
|
|
703
|
+
const ZMLookups = {
|
|
704
704
|
AM02Mode: {
|
|
705
705
|
0: 'morning',
|
|
706
706
|
1: 'night',
|
|
@@ -728,7 +728,7 @@ const ZMAM02 = {
|
|
|
728
728
|
0: 'fully_open',
|
|
729
729
|
1: 'fully_close',
|
|
730
730
|
},
|
|
731
|
-
|
|
731
|
+
AM02MotorWorkingMode: {
|
|
732
732
|
0: 'continuous',
|
|
733
733
|
1: 'intermittently',
|
|
734
734
|
},
|
|
@@ -744,6 +744,7 @@ const moesSwitch = {
|
|
|
744
744
|
0: 'off',
|
|
745
745
|
1: 'switch',
|
|
746
746
|
2: 'position',
|
|
747
|
+
3: 'freeze',
|
|
747
748
|
},
|
|
748
749
|
};
|
|
749
750
|
|
|
@@ -896,6 +897,6 @@ module.exports = {
|
|
|
896
897
|
tvThermostatMode,
|
|
897
898
|
tvThermostatPreset,
|
|
898
899
|
tuyaRadar,
|
|
899
|
-
|
|
900
|
+
ZMLookups,
|
|
900
901
|
moesSwitch,
|
|
901
902
|
};
|
package/lib/utils.js
CHANGED
|
@@ -158,6 +158,8 @@ function batteryVoltageToPercentage(voltage, option) {
|
|
|
158
158
|
percentage = 0;
|
|
159
159
|
}
|
|
160
160
|
percentage = Math.round(percentage);
|
|
161
|
+
} else if (option === '3V_2850_3200') {
|
|
162
|
+
percentage = toPercentage(voltage, 2850, 3200);
|
|
161
163
|
} else if (option === '4LR6AA1_5v') {
|
|
162
164
|
percentage = toPercentage(voltage, 3000, 4200);
|
|
163
165
|
} else {
|
package/npm-shrinkwrap.json
CHANGED