zigbee-herdsman-converters 14.0.536 → 14.0.537

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.
@@ -8,6 +8,32 @@ const e = exposes.presets;
8
8
  const ea = exposes.access;
9
9
  const constants = require('../lib/constants');
10
10
 
11
+ const fzLocal = {
12
+ thermostat_3156105: {
13
+ cluster: 'hvacThermostat',
14
+ type: ['attributeReport', 'readResponse'],
15
+ convert: (model, msg, publish, options, meta) => {
16
+ if (msg.data.hasOwnProperty('runningState')) {
17
+ if (msg.data['runningState'] == 1) {
18
+ msg.data['runningState'] = 0;
19
+ } else if (msg.data['runningState'] == 5) {
20
+ msg.data['runningState'] = 4;
21
+ } else if (msg.data['runningState'] == 7) {
22
+ msg.data['runningState'] = 6;
23
+ } else if (msg.data['runningState'] == 13) {
24
+ msg.data['runningState'] = 9;
25
+ }
26
+ }
27
+ if (msg.data.hasOwnProperty('ctrlSeqeOfOper')) {
28
+ if (msg.data['ctrlSeqeOfOper'] == 6) {
29
+ msg.data['ctrlSeqeOfOper'] = 4;
30
+ }
31
+ }
32
+ return fz.thermostat.convert(model, msg, publish, options, meta);
33
+ },
34
+ },
35
+ };
36
+
11
37
  module.exports = [
12
38
  {
13
39
  zigbeeModel: ['4256251-RZHAC'],
@@ -195,7 +221,7 @@ module.exports = [
195
221
  model: '3156105',
196
222
  vendor: 'Centralite',
197
223
  description: 'HA thermostat',
198
- fromZigbee: [fz.battery, fz.thermostat, fz.fan, fz.ignore_time_read],
224
+ fromZigbee: [fz.battery, fzLocal.thermostat_3156105, fz.fan, fz.ignore_time_read],
199
225
  toZigbee: [tz.factory_reset, tz.thermostat_local_temperature,
200
226
  tz.thermostat_occupied_heating_setpoint, tz.thermostat_occupied_cooling_setpoint,
201
227
  tz.thermostat_setpoint_raise_lower, tz.thermostat_remote_sensing,
package/devices/ecodim.js CHANGED
@@ -127,7 +127,8 @@ module.exports = [
127
127
  extend: extend.light_onoff_brightness(),
128
128
  },
129
129
  {
130
- fingerprint: [{modelID: 'CCT Light', manufacturerName: 'ZigBee/CCT', manufacturerID: 4137}],
130
+ fingerprint: [{modelID: 'CCT Light', manufacturerName: 'ZigBee/CCT', manufacturerID: 4137},
131
+ {modelID: 'CCT Light', manufacturerName: 'Astuta/ZB-CCT', manufacturerID: 4137}],
131
132
  model: 'ED-10041',
132
133
  vendor: 'EcoDim',
133
134
  description: 'Zigbee LED filament light dimmable E27, edison ST64, flame 2200K',
@@ -26,15 +26,19 @@ module.exports = [
26
26
  model: 'SZ-ESW01-AU',
27
27
  vendor: 'Sercomm',
28
28
  description: 'Telstra smart plug',
29
- exposes: [e.switch(), e.power()],
30
- fromZigbee: [fz.on_off, fz.metering],
29
+ exposes: [e.switch(), e.power(), e.energy(), e.current(), e.voltage()],
30
+ fromZigbee: [fz.on_off, fz.metering, fz.electrical_measurement],
31
31
  toZigbee: [tz.on_off],
32
32
  configure: async (device, coordinatorEndpoint, logger) => {
33
33
  const endpoint = device.getEndpoint(1);
34
- await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'seMetering']);
34
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'seMetering', 'haElectricalMeasurement']);
35
35
  await reporting.onOff(endpoint);
36
36
  await reporting.instantaneousDemand(endpoint);
37
+ await reporting.currentSummDelivered(endpoint);
37
38
  endpoint.saveClusterAttributeKeyValue('seMetering', {divisor: 1000000, multiplier: 1});
39
+ await reporting.readEletricalMeasurementMultiplierDivisors(endpoint);
40
+ await reporting.rmsVoltage(endpoint);
41
+ await reporting.rmsCurrent(endpoint);
38
42
  },
39
43
  },
40
44
  {
package/devices/tuya.js CHANGED
@@ -43,6 +43,73 @@ const tzLocal = {
43
43
  }
44
44
  },
45
45
  },
