iobroker-ucl 1.4.5 → 1.4.6
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/zigbeeFunctions.js +479 -589
- package/zigbeeFunctions.ts +12 -142
package/zigbeeFunctions.ts
CHANGED
@@ -146,126 +146,38 @@ function createZigbeeDevice(adapter:any, rawId: number, baseState: string, etage
|
|
146
146
|
|
147
147
|
// Fenstersensor:
|
148
148
|
export function createZigbeeFenstersensor(adapter:any, rawId: number, baseState: string, etage:string, raum:string, device:string) {
|
149
|
-
|
150
|
-
// Bei Update alte States löschen:
|
151
|
-
let stateFolderDatenpunkt = "0_userdata.0.devices.zigbee." + deviceZigbeeFenstersensor + "." + rawId + ".*";
|
152
|
-
adapter.$(stateFolderDatenpunkt).each(function (id) {
|
153
|
-
if (adapter.existsState(id)) {
|
154
|
-
adapter.deleteState(id);
|
155
|
-
}
|
156
|
-
});
|
157
|
-
|
158
|
-
// Neue States anlegen:
|
159
|
-
setTimeout(function() {
|
160
|
-
createZigbeeDevice(adapter, rawId, baseState, etage, raum, device, deviceZigbeeFenstersensor);
|
161
|
-
cacheFenstersensorenArray = null;
|
162
|
-
}, 60000);
|
149
|
+
createZigbeeDevice(adapter, rawId, baseState, etage, raum, device, deviceZigbeeFenstersensor);
|
163
150
|
}
|
164
151
|
|
165
152
|
// Repeater:
|
166
153
|
export function createZigbeeRepeater(adapter:any, rawId: number, baseState: string, etage:string, raum:string, device:string) {
|
167
|
-
|
168
|
-
// Bei Update alte States löschen:
|
169
|
-
let stateFolderDatenpunkt = "0_userdata.0.devices.zigbee." + deviceZigbeeRepeater + "." + rawId + ".*";
|
170
|
-
adapter.$(stateFolderDatenpunkt).each(function (id) {
|
171
|
-
if (adapter.existsState(id)) {
|
172
|
-
adapter.deleteState(id);
|
173
|
-
}
|
174
|
-
});
|
175
|
-
|
176
|
-
// Neue States anlegen:
|
177
|
-
setTimeout(function() {
|
178
154
|
createZigbeeDevice(adapter, rawId, baseState, etage, raum, device, deviceZigbeeRepeater);
|
179
|
-
cacheRepeaterArray = null;
|
180
|
-
}, 60000);
|
181
155
|
}
|
182
156
|
|
183
157
|
// Schalter:
|
184
158
|
export function createZigbeeSchalter(adapter:any, rawId: number, baseState: string, etage:string, raum:string, device:string) {
|
185
|
-
|
186
|
-
// Bei Update alte States löschen:
|
187
|
-
let stateFolderDatenpunkt = "0_userdata.0.devices.zigbee." + deviceZigbeeSchalter + "." + rawId + ".*";
|
188
|
-
adapter.$(stateFolderDatenpunkt).each(function (id) {
|
189
|
-
if (adapter.existsState(id)) {
|
190
|
-
adapter.deleteState(id);
|
191
|
-
}
|
192
|
-
});
|
193
|
-
|
194
|
-
// Neue States anlegen:
|
195
|
-
setTimeout(function() {
|
196
159
|
createZigbeeDevice(adapter, rawId, baseState, etage, raum, device, deviceZigbeeSchalter);
|
197
|
-
cacheSchalterArray = null;
|
198
|
-
}, 60000);
|
199
160
|
}
|
200
161
|
|
201
162
|
// Wandtaster:
|
202
163
|
export function createZigbeeWandtaster(adapter:any, rawId: number, baseState: string, etage:string, raum:string, device:string) {
|
203
|
-
|
204
|
-
// Bei Update alte States löschen:
|
205
|
-
let stateFolderDatenpunkt = "0_userdata.0.devices.zigbee." + deviceZigbeeWandtaster + "." + rawId + ".*";
|
206
|
-
adapter.$(stateFolderDatenpunkt).each(function (id) {
|
207
|
-
if (adapter.existsState(id)) {
|
208
|
-
adapter.deleteState(id);
|
209
|
-
}
|
210
|
-
});
|
211
|
-
|
212
|
-
// Neue States anlegen:
|
213
|
-
setTimeout(function() {
|
214
164
|
createZigbeeDevice(adapter, rawId, baseState, etage, raum, device, deviceZigbeeWandtaster);
|
215
|
-
cacheWandtasterArray = null;
|
216
|
-
}, 60000);
|
217
165
|
}
|
218
166
|
|
219
167
|
// Rauchmelder:
|
220
168
|
export function createZigbeeRauchmelder(adapter:any, rawId: number, baseState: string, etage:string, raum:string, device:string) {
|
221
|
-
|
222
|
-
// Bei Update alte States löschen:
|
223
|
-
let stateFolderDatenpunkt = "0_userdata.0.devices.zigbee." + deviceZigbeeRauchmelder + "." + rawId + ".*";
|
224
|
-
adapter.$(stateFolderDatenpunkt).each(function (id) {
|
225
|
-
if (adapter.existsState(id)) {
|
226
|
-
adapter.deleteState(id);
|
227
|
-
}
|
228
|
-
});
|
229
|
-
|
230
|
-
// Neue States anlegen:
|
231
|
-
setTimeout(function() {
|
232
169
|
createZigbeeDevice(adapter, rawId, baseState, etage, raum, device, deviceZigbeeRauchmelder);
|
233
|
-
cacheRauchmelderArray = null;
|
234
|
-
}, 60000);
|
235
170
|
}
|
236
171
|
|
237
172
|
// Bewegungsmelder:
|
238
173
|
export function createZigbeeBewegungsmelder(adapter:any, rawId: number, baseState: string, etage:string, raum:string, device:string) {
|
239
|
-
|
240
|
-
// Bei Update alte States löschen:
|
241
|
-
let stateFolderDatenpunkt = "0_userdata.0.devices.zigbee." + deviceZigbeeBewegungsmelder + "." + rawId + ".*";
|
242
|
-
adapter.$(stateFolderDatenpunkt).each(function (id) {
|
243
|
-
if (adapter.existsState(id)) {
|
244
|
-
adapter.deleteState(id);
|
245
|
-
}
|
246
|
-
});
|
247
|
-
|
248
|
-
// Neue States anlegen:
|
249
|
-
setTimeout(function() {
|
250
174
|
createZigbeeDevice(adapter, rawId, baseState, etage, raum, device, deviceZigbeeBewegungsmelder);
|
251
|
-
cacheBewegungsmelderArray = null;
|
252
|
-
}, 60000);
|
253
175
|
}
|
254
176
|
|
255
177
|
// Dosenrelais:
|
256
178
|
export function createZigbeeDosenrelais(adapter:any, rawId: number, baseState: string, etage:string, raum:string, device:string, smartNames:string[]) {
|
257
179
|
|
258
|
-
//
|
259
|
-
let stateFolderDatenpunkt = "0_userdata.0.devices.zigbee." + deviceZigbeeDosenrelais + "." + rawId + ".*";
|
260
|
-
adapter.$(stateFolderDatenpunkt).each(function (id) {
|
261
|
-
if (adapter.existsState(id)) {
|
262
|
-
adapter.deleteState(id);
|
263
|
-
}
|
264
|
-
});
|
265
|
-
|
266
|
-
// Neue States anlegen:
|
267
|
-
setTimeout(function() {
|
268
|
-
// Allgemein:
|
180
|
+
// Allgemein:
|
269
181
|
createZigbeeDevice(adapter, rawId, baseState, etage, raum, device, deviceZigbeeDosenrelais);
|
270
182
|
|
271
183
|
// Spezifisch:
|
@@ -280,25 +192,12 @@ export function createZigbeeDosenrelais(adapter:any, rawId: number, baseState: s
|
|
280
192
|
}
|
281
193
|
});
|
282
194
|
createDatenpunktSingle(adapter, rawId, attributeTypeString, attributeDosenrelais_smartNames, db_smartNames, deviceZigbeeDosenrelais);
|
283
|
-
cacheDosenrelaisArray = null;
|
284
|
-
}, 60000);
|
285
195
|
}
|
286
196
|
|
287
197
|
// Steckdose:
|
288
198
|
export function createZigbeeSteckdose(adapter:any, rawId: number, baseState: string, etage: string, raum: string, device: string, alexaSmartNamesForOn:string[],
|
289
199
|
alexaActionNamesForOn:string[], alexaSmartNamesForOff: string[],alexaActionNamesForOff: string[], additionalStates4TurnOn:string[], additionalStates4TurnOff:string[]) {
|
290
200
|
|
291
|
-
// Bei Update alte States löschen:
|
292
|
-
let stateFolderDatenpunkt = "0_userdata.0.devices.zigbee." + deviceZigbeeSteckdose + "." + rawId + ".*";
|
293
|
-
adapter.$(stateFolderDatenpunkt).each(function (id) {
|
294
|
-
if (adapter.existsState(id)) {
|
295
|
-
adapter.deleteState(id);
|
296
|
-
}
|
297
|
-
});
|
298
|
-
|
299
|
-
// Neue States anlegen:
|
300
|
-
setTimeout(function() {
|
301
|
-
|
302
201
|
// Allgemein:
|
303
202
|
createZigbeeDevice(adapter, rawId, baseState, etage, raum, device, deviceZigbeeSteckdose);
|
304
203
|
|
@@ -379,9 +278,6 @@ export function createZigbeeSteckdose(adapter:any, rawId: number, baseState: str
|
|
379
278
|
}
|
380
279
|
});
|
381
280
|
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_TasterBooleanOff, db_additionalStates4TurnOff, deviceZigbeeSteckdose);
|
382
|
-
cacheSteckdosenArray = null;
|
383
|
-
|
384
|
-
}, 60000);
|
385
281
|
}
|
386
282
|
|
387
283
|
// LampeWeiss:
|
@@ -393,17 +289,6 @@ export function createZigbeeLampeWeiss(adapter:any, rawId: number, baseState: st
|
|
393
289
|
tasterBooleanOff: string[], nachtbeleuchtung:boolean,
|
394
290
|
turnOffExitHouseSummer:boolean, turnOffExitHouseWinter:boolean, turnOnEnterHouseSummer:boolean, turnOnEnterHouseWinter:boolean) {
|
395
291
|
|
396
|
-
// Bei Update alte States löschen:
|
397
|
-
let stateFolderDatenpunkt = "0_userdata.0.devices.zigbee." + deviceZigbeeLampeWeiss + "." + rawId + ".*";
|
398
|
-
adapter.$(stateFolderDatenpunkt).each(function (id) {
|
399
|
-
if (adapter.existsState(id)) {
|
400
|
-
adapter.deleteState(id);
|
401
|
-
}
|
402
|
-
});
|
403
|
-
|
404
|
-
// Neue States anlegen:
|
405
|
-
setTimeout(function() {
|
406
|
-
|
407
292
|
// Allgemein:
|
408
293
|
createZigbeeDevice(adapter, rawId, baseState, etage, raum, device, deviceZigbeeLampeWeiss);
|
409
294
|
|
@@ -596,9 +481,6 @@ export function createZigbeeLampeWeiss(adapter:any, rawId: number, baseState: st
|
|
596
481
|
createDatenpunktSingle(adapter, rawId, attributeTypeNumber, attributeLampWeiss_ColorSchemes_Weiss4_level, null, deviceZigbeeLampeWeiss);
|
597
482
|
createDatenpunktSingle(adapter, rawId, attributeTypeNumber, attributeLampWeiss_ColorSchemes_Weiss4_ct, null, deviceZigbeeLampeWeiss);*/
|
598
483
|
}
|
599
|
-
cacheLampenWeissArray = null;
|
600
|
-
|
601
|
-
}, 60000);
|
602
484
|
|
603
485
|
}
|
604
486
|
|
@@ -610,16 +492,6 @@ export function createZigbeeLampeRGB(adapter:any, rawId: number, baseState: stri
|
|
610
492
|
tasterBooleanOn: string[], tasterBooleanOff: string[],nachtbeleuchtung:boolean, turnOffExitHouseSummer:boolean, turnOffExitHouseWinter:boolean,
|
611
493
|
turnOnEnterHouseSummer:boolean, turnOnEnterHouseWinter:boolean) {
|
612
494
|
|
613
|
-
// Bei Update alte States löschen:
|
614
|
-
let stateFolderDatenpunkt = "0_userdata.0.devices.zigbee." + deviceZigbeeLampeRGB + "." + rawId + ".*";
|
615
|
-
adapter.$(stateFolderDatenpunkt).each(function (id) {
|
616
|
-
if (adapter.existsState(id)) {
|
617
|
-
adapter.deleteState(id);
|
618
|
-
}
|
619
|
-
});
|
620
|
-
|
621
|
-
// Neue States anlegen:
|
622
|
-
setTimeout(function() {
|
623
495
|
let category: string = deviceZigbeeLampeRGB;
|
624
496
|
|
625
497
|
// Allgemein:
|
@@ -862,8 +734,6 @@ export function createZigbeeLampeRGB(adapter:any, rawId: number, baseState: stri
|
|
862
734
|
createDatenpunktSingle(adapter, rawId, attributeTypeNumber, attributeRGBLamp_ColorSchemes_Weiss4_level, null, category);
|
863
735
|
createDatenpunktSingle(adapter, rawId, attributeTypeNumber, attributeRGBLamp_ColorSchemes_Weiss4_ct, null, category);*/
|
864
736
|
}
|
865
|
-
cacheLampenRGBArray = null;
|
866
|
-
}, 60000);
|
867
737
|
}
|
868
738
|
|
869
739
|
function createDatenpunktSingle(adapter:any, deviceRawId, attributeType, attributeName, attributeValue, category:string) {
|
@@ -886,7 +756,7 @@ function toStringArray(databaseValue) { // z.B. "Werkbank|Arbeiten|Keller"
|
|
886
756
|
}
|
887
757
|
}
|
888
758
|
|
889
|
-
|
759
|
+
var cacheSteckdosenArray = null;
|
890
760
|
export function loadZigbeeSteckdosen(adapter: any) {
|
891
761
|
if (cacheSteckdosenArray != null) {
|
892
762
|
return cacheSteckdosenArray;
|
@@ -916,7 +786,7 @@ export function loadZigbeeSteckdosen(adapter: any) {
|
|
916
786
|
return cacheSteckdosenArray;
|
917
787
|
}
|
918
788
|
|
919
|
-
|
789
|
+
var cacheBewegungsmelderArray = null;
|
920
790
|
export function loadZigbeeBewegungsmelder(adapter: any) {
|
921
791
|
if (cacheBewegungsmelderArray != null) {
|
922
792
|
return cacheBewegungsmelderArray;
|
@@ -940,7 +810,7 @@ export function loadZigbeeBewegungsmelder(adapter: any) {
|
|
940
810
|
return cacheBewegungsmelderArray;
|
941
811
|
}
|
942
812
|
|
943
|
-
|
813
|
+
var cacheLampenRGBArray = null;
|
944
814
|
export function loadZigbeeLampenRGB(adapter: any) {
|
945
815
|
if (cacheLampenRGBArray != null) {
|
946
816
|
return cacheLampenRGBArray;
|
@@ -1082,7 +952,7 @@ export function loadZigbeeLampenRGB(adapter: any) {
|
|
1082
952
|
return cacheLampenRGBArray;
|
1083
953
|
}
|
1084
954
|
|
1085
|
-
|
955
|
+
var cacheLampenWeissArray = null;
|
1086
956
|
export function loadZigbeeLampenWeiss(adapter: any) {
|
1087
957
|
if (cacheLampenWeissArray != null) {
|
1088
958
|
return cacheLampenWeissArray;
|
@@ -1217,7 +1087,7 @@ export function loadZigbeeLampenWeiss(adapter: any) {
|
|
1217
1087
|
return cacheLampenWeissArray;
|
1218
1088
|
}
|
1219
1089
|
|
1220
|
-
|
1090
|
+
var cacheRauchmelderArray = null;
|
1221
1091
|
export function loadZigbeeRauchmelder(adapter: any) {
|
1222
1092
|
if (cacheRauchmelderArray != null) {
|
1223
1093
|
return cacheRauchmelderArray;
|
@@ -1241,7 +1111,7 @@ export function loadZigbeeRauchmelder(adapter: any) {
|
|
1241
1111
|
return cacheRauchmelderArray;
|
1242
1112
|
}
|
1243
1113
|
|
1244
|
-
|
1114
|
+
var cacheWandtasterArray = null;
|
1245
1115
|
export function loadZigbeeWandtaster(adapter: any) {
|
1246
1116
|
if (cacheWandtasterArray != null) {
|
1247
1117
|
return cacheWandtasterArray;
|
@@ -1265,7 +1135,7 @@ export function loadZigbeeWandtaster(adapter: any) {
|
|
1265
1135
|
return cacheWandtasterArray;
|
1266
1136
|
}
|
1267
1137
|
|
1268
|
-
|
1138
|
+
var cacheDosenrelaisArray = null;
|
1269
1139
|
export function loadZigbeeDosenrelais(adapter: any) {
|
1270
1140
|
if (cacheDosenrelaisArray != null) {
|
1271
1141
|
return cacheDosenrelaisArray;
|
@@ -1290,7 +1160,7 @@ export function loadZigbeeDosenrelais(adapter: any) {
|
|
1290
1160
|
return cacheDosenrelaisArray;
|
1291
1161
|
}
|
1292
1162
|
|
1293
|
-
|
1163
|
+
var cacheSchalterArray = null;
|
1294
1164
|
export function loadZigbeeSchalter(adapter: any) {
|
1295
1165
|
if (cacheSchalterArray != null) {
|
1296
1166
|
return cacheSchalterArray;
|
@@ -1314,7 +1184,7 @@ export function loadZigbeeSchalter(adapter: any) {
|
|
1314
1184
|
return cacheSchalterArray;
|
1315
1185
|
}
|
1316
1186
|
|
1317
|
-
|
1187
|
+
var cacheRepeaterArray = null;
|
1318
1188
|
export function loadZigbeeRepeater(adapter: any) {
|
1319
1189
|
if (cacheRepeaterArray != null) {
|
1320
1190
|
return cacheRepeaterArray;
|
@@ -1338,7 +1208,7 @@ export function loadZigbeeRepeater(adapter: any) {
|
|
1338
1208
|
return cacheRepeaterArray;
|
1339
1209
|
}
|
1340
1210
|
|
1341
|
-
|
1211
|
+
var cacheFenstersensorenArray = null;
|
1342
1212
|
export function loadZigbeeFenstersensor(adapter: any) {
|
1343
1213
|
if (cacheFenstersensorenArray != null) {
|
1344
1214
|
return cacheFenstersensorenArray;
|