iobroker.zigbee 1.7.6 → 1.8.0
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/LICENSE +21 -21
- package/README.md +368 -381
- package/admin/admin.js +2951 -2927
- package/admin/i18n/de/translations.json +108 -0
- package/admin/i18n/en/translations.json +108 -0
- package/admin/i18n/es/translations.json +102 -0
- package/admin/i18n/fr/translations.json +108 -0
- package/admin/i18n/it/translations.json +102 -0
- package/admin/i18n/nl/translations.json +108 -0
- package/admin/i18n/pl/translations.json +108 -0
- package/admin/i18n/pt/translations.json +102 -0
- package/admin/i18n/ru/translations.json +108 -0
- package/admin/i18n/uk/translations.json +108 -0
- package/admin/i18n/zh-cn/translations.json +102 -0
- package/admin/img/philips_hue_lom001.png +0 -0
- package/admin/index.html +159 -159
- package/admin/index_m.html +1161 -1161
- package/admin/moment.min.js +1 -1
- package/admin/shuffle.min.js +2 -2
- package/admin/tab_m.html +985 -944
- package/admin/vis-network.min.css +1 -1
- package/admin/vis-network.min.js +27 -27
- package/admin/words.js +110 -110
- package/docs/de/img/CC2531.png +0 -0
- package/docs/de/img/CC2538_CC2592_PA.PNG +0 -0
- package/docs/de/img/CC2591.png +0 -0
- package/docs/de/img/boards.jpg +0 -0
- package/docs/de/img/cc26x2r.PNG +0 -0
- package/docs/de/img/results.jpg +0 -0
- package/docs/de/img/sku_429478_2.png +0 -0
- package/docs/de/img/sku_429601_2.png +0 -0
- package/docs/de/readme.md +27 -0
- package/docs/en/img/CC2531.png +0 -0
- package/docs/en/img/CC2591.png +0 -0
- package/docs/en/img/deconz.png +0 -0
- package/docs/en/img/sku_429478_2.png +0 -0
- package/docs/en/img/sku_429601_2.png +0 -0
- package/docs/en/readme.md +30 -0
- package/docs/flashing_via_arduino_(en).md +110 -0
- package/docs/ru/img/CC2531.png +0 -0
- package/docs/ru/img/CC2591.png +0 -0
- package/docs/ru/img/sku_429478_2.png +0 -0
- package/docs/ru/img/sku_429601_2.png +0 -0
- package/docs/ru/readme.md +28 -0
- package/docs/tutorial/CC2530_20190425.zip +0 -0
- package/docs/tutorial/CC2530_CC2591_20190515.zip +0 -0
- package/docs/tutorial/CC2530_CC2592_20190515.zip +0 -0
- package/docs/tutorial/CC2531_20190425.zip +0 -0
- package/docs/tutorial/adm5_1.PNG +0 -0
- package/docs/tutorial/adm5_2.PNG +0 -0
- package/docs/tutorial/cat.PNG +0 -0
- package/docs/tutorial/groups-1.png +0 -0
- package/docs/tutorial/groups-2.png +0 -0
- package/docs/tutorial/inst.PNG +0 -0
- package/docs/tutorial/reflash-finish.PNG +0 -0
- package/docs/tutorial/reflash-step0.png +0 -0
- package/docs/tutorial/reflash-step1.PNG +0 -0
- package/docs/tutorial/reflash-step2.PNG +0 -0
- package/docs/tutorial/settings.png +0 -0
- package/docs/tutorial/tab-dev-1.png +0 -0
- package/docs/tutorial/zigbee.png +0 -0
- package/docs/tutorial/zigbee15.png +0 -0
- package/io-package.json +335 -370
- package/lib/backup.js +171 -171
- package/lib/binding.js +324 -325
- package/lib/colors.js +462 -460
- package/lib/commands.js +508 -501
- package/lib/developer.js +147 -148
- package/lib/devices.js +3136 -3145
- package/lib/exclude.js +162 -168
- package/lib/exposes.js +799 -804
- package/lib/groups.js +341 -342
- package/lib/json.js +59 -60
- package/lib/networkmap.js +56 -56
- package/lib/ota.js +187 -179
- package/lib/rgb.js +258 -255
- package/lib/seriallist.js +48 -37
- package/lib/states.js +6406 -6416
- package/lib/statescontroller.js +676 -670
- package/lib/tools.js +54 -54
- package/lib/utils.js +152 -151
- package/lib/zbBaseExtension.js +36 -36
- package/lib/zbDelayedAction.js +144 -152
- package/lib/zbDeviceAvailability.js +318 -315
- package/lib/zbDeviceConfigure.js +147 -159
- package/lib/zbDeviceEvent.js +48 -49
- package/lib/zigbeecontroller.js +943 -951
- package/main.js +149 -133
- package/package.json +33 -19
- package/support/docgen.js +93 -93
- package/.eslintignore +0 -2
- package/.eslintrc.json +0 -37
- package/.github/FUNDING.yml +0 -3
- package/.github/stale.yml +0 -13
- package/.github/workflows/test-and-release.yml +0 -151
- package/.travis/wiki.sh +0 -28
- package/admin/adapter-settings.js +0 -244
package/lib/zbDeviceConfigure.js
CHANGED
|
@@ -1,159 +1,147 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const zigbeeHerdsmanConverters = require('zigbee-herdsman-converters');
|
|
4
|
-
const BaseExtension = require('./zbBaseExtension');
|
|
5
|
-
|
|
6
|
-
const forcedConfigureOnEachStart = [
|
|
7
|
-
zigbeeHerdsmanConverters.devices.find((d) => d.model === 'V3-BTZB'),
|
|
8
|
-
zigbeeHerdsmanConverters.devices.find((d) => d.model === '014G2461'),
|
|
9
|
-
zigbeeHerdsmanConverters.devices.find((d) => d.model === 'SPZB0001'),
|
|
10
|
-
zigbeeHerdsmanConverters.devices.find((d) => d.model === 'ZK03840')
|
|
11
|
-
];
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
this.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if (!
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
if (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
device.
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
)
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
this.
|
|
107
|
-
|
|
108
|
-
this.
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
device.save();
|
|
149
|
-
this.info(`DeviceConfigure successful ${device.ieeeAddr} ${device.modelID}`);
|
|
150
|
-
} catch (error) {
|
|
151
|
-
this.sendError(error);
|
|
152
|
-
this.error(
|
|
153
|
-
`Failed to DeviceConfigure.configure ${device.ieeeAddr} ${device.modelID} (${error.stack})`,
|
|
154
|
-
);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
module.exports = DeviceConfigure;
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const zigbeeHerdsmanConverters = require('zigbee-herdsman-converters');
|
|
4
|
+
const BaseExtension = require('./zbBaseExtension');
|
|
5
|
+
|
|
6
|
+
const forcedConfigureOnEachStart = [
|
|
7
|
+
zigbeeHerdsmanConverters.devices.find((d) => d.model === 'V3-BTZB'),
|
|
8
|
+
zigbeeHerdsmanConverters.devices.find((d) => d.model === '014G2461'),
|
|
9
|
+
zigbeeHerdsmanConverters.devices.find((d) => d.model === 'SPZB0001'),
|
|
10
|
+
zigbeeHerdsmanConverters.devices.find((d) => d.model === 'ZK03840')
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
class DeviceConfigure extends BaseExtension {
|
|
14
|
+
constructor(zigbee, options) {
|
|
15
|
+
super(zigbee, options);
|
|
16
|
+
|
|
17
|
+
this.configuring = new Set();
|
|
18
|
+
this.attempts = {};
|
|
19
|
+
this.name = 'DeviceConfigure';
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
setOptions(options) {
|
|
23
|
+
return typeof options === 'object';
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
shouldConfigure(device, mappedDevice) {
|
|
27
|
+
if (!device || !mappedDevice) {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
if (!mappedDevice || !mappedDevice.configure) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
if (device.meta.hasOwnProperty('configured') &&
|
|
34
|
+
zigbeeHerdsmanConverters.getConfigureKey(mappedDevice)) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return device.interviewing !== true;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
async onZigbeeStarted() {
|
|
42
|
+
try {
|
|
43
|
+
this.coordinatorEndpoint = await this.zigbee.getDevicesByType('Coordinator')[0].endpoints[0];
|
|
44
|
+
|
|
45
|
+
for (const device of await this.zigbee.getClients()) {
|
|
46
|
+
const mappedDevice = zigbeeHerdsmanConverters.findByDevice(device);
|
|
47
|
+
|
|
48
|
+
if (forcedConfigureOnEachStart.find((d) => d && d.hasOwnProperty('zigbeeModel') && d.zigbeeModel.includes(device.modelID))) {
|
|
49
|
+
this.debug(`DeviceConfigure ${device.ieeeAddr} ${device.modelID} forced by adapter config`);
|
|
50
|
+
device.meta.configured = -1; // Force a reconfiguration for this device
|
|
51
|
+
}
|
|
52
|
+
if (this.shouldConfigure(device, mappedDevice)) {
|
|
53
|
+
this.debug(`DeviceConfigure ${device.ieeeAddr} ${device.modelID} needed`);
|
|
54
|
+
await this.configure(device, mappedDevice);
|
|
55
|
+
} else {
|
|
56
|
+
this.debug(`DeviceConfigure ${device.ieeeAddr} ${device.modelID} not needed`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
} catch (error) {
|
|
60
|
+
this.sendError(error);
|
|
61
|
+
this.error(`Failed to DeviceConfigure.onZigbeeStarted (${error.stack})`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
onZigbeeEvent(data, mappedDevice) {
|
|
66
|
+
try {
|
|
67
|
+
const device = data.device;
|
|
68
|
+
if (this.shouldConfigure(device, mappedDevice)) {
|
|
69
|
+
this.configure(device, mappedDevice);
|
|
70
|
+
}
|
|
71
|
+
} catch (error) {
|
|
72
|
+
this.sendError(error);
|
|
73
|
+
this.error(`Failed to DeviceConfigure.onZigbeeEvent (${error.stack})`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
onDeviceRemove(device){
|
|
78
|
+
try {
|
|
79
|
+
if (this.configuring.has(device.ieeeAddr)) {
|
|
80
|
+
this.configuring.delete(device.ieeeAddr);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (this.attempts.hasOwnProperty(device.ieeeAddr)) {
|
|
84
|
+
delete this.attempts[device.ieeeAddr];
|
|
85
|
+
}
|
|
86
|
+
} catch (error) {
|
|
87
|
+
this.sendError(error);
|
|
88
|
+
this.error(`Failed to DeviceConfigure.onDeviceRemove (${error.stack})`);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
onDeviceLeave(data, entity){
|
|
93
|
+
if (entity) {
|
|
94
|
+
this.onDeviceRemove(entity.device);
|
|
95
|
+
} else {
|
|
96
|
+
this.onDeviceRemove(data);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
async configure(device, mappedDevice) {
|
|
101
|
+
try {
|
|
102
|
+
if (this.configuring.has(device.ieeeAddr) || this.attempts[device.ieeeAddr] >= 5) {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
this.configuring.add(device.ieeeAddr);
|
|
107
|
+
|
|
108
|
+
if (!this.attempts.hasOwnProperty(device.ieeeAddr)) {
|
|
109
|
+
this.attempts[device.ieeeAddr] = 0;
|
|
110
|
+
}
|
|
111
|
+
try {
|
|
112
|
+
await this.doConfigure(device, mappedDevice);
|
|
113
|
+
} catch (error) {
|
|
114
|
+
this.sendError(error);
|
|
115
|
+
this.warn(
|
|
116
|
+
`DeviceConfigure failed ${device.ieeeAddr} ${device.modelID}, ` +
|
|
117
|
+
`attempt ${this.attempts[device.ieeeAddr] + 1} (${error.stack})`,
|
|
118
|
+
);
|
|
119
|
+
this.attempts[device.ieeeAddr]++;
|
|
120
|
+
}
|
|
121
|
+
this.configuring.delete(device.ieeeAddr);
|
|
122
|
+
} catch (error) {
|
|
123
|
+
this.sendError(error);
|
|
124
|
+
this.error(
|
|
125
|
+
`Failed to DeviceConfigure.configure ${device.ieeeAddr} ${device.modelID} (${error.stack})`,
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
async doConfigure(device, mappedDevice) {
|
|
131
|
+
this.info(`Configuring ${device.ieeeAddr} ${device.modelID}`);
|
|
132
|
+
const coordinatorEndpoint = await this.zigbee.getDevicesByType('Coordinator')[0].endpoints[0];
|
|
133
|
+
try {
|
|
134
|
+
await mappedDevice.configure(device, coordinatorEndpoint);
|
|
135
|
+
device.meta.configured = zigbeeHerdsmanConverters.getConfigureKey(mappedDevice);
|
|
136
|
+
device.save();
|
|
137
|
+
this.info(`DeviceConfigure successful ${device.ieeeAddr} ${device.modelID}`);
|
|
138
|
+
} catch (error) {
|
|
139
|
+
this.sendError(error);
|
|
140
|
+
this.error(
|
|
141
|
+
`Failed to DeviceConfigure.configure ${device.ieeeAddr} ${device.modelID} (${error.stack})`,
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
module.exports = DeviceConfigure;
|
package/lib/zbDeviceEvent.js
CHANGED
|
@@ -1,49 +1,48 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const BaseExtension = require('./zbBaseExtension');
|
|
4
|
-
const zigbeeHerdsmanConverters = require('zigbee-herdsman-converters');
|
|
5
|
-
|
|
6
|
-
class DeviceEvent extends BaseExtension {
|
|
7
|
-
constructor(zigbee, options) {
|
|
8
|
-
super(zigbee, options);
|
|
9
|
-
this.name =
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
module.exports = DeviceEvent;
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const BaseExtension = require('./zbBaseExtension');
|
|
4
|
+
const zigbeeHerdsmanConverters = require('zigbee-herdsman-converters');
|
|
5
|
+
|
|
6
|
+
class DeviceEvent extends BaseExtension {
|
|
7
|
+
constructor(zigbee, options) {
|
|
8
|
+
super(zigbee, options);
|
|
9
|
+
this.name = 'DeviceEvent';
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
async onZigbeeStarted() {
|
|
13
|
+
for (const device of await this.zigbee.getClients()) {
|
|
14
|
+
this.callOnEvent(device, 'start', {});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
setOptions(options) {
|
|
19
|
+
return typeof options === 'object';
|
|
20
|
+
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
onZigbeeEvent(data, mappedDevice) {
|
|
24
|
+
if (data.device) {
|
|
25
|
+
this.callOnEvent(data.device, data.type, data, mappedDevice);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
async stop() {
|
|
30
|
+
if (this.zigbee.getClients() > 0) {
|
|
31
|
+
for (const device of await this.zigbee.getClients()) {
|
|
32
|
+
this.callOnEvent(device, 'stop', {});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
callOnEvent(device, type, data, mappedDevice) {
|
|
38
|
+
if (!mappedDevice) {
|
|
39
|
+
mappedDevice = zigbeeHerdsmanConverters.findByDevice(device);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (mappedDevice && mappedDevice.onEvent) {
|
|
43
|
+
mappedDevice.onEvent(type, data, device);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
module.exports = DeviceEvent;
|