46
+ zb_sm_cover: {
47
+ key: ['state', 'position', 'reverse_direction', 'top_limit', 'bottom_limit', 'favorite_position', 'goto_positon', 'report'],
48
+ convertSet: async (entity, key, value, meta) => {
49
+ switch (key) {
50
+ case 'position': {
51
+ const invert = (meta.state) ? !meta.state.invert_cover : false;
52
+ value = invert ? 100 - value : value;
53
+ if (value >= 0 && value <= 100) {
54
+ await tuya.sendDataPointValue(entity, tuya.dataPoints.coverPosition, value);
55
+ } else {
56
+ throw new Error('TuYa_cover_control: Curtain motor position is out of range');
57
+ }
58
+ break;
59
+ }
60
+ case 'state': {
61
+ const stateEnums = tuya.getCoverStateEnums(meta.device.manufacturerName);
62
+ meta.logger.debug(`TuYa_cover_control: Using state enums for ${meta.device.manufacturerName}:
63
+ ${JSON.stringify(stateEnums)}`);
64
+
65
+ value = value.toLowerCase();
66
+ switch (value) {
67
+ case 'close':
68
+ await tuya.sendDataPointEnum(entity, tuya.dataPoints.state, stateEnums.close);
69
+ break;
70
+ case 'open':
71
+ await tuya.sendDataPointEnum(entity, tuya.dataPoints.state, stateEnums.open);
72
+ break;
73
+ case 'stop':
74
+ await tuya.sendDataPointEnum(entity, tuya.dataPoints.state, stateEnums.stop);
75
+ break;
76
+ default:
77
+ throw new Error('TuYa_cover_control: Invalid command received');
78
+ }
79
+ break;
80
+ }
81
+ case 'reverse_direction': {
82
+ meta.logger.info(`Motor direction ${(value) ? 'reverse' : 'forward'}`);
83
+ await tuya.sendDataPointEnum(entity, tuya.dataPoints.motorDirection, (value) ? 1 : 0);
84
+ break;
85
+ }
86
+ case 'top_limit': {
87
+ await tuya.sendDataPointEnum(entity, 104, {'SET': 0, 'CLEAR': 1}[value]);
88
+ break;
89
+ }
90
+ case 'bottom_limit': {
91
+ await tuya.sendDataPointEnum(entity, 103, {'SET': 0, 'CLEAR': 1}[value]);
92
+ break;
93
+ }
94
+ case 'favorite_position': {
95
+ await tuya.sendDataPointValue(entity, 115, value);
96
+ break;
97
+ }
98
+ case 'goto_positon': {
99
+ if (value == 'FAVORITE') {
100
+ value = (meta.state) ? meta.state.favorite_position : null;
101
+ } else {
102
+ value = parseInt(value);
103
+ }
104
+ return tz.tuya_cover_control.convertSet(entity, 'position', value, meta);
105
+ }
106
+ case 'report': {
107
+ await tuya.sendDataPointBool(entity, 116, 0);
108
+ break;
109
+ }
110
+ }
111
+ },
112
+ },
46
113
  };
47
114
 
48
115
  const fzLocal = {
@@ -99,6 +166,71 @@ const fzLocal = {
99
166
  }
100
167
  },
101
168
  },
169
+ zb_sm_cover: {
170
+ cluster: 'manuSpecificTuya',
171
+ type: ['commandDataReport', 'commandDataResponse'],
172
+ convert: (model, msg, publish, options, meta) => {
173
+ const result = {};
174
+ for (const dpValue of msg.data.dpValues) {
175
+ const dp = dpValue.dp;
176
+ const value = tuya.getDataValue(dpValue);
177
+
178
+ switch (dp) {
179
+ case tuya.dataPoints.coverPosition: // Started moving to position (triggered from Zigbee)
180
+ case tuya.dataPoints.coverArrived: { // Arrived at position
181
+ const invert = (meta.state) ? !meta.state.invert_cover : false;
182
+ const position = invert ? 100 - (value & 0xFF) : (value & 0xFF);
183
+ if (position > 0 && position <= 100) {
184
+ result.position = position;
185
+ result.state = 'OPEN';
186
+ } else if (position == 0) { // Report fully closed
187
+ result.position = position;
188
+ result.state = 'CLOSE';
189
+ }
190
+ break;
191
+ }
192
+ case 1: // report state
193
+ result.state = {0: 'OPEN', 1: 'STOP', 2: 'CLOSE'}[value];
194
+ break;
195
+ case tuya.dataPoints.motorDirection: // reverse direction
196
+ result.reverse_direction = (value == 1);
197
+ break;
198
+ case 10: // cycle time
199
+ result.cycle_time = value;
200
+ break;
201
+ case 101: // model
202
+ result.motor_type = {0: '', 1: 'AM0/6-28R-Sm', 2: 'AM0/10-19R-Sm',
203
+ 3: 'AM1/10-13R-Sm', 4: 'AM1/20-13R-Sm', 5: 'AM1/30-13R-Sm'}[value];
204
+ break;
205
+ case 102: // cycles
206
+ result.cycle_count = value;
207
+ break;
208
+ case 103: // set or clear bottom limit
209
+ result.bottom_limit = {0: 'SET', 1: 'CLEAR'}[value];
210
+ break;
211
+ case 104: // set or clear top limit
212
+ result.top_limit = {0: 'SET', 1: 'CLEAR'}[value];
213
+ break;
214
+ case 109: // active power
215
+ result.active_power = value;
216
+ break;
217
+ case 115: // favorite_position
218
+ result.favorite_position = (value != 101) ? value : null;
219
+ break;
220
+ case 116: // report confirmation
221
+ break;
222
+ case 121: // running state
223
+ result.running_state = {0: 'OPENING', 1: 'STOPPED', 2: 'CLOSING'}[value];
224
+ result.running = (value !== 1) ? true : false;
225
+ break;
226
+ default: // Unknown code
227
+ meta.logger.warn(`zb_sm_tuya_cover: Unhandled DP #${dp} for ${meta.device.manufacturerName}:
228
+ ${JSON.stringify(dpValue)}`);
229
+ }
230
+ }
231
+ return result;
232
+ },
233
+ },
102
234
  };
103
235
 
104
236
  module.exports = [
@@ -1128,7 +1260,6 @@ module.exports = [
1128
1260
  // Tubular motors:
1129
1261
  {modelID: 'TS0601', manufacturerName: '_TZE200_5sbebbzs'},
1130
1262
  {modelID: 'TS0601', manufacturerName: '_TZE200_zuz7f94z'},
1131
- {modelID: 'TS0601', manufacturerName: '_TZE200_zyrdrmno'},
1132
1263
  {modelID: 'TS0601', manufacturerName: '_TZE200_68nvbio9'},
1133
1264
  ],
1134
1265
  model: 'TS0601_cover',
@@ -2426,4 +2557,28 @@ module.exports = [
2426
2557
  await reporting.batteryPercentageRemaining(endpoint);
2427
2558
  },
2428
2559
  },
2560
+ {
2561
+ fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_zyrdrmno'}],
2562
+ model: 'ZB-Sm',
2563
+ vendor: 'TuYa',
2564
+ description: 'Tubular motor',
2565
+ fromZigbee: [fzLocal.zb_sm_cover, fz.ignore_basic_report],
2566
+ toZigbee: [tzLocal.zb_sm_cover],
2567
+ onEvent: tuya.onEventSetTime,
2568
+ exposes: [
2569
+ e.cover_position().setAccess('position', ea.STATE_SET),
2570
+ exposes.enum('goto_positon', ea.SET, ['25', '50', '75', 'FAVORITE']),
2571
+ exposes.enum('running_state', ea.STATE, ['OPENING', 'CLOSING', 'STOPPED']),
2572
+ exposes.numeric('active_power', ea.STATE).withDescription('Active power').withUnit('mWt'),
2573
+ exposes.numeric('cycle_count', ea.STATE).withDescription('Cycle count'),
2574
+ exposes.numeric('cycle_time', ea.STATE).withDescription('Cycle time').withUnit('ms'),
2575
+ exposes.enum('top_limit', ea.STATE_SET, ['SET', 'CLEAR']).withDescription('Setup or clear top limit'),
2576
+ exposes.enum('bottom_limit', ea.STATE_SET, ['SET', 'CLEAR']).withDescription('Setup or clear bottom limit'),
2577
+ exposes.numeric('favorite_position', ea.STATE_SET).withValueMin(0).withValueMax(100)
2578
+ .withDescription('Favorite position of this cover'),
2579
+ exposes.binary(`reverse_direction`, ea.STATE_SET, true, false).withDescription(`Inverts the cover direction`),
2580
+ exposes.text('motor_type', ea.STATE),
2581
+ exposes.enum('report', ea.SET, ['REPORT']),
2582
+ ],
2583
+ },
2429
2584
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zigbee-herdsman-converters",
3
- "version": "14.0.536",
3
+ "version": "14.0.537",
4
4
  "description": "Collection of device converters to be used with zigbee-herdsman",
5
5
  "main": "index.js",
6
6
  "files": [