zigbee-herdsman-converters 14.0.588 → 14.0.589

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/README.md CHANGED
@@ -28,6 +28,7 @@ If any of those commands finish with an error your PR won't pass the tests and w
28
28
  - `disableActionGroup`: Prevents some converters adding the action_group to the payload (default: false)
29
29
  - `tuyaThermostatSystemMode`/`tuyaThermostatPreset`: TuYa specific thermostat options
30
30
  - `thermostat`: see e.g. HT-08 definition
31
+ - `{dontMapPIHeatingDemand: true}`: do not map piHeatingDemand from 0-255 -> 0-100, see fromZigbee.thermostat (default: false)
31
32
  - `battery`:
32
33
  - `{dontDividePercentage: true}`: prevents batteryPercentageRemainig from being divided (ZCL 200=100%, but some report 100=100%) (default: false)
33
34
  - `{voltageToPercentage: '3V_2100'}`: convert voltage to percentage using specified option. See utils.batteryVoltageToPercentage() (default: null, no voltage to percentage conversion)
@@ -37,6 +37,7 @@ const converters = {
37
37
  type: ['attributeReport', 'readResponse'],
38
38
  convert: (model, msg, publish, options, meta) => {
39
39
  const result = {};
40
+ const dontMapPIHeatingDemand = model.meta && model.meta.thermostat && model.meta.thermostat.dontMapPIHeatingDemand;
40
41
  if (msg.data.hasOwnProperty('localTemp')) {
41
42
  result[postfixWithEndpointName('local_temperature', msg, model, meta)] = precisionRound(msg.data['localTemp'], 2) / 100;
42
43
  }
@@ -110,7 +111,7 @@ const converters = {
110
111
  }
111
112
  if (msg.data.hasOwnProperty('pIHeatingDemand')) {
112
113
  result[postfixWithEndpointName('pi_heating_demand', msg, model, meta)] =
113
- mapNumberRange(msg.data['pIHeatingDemand'], 0, 255, 0, 100);
114
+ mapNumberRange(msg.data['pIHeatingDemand'], 0, (dontMapPIHeatingDemand ? 100: 255), 0, 100);
114
115
  }
115
116
  if (msg.data.hasOwnProperty('tempSetpointHold')) {
116
117
  result[postfixWithEndpointName('temperature_setpoint_hold', msg, model, meta)] = msg.data['tempSetpointHold'] == 1;
@@ -2488,18 +2489,6 @@ const converters = {
2488
2489
  }
2489
2490
  },
2490
2491
  },
2491
- sinope_thermostat: {
2492
- cluster: 'hvacThermostat',
2493
- type: ['attributeReport', 'readResponse'],
2494
- convert: (model, msg, publish, options, meta) => {
2495
- const result = converters.thermostat.convert(model, msg, publish, options, meta);
2496
- // Sinope seems to report pIHeatingDemand between 0 and 100 already
2497
- if (msg.data.hasOwnProperty('pIHeatingDemand')) {
2498
- result.pi_heating_demand = precisionRound(msg.data['pIHeatingDemand'], 0);
2499
- }
2500
- return result;
2501
- },
2502
- },
2503
2492
  stelpro_thermostat: {
2504
2493
  cluster: 'hvacThermostat',
2505
2494
  type: ['attributeReport', 'readResponse'],
@@ -3516,11 +3505,6 @@ const converters = {
3516
3505
  type: ['attributeReport', 'readResponse'],
3517
3506
  convert: (model, msg, publish, options, meta) => {
3518
3507
  const result = {};
3519
- // Danfoss sends pi_heating_demand as raw %
3520
- if (typeof msg.data['pIHeatingDemand'] == 'number') {
3521
- result[postfixWithEndpointName('pi_heating_demand', msg, model, meta)] =
3522
- precisionRound(msg.data['pIHeatingDemand'], 0);
3523
- }
3524
3508
  if (msg.data.hasOwnProperty('danfossWindowOpenFeatureEnable')) {
3525
3509
  result[postfixWithEndpointName('window_open_feature', msg, model, meta)] =
3526
3510
  (msg.data['danfossWindowOpenFeatureEnable'] === 1);
@@ -16,6 +16,7 @@ module.exports = [
16
16
  vendor: 'Danfoss',
17
17
  description: 'Ally thermostat',
18
18
  whiteLabel: [{vendor: 'Danfoss', model: '014G2463'}],
19
+ meta: {thermostat: {dontMapPIHeatingDemand: true}},
19
20
  fromZigbee: [fz.battery, fz.thermostat, fz.thermostat_weekly_schedule, fz.hvac_user_interface, fz.danfoss_thermostat],
20
21
  toZigbee: [tz.danfoss_thermostat_occupied_heating_setpoint, tz.thermostat_local_temperature, tz.danfoss_mounted_mode_active,
21
22
  tz.danfoss_mounted_mode_control, tz.danfoss_thermostat_vertical_orientation, tz.danfoss_algorithm_scale_factor,
@@ -213,7 +214,7 @@ module.exports = [
213
214
  tz.danfoss_system_status_code,
214
215
  tz.danfoss_multimaster_role,
215
216
  ],
216
- meta: {multiEndpoint: true},
217
+ meta: {multiEndpoint: true, thermostat: {dontMapPIHeatingDemand: true}},
217
218
  // ota: ota.zigbeeOTA,
218
219
  endpoint: (device) => {
219
220
  return {
@@ -0,0 +1,51 @@
1
+ const exposes = require('../lib/exposes');
2
+ const fz = require('../converters/fromZigbee');
3
+ const tz = require('../converters/toZigbee');
4
+ const reporting = require('../lib/reporting');
5
+ const utils = require('../lib/utils');
6
+ const e = exposes.presets;
7
+ const ea = exposes.access;
8
+
9
+ const fzLocal = {
10
+ // MG-AUZG01 requires multiEndpoint only for on_off
11
+ // https://github.com/Koenkk/zigbee2mqtt/issues/13190
12
+ MGAUZG01_on_off: {
13
+ cluster: 'genOnOff',
14
+ type: ['attributeReport', 'readResponse'],
15
+ convert: (model, msg, publish, options, meta) => {
16
+ if (msg.data.hasOwnProperty('onOff')) {
17
+ const endpointName = utils.getKey(model.endpoint(meta.device), msg.endpoint.ID);
18
+ return {[`state_${endpointName}`]: msg.data['onOff'] === 1 ? 'ON' : 'OFF'};
19
+ }
20
+ },
21
+ },
22
+ };
23
+
24
+ module.exports = [
25
+ {
26
+ fingerprint: [{modelID: 'TS011F', manufacturerName: '_TZ3000_dd8wwzcy'}],
27
+ model: 'MG-AUZG01',
28
+ vendor: 'Makegood',
29
+ description: 'Double Zigbee power point',
30
+ fromZigbee: [fzLocal.MGAUZG01_on_off, fz.electrical_measurement, fz.metering, fz.ignore_basic_report],
31
+ toZigbee: [tz.on_off],
32
+ exposes: [e.switch().withEndpoint('l1'), e.switch().withEndpoint('l2'), e.power(), e.current(), e.voltage().withAccess(ea.STATE),
33
+ e.energy()],
34
+ endpoint: (device) => {
35
+ return {'l1': 1, 'l2': 2};
36
+ },
37
+ configure: async (device, coordinatorEndpoint, logger) => {
38
+ const endpoint = device.getEndpoint(1);
39
+ await endpoint.read('genBasic', ['manufacturerName', 'zclVersion', 'appVersion', 'modelId', 'powerSource', 0xfffe]);
40
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'haElectricalMeasurement', 'seMetering']);
41
+ await reporting.bind(device.getEndpoint(2), coordinatorEndpoint, ['genOnOff']);
42
+ await reporting.rmsVoltage(endpoint, {change: 5});
43
+ await reporting.rmsCurrent(endpoint, {change: 50});
44
+ await reporting.activePower(endpoint, {change: 10});
45
+ await reporting.currentSummDelivered(endpoint);
46
+ endpoint.saveClusterAttributeKeyValue('haElectricalMeasurement', {acCurrentDivisor: 1000, acCurrentMultiplier: 1});
47
+ endpoint.saveClusterAttributeKeyValue('seMetering', {divisor: 100, multiplier: 1});
48
+ device.save();
49
+ },
50
+ },
51
+ ];
package/devices/sinope.js CHANGED
@@ -13,6 +13,7 @@ module.exports = [
13
13
  model: 'TH1123ZB',
14
14
  vendor: 'Sinopé',
15
15
  description: 'Zigbee line volt thermostat',
16
+ meta: {thermostat: {dontMapPIHeatingDemand: true}},
16
17
  fromZigbee: [fz.legacy.sinope_thermostat_att_report, fz.legacy.hvac_user_interface, fz.electrical_measurement, fz.metering,
17
18
  fz.ignore_temperature_report, fz.legacy.sinope_thermostat_state],
18
19
  toZigbee: [tz.thermostat_local_temperature, tz.thermostat_occupied_heating_setpoint, tz.thermostat_unoccupied_heating_setpoint,
@@ -69,6 +70,7 @@ module.exports = [
69
70
  model: 'TH1124ZB',
70
71
  vendor: 'Sinopé',
71
72
  description: 'Zigbee line volt thermostat',
73
+ meta: {thermostat: {dontMapPIHeatingDemand: true}},
72
74
  fromZigbee: [fz.legacy.sinope_thermostat_att_report, fz.legacy.hvac_user_interface, fz.electrical_measurement, fz.metering,
73
75
  fz.ignore_temperature_report, fz.legacy.sinope_thermostat_state],
74
76
  toZigbee: [tz.thermostat_local_temperature, tz.thermostat_occupied_heating_setpoint, tz.thermostat_unoccupied_heating_setpoint,
@@ -126,6 +128,7 @@ module.exports = [
126
128
  model: 'TH1300ZB',
127
129
  vendor: 'Sinopé',
128
130
  description: 'Zigbee smart floor heating thermostat',
131
+ meta: {thermostat: {dontMapPIHeatingDemand: true}},
129
132
  fromZigbee: [fz.legacy.sinope_thermostat_att_report, fz.legacy.hvac_user_interface, fz.electrical_measurement,
130
133
  fz.ignore_temperature_report, fz.legacy.sinope_thermostat_state, fz.sinope_TH1300ZB_specific],
131
134
  toZigbee: [tz.thermostat_local_temperature, tz.thermostat_occupied_heating_setpoint, tz.thermostat_unoccupied_heating_setpoint,
@@ -184,6 +187,7 @@ module.exports = [
184
187
  model: 'TH1400ZB',
185
188
  vendor: 'Sinopé',
186
189
  description: 'Zigbee low volt thermostat',
190
+ meta: {thermostat: {dontMapPIHeatingDemand: true}},
187
191
  fromZigbee: [fz.legacy.sinope_thermostat_att_report, fz.legacy.sinope_thermostat_state],
188
192
  toZigbee: [tz.thermostat_local_temperature, tz.thermostat_occupied_heating_setpoint, tz.thermostat_temperature_display_mode,
189
193
  tz.thermostat_keypad_lockout, tz.thermostat_system_mode, tz.thermostat_running_state,
package/devices/tuya.js CHANGED
@@ -19,7 +19,7 @@ const TS011Fplugs = ['_TZ3000_5f43h46b', '_TZ3000_cphmq0q7', '_TZ3000_dpo1ysak',
19
19
  '_TZ3000_jvzvulen', '_TZ3000_mraovvmm', '_TZ3000_nfnmi125', '_TZ3000_ps3dmato', '_TZ3000_w0qqde0g', '_TZ3000_u5u4cakc',
20
20
  '_TZ3000_rdtixbnu', '_TZ3000_typdpbpg', '_TZ3000_kx0pris5', '_TZ3000_amdymr7l', '_TZ3000_z1pnpsdo', '_TZ3000_ksw8qtmt',
21
21
  '_TZ3000_1h2x4akh', '_TZ3000_9vo5icau', '_TZ3000_cehuw1lw', '_TZ3000_ko6v90pg', '_TZ3000_f1bapcit', '_TZ3000_cjrngdr3',
22
- '_TZ3000_zloso4jk', '_TZ3000_r6buo8ba', '_TZ3000_iksasdbv', '_TZ3000_dd8wwzcy', '_TZ3000_okaz9tjs', '_TZ3210_q7oryllx'];
22
+ '_TZ3000_zloso4jk', '_TZ3000_r6buo8ba', '_TZ3000_iksasdbv', '_TZ3000_idrffznf', '_TZ3000_okaz9tjs', '_TZ3210_q7oryllx'];
23
23
 
24
24
  const tzLocal = {
25
25
  TS0504B_color: {
package/devices/ubisys.js CHANGED
@@ -792,6 +792,7 @@ module.exports = [
792
792
  model: 'H1',
793
793
  vendor: 'Ubisys',
794
794
  description: 'Heating regulator',
795
+ meta: {thermostat: {dontMapPIHeatingDemand: true}},
795
796
  fromZigbee: [fz.battery, fz.thermostat, fz.thermostat_weekly_schedule, ubisys.fz.thermostat_vacation_mode],
796
797
  toZigbee: [
797
798
  tz.thermostat_occupied_heating_setpoint, tz.thermostat_unoccupied_heating_setpoint,
package/lib/legacy.js CHANGED
@@ -1726,7 +1726,7 @@ const fromZigbee = {
1726
1726
  options: [exposes.options.legacy()],
1727
1727
  convert: (model, msg, publish, options, meta) => {
1728
1728
  if (!isLegacyEnabled(options)) {
1729
- return fromZigbeeConverters.sinope_thermostat.convert(model, msg, publish, options, meta);
1729
+ return fromZigbeeConverters.thermostat.convert(model, msg, publish, options, meta);
1730
1730
  }
1731
1731
 
1732
1732
  const result = fromZigbee.thermostat_att_report.convert(model, msg, publish, options, meta);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zigbee-herdsman-converters",
3
- "version": "14.0.588",
3
+ "version": "14.0.589",
4
4
  "description": "Collection of device converters to be used with zigbee-herdsman",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -38,7 +38,7 @@
38
38
  "buffer-crc32": "^0.2.13",
39
39
  "https-proxy-agent": "^5.0.1",
40
40
  "tar-stream": "^2.2.0",
41
- "zigbee-herdsman": "^0.14.46"
41
+ "zigbee-herdsman": "^0.14.47"
42
42
  },
43
43
  "devDependencies": {
44
44
  "eslint": "*",