zigbee-herdsman-converters 14.0.477 → 14.0.478
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/converters/toZigbee.js +0 -3
- package/devices/fantem.js +4 -1
- package/devices/schneider_electric.js +71 -0
- package/package.json +1 -1
package/converters/toZigbee.js
CHANGED
|
@@ -6311,16 +6311,13 @@ const converters = {
|
|
|
6311
6311
|
convertSet: async (entity, key, value, meta) => {
|
|
6312
6312
|
switch (key) {
|
|
6313
6313
|
case 'ext_switch_type':
|
|
6314
|
-
meta.logger.debug(`toZigbee.ZB006X_settings: Send key/value [${key}|${value}]`);
|
|
6315
6314
|
await tuya.sendDataPointEnum(entity, 103, {'unknown': 0, 'toggle_sw': 1,
|
|
6316
6315
|
'momentary_sw': 2, 'rotary_sw': 3, 'auto_config': 4}[value]);
|
|
6317
6316
|
break;
|
|
6318
6317
|
case 'load_detection_mode':
|
|
6319
|
-
meta.logger.debug(`toZigbee.ZB006X_settings: Send key/value [${key}|${value}]`);
|
|
6320
6318
|
await tuya.sendDataPointEnum(entity, 105, {'none': 0, 'first_power_on': 1, 'every_power_on': 2}[value]);
|
|
6321
6319
|
break;
|
|
6322
6320
|
case 'control_mode':
|
|
6323
|
-
meta.logger.debug(`toZigbee.ZB006X_settings: Send key/value [${key}|${value}]`);
|
|
6324
6321
|
await tuya.sendDataPointEnum(entity, 109, {'local': 0, 'remote': 1, 'both': 2}[value]);
|
|
6325
6322
|
break;
|
|
6326
6323
|
default: // Unknown key
|
package/devices/fantem.js
CHANGED
|
@@ -13,15 +13,18 @@ module.exports = [
|
|
|
13
13
|
vendor: 'Fantem',
|
|
14
14
|
description: 'Smart dimmer module without neutral',
|
|
15
15
|
extend: extend.light_onoff_brightness({noConfigure: true}),
|
|
16
|
-
fromZigbee: [...extend.light_onoff_brightness({noConfigure: true}).fromZigbee, fz.
|
|
16
|
+
fromZigbee: [...extend.light_onoff_brightness({noConfigure: true}).fromZigbee, fz.command_on, fz.command_off,
|
|
17
|
+
fz.command_move, fz.command_stop, fz.ZB006X_settings],
|
|
17
18
|
toZigbee: [...extend.light_onoff_brightness({noConfigure: true}).toZigbee, tz.ZB006X_settings],
|
|
18
19
|
exposes: [e.light_brightness(),
|
|
20
|
+
e.action(['on', 'off', 'brightness_move_down', 'brightness_move_up', 'brightness_stop']),
|
|
19
21
|
exposes.enum('ext_switch_type', ea.STATE_SET, ['unknown', 'toggle_sw', 'momentary_sw', 'rotary_sw', 'auto_config'])
|
|
20
22
|
.withDescription('External switch type'),
|
|
21
23
|
exposes.enum('load_detection_mode', ea.STATE_SET, ['none', 'first_power_on', 'every_power_on'])
|
|
22
24
|
.withDescription('Load detection mode'),
|
|
23
25
|
exposes.enum('control_mode', ea.STATE_SET, ['local', 'remote', 'both']).withDescription('Control mode'),
|
|
24
26
|
],
|
|
27
|
+
meta: {disableActionGroup: true},
|
|
25
28
|
configure: async (device, coordinatorEndpoint, logger) => {
|
|
26
29
|
await extend.light_onoff_brightness().configure(device, coordinatorEndpoint, logger);
|
|
27
30
|
const endpoint = device.getEndpoint(1);
|
|
@@ -4,6 +4,7 @@ const tz = require('../converters/toZigbee');
|
|
|
4
4
|
const constants = require('../lib/constants');
|
|
5
5
|
const reporting = require('../lib/reporting');
|
|
6
6
|
const extend = require('../lib/extend');
|
|
7
|
+
const utils = require('../lib/utils');
|
|
7
8
|
const e = exposes.presets;
|
|
8
9
|
const ea = exposes.access;
|
|
9
10
|
|
|
@@ -17,6 +18,67 @@ const tzLocal = {
|
|
|
17
18
|
},
|
|
18
19
|
};
|
|
19
20
|
|
|
21
|
+
const fzLocal = {
|
|
22
|
+
schneider_powertag: {
|
|
23
|
+
cluster: 'greenPower',
|
|
24
|
+
type: ['commandNotification', 'commandCommisioningNotification'],
|
|
25
|
+
convert: async (model, msg, publish, options, meta) => {
|
|
26
|
+
if (msg.type !== 'commandNotification') {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const commandID = msg.data.commandID;
|
|
31
|
+
if (utils.hasAlreadyProcessedMessage(msg, msg.data.frameCounter, `${msg.device.ieeeAddr}_${commandID}`)) return;
|
|
32
|
+
|
|
33
|
+
const rxAfterTx = (msg.data.options & (1<<11));
|
|
34
|
+
const ret = {};
|
|
35
|
+
|
|
36
|
+
switch (commandID) {
|
|
37
|
+
case 0xA1:
|
|
38
|
+
Object.entries(msg.data.commandFrame.attributes).forEach(([attr, val]) => {
|
|
39
|
+
switch (attr) {
|
|
40
|
+
case 'totalActivePower':
|
|
41
|
+
ret['power'] = val;
|
|
42
|
+
break;
|
|
43
|
+
case 'currentSummDelivered':
|
|
44
|
+
ret['energy'] = ((parseInt(val[0]) << 32) + parseInt(val[1])) / 1000.0;
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
break;
|
|
50
|
+
case 0xA3:
|
|
51
|
+
// Should handle this cluster as well
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (rxAfterTx) {
|
|
56
|
+
// Send Schneider specific ACK to make PowerTag happy
|
|
57
|
+
const networkParameters = await msg.device.zh.getNetworkParameters();
|
|
58
|
+
const payload = {
|
|
59
|
+
options: 0b000,
|
|
60
|
+
tempMaster: msg.data.gppNwkAddr,
|
|
61
|
+
tempMasterTx: networkParameters.channel - 11,
|
|
62
|
+
srcID: msg.data.srcID,
|
|
63
|
+
gpdCmd: 0xFE,
|
|
64
|
+
gpdPayload: {
|
|
65
|
+
commandID: 0xFE,
|
|
66
|
+
buffer: Buffer.alloc(1), // I hope it's zero initialised
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
await msg.endpoint.commandResponse('greenPower', 'response', payload,
|
|
71
|
+
{
|
|
72
|
+
srcEndpoint: 242,
|
|
73
|
+
disableDefaultResponse: true,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return ret;
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
|
|
20
82
|
module.exports = [
|
|
21
83
|
{
|
|
22
84
|
zigbeeModel: ['PUCK/SHUTTER/1'],
|
|
@@ -714,4 +776,13 @@ module.exports = [
|
|
|
714
776
|
await reporting.onOff(endpoint2);
|
|
715
777
|
},
|
|
716
778
|
},
|
|
779
|
+
{
|
|
780
|
+
fingerprint: [{modelID: 'GreenPower_254', ieeeAddr: /^0x00000000e.......$/}],
|
|
781
|
+
model: 'A9MEM1570',
|
|
782
|
+
vendor: 'Schneider Electric',
|
|
783
|
+
description: 'PowerTag power sensor',
|
|
784
|
+
fromZigbee: [fzLocal.schneider_powertag],
|
|
785
|
+
toZigbee: [],
|
|
786
|
+
exposes: [e.power(), e.energy()],
|
|
787
|
+
},
|
|
717
788
|
];
|