iobroker-ucl 1.3.1 → 1.3.3
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/homematicFunctions.js +2 -0
- package/homematicFunctions.ts +47 -45
- package/html.js +10 -10
- package/html.ts +29 -29
- package/package.json +1 -1
- package/shellyClasses.ts +16 -16
- package/shellyFunctions.js +7 -0
- package/shellyFunctions.ts +49 -42
- package/zigbeeClasses.ts +28 -28
- package/zigbeeFunctions.js +4 -0
- package/zigbeeFunctions.ts +56 -52
package/shellyClasses.ts
CHANGED
@@ -66,7 +66,7 @@ export abstract class AbstractShelly {
|
|
66
66
|
|
67
67
|
// Shelly1, Shelly2.5,...
|
68
68
|
public getType() : string {
|
69
|
-
|
69
|
+
let typ = this.adapter.getState(this.baseState + ".id").val;
|
70
70
|
if (typ == "shelly1") {
|
71
71
|
return "1";
|
72
72
|
} else if (typ == "shellyswitch25") {
|
@@ -91,8 +91,8 @@ export abstract class AbstractShelly {
|
|
91
91
|
}
|
92
92
|
|
93
93
|
public getFirmware() : string {
|
94
|
-
|
95
|
-
|
94
|
+
let versionState = this.baseState + ".version";
|
95
|
+
let version = this.adapter.getState(versionState).val;
|
96
96
|
version= version.substr(0, version.indexOf('-'));
|
97
97
|
return version;
|
98
98
|
}
|
@@ -105,7 +105,7 @@ export abstract class AbstractShelly {
|
|
105
105
|
|
106
106
|
// Level:
|
107
107
|
// ----------------------------------------------------------------------------------
|
108
|
-
|
108
|
+
let alexaLampeLevel = "0_userdata.0.alexa." + smartName + ".level";
|
109
109
|
this.adapter.createState(alexaLampeLevel, 0, {
|
110
110
|
name: alexaLampeLevel,
|
111
111
|
desc: alexaLampeLevel,
|
@@ -134,7 +134,7 @@ export abstract class AbstractShelly {
|
|
134
134
|
|
135
135
|
// HUE:
|
136
136
|
// ----------------------------------------------------------------------------------
|
137
|
-
|
137
|
+
let alexaLampeHue = "0_userdata.0.alexa." + smartName + ".hue";
|
138
138
|
this.adapter.createState(alexaLampeHue, 0, {
|
139
139
|
name: alexaLampeHue,
|
140
140
|
desc: alexaLampeHue,
|
@@ -160,7 +160,7 @@ export abstract class AbstractShelly {
|
|
160
160
|
|
161
161
|
// SAT:
|
162
162
|
// ----------------------------------------------------------------------------------
|
163
|
-
|
163
|
+
let alexaLampeSat = "0_userdata.0.alexa." + smartName + ".sat";
|
164
164
|
this.adapter.createState(alexaLampeSat, 0, {
|
165
165
|
name: alexaLampeSat,
|
166
166
|
desc: alexaLampeSat,
|
@@ -186,7 +186,7 @@ export abstract class AbstractShelly {
|
|
186
186
|
|
187
187
|
// CT:
|
188
188
|
// ----------------------------------------------------------------------------------
|
189
|
-
|
189
|
+
let alexaLampeCT = "0_userdata.0.alexa." + smartName + ".ct";
|
190
190
|
this.adapter.createState(alexaLampeCT, 0, {
|
191
191
|
name: alexaLampeCT,
|
192
192
|
desc: alexaLampeCT,
|
@@ -265,7 +265,7 @@ export class ShellyLampeWeiss extends AbstractShelly {
|
|
265
265
|
}
|
266
266
|
|
267
267
|
private createState(key_in) {
|
268
|
-
|
268
|
+
let jarvisDatenpunkt = key_in;//.replace(/\./g,'_'); // wegen Wohnzimmer T.V.
|
269
269
|
//log(">>> CREATE STATE: " + jarvisDatenpunkt);
|
270
270
|
this.adapter.createState(jarvisDatenpunkt, false, {
|
271
271
|
name: jarvisDatenpunkt,
|
@@ -317,7 +317,7 @@ export class ShellyLampeWeiss extends AbstractShelly {
|
|
317
317
|
}
|
318
318
|
|
319
319
|
public getAlexaNamesForOnAsString() : string {
|
320
|
-
|
320
|
+
let result = "";
|
321
321
|
|
322
322
|
this.alexaSmartNamesForOn.forEach(alexaOnName => {
|
323
323
|
if (result == "") {
|
@@ -338,7 +338,7 @@ export class ShellyLampeWeiss extends AbstractShelly {
|
|
338
338
|
}
|
339
339
|
|
340
340
|
public getAlexaNamesForOffAsString() : string {
|
341
|
-
|
341
|
+
let result = "";
|
342
342
|
|
343
343
|
this.alexaSmartNamesForOff.forEach(alexaOffName => {
|
344
344
|
if (result == "") {
|
@@ -510,7 +510,7 @@ export class ShellyDimmer extends AbstractShelly {
|
|
510
510
|
}
|
511
511
|
|
512
512
|
private createState(key_in) {
|
513
|
-
|
513
|
+
let jarvisDatenpunkt = key_in;//.replace(/\./g,'_'); // wegen Wohnzimmer T.V.
|
514
514
|
//log(">>> CREATE STATE: " + jarvisDatenpunkt);
|
515
515
|
this.adapter.createState(jarvisDatenpunkt, false, {
|
516
516
|
name: jarvisDatenpunkt,
|
@@ -550,7 +550,7 @@ export class ShellyDimmer extends AbstractShelly {
|
|
550
550
|
}
|
551
551
|
|
552
552
|
public getAlexaNamesForOnAsString() : string {
|
553
|
-
|
553
|
+
let result = "";
|
554
554
|
|
555
555
|
this.alexaSmartNamesForOn.forEach(alexaOnName => {
|
556
556
|
if (result == "") {
|
@@ -571,7 +571,7 @@ export class ShellyDimmer extends AbstractShelly {
|
|
571
571
|
}
|
572
572
|
|
573
573
|
public getAlexaNamesForOffAsString() : string {
|
574
|
-
|
574
|
+
let result = "";
|
575
575
|
|
576
576
|
this.alexaSmartNamesForOff.forEach(alexaOffName => {
|
577
577
|
if (result == "") {
|
@@ -706,7 +706,7 @@ export class ShellyLampeRGB extends AbstractShelly {
|
|
706
706
|
}
|
707
707
|
|
708
708
|
private createState(key_in) {
|
709
|
-
|
709
|
+
let jarvisDatenpunkt = key_in;//.replace(/\./g,'_'); // wegen Wohnzimmer T.V.
|
710
710
|
//log(">>> CREATE STATE: " + jarvisDatenpunkt);
|
711
711
|
this.adapter.createState(jarvisDatenpunkt, false, {
|
712
712
|
name: jarvisDatenpunkt,
|
@@ -747,7 +747,7 @@ export class ShellyLampeRGB extends AbstractShelly {
|
|
747
747
|
}
|
748
748
|
|
749
749
|
public getAlexaNamesForOnAsString() : string {
|
750
|
-
|
750
|
+
let result = "";
|
751
751
|
|
752
752
|
this.alexaSmartNamesForOn.forEach(alexaOnName => {
|
753
753
|
if (result == "") {
|
@@ -768,7 +768,7 @@ export class ShellyLampeRGB extends AbstractShelly {
|
|
768
768
|
}
|
769
769
|
|
770
770
|
public getAlexaNamesForOffAsString() : string {
|
771
|
-
|
771
|
+
let result = "";
|
772
772
|
|
773
773
|
this.alexaSmartNamesForOff.forEach(alexaOffName => {
|
774
774
|
if (result == "") {
|
package/shellyFunctions.js
CHANGED
@@ -69,6 +69,7 @@ function createShellyDevice(adapter, rawId, etage, raum, device, baseState, cate
|
|
69
69
|
createDatenpunktSingle(adapter, rawId, attributeTypeString, attributeEtage, etage, category);
|
70
70
|
createDatenpunktSingle(adapter, rawId, attributeTypeString, attributeRaum, raum, category);
|
71
71
|
createDatenpunktSingle(adapter, rawId, attributeTypeString, attributeDevice, device, category);
|
72
|
+
this.clearShellyCaches(adapter);
|
72
73
|
}
|
73
74
|
exports.createShellyDevice = createShellyDevice;
|
74
75
|
function createDatenpunktSingle(adapter, deviceRawId, attributeType, attributeName, attributeValue, category) {
|
@@ -86,18 +87,21 @@ console.log("test");
|
|
86
87
|
function createShellySensor(adapter, rawId, etage, raum, device, baseState) {
|
87
88
|
// Allgemein:
|
88
89
|
createShellyDevice(adapter, rawId, etage, raum, device, baseState, deviceShellySensor);
|
90
|
+
this.clearShellyCaches(adapter);
|
89
91
|
}
|
90
92
|
exports.createShellySensor = createShellySensor;
|
91
93
|
// Lampe RGB:
|
92
94
|
function createShellyLampeRGB(adapter, rawId, etage, raum, device, baseState) {
|
93
95
|
// Allgemein:
|
94
96
|
createShellyDevice(adapter, rawId, etage, raum, device, baseState, deviceShellyLampeRGB);
|
97
|
+
this.clearShellyCaches(adapter);
|
95
98
|
}
|
96
99
|
exports.createShellyLampeRGB = createShellyLampeRGB;
|
97
100
|
// Rollladen:
|
98
101
|
function createShellyRollladen(adapter, rawId, etage, raum, device, baseState) {
|
99
102
|
// Allgemein:
|
100
103
|
createShellyDevice(adapter, rawId, etage, raum, device, baseState, deviceShellyRollladen);
|
104
|
+
this.clearShellyCaches(adapter);
|
101
105
|
}
|
102
106
|
exports.createShellyRollladen = createShellyRollladen;
|
103
107
|
// Dimmer:
|
@@ -256,6 +260,7 @@ function createShellyDimmer(adapter, rawId, etage, raum, device, baseState, alex
|
|
256
260
|
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOffExitHouseWinter, turnOffExitHouseWinter, deviceShellyDimmer);
|
257
261
|
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOnEnterHouseSummer, turnOnEnterHouseSummer, deviceShellyDimmer);
|
258
262
|
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOnEnterHouseWinter, turnOnEnterHouseWinter, deviceShellyDimmer);
|
263
|
+
this.clearShellyCaches(adapter);
|
259
264
|
}
|
260
265
|
exports.createShellyDimmer = createShellyDimmer;
|
261
266
|
// Lampe Weiss:
|
@@ -348,6 +353,7 @@ function createShellyLampe(adapter, rawId, etage, raum, device, baseState, chann
|
|
348
353
|
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOffExitHouseWinter, turnOffExitHouseWinter, deviceShellyLampeWeiss);
|
349
354
|
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOnEnterHouseSummer, turnOnEnterHouseSummer, deviceShellyLampeWeiss);
|
350
355
|
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOnEnterHouseWinter, turnOnEnterHouseWinter, deviceShellyLampeWeiss);
|
356
|
+
this.clearShellyCaches(adapter);
|
351
357
|
}
|
352
358
|
exports.createShellyLampe = createShellyLampe;
|
353
359
|
// Steckdose:
|
@@ -440,6 +446,7 @@ function createShellySteckdose(adapter, rawId, etage, raum, device, baseState, c
|
|
440
446
|
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOffExitHouseWinter, turnOffExitHouseWinter, deviceShellySteckdose);
|
441
447
|
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOnEnterHouseSummer, turnOnEnterHouseSummer, deviceShellySteckdose);
|
442
448
|
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOnEnterHouseWinter, turnOnEnterHouseWinter, deviceShellySteckdose);
|
449
|
+
this.clearShellyCaches(adapter);
|
443
450
|
}
|
444
451
|
exports.createShellySteckdose = createShellySteckdose;
|
445
452
|
var cacheRollladenArray = null;
|
package/shellyFunctions.ts
CHANGED
@@ -82,10 +82,11 @@ export function createShellyDevice(adapter: any, rawId: number, etage: string, r
|
|
82
82
|
createDatenpunktSingle(adapter, rawId, attributeTypeString, attributeEtage, etage, category);
|
83
83
|
createDatenpunktSingle(adapter, rawId, attributeTypeString, attributeRaum, raum, category);
|
84
84
|
createDatenpunktSingle(adapter, rawId, attributeTypeString, attributeDevice, device, category);
|
85
|
+
this.clearShellyCaches(adapter);
|
85
86
|
}
|
86
87
|
|
87
88
|
function createDatenpunktSingle(adapter: any, deviceRawId, attributeType, attributeName, attributeValue, category) {
|
88
|
-
|
89
|
+
let stateDatenpunkt = "0_userdata.0.devices.shelly." + category + "." + deviceRawId + "." + attributeName;
|
89
90
|
adapter.createState(stateDatenpunkt, attributeValue, {
|
90
91
|
name: "S" + deviceRawId.toString().padStart(2, '0'),
|
91
92
|
desc: "",
|
@@ -102,6 +103,7 @@ export function createShellySensor(adapter: any, rawId: number, etage: string,
|
|
102
103
|
|
103
104
|
// Allgemein:
|
104
105
|
createShellyDevice(adapter, rawId, etage, raum, device, baseState, deviceShellySensor);
|
106
|
+
this.clearShellyCaches(adapter);
|
105
107
|
}
|
106
108
|
|
107
109
|
// Lampe RGB:
|
@@ -109,6 +111,7 @@ export function createShellyLampeRGB(adapter: any, rawId: number, etage: string
|
|
109
111
|
|
110
112
|
// Allgemein:
|
111
113
|
createShellyDevice(adapter, rawId, etage, raum, device, baseState, deviceShellyLampeRGB);
|
114
|
+
this.clearShellyCaches(adapter);
|
112
115
|
}
|
113
116
|
|
114
117
|
// Rollladen:
|
@@ -116,6 +119,7 @@ export function createShellyRollladen(adapter: any, rawId: number, etage: strin
|
|
116
119
|
|
117
120
|
// Allgemein:
|
118
121
|
createShellyDevice(adapter, rawId, etage, raum, device, baseState, deviceShellyRollladen);
|
122
|
+
this.clearShellyCaches(adapter);
|
119
123
|
}
|
120
124
|
|
121
125
|
// Dimmer:
|
@@ -213,7 +217,7 @@ export function createShellyDimmer(adapter: any, rawId: number, etage: string,
|
|
213
217
|
}
|
214
218
|
|
215
219
|
// alexaSmartNamesForOn:string[]
|
216
|
-
|
220
|
+
let db_alexaSmartNamesForOn = null;
|
217
221
|
alexaSmartNamesForOn.forEach(value => {
|
218
222
|
if (db_alexaSmartNamesForOn == null) {
|
219
223
|
// @ts-ignore
|
@@ -226,7 +230,7 @@ export function createShellyDimmer(adapter: any, rawId: number, etage: string,
|
|
226
230
|
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_AlexaSmartNamesForOn, db_alexaSmartNamesForOn, deviceShellyDimmer);
|
227
231
|
|
228
232
|
// alexaActionNamesForOn:string[]
|
229
|
-
|
233
|
+
let db_alexaActionNamesForOn = null;
|
230
234
|
alexaActionNamesForOn.forEach(value => {
|
231
235
|
if (db_alexaActionNamesForOn == null) {
|
232
236
|
// @ts-ignore
|
@@ -239,7 +243,7 @@ export function createShellyDimmer(adapter: any, rawId: number, etage: string,
|
|
239
243
|
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_AlexaActionNamesForOn, db_alexaActionNamesForOn, deviceShellyDimmer);
|
240
244
|
|
241
245
|
// alexaSmartNamesForOff:string[]
|
242
|
-
|
246
|
+
let db_alexaSmartNamesForOff = null;
|
243
247
|
alexaSmartNamesForOff.forEach(value => {
|
244
248
|
if (db_alexaSmartNamesForOff == null) {
|
245
249
|
// @ts-ignore
|
@@ -252,7 +256,7 @@ export function createShellyDimmer(adapter: any, rawId: number, etage: string,
|
|
252
256
|
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_AlexaSmartNamesForOff, db_alexaSmartNamesForOff, deviceShellyDimmer);
|
253
257
|
|
254
258
|
// alexaActionNamesForOff:string[]
|
255
|
-
|
259
|
+
let db_alexaActionNamesForOff = null;
|
256
260
|
alexaActionNamesForOff.forEach(value => {
|
257
261
|
if (db_alexaActionNamesForOff == null) {
|
258
262
|
// @ts-ignore
|
@@ -265,7 +269,7 @@ export function createShellyDimmer(adapter: any, rawId: number, etage: string,
|
|
265
269
|
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_AlexaActionNamesForOff, db_alexaActionNamesForOff, deviceShellyDimmer);
|
266
270
|
|
267
271
|
// additionalStates4TurnOff: string[]
|
268
|
-
|
272
|
+
let db_additionalStates4TurnOff = null;
|
269
273
|
tasterBooleanOff.forEach(value => {
|
270
274
|
if (db_additionalStates4TurnOff == null) {
|
271
275
|
// @ts-ignore
|
@@ -283,6 +287,7 @@ export function createShellyDimmer(adapter: any, rawId: number, etage: string,
|
|
283
287
|
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOffExitHouseWinter, turnOffExitHouseWinter, deviceShellyDimmer);
|
284
288
|
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOnEnterHouseSummer, turnOnEnterHouseSummer, deviceShellyDimmer);
|
285
289
|
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOnEnterHouseWinter, turnOnEnterHouseWinter, deviceShellyDimmer);
|
290
|
+
this.clearShellyCaches(adapter);
|
286
291
|
}
|
287
292
|
|
288
293
|
// Lampe Weiss:
|
@@ -298,7 +303,7 @@ export function createShellyLampe(adapter:any, rawId: number, etage: string, rau
|
|
298
303
|
createDatenpunktSingle(adapter, rawId, attributeTypeNumber, attributeChannel, channel, deviceShellyLampeWeiss);
|
299
304
|
|
300
305
|
// alexaSmartNamesForOn:string[]
|
301
|
-
|
306
|
+
let db_alexaSmartNamesForOn = null;
|
302
307
|
alexaSmartNamesForOn.forEach(value => {
|
303
308
|
if (db_alexaSmartNamesForOn == null) {
|
304
309
|
// @ts-ignore
|
@@ -311,7 +316,7 @@ export function createShellyLampe(adapter:any, rawId: number, etage: string, rau
|
|
311
316
|
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_AlexaSmartNamesForOn, db_alexaSmartNamesForOn, deviceShellyLampeWeiss);
|
312
317
|
|
313
318
|
// alexaActionNamesForOn:string[]
|
314
|
-
|
319
|
+
let db_alexaActionNamesForOn = null;
|
315
320
|
alexaActionNamesForOn.forEach(value => {
|
316
321
|
if (db_alexaActionNamesForOn == null) {
|
317
322
|
// @ts-ignore
|
@@ -324,7 +329,7 @@ export function createShellyLampe(adapter:any, rawId: number, etage: string, rau
|
|
324
329
|
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_AlexaActionNamesForOn, db_alexaActionNamesForOn, deviceShellyLampeWeiss);
|
325
330
|
|
326
331
|
// alexaSmartNamesForOff:string[]
|
327
|
-
|
332
|
+
let db_alexaSmartNamesForOff = null;
|
328
333
|
alexaSmartNamesForOff.forEach(value => {
|
329
334
|
if (db_alexaSmartNamesForOff == null) {
|
330
335
|
// @ts-ignore
|
@@ -337,7 +342,7 @@ export function createShellyLampe(adapter:any, rawId: number, etage: string, rau
|
|
337
342
|
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_AlexaSmartNamesForOff, db_alexaSmartNamesForOff, deviceShellyLampeWeiss);
|
338
343
|
|
339
344
|
// alexaActionNamesForOff:string[]
|
340
|
-
|
345
|
+
let db_alexaActionNamesForOff = null;
|
341
346
|
alexaActionNamesForOff.forEach(value => {
|
342
347
|
if (db_alexaActionNamesForOff == null) {
|
343
348
|
// @ts-ignore
|
@@ -350,7 +355,7 @@ export function createShellyLampe(adapter:any, rawId: number, etage: string, rau
|
|
350
355
|
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_AlexaActionNamesForOff, db_alexaActionNamesForOff, deviceShellyLampeWeiss);
|
351
356
|
|
352
357
|
// additionalStates4TurnOn: string[]
|
353
|
-
|
358
|
+
let db_additionalStates4TurnOn = null;
|
354
359
|
additionalStates4TurnOn.forEach(value => {
|
355
360
|
if (db_additionalStates4TurnOn == null) {
|
356
361
|
// @ts-ignore
|
@@ -363,7 +368,7 @@ export function createShellyLampe(adapter:any, rawId: number, etage: string, rau
|
|
363
368
|
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_TasterBooleanOn, db_additionalStates4TurnOn, deviceShellyLampeWeiss);
|
364
369
|
|
365
370
|
// additionalStates4TurnOff: string[]
|
366
|
-
|
371
|
+
let db_additionalStates4TurnOff = null;
|
367
372
|
additionalStates4TurnOff.forEach(value => {
|
368
373
|
if (db_additionalStates4TurnOff == null) {
|
369
374
|
// @ts-ignore
|
@@ -381,6 +386,7 @@ export function createShellyLampe(adapter:any, rawId: number, etage: string, rau
|
|
381
386
|
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOffExitHouseWinter, turnOffExitHouseWinter, deviceShellyLampeWeiss);
|
382
387
|
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOnEnterHouseSummer, turnOnEnterHouseSummer, deviceShellyLampeWeiss);
|
383
388
|
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOnEnterHouseWinter, turnOnEnterHouseWinter, deviceShellyLampeWeiss);
|
389
|
+
this.clearShellyCaches(adapter);
|
384
390
|
}
|
385
391
|
|
386
392
|
// Steckdose:
|
@@ -396,7 +402,7 @@ export function createShellySteckdose(adapter:any, rawId: number, etage: string,
|
|
396
402
|
createDatenpunktSingle(adapter, rawId, attributeTypeNumber, attributeChannel, channel, deviceShellySteckdose);
|
397
403
|
|
398
404
|
// alexaSmartNamesForOn:string[]
|
399
|
-
|
405
|
+
let db_alexaSmartNamesForOn = null;
|
400
406
|
alexaSmartNamesForOn.forEach(value => {
|
401
407
|
if (db_alexaSmartNamesForOn == null) {
|
402
408
|
// @ts-ignore
|
@@ -409,7 +415,7 @@ export function createShellySteckdose(adapter:any, rawId: number, etage: string,
|
|
409
415
|
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_AlexaSmartNamesForOn, db_alexaSmartNamesForOn, deviceShellySteckdose);
|
410
416
|
|
411
417
|
// alexaActionNamesForOn:string[]
|
412
|
-
|
418
|
+
let db_alexaActionNamesForOn = null;
|
413
419
|
alexaActionNamesForOn.forEach(value => {
|
414
420
|
if (db_alexaActionNamesForOn == null) {
|
415
421
|
// @ts-ignore
|
@@ -422,7 +428,7 @@ export function createShellySteckdose(adapter:any, rawId: number, etage: string,
|
|
422
428
|
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_AlexaActionNamesForOn, db_alexaActionNamesForOn, deviceShellySteckdose);
|
423
429
|
|
424
430
|
// alexaSmartNamesForOff:string[]
|
425
|
-
|
431
|
+
let db_alexaSmartNamesForOff = null;
|
426
432
|
alexaSmartNamesForOff.forEach(value => {
|
427
433
|
if (db_alexaSmartNamesForOff == null) {
|
428
434
|
// @ts-ignore
|
@@ -435,7 +441,7 @@ export function createShellySteckdose(adapter:any, rawId: number, etage: string,
|
|
435
441
|
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_AlexaSmartNamesForOff, db_alexaSmartNamesForOff, deviceShellySteckdose);
|
436
442
|
|
437
443
|
// alexaActionNamesForOff:string[]
|
438
|
-
|
444
|
+
let db_alexaActionNamesForOff = null;
|
439
445
|
alexaActionNamesForOff.forEach(value => {
|
440
446
|
if (db_alexaActionNamesForOff == null) {
|
441
447
|
// @ts-ignore
|
@@ -448,7 +454,7 @@ export function createShellySteckdose(adapter:any, rawId: number, etage: string,
|
|
448
454
|
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_AlexaActionNamesForOff, db_alexaActionNamesForOff, deviceShellySteckdose);
|
449
455
|
|
450
456
|
// additionalStates4TurnOn: string[]
|
451
|
-
|
457
|
+
let db_additionalStates4TurnOn = null;
|
452
458
|
additionalStates4TurnOn.forEach(value => {
|
453
459
|
if (db_additionalStates4TurnOn == null) {
|
454
460
|
// @ts-ignore
|
@@ -461,7 +467,7 @@ export function createShellySteckdose(adapter:any, rawId: number, etage: string,
|
|
461
467
|
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_TasterBooleanOn, db_additionalStates4TurnOn, deviceShellySteckdose);
|
462
468
|
|
463
469
|
// additionalStates4TurnOff: string[]
|
464
|
-
|
470
|
+
let db_additionalStates4TurnOff = null;
|
465
471
|
additionalStates4TurnOff.forEach(value => {
|
466
472
|
if (db_additionalStates4TurnOff == null) {
|
467
473
|
// @ts-ignore
|
@@ -479,6 +485,7 @@ export function createShellySteckdose(adapter:any, rawId: number, etage: string,
|
|
479
485
|
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOffExitHouseWinter, turnOffExitHouseWinter, deviceShellySteckdose);
|
480
486
|
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOnEnterHouseSummer, turnOnEnterHouseSummer, deviceShellySteckdose);
|
481
487
|
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOnEnterHouseWinter, turnOnEnterHouseWinter, deviceShellySteckdose);
|
488
|
+
this.clearShellyCaches(adapter);
|
482
489
|
}
|
483
490
|
|
484
491
|
var cacheRollladenArray = null;
|
@@ -489,7 +496,7 @@ export function loadShellyRollladen(adapter: any) {
|
|
489
496
|
// @ts-ignore
|
490
497
|
cacheRollladenArray = [];
|
491
498
|
adapter.$('state[id=0_userdata.0.devices.shelly.*.*.category]').each(datenpunktKey => {
|
492
|
-
|
499
|
+
let datenpunktPraefix = datenpunktKey.replaceAll(".category", "");
|
493
500
|
if (adapter.getState(datenpunktKey).val == deviceShellyRollladen) {
|
494
501
|
// @ts-ignore
|
495
502
|
cacheRollladenArray.push(new ShellyRollladen(adapter,
|
@@ -513,7 +520,7 @@ export function loadShellySensoren(adapter: any) {
|
|
513
520
|
// @ts-ignore
|
514
521
|
cacheSensorenArray = [];
|
515
522
|
adapter.$('state[id=0_userdata.0.devices.shelly.*.*.category]').each(datenpunktKey => {
|
516
|
-
|
523
|
+
let datenpunktPraefix = datenpunktKey.replaceAll(".category", "");
|
517
524
|
if (adapter.getState(datenpunktKey).val == deviceShellySensor) {
|
518
525
|
// @ts-ignore
|
519
526
|
cacheSensorenArray.push(new ShellySensor(adapter,
|
@@ -562,11 +569,11 @@ export function loadShellyDimmer(adapter: any) {
|
|
562
569
|
// @ts-ignore
|
563
570
|
cacheDimmerArray = [];
|
564
571
|
adapter.$('state[id=0_userdata.0.devices.shelly.*.*.category]').each(datenpunktKey => {
|
565
|
-
|
572
|
+
let datenpunktPraefix = datenpunktKey.replaceAll(".category", "");
|
566
573
|
if (adapter.getState(datenpunktKey).val == deviceShellyDimmer) {
|
567
574
|
|
568
575
|
// Einschalt-Scheme:
|
569
|
-
|
576
|
+
let alexaOnScheme = null;
|
570
577
|
if (adapter.getState(datenpunktPraefix + "." + attributeDimmer_alexaScheme_aktiv ).val == true) {
|
571
578
|
// @ts-ignore
|
572
579
|
alexaOnScheme = new ShellyDimmerAlexaScheme(null,
|
@@ -575,7 +582,7 @@ export function loadShellyDimmer(adapter: any) {
|
|
575
582
|
}
|
576
583
|
|
577
584
|
// Weitere Schemes als Array:
|
578
|
-
|
585
|
+
let schemeArray = [];
|
579
586
|
|
580
587
|
// alexaScheme1: InstanceType<typeof ShellyDimmerAlexaScheme>
|
581
588
|
if (adapter.getState(datenpunktPraefix + "." + attributeDimmer_alexaScheme_aktiv1 ).val == true) {
|
@@ -614,7 +621,7 @@ export function loadShellyDimmer(adapter: any) {
|
|
614
621
|
}
|
615
622
|
|
616
623
|
// Weitere Schemes als Array:
|
617
|
-
|
624
|
+
let tasterSchemeArray = [];
|
618
625
|
|
619
626
|
// tasterScheme1: InstanceType<typeof ShellyDimmerTasterScheme>
|
620
627
|
if (adapter.getState(datenpunktPraefix + "." + attributeDimmer_tasterScheme_aktiv1 ).val == true) {
|
@@ -688,7 +695,7 @@ export function loadShellyLampenWeiss(adapter: any) {
|
|
688
695
|
cacheLampenWeissArray = [];
|
689
696
|
|
690
697
|
adapter.$('state[id=0_userdata.0.devices.shelly.*.*.category]').each(datenpunktKey => {
|
691
|
-
|
698
|
+
let datenpunktPraefix = datenpunktKey.replaceAll(".category", "");
|
692
699
|
if (adapter.getState(datenpunktKey).val == deviceShellyLampeWeiss) {
|
693
700
|
|
694
701
|
// @ts-ignore
|
@@ -726,7 +733,7 @@ export function loadShellySteckdosen(adapter: any) {
|
|
726
733
|
cacheSteckdosenArray = [];
|
727
734
|
|
728
735
|
adapter.$('state[id=0_userdata.0.devices.shelly.*.*.category]').each(datenpunktKey => {
|
729
|
-
|
736
|
+
let datenpunktPraefix = datenpunktKey.replaceAll(".category", "");
|
730
737
|
if (adapter.getState(datenpunktKey).val == deviceShellySteckdose) {
|
731
738
|
|
732
739
|
// @ts-ignore
|
@@ -762,7 +769,7 @@ export function loadShellyDevicesAll(adapter: any) {
|
|
762
769
|
//}
|
763
770
|
|
764
771
|
// @ts-ignore
|
765
|
-
|
772
|
+
let shellyAllArray = [];
|
766
773
|
|
767
774
|
adapter.loadShellyLampenWeiss(adapter).forEach(shelly => {
|
768
775
|
// @ts-ignore
|
@@ -789,7 +796,7 @@ export function loadShellyDevicesAll(adapter: any) {
|
|
789
796
|
}
|
790
797
|
|
791
798
|
function toStringArray(databaseValue) { // z.B. "Werkbank|Arbeiten|Keller"
|
792
|
-
|
799
|
+
let stringArray = [];
|
793
800
|
if (databaseValue == null) {
|
794
801
|
return stringArray;
|
795
802
|
} else {
|
@@ -809,34 +816,34 @@ function clearShellyCaches(adapter: any) {
|
|
809
816
|
|
810
817
|
function sortArray(inputArray) {
|
811
818
|
inputArray.sort((a,b) => {
|
812
|
-
|
813
|
-
|
819
|
+
let elementA = a;
|
820
|
+
let elementB = b;
|
814
821
|
|
815
|
-
|
816
|
-
|
817
|
-
|
822
|
+
let etageA = elementA.getEtage();
|
823
|
+
let etageB = elementB.getEtage();
|
824
|
+
let compareEtage = getEtageSortIndex(etageA).localeCompare(getEtageSortIndex(etageB));
|
818
825
|
if (compareEtage != 0) {
|
819
826
|
return compareEtage;
|
820
827
|
}
|
821
828
|
|
822
|
-
|
823
|
-
|
824
|
-
|
829
|
+
let typA = elementA.getCategory();
|
830
|
+
let typB = elementB.getCategory();
|
831
|
+
let compareTyp = typA.localeCompare(typB);
|
825
832
|
if (compareTyp != 0) {
|
826
833
|
return compareTyp;
|
827
834
|
}
|
828
835
|
|
829
836
|
|
830
|
-
|
831
|
-
|
832
|
-
|
837
|
+
let raumA = elementA.getRaum();
|
838
|
+
let raumB = elementB.getRaum();
|
839
|
+
let compareRaum = raumA.localeCompare(raumB);
|
833
840
|
if (compareRaum != 0) {
|
834
841
|
return compareRaum;
|
835
842
|
}
|
836
843
|
|
837
|
-
|
838
|
-
|
839
|
-
|
844
|
+
let deviceA = elementA.getDevice();
|
845
|
+
let deviceB = elementB.getDevice();
|
846
|
+
let compareDevice = deviceA.localeCompare(deviceB);
|
840
847
|
if (compareDevice != 0) {
|
841
848
|
return compareDevice;
|
842
849
|
}
|