zigbee-herdsman-converters 14.0.448 → 14.0.449

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/devices/tuya.js CHANGED
@@ -999,6 +999,8 @@ module.exports = [
999
999
  toZigbee: [tz.tuya_cover_control, tz.tuya_cover_options],
1000
1000
  exposes: [
1001
1001
  e.cover_position().setAccess('position', ea.STATE_SET),
1002
+ exposes.binary('running', ea.STATE, true, false)
1003
+ .withDescription('Whether the motor is moving or not'),
1002
1004
  exposes.composite('options', 'options')
1003
1005
  .withFeature(exposes.numeric('motor_speed', ea.STATE_SET)
1004
1006
  .withValueMin(0)
package/devices/xiaomi.js CHANGED
@@ -914,7 +914,7 @@ module.exports = [
914
914
  fromZigbee: [fz.aqara_opple],
915
915
  toZigbee: [tz.RTCZCGQ11LM_presence, tz.RTCZCGQ11LM_monitoring_mode, tz.RTCZCGQ11LM_approach_distance,
916
916
  tz.aqara_motion_sensitivity, tz.RTCZCGQ11LM_reset_nopresence_status],
917
- exposes: [e.presence().withAccess(ea.STATE_GET),
917
+ exposes: [e.presence().withAccess(ea.STATE_GET), e.power_outage_count(), e.temperature(),
918
918
  exposes.enum('presence_event', ea.STATE, ['enter', 'leave', 'left_enter', 'right_leave', 'right_enter', 'left_leave',
919
919
  'approach', 'away']).withDescription('Presence events: "enter", "leave", "left_enter", "right_leave", ' +
920
920
  '"right_enter", "left_leave", "approach", "away"'),
@@ -925,8 +925,7 @@ module.exports = [
925
925
  exposes.enum('motion_sensitivity', ea.ALL, ['low', 'medium', 'high']).withDescription('Different sensitivities ' +
926
926
  'means different static human body recognition rate and response speed of occupied'),
927
927
  exposes.enum('reset_nopresence_status', ea.SET, ['Reset']).withDescription('Reset the status of no presence'),
928
- exposes.numeric('power_outage_count', ea.STATE).withDescription('Number of power outages (since last pairing)'),
929
- e.temperature()],
928
+ ],
930
929
  configure: async (device, coordinatorEndpoint, logger) => {
931
930
  const endpoint = device.getEndpoint(1);
932
931
  await endpoint.read('aqaraOpple', [0x010c], {manufacturerCode: 0x115f});
@@ -1173,7 +1172,7 @@ module.exports = [
1173
1172
  fromZigbee: [fz.aqara_opple],
1174
1173
  toZigbee: [tz.JTBZ01AQA_gas, tz.JTBZ01AQA_gas_density, tz.JTBZ01AQA_gas_sensitivity, tz.JTBZ01AQA_selftest,
1175
1174
  tz.JTBZ01AQA_mute_buzzer, tz.JTBZ01AQA_mute, tz.JTBZ01AQA_linkage_alarm, tz.JTBZ01AQA_state, tz.aqara_power_outage_count],
1176
- exposes: [e.gas().withAccess(ea.STATE_GET),
1175
+ exposes: [e.gas().withAccess(ea.STATE_GET), e.power_outage_count().withAccess(ea.STATE_GET),
1177
1176
  exposes.numeric('gas_density', ea.STATE_GET).withUnit('%LEL').withDescription('Value of gas concentration'),
1178
1177
  exposes.enum('gas_sensitivity', ea.ALL, ['10%LEL', '15%LEL']).withDescription('Gas concentration value at which ' +
1179
1178
  'an alarm is triggered ("10%LEL" is more sensitive than "15%LEL")'),
@@ -1187,7 +1186,7 @@ module.exports = [
1187
1186
  'is detected, other detectors with this option enabled will also sound the alarm buzzer'),
1188
1187
  exposes.binary('state', ea.STATE_GET, 'preparation', 'work').withDescription('"Preparation" or "work" ' +
1189
1188
  '(measurement of the gas concentration value and triggering of an alarm are only performed in the "work" state)'),
1190
- exposes.numeric('power_outage_count', ea.STATE_GET).withDescription('Number of power outages (since last pairing)')],
1189
+ ],
1191
1190
  configure: async (device, coordinatorEndpoint, logger) => {
1192
1191
  const endpoint = device.getEndpoint(1);
1193
1192
  await endpoint.read('aqaraOpple', [0x013a], {manufacturerCode: 0x115f});
@@ -1239,7 +1238,9 @@ module.exports = [
1239
1238
  vendor: 'Xiaomi',
1240
1239
  fromZigbee: [fz.xiaomi_curtain_position, fz.cover_position_tilt, fz.xiaomi_curtain_options],
1241
1240
  toZigbee: [tz.xiaomi_curtain_position_state, tz.xiaomi_curtain_options],
1242
- exposes: [e.cover_position().setAccess('state', ea.ALL)],
1241
+ exposes: [e.cover_position().setAccess('state', ea.ALL),
1242
+ exposes.binary('running', ea.STATE, true, false)
1243
+ .withDescription('Whether the motor is moving or not')],
1243
1244
  ota: ota.zigbeeOTA,
1244
1245
  },
1245
1246
  {
@@ -1249,7 +1250,9 @@ module.exports = [
1249
1250
  vendor: 'Xiaomi',
1250
1251
  fromZigbee: [fz.xiaomi_curtain_position, fz.cover_position_tilt, fz.xiaomi_curtain_options],
1251
1252
  toZigbee: [tz.xiaomi_curtain_position_state, tz.xiaomi_curtain_options],
1252
- exposes: [e.cover_position().setAccess('state', ea.ALL)],
1253
+ exposes: [e.cover_position().setAccess('state', ea.ALL),
1254
+ exposes.binary('running', ea.STATE, true, false)
1255
+ .withDescription('Whether the motor is moving or not')],
1253
1256
  ota: ota.zigbeeOTA,
1254
1257
  },
1255
1258
  {
@@ -1266,7 +1269,9 @@ module.exports = [
1266
1269
  await device.endpoints[0].read('genAnalogOutput', ['presentValue']);
1267
1270
  }
1268
1271
  },
1269
- exposes: [e.cover_position().setAccess('state', ea.ALL), e.battery()],
1272
+ exposes: [e.cover_position().setAccess('state', ea.ALL), e.battery(),
1273
+ exposes.binary('running', ea.STATE, true, false)
1274
+ .withDescription('Whether the motor is moving or not')],
1270
1275
  configure: async (device, coordinatorEndpoint, logger) => {
1271
1276
  const endpoint = device.endpoints[0];
1272
1277
  await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg']);
@@ -1286,7 +1291,7 @@ module.exports = [
1286
1291
  exposes.enum('motor_state', ea.STATE, ['declining', 'rising', 'pause', 'blocked'])
1287
1292
  .withDescription('The current state of the motor.'),
1288
1293
  exposes.binary('running', ea.STATE, true, false)
1289
- .withDescription('Whether the motor is moving or not.')],
1294
+ .withDescription('Whether the motor is moving or not')],
1290
1295
  configure: async (device, coordinatorEndpoint, logger) => {
1291
1296
  device.powerSource = 'Battery';
1292
1297
  device.save();
@@ -1304,10 +1309,11 @@ module.exports = [
1304
1309
  endpoint: (device) => {
1305
1310
  return {'l1': 1, 'l2': 2};
1306
1311
  },
1307
- exposes: [e.power().withAccess(ea.STATE_GET), e.energy(), e.temperature(), e.voltage().withAccess(ea.STATE), e.current(),
1308
- e.switch().withEndpoint('l1'), e.switch().withEndpoint('l2'),
1312
+ exposes: [e.power().withAccess(ea.STATE_GET), e.energy(), e.temperature(), e.voltage(), e.current(),
1313
+ e.switch().withEndpoint('l1'), e.switch().withEndpoint('l2'), e.power_outage_count(false),
1309
1314
  exposes.binary('interlock', ea.STATE_SET, true, false)
1310
- .withDescription('Enabling prevents both relais being on at the same time')],
1315
+ .withDescription('Enabling prevents both relais being on at the same time'),
1316
+ ],
1311
1317
  ota: ota.zigbeeOTA,
1312
1318
  },
1313
1319
  {
@@ -1481,8 +1487,9 @@ module.exports = [
1481
1487
  // Ignore energy metering reports, rely on aqara_opple: https://github.com/Koenkk/zigbee2mqtt/issues/10709
1482
1488
  fromZigbee: [fz.on_off, fz.device_temperature, fz.aqara_opple, fz.ignore_metering, fz.ignore_electrical_measurement,
1483
1489
  fz.xiaomi_power],
1484
- exposes: [e.switch(), e.energy(), e.power(), e.device_temperature(), e.power_outage_memory(), e.switch_type(),
1485
- e.voltage(), e.temperature(), e.current()],
1490
+ exposes: [e.switch(), e.energy(), e.power(), e.device_temperature(), e.power_outage_memory(), e.power_outage_count(),
1491
+ e.switch_type(), e.voltage(), e.temperature(), e.current(),
1492
+ ],
1486
1493
  toZigbee: [tz.xiaomi_switch_type, tz.on_off, tz.xiaomi_switch_power_outage_memory, tz.xiaomi_led_disabled_night],
1487
1494
  configure: async (device, coordinatorEndpoint, logger) => {
1488
1495
  const endpoint = device.getEndpoint(1);
package/lib/exposes.js CHANGED
@@ -582,6 +582,7 @@ module.exports = {
582
582
  position: () => new Numeric('position', access.STATE).withUnit('%').withDescription('Position'),
583
583
  power: () => new Numeric('power', access.STATE).withUnit('W').withDescription('Instantaneous measured power'),
584
584
  power_on_behavior: () => new Enum('power_on_behavior', access.ALL, ['off', 'previous', 'on']).withDescription('Controls the behavior when the device is powered on'),
585
+ power_outage_count: (resetsWhenPairing = true) => new Numeric('power_outage_count', access.STATE).withDescription('Number of power outages' + (resetsWhenPairing ? ' (since last pairing)' : '')),
585
586
  power_outage_memory: () => new Binary('power_outage_memory', access.ALL, true, false).withDescription('Enable/disable the power outage memory, this recovers the on/off mode after power failure'),
586
587
  presence: () => new Binary('presence', access.STATE, true, false).withDescription('Indicates whether the device detected presence'),
587
588
  pressure: () => new Numeric('pressure', access.STATE).withUnit('hPa').withDescription('The measured atmospheric pressure'),
package/lib/xiaomi.js CHANGED
@@ -160,7 +160,7 @@ const numericAttributes2Payload = (msg, meta, model, options, dataObject) => {
160
160
  payload.mode_switch = {4: 'anti_flicker_mode', 1: 'quick_mode'}[value];
161
161
  break;
162
162
  case '5':
163
- if (['JT-BZ-01AQ/A', 'RTCZCGQ11LM'].includes(model.model)) {
163
+ if (['Mains (single phase)', 'DC Source'].includes(meta.device.powerSource)) {
164
164
  payload.power_outage_count = value;
165
165
  }
166
166
  break;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zigbee-herdsman-converters",
3
- "version": "14.0.448",
3
+ "version": "14.0.449",
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.448",
3
+ "version": "14.0.449",
4
4
  "description": "Collection of device converters to be used with zigbee-herdsman",
5
5
  "main": "index.js",
6
6
  "files": [