zigbee-herdsman-converters 14.0.478 → 14.0.479

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.
@@ -4272,6 +4272,55 @@ const converters = {
4272
4272
  }
4273
4273
  },
4274
4274
  },
4275
+ connecte_thermostat: {
4276
+ cluster: 'manuSpecificTuya',
4277
+ type: ['commandDataResponse', 'commandDataReport'],
4278
+ convert: (model, msg, publish, options, meta) => {
4279
+ const dpValue = tuya.firstDpValue(msg, meta, 'connecte_thermostat');
4280
+ const dp = dpValue.dp;
4281
+ const value = tuya.getDataValue(dpValue);
4282
+
4283
+ switch (dp) {
4284
+ case tuya.dataPoints.connecteState:
4285
+ return {state: value ? 'ON' : 'OFF'};
4286
+ case tuya.dataPoints.connecteMode:
4287
+ switch (value) {
4288
+ case 0: // manual
4289
+ return {system_mode: 'heat', away_mode: 'OFF'};
4290
+ case 1: // home (auto)
4291
+ return {system_mode: 'auto', away_mode: 'OFF'};
4292
+ case 2: // away (auto)
4293
+ return {system_mode: 'auto', away_mode: 'ON'};
4294
+ }
4295
+ break;
4296
+ case tuya.dataPoints.connecteHeatingSetpoint:
4297
+ return {current_heating_setpoint: value};
4298
+ case tuya.dataPoints.connecteLocalTemp:
4299
+ return {local_temperature: value};
4300
+ case tuya.dataPoints.connecteTempCalibration:
4301
+ return {local_temperature_calibration: value};
4302
+ case tuya.dataPoints.connecteChildLock:
4303
+ return {child_lock: value ? 'LOCK' : 'UNLOCK'};
4304
+ case tuya.dataPoints.connecteTempFloor:
4305
+ return {external_temperature: value};
4306
+ case tuya.dataPoints.connecteSensorType:
4307
+ return {sensor: {0: 'internal', 1: 'external', 2: 'both'}[value]};
4308
+ case tuya.dataPoints.connecteHysteresis:
4309
+ return {hysteresis: value};
4310
+ case tuya.dataPoints.connecteRunningState:
4311
+ return {running_state: value ? 'heat' : 'idle'};
4312
+ case tuya.dataPoints.connecteTempProgram:
4313
+ break;
4314
+ case tuya.dataPoints.connecteOpenWindow:
4315
+ return {window_detection: value ? 'ON' : 'OFF'};
4316
+ case tuya.dataPoints.connecteMaxProtectTemp:
4317
+ return {max_temperature_protection: value};
4318
+ default:
4319
+ meta.logger.warn(`zigbee-herdsman-converters:connecte_thermostat: Unrecognized DP #${
4320
+ dp} with data ${JSON.stringify(dpValue)}`);
4321
+ }
4322
+ },
4323
+ },
4275
4324
  saswell_thermostat: {
4276
4325
  cluster: 'manuSpecificTuya',
4277
4326
  type: ['commandDataResponse', 'commandDataReport'],
@@ -5477,7 +5526,7 @@ const converters = {
5477
5526
  return payload;
5478
5527
  },
5479
5528
  },
5480
- RTCGQ12LM_occupancy_illuminance: {
5529
+ aqara_occupancy_illuminance: {
5481
5530
  // This is for occupancy sensor that only send a message when motion detected,
5482
5531
  // but do not send a motion stop.
5483
5532
  // Therefore we need to publish the no_motion detected by ourselves.
@@ -3005,6 +3005,68 @@ const converters = {
3005
3005
  await entity.read('closuresWindowCovering', [isPosition ? 'currentPositionLiftPercentage' : 'currentPositionTiltPercentage']);
3006
3006
  },
3007
3007
  },
3008
+ connecte_thermostat: {
3009
+ key: [
3010
+ 'child_lock', 'current_heating_setpoint', 'local_temperature_calibration', 'max_temperature_protection', 'window_detection',
3011
+ 'hysteresis', 'state', 'away_mode', 'sensor', 'system_mode',
3012
+ ],
3013
+ convertSet: async (entity, key, value, meta) => {
3014
+ switch (key) {
3015
+ case 'state':
3016
+ await tuya.sendDataPointBool(entity, tuya.dataPoints.connecteState, value === 'ON');
3017
+ break;
3018
+ case 'child_lock':
3019
+ await tuya.sendDataPointBool(entity, tuya.dataPoints.connecteChildLock, value === 'LOCK');
3020
+ break;
3021
+ case 'local_temperature_calibration':
3022
+ if (value < 0) value = 0xFFFFFFFF + value + 1;
3023
+ await tuya.sendDataPointValue(entity, tuya.dataPoints.connecteTempCalibration, value);
3024
+ break;
3025
+ case 'hysteresis':
3026
+ // value = Math.round(value * 10);
3027
+ await tuya.sendDataPointValue(entity, tuya.dataPoints.connecteHysteresis, value);
3028
+ break;
3029
+ case 'max_temperature_protection':
3030
+ await tuya.sendDataPointValue(entity, tuya.dataPoints.connecteMaxProtectTemp, Math.round(value));
3031
+ break;
3032
+ case 'current_heating_setpoint':
3033
+ await tuya.sendDataPointValue(entity, tuya.dataPoints.connecteHeatingSetpoint, value);
3034
+ break;
3035
+ case 'sensor':
3036
+ await tuya.sendDataPointEnum(
3037
+ entity,
3038
+ tuya.dataPoints.connecteSensorType,
3039
+ {'internal': 0, 'external': 1, 'both': 2}[value]);
3040
+ break;
3041
+ case 'system_mode':
3042
+ switch (value) {
3043
+ case 'heat':
3044
+ await tuya.sendDataPointEnum(entity, tuya.dataPoints.connecteMode, 0 /* manual */);
3045
+ break;
3046
+ case 'auto':
3047
+ await tuya.sendDataPointEnum(entity, tuya.dataPoints.connecteMode, 1 /* auto */);
3048
+ break;
3049
+ }
3050
+ break;
3051
+ case 'away_mode':
3052
+ switch (value) {
3053
+ case 'ON':
3054
+ await tuya.sendDataPointEnum(entity, tuya.dataPoints.connecteMode, 2 /* auto */);
3055
+ break;
3056
+ case 'OFF':
3057
+ await tuya.sendDataPointEnum(entity, tuya.dataPoints.connecteMode, 0 /* manual */);
3058
+ break;
3059
+ }
3060
+ break;
3061
+ case 'window_detection':
3062
+ await tuya.sendDataPointBool(entity, tuya.dataPoints.connecteOpenWindow, value === 'ON');
3063
+ break;
3064
+ default: // Unknown key
3065
+ throw new Error(`Unhandled key toZigbee.connecte_thermostat ${key}`);
3066
+ }
3067
+ },
3068
+ },
3069
+
3008
3070
  moes_thermostat_child_lock: {
3009
3071
  key: ['child_lock'],
3010
3072
  convertSet: async (entity, key, value, meta) => {
@@ -0,0 +1,50 @@
1
+ const exposes = require('../lib/exposes');
2
+ const fz = {...require('../converters/fromZigbee'), legacy: require('../lib/legacy').fromZigbee};
3
+ const tz = require('../converters/toZigbee');
4
+ const tuya = require('../lib/tuya');
5
+ const e = exposes.presets;
6
+ const ea = exposes.access;
7
+
8
+ module.exports = [
9
+ {
10
+ fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_4hbx5cvx'}],
11
+ model: '4500994',
12
+ vendor: 'Connecte',
13
+ description: 'Smart thermostat',
14
+ fromZigbee: [fz.connecte_thermostat],
15
+ toZigbee: [tz.connecte_thermostat],
16
+ onEvent: tuya.onEventSetTime,
17
+ configure: async (device, coordinatorEndpoint, logger) => {
18
+ const endpoint = device.getEndpoint(1);
19
+ // Do a "magic" read on the basic cluster to trigger the thermostat start reporting.
20
+ await endpoint.read('genBasic', ['manufacturerName', 'zclVersion', 'appVersion', 'modelId', 'powerSource', 0xfffe]);
21
+ },
22
+ exposes: [
23
+ exposes.binary('state', ea.STATE_SET, 'ON', 'OFF')
24
+ .withDescription('On/off state of the switch'),
25
+ e.child_lock(),
26
+ e.window_detection(),
27
+ exposes.climate()
28
+ .withSetpoint('current_heating_setpoint', 5, 35, 1, ea.STATE_SET)
29
+ .withLocalTemperature(ea.STATE)
30
+ .withLocalTemperatureCalibration(-9, 9, 1, ea.STATE_SET)
31
+ .withSystemMode(['heat', 'auto'], ea.STATE_SET)
32
+ .withRunningState(['idle', 'heat'], ea.STATE)
33
+ .withAwayMode()
34
+ .withSensor(['internal', 'external', 'both']),
35
+ exposes.numeric('external_temperature', ea.STATE)
36
+ .withUnit('°C')
37
+ .withDescription('Current temperature measured on the external sensor (floor)'),
38
+ exposes.numeric('hysteresis', ea.STATE_SET)
39
+ .withDescription('The difference between the temperature at which the thermostat switches off, ' +
40
+ 'and the temperature at which it switches on again.')
41
+ .withValueMin(1)
42
+ .withValueMax(9),
43
+ exposes.numeric('max_temperature_protection', ea.STATE_SET)
44
+ .withUnit('°C')
45
+ .withDescription('Max guarding temperature')
46
+ .withValueMin(20)
47
+ .withValueMax(95),
48
+ ],
49
+ },
50
+ ];
package/devices/innr.js CHANGED
@@ -159,6 +159,14 @@ module.exports = [
159
159
  extend: extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 555], supportsHS: true}),
160
160
  meta: {applyRedFix: true, turnsOffAtBrightness1: true},
161
161
  },
162
+ {
163
+ zigbeeModel: ['BY 286 C'],
164
+ model: 'BY 286 C',
165
+ vendor: 'Innr',
166
+ description: 'B22 bulb RGBW',
167
+ extend: extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 555], supportsHS: true}),
168
+ meta: {applyRedFix: true, turnsOffAtBrightness1: true},
169
+ },
162
170
  {
163
171
  zigbeeModel: ['RB 165'],
164
172
  model: 'RB 165',
@@ -776,6 +776,15 @@ module.exports = [
776
776
  await reporting.onOff(endpoint2);
777
777
  },
778
778
  },
779
+ {
780
+ zigbeeModel: ['CCT592011_AS'],
781
+ model: 'CCT592011',
782
+ vendor: 'Schneider Electric',
783
+ description: 'Wiser water leakage sensor',
784
+ fromZigbee: [fz.ias_water_leak_alarm_1],
785
+ toZigbee: [],
786
+ exposes: [e.battery_low(), e.water_leak(), e.tamper()],
787
+ },
779
788
  {
780
789
  fingerprint: [{modelID: 'GreenPower_254', ieeeAddr: /^0x00000000e.......$/}],
781
790
  model: 'A9MEM1570',
package/devices/tuya.js CHANGED
@@ -178,6 +178,15 @@ module.exports = [
178
178
  exposes: [e.temperature(), e.humidity(), e.co2(), e.voc(), e.formaldehyd().withUnit('ppm'),
179
179
  e.pm25().withValueMin(0).withValueMax(999).withValueStep(1)],
180
180
  },
181
+ {
182
+ fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_ogkdpgy2'}],
183
+ model: 'TS0601_co2_sensor',
184
+ vendor: 'TuYa',
185
+ description: 'NDIR co2 sensor',
186
+ fromZigbee: [fz.tuya_air_quality],
187
+ toZigbee: [],
188
+ exposes: [e.co2()],
189
+ },
181
190
  {
182
191
  fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_7bztmfm1'}],
183
192
  model: 'TS0601_smart_CO_air_box',
@@ -1391,7 +1400,7 @@ module.exports = [
1391
1400
  },
1392
1401
  {
1393
1402
  fingerprint: [].concat(...TS011Fplugs.map((manufacturerName) => {
1394
- return [69, 68, 65, 64].map((applicationVersion) => {
1403
+ return [69, 68, 65, 64, 74].map((applicationVersion) => {
1395
1404
  return {modelID: 'TS011F', manufacturerName, applicationVersion};
1396
1405
  });
1397
1406
  })),
package/devices/xiaomi.js CHANGED
@@ -874,7 +874,7 @@ module.exports = [
874
874
  model: 'RTCGQ12LM',
875
875
  vendor: 'Xiaomi',
876
876
  description: 'Aqara T1 human body movement and illuminance sensor',
877
- fromZigbee: [fz.RTCGQ12LM_occupancy_illuminance, fz.aqara_opple, fz.battery],
877
+ fromZigbee: [fz.aqara_occupancy_illuminance, fz.aqara_opple, fz.battery],
878
878
  toZigbee: [tz.aqara_detection_interval],
879
879
  exposes: [e.occupancy(), e.illuminance().withUnit('lx').withDescription('Measured illuminance in lux'),
880
880
  exposes.numeric('detection_interval', ea.ALL).withValueMin(2).withValueMax(65535).withUnit('s')
@@ -906,6 +906,27 @@ module.exports = [
906
906
  },
907
907
  ota: ota.zigbeeOTA,
908
908
  },
909
+ {
910
+ zigbeeModel: ['lumi.motion.ac02'],
911
+ model: 'RTCGQ14LM',
912
+ vendor: 'Xiaomi',
913
+ whiteLabel: [{vendor: 'Xiaomi', model: 'MS-S02'}],
914
+ description: 'Aqara P1 human body movement and illuminance sensor',
915
+ fromZigbee: [fz.aqara_occupancy_illuminance, fz.aqara_opple, fz.battery],
916
+ toZigbee: [tz.aqara_detection_interval, tz.aqara_motion_sensitivity],
917
+ exposes: [e.occupancy(), e.illuminance().withUnit('lx').withDescription('Measured illuminance in lux'),
918
+ exposes.enum('motion_sensitivity', ea.ALL, ['low', 'medium', 'high']),
919
+ exposes.numeric('detection_interval', ea.ALL).withValueMin(2).withValueMax(65535).withUnit('s')
920
+ .withDescription('Time interval for detecting actions'), e.temperature(), e.battery()],
921
+ meta: {battery: {voltageToPercentage: '3V_2850_3000_log'}},
922
+ configure: async (device, coordinatorEndpoint, logger) => {
923
+ const endpoint = device.getEndpoint(1);
924
+ await endpoint.read('genPowerCfg', ['batteryVoltage']);
925
+ await endpoint.read('aqaraOpple', [0x0102], {manufacturerCode: 0x115f});
926
+ await endpoint.read('aqaraOpple', [0x010c], {manufacturerCode: 0x115f});
927
+ },
928
+ ota: ota.zigbeeOTA,
929
+ },
909
930
  {
910
931
  zigbeeModel: ['lumi.motion.ac01'],
911
932
  model: 'RTCZCGQ11LM',
package/lib/tuya.js CHANGED
@@ -645,6 +645,20 @@ const dataPoints = {
645
645
  // Moes switch with optional neutral
646
646
  moesSwitchPowerOnBehavior: 14,
647
647
  moesSwitchIndicateLight: 15,
648
+ // Connecte thermostat
649
+ connecteState: 1,
650
+ connecteMode: 2,
651
+ connecteHeatingSetpoint: 16,
652
+ connecteLocalTemp: 24,
653
+ connecteTempCalibration: 28,
654
+ connecteChildLock: 30,
655
+ connecteTempFloor: 101,
656
+ connecteSensorType: 102,
657
+ connecteHysteresis: 103,
658
+ connecteRunningState: 104,
659
+ connecteTempProgram: 105,
660
+ connecteOpenWindow: 106,
661
+ connecteMaxProtectTemp: 107,
648
662
  };
649
663
 
650
664
  const thermostatWeekFormat = {
package/lib/xiaomi.js CHANGED
@@ -238,7 +238,7 @@ const numericAttributes2Payload = (msg, meta, model, options, dataObject) => {
238
238
  mapping = 'right';
239
239
  }
240
240
  payload[`state_${mapping}`] = value === 1 ? 'ON' : 'OFF';
241
- } else if (['RTCGQ12LM'].includes(model.model)) {
241
+ } else if (['RTCGQ12LM', 'RTCGQ14LM'].includes(model.model)) {
242
242
  payload.illuminance = calibrateAndPrecisionRoundOptions(value, options, 'illuminance');
243
243
  } else if (['WSDCGQ01LM', 'WSDCGQ11LM'].includes(model.model)) {
244
244
  // https://github.com/Koenkk/zigbee2mqtt/issues/798
@@ -277,6 +277,13 @@ const numericAttributes2Payload = (msg, meta, model, options, dataObject) => {
277
277
  payload.motion_sensitivity = {1: 'low', 2: 'medium', 3: 'high'}[value];
278
278
  } else if (['RTCZCGQ11LM'].includes(model.model)) {
279
279
  payload.approach_distance = {0: 'far', 1: 'medium', 2: 'near'}[value];
280
+ } else if (['RTCGQ14LM'].includes(model.model)) {
281
+ payload.detection_interval = value;
282
+ }
283
+ break;
284
+ case '106':
285
+ if (['RTCGQ14LM'].includes(model.model)) {
286
+ payload.motion_sensitivity = {1: 'low', 2: 'medium', 3: 'high'}[value];
280
287
  }
281
288
  break;
282
289
  case '149':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zigbee-herdsman-converters",
3
- "version": "14.0.478",
3
+ "version": "14.0.479",
4
4
  "description": "Collection of device converters to be used with zigbee-herdsman",
5
5
  "main": "index.js",
6
6
  "files": [