zigbee-herdsman-converters 14.0.374 → 14.0.375

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.
@@ -5160,7 +5160,7 @@ const converters = {
5160
5160
  if (msg.data.hasOwnProperty('0')) payload.detection_period = msg.data['0'];
5161
5161
  if (msg.data.hasOwnProperty('4')) payload.mode_switch = {4: 'anti_flicker_mode', 1: 'quick_mode'}[msg.data['4']];
5162
5162
  if (msg.data.hasOwnProperty('10')) payload.switch_type = {1: 'toggle', 2: 'momentary'}[msg.data['10']];
5163
- if (msg.data.hasOwnProperty('258')) payload.occupancy_timeout = msg.data['258'];
5163
+ if (msg.data.hasOwnProperty('258')) payload.detection_interval = msg.data['258'];
5164
5164
  if (msg.data.hasOwnProperty('268')) payload.motion_sensitivity = {1: 'low', 2: 'medium', 3: 'high'}[msg.data['268']];
5165
5165
  if (msg.data.hasOwnProperty('512')) {
5166
5166
  if (['ZNCZ15LM', 'QBCZ14LM', 'QBCZ15LM'].includes(model.model)) {
@@ -5321,7 +5321,7 @@ const converters = {
5321
5321
  if (msg.data.hasOwnProperty('illuminance')) {
5322
5322
  // The occupancy sensor only sends a message when motion detected.
5323
5323
  // Therefore we need to publish the no_motion detected by ourselves.
5324
- const timeout = meta && meta.state && meta.state.hasOwnProperty('occupancy_timeout') ? meta.state.occupancy_timeout : 60;
5324
+ const timeout = meta && meta.state && meta.state.hasOwnProperty('detection_interval') ? meta.state.detection_interval : 60;
5325
5325
 
5326
5326
  // Stop existing timers because motion is detected and set a new one.
5327
5327
  globalStore.getValue(msg.endpoint, 'timers', []).forEach((t) => clearTimeout(t));
@@ -5355,7 +5355,7 @@ const converters = {
5355
5355
 
5356
5356
  // The occupancy sensor only sends a message when motion detected.
5357
5357
  // Therefore we need to publish the no_motion detected by ourselves.
5358
- const timeout = meta && meta.state && meta.state.hasOwnProperty('occupancy_timeout') ? meta.state.occupancy_timeout : 60;
5358
+ const timeout = meta && meta.state && meta.state.hasOwnProperty('detection_interval') ? meta.state.detection_interval : 60;
5359
5359
 
5360
5360
  // Stop existing timers because motion is detected and set a new one.
5361
5361
  globalStore.getValue(msg.endpoint, 'timers', []).forEach((t) => clearTimeout(t));
@@ -7538,19 +7538,25 @@ const converters = {
7538
7538
  cluster: 'manuSpecificTuya',
7539
7539
  type: ['commandGetData', 'commandDataResponse', 'raw'],
7540
7540
  convert: (model, msg, publish, options, meta) => {
7541
- const dp = msg.data.dp;
7542
- const value = tuya.getDataValue(msg.data.datatype, msg.data.data);
7543
- switch (dp) {
7544
- case tuya.dataPoints.state:
7545
- return {contact: Boolean(value)};
7546
- case tuya.dataPoints.thitBatteryPercentage:
7547
- return {battery: value};
7548
- case tuya.dataPoints.tuyaVibration:
7549
- return {vibration: Boolean(value)};
7550
- default:
7551
- meta.logger.warn(`zigbee-herdsman-converters:tuya_smart_vibration_sensor: NOT RECOGNIZED ` +
7552
- `DP #${dp} with data ${JSON.stringify(msg.data)}`);
7541
+ const result = {};
7542
+ for (const dpValue of msg.data.dpValues) {
7543
+ const value = tuya.getDataValue(dpValue);
7544
+ switch (dpValue.dp) {
7545
+ case tuya.dataPoints.state:
7546
+ result.contact = Boolean(value);
7547
+ break;
7548
+ case tuya.dataPoints.thitBatteryPercentage:
7549
+ result.battery = value;
7550
+ break;
7551
+ case tuya.dataPoints.tuyaVibration:
7552
+ result.vibration = Boolean(value);
7553
+ break;
7554
+ default:
7555
+ meta.logger.warn(`zigbee-herdsman-converters:tuya_smart_vibration_sensor: NOT RECOGNIZED ` +
7556
+ `DP #${dpValue.dp} with data ${JSON.stringify(dpValue)}`);
7557
+ }
7553
7558
  }
7559
+ return result;
7554
7560
  },
7555
7561
  },
7556
7562
  moes_thermostat_tv: {
@@ -2078,12 +2078,12 @@ const converters = {
2078
2078
  await entity.read('aqaraOpple', [0x0000], manufacturerOptions.xiaomi);
2079
2079
  },
2080
2080
  },
2081
- aqara_occupancy_timeout: {
2082
- key: ['occupancy_timeout'],
2081
+ aqara_detection_interval: {
2082
+ key: ['detection_interval'],
2083
2083
  convertSet: async (entity, key, value, meta) => {
2084
2084
  value *= 1;
2085
2085
  await entity.write('aqaraOpple', {0x0102: {value: [value], type: 0x20}}, manufacturerOptions.xiaomi);
2086
- return {state: {occupancy_timeout: value}};
2086
+ return {state: {detection_interval: value}};
2087
2087
  },
2088
2088
  convertGet: async (entity, key, meta) => {
2089
2089
  await entity.read('aqaraOpple', [0x0102], manufacturerOptions.xiaomi);
package/devices/iris.js CHANGED
@@ -19,6 +19,8 @@ module.exports = [
19
19
  await reporting.bind(endpoint, coordinatorEndpoint, ['msTemperatureMeasurement', 'genPowerCfg']);
20
20
  await reporting.temperature(endpoint);
21
21
  await reporting.batteryVoltage(endpoint);
22
+ device.powerSource = 'Battery';
23
+ device.save();
22
24
  },
23
25
  exposes: [e.contact(), e.battery_low(), e.tamper(), e.temperature(), e.battery()],
24
26
  },
package/devices/tuya.js CHANGED
@@ -1142,7 +1142,9 @@ module.exports = [
1142
1142
  toZigbee: [tz.on_off, tz.tuya_switch_power_outage_memory],
1143
1143
  configure: async (device, coordinatorEndpoint, logger) => {
1144
1144
  const endpoint = device.getEndpoint(1);
1145
- await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']);
1145
+ // Enables reporting of physical state changes
1146
+ // https://github.com/Koenkk/zigbee2mqtt/issues/9057#issuecomment-1007742130
1147
+ await endpoint.read('genBasic', ['manufacturerName', 'zclVersion', 'appVersion', 'modelId', 'powerSource', 0xfffe]);
1146
1148
  endpoint.saveClusterAttributeKeyValue('haElectricalMeasurement', {acCurrentDivisor: 1000, acCurrentMultiplier: 1});
1147
1149
  endpoint.saveClusterAttributeKeyValue('seMetering', {divisor: 100, multiplier: 1});
1148
1150
  device.save();
package/devices/xiaomi.js CHANGED
@@ -875,10 +875,10 @@ module.exports = [
875
875
  vendor: 'Xiaomi',
876
876
  description: 'Aqara T1 human body movement and illuminance sensor',
877
877
  fromZigbee: [fz.RTCGQ12LM_occupancy_illuminance, fz.aqara_opple, fz.battery],
878
- toZigbee: [tz.aqara_occupancy_timeout],
878
+ toZigbee: [tz.aqara_detection_interval],
879
879
  exposes: [e.occupancy(), e.illuminance().withUnit('lx').withDescription('Measured illuminance in lux'),
880
- exposes.numeric('occupancy_timeout', ea.ALL).withValueMin(2).withValueMax(65535).withUnit('s')
881
- .withDescription('Time in seconds till occupancy goes to false'), e.battery()],
880
+ exposes.numeric('detection_interval', ea.ALL).withValueMin(2).withValueMax(65535).withUnit('s')
881
+ .withDescription('Time interval for detecting actions'), e.battery()],
882
882
  meta: {battery: {voltageToPercentage: '3V_2100'}},
883
883
  configure: async (device, coordinatorEndpoint, logger) => {
884
884
  const endpoint = device.getEndpoint(1);
@@ -892,10 +892,10 @@ module.exports = [
892
892
  vendor: 'Xiaomi',
893
893
  description: 'Aqara high precision motion sensor',
894
894
  fromZigbee: [fz.RTCGQ13LM_occupancy, fz.aqara_opple, fz.battery],
895
- toZigbee: [tz.aqara_occupancy_timeout, tz.RTCGQ13LM_motion_sensitivity],
895
+ toZigbee: [tz.aqara_detection_interval, tz.RTCGQ13LM_motion_sensitivity],
896
896
  exposes: [e.occupancy(), exposes.enum('motion_sensitivity', ea.ALL, ['low', 'medium', 'high']),
897
- exposes.numeric('occupancy_timeout', ea.ALL).withValueMin(2).withValueMax(65535).withUnit('s')
898
- .withDescription('Time in seconds till occupancy goes to false'), e.battery()],
897
+ exposes.numeric('detection_interval', ea.ALL).withValueMin(2).withValueMax(65535).withUnit('s')
898
+ .withDescription('Time interval for detecting actions'), e.battery()],
899
899
  meta: {battery: {voltageToPercentage: '3V_2100'}},
900
900
  configure: async (device, coordinatorEndpoint, logger) => {
901
901
  const endpoint = device.getEndpoint(1);
package/lib/tuya.js CHANGED
@@ -85,10 +85,6 @@ async function onEventMeasurementPoll(type, data, device, options) {
85
85
  const interval = setInterval(async () => {
86
86
  try {
87
87
  await endpoint.read('haElectricalMeasurement', ['rmsVoltage', 'rmsCurrent', 'activePower']);
88
- await endpoint.read('seMetering', ['currentSummDelivered']);
89
- if (device.manufacturerName === '_TZ3000_u5u4cakc') {
90
- await endpoint.read('genOnOff', ['onOff']);
91
- }
92
88
  } catch (error) {/* Do nothing*/}
93
89
  }, seconds*1000);
94
90
  globalStore.putValue(device, 'interval', interval);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zigbee-herdsman-converters",
3
- "version": "14.0.374",
3
+ "version": "14.0.375",
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.374",
3
+ "version": "14.0.375",
4
4
  "description": "Collection of device converters to be used with zigbee-herdsman",
5
5
  "main": "index.js",
6
6
  "files": [