iobroker-ucl 1.1.8 → 1.1.10
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/!!!_INSTRUCTIONS_!!!.ts +6 -2
- package/homematicClasses.js +448 -72
- package/homematicClasses.ts +515 -74
- package/homematicFunctions.js +349 -4
- package/homematicFunctions.ts +410 -8
- package/main.js +36 -2
- package/main.ts +12 -3
- package/package.json +12 -12
- package/shellyClasses.js +756 -0
- package/shellyClasses.ts +873 -0
- package/shellyFunctions.js +694 -0
- package/shellyFunctions.ts +778 -0
- package/test.js +8 -9
- package/test.ts +8 -9
- package/zigbeeFunctions.js +0 -1
- package/zigbeeFunctions.ts +0 -2
package/homematicClasses.ts
CHANGED
@@ -83,8 +83,126 @@ export abstract class AbstractHomematic {
|
|
83
83
|
return this.adapter.getState(this.baseState + ".0.RSSI_DEVICE").val;
|
84
84
|
}
|
85
85
|
|
86
|
+
protected createIOTAdapterSmartDevices(smartName) {
|
87
|
+
|
88
|
+
// Level:
|
89
|
+
// ----------------------------------------------------------------------------------
|
90
|
+
var alexaLampeLevel = "0_userdata.0.alexa." + smartName + ".level";
|
91
|
+
this.adapter.createState(alexaLampeLevel, 0, {
|
92
|
+
name: alexaLampeLevel,
|
93
|
+
desc: alexaLampeLevel,
|
94
|
+
type: 'number',
|
95
|
+
read: true,
|
96
|
+
write: true
|
97
|
+
});
|
98
|
+
|
99
|
+
// @ts-ignore
|
100
|
+
let objLevel = this.adapter.getObject(alexaLampeLevel) as unknown as iobJS.StateObject;
|
101
|
+
objLevel.common = {
|
102
|
+
"type": "number",
|
103
|
+
"name": alexaLampeLevel,
|
104
|
+
"read": true,
|
105
|
+
"write": true,
|
106
|
+
"role": "level.dimmer",
|
107
|
+
"min": 0,
|
108
|
+
"max": 100,
|
109
|
+
"def": 0,
|
110
|
+
"smartName": {
|
111
|
+
"de": smartName,
|
112
|
+
"smartType": "LIGHT"
|
113
|
+
}
|
114
|
+
};
|
115
|
+
this.adapter.setObject(alexaLampeLevel, objLevel);
|
116
|
+
|
117
|
+
// HUE:
|
118
|
+
// ----------------------------------------------------------------------------------
|
119
|
+
var alexaLampeHue = "0_userdata.0.alexa." + smartName + ".hue";
|
120
|
+
this.adapter.createState(alexaLampeHue, 0, {
|
121
|
+
name: alexaLampeHue,
|
122
|
+
desc: alexaLampeHue,
|
123
|
+
type: 'number',
|
124
|
+
read: true,
|
125
|
+
write: true
|
126
|
+
});
|
127
|
+
// @ts-ignore
|
128
|
+
let objHue = this.adapter.getObject(alexaLampeHue) as unknown as iobJS.StateObject;
|
129
|
+
objHue.common = {
|
130
|
+
"name": alexaLampeHue,
|
131
|
+
"desc": alexaLampeHue,
|
132
|
+
"type": "number",
|
133
|
+
"read": true,
|
134
|
+
"write": true,
|
135
|
+
"role": "level.color.hue", // <---- Das ist wichtig, ohne dieses Common-Zeugs würde hier "state" stehen und die ALexa-App würde dieses Gerär nicht als "Farbe-Lampe" akzeptieren/erkennen
|
136
|
+
"smartName": {
|
137
|
+
"de": smartName,
|
138
|
+
"smartType": "LIGHT"
|
139
|
+
}
|
140
|
+
};
|
141
|
+
this.adapter.setObject(alexaLampeHue, objHue);
|
142
|
+
|
143
|
+
// SAT:
|
144
|
+
// ----------------------------------------------------------------------------------
|
145
|
+
var alexaLampeSat = "0_userdata.0.alexa." + smartName + ".sat";
|
146
|
+
this.adapter.createState(alexaLampeSat, 0, {
|
147
|
+
name: alexaLampeSat,
|
148
|
+
desc: alexaLampeSat,
|
149
|
+
type: 'number',
|
150
|
+
read: true,
|
151
|
+
write: true
|
152
|
+
});
|
153
|
+
// @ts-ignore
|
154
|
+
let obSat = this.adapter.getObject(alexaLampeSat) as unknown as iobJS.StateObject;
|
155
|
+
obSat.common = {
|
156
|
+
"name": alexaLampeSat,
|
157
|
+
"desc": alexaLampeSat,
|
158
|
+
"type": "number",
|
159
|
+
"read": true,
|
160
|
+
"write": true,
|
161
|
+
"role": "level.color.saturation", // <---- Das ist wichtig, ohne dieses Common-Zeugs würde hier "state" stehen und die ALexa-App würde dieses Gerär nicht als "Farbe-Lampe" akzeptieren/erkennen
|
162
|
+
"smartName": {
|
163
|
+
"de": smartName,
|
164
|
+
"smartType": "LIGHT"
|
165
|
+
}
|
166
|
+
};
|
167
|
+
this.adapter.setObject(alexaLampeSat, obSat);
|
168
|
+
|
169
|
+
// CT:
|
170
|
+
// ----------------------------------------------------------------------------------
|
171
|
+
var alexaLampeCT = "0_userdata.0.alexa." + smartName + ".ct";
|
172
|
+
this.adapter.createState(alexaLampeCT, 0, {
|
173
|
+
name: alexaLampeCT,
|
174
|
+
desc: alexaLampeCT,
|
175
|
+
type: 'number',
|
176
|
+
read: true,
|
177
|
+
write: true
|
178
|
+
});
|
179
|
+
// @ts-ignore
|
180
|
+
let objCT = this.adapter.getObject(alexaLampeCT) as unknown as iobJS.StateObject;
|
181
|
+
objCT.common = {
|
182
|
+
"type": "number",
|
183
|
+
"name": alexaLampeCT,
|
184
|
+
"read": true,
|
185
|
+
"write": true,
|
186
|
+
"role": "level.color.temperature",
|
187
|
+
"smartName": {
|
188
|
+
"de": smartName,
|
189
|
+
"smartType": "LIGHT"
|
190
|
+
}
|
191
|
+
};
|
192
|
+
this.adapter.setObject(alexaLampeCT, objCT);
|
193
|
+
}
|
194
|
+
|
86
195
|
abstract getCategory(): string;
|
196
|
+
}
|
87
197
|
|
198
|
+
export class HomematicWandtaster extends AbstractHomematic {
|
199
|
+
constructor(adapter: any, id: number, baseState: string, etage: string, raum: string, device: string) {
|
200
|
+
super(adapter, id, baseState, etage, raum, device);
|
201
|
+
}
|
202
|
+
|
203
|
+
public getCategory(): string {
|
204
|
+
return deviceHomematicWandtaster;
|
205
|
+
}
|
88
206
|
}
|
89
207
|
|
90
208
|
export class HomematicWandthermostat extends AbstractHomematic {
|
@@ -160,6 +278,13 @@ export class HomematicWindow extends AbstractHomematic {
|
|
160
278
|
public isStatusBattery(): boolean {
|
161
279
|
return !this.adapter.getState(this.baseState + ".0.LOW_BAT").val; // // hm-rpc.0.000A9BE993E2F7.0.LOW_BAT
|
162
280
|
}
|
281
|
+
|
282
|
+
public isOpen(): boolean {
|
283
|
+
if (this.adapter.getState(this.baseState + ".1.STATE").val == 0) {
|
284
|
+
return false;
|
285
|
+
}
|
286
|
+
return true;
|
287
|
+
}
|
163
288
|
}
|
164
289
|
|
165
290
|
export class HomematicSteckdose extends AbstractHomematic {
|
@@ -170,6 +295,13 @@ export class HomematicSteckdose extends AbstractHomematic {
|
|
170
295
|
public getCategory(): string {
|
171
296
|
return deviceHomematicSteckdose;
|
172
297
|
}
|
298
|
+
|
299
|
+
public isSwitchedOn(): boolean {
|
300
|
+
if (this.adapter.getState(this.baseState + ".3.STATE").val == false) { // hm-rpc.1.00021D8999C78B.3.STATE
|
301
|
+
return false;
|
302
|
+
}
|
303
|
+
return true;
|
304
|
+
}
|
173
305
|
}
|
174
306
|
|
175
307
|
export class HomematicHeizkoerper extends AbstractHomematic {
|
@@ -181,21 +313,280 @@ export class HomematicHeizkoerper extends AbstractHomematic {
|
|
181
313
|
return deviceHomematicHeizkoerper;
|
182
314
|
}
|
183
315
|
|
316
|
+
public getTemperatureIst() : number {
|
317
|
+
return this.adapter.getState(this.baseState + ".1.ACTUAL_TEMPERATURE").val; // hm-rpc.0.000A9BE9A03005.1.ACTUAL_TEMPERATURE
|
318
|
+
}
|
319
|
+
|
320
|
+
public getTemperatureSoll() : number {
|
321
|
+
return this.adapter.getState(this.baseState + ".1.SET_POINT_TEMPERATURE").val; // hm-rpc.0.000A9BE9A03005.1.SET_POINT_TEMPERATURE
|
322
|
+
}
|
323
|
+
|
184
324
|
public isStatusBattery(): boolean {
|
185
325
|
return !this.adapter.getState(this.baseState + ".0.LOW_BAT").val; // // hm-rpc.0.000A9BE993E2F7.0.LOW_BAT
|
186
326
|
}
|
187
327
|
}
|
188
328
|
|
329
|
+
export class DimmerAlexaScheme {
|
330
|
+
protected alexaName: string;
|
331
|
+
protected level: number;
|
332
|
+
protected device: HomematicDimmer;
|
333
|
+
|
334
|
+
constructor(alexaName: string, level: number) {
|
335
|
+
this.alexaName = alexaName;
|
336
|
+
this.level = level;
|
337
|
+
}
|
338
|
+
|
339
|
+
public getAlexaName() : string {
|
340
|
+
return this.alexaName;
|
341
|
+
}
|
342
|
+
|
343
|
+
public getLevel() : number {
|
344
|
+
return this.level;
|
345
|
+
}
|
346
|
+
|
347
|
+
public setDevice(device: HomematicDimmer) {
|
348
|
+
this.device = device;
|
349
|
+
}
|
350
|
+
|
351
|
+
public getDevice() : HomematicDimmer {
|
352
|
+
return this.device;
|
353
|
+
}
|
354
|
+
}
|
355
|
+
|
356
|
+
export class DimmerTasterScheme {
|
357
|
+
protected tasterBooleanOn: string;
|
358
|
+
protected level: number;
|
359
|
+
|
360
|
+
constructor(tasterBooleanOn: string, level: number) {
|
361
|
+
this.tasterBooleanOn = tasterBooleanOn;
|
362
|
+
this.level = level;
|
363
|
+
}
|
364
|
+
|
365
|
+
public getTasterBooleanOnName() : string {
|
366
|
+
return this.tasterBooleanOn;
|
367
|
+
}
|
368
|
+
|
369
|
+
public getLevel() : number {
|
370
|
+
return this.level;
|
371
|
+
}
|
372
|
+
}
|
373
|
+
|
189
374
|
export class HomematicDimmer extends AbstractHomematic {
|
190
|
-
|
191
|
-
|
375
|
+
protected alexaLevelSchemeForOn: DimmerAlexaScheme;
|
376
|
+
protected alexaSmartNamesForOn:string[];
|
377
|
+
protected alexaSmartNamesForOff: string[];
|
378
|
+
protected alexaActionNamesForOn:string[];
|
379
|
+
protected alexaActionNamesForOff: string[];
|
380
|
+
|
381
|
+
protected tasterBooleanOn: DimmerTasterScheme[];
|
382
|
+
protected tasterBooleanOff: string[];
|
383
|
+
protected levelSchemes: DimmerAlexaScheme[];
|
384
|
+
|
385
|
+
private nachtbeleuchtung:boolean;
|
386
|
+
private turnOffExitHouseSummer:boolean;
|
387
|
+
private turnOffExitHouseWinter:boolean;
|
388
|
+
private turnOnEnterHouseSummer:boolean;
|
389
|
+
private turnOnEnterHouseWinter:boolean;
|
390
|
+
|
391
|
+
constructor(adapter:any, id: number, baseState: string, etage: string, raum: string, device: string, alexaSmartNamesForOn:string[], alexaActionNamesForOn:string[], alexaLevelSchemeForOn: DimmerAlexaScheme, alexaSmartNamesForOff: string[],alexaActionNamesForOff: string[], levelSchemes: DimmerAlexaScheme[], tasterBooleanOn: DimmerTasterScheme[], tasterBooleanOff: string[], nachtbeleuchtung:boolean, turnOffExitHouseSummer:boolean, turnOffExitHouseWinter:boolean, turnOnEnterHouseSummer:boolean, turnOnEnterHouseWinter:boolean) {
|
392
|
+
super(adapter, id, baseState, etage, raum, device);
|
393
|
+
this.alexaLevelSchemeForOn = alexaLevelSchemeForOn;
|
394
|
+
this.levelSchemes = levelSchemes;
|
395
|
+
this.tasterBooleanOn = tasterBooleanOn;
|
396
|
+
this.tasterBooleanOff = tasterBooleanOff;
|
397
|
+
this.alexaSmartNamesForOn = alexaSmartNamesForOn;
|
398
|
+
this.alexaSmartNamesForOff = alexaSmartNamesForOff;
|
399
|
+
this.alexaActionNamesForOn = alexaActionNamesForOn;
|
400
|
+
this.alexaActionNamesForOff = alexaActionNamesForOff;
|
401
|
+
this.nachtbeleuchtung = nachtbeleuchtung;
|
402
|
+
this.turnOffExitHouseSummer = turnOffExitHouseSummer;
|
403
|
+
this.turnOffExitHouseWinter = turnOffExitHouseWinter;
|
404
|
+
this.turnOnEnterHouseSummer = turnOnEnterHouseSummer;
|
405
|
+
this.turnOnEnterHouseWinter = turnOnEnterHouseWinter;
|
406
|
+
|
407
|
+
this.levelSchemes.forEach(colorscheme => {
|
408
|
+
colorscheme.setDevice(this);
|
409
|
+
if (colorscheme.getAlexaName() != null) {
|
410
|
+
this.createState(colorscheme.getAlexaName());
|
411
|
+
}
|
412
|
+
});
|
413
|
+
if (this.alexaLevelSchemeForOn != null) {
|
414
|
+
this.alexaLevelSchemeForOn.setDevice(this);
|
415
|
+
if (alexaLevelSchemeForOn.getAlexaName() != null) {
|
416
|
+
this.createState(alexaLevelSchemeForOn.getAlexaName());
|
417
|
+
}
|
418
|
+
}
|
419
|
+
this.tasterBooleanOn.forEach(tasterScheme => {
|
420
|
+
if (tasterScheme.getTasterBooleanOnName() != null) {
|
421
|
+
this.createState(tasterScheme.getTasterBooleanOnName());
|
422
|
+
}
|
423
|
+
});
|
424
|
+
this.tasterBooleanOff.forEach(offName => {
|
425
|
+
this.createState(offName);
|
426
|
+
});
|
427
|
+
|
428
|
+
this.alexaSmartNamesForOn.forEach(alexaSmartName => {
|
429
|
+
this.createIOTAdapterSmartDevices(alexaSmartName);
|
430
|
+
});
|
431
|
+
this.alexaSmartNamesForOff.forEach(alexaSmartName => {
|
432
|
+
this.createIOTAdapterSmartDevices(alexaSmartName);
|
433
|
+
});
|
434
|
+
this.alexaActionNamesForOn.forEach(alexaSmartName => {
|
435
|
+
this.createIOTAdapterSmartDevices(alexaSmartName);
|
436
|
+
});
|
437
|
+
this.alexaActionNamesForOff.forEach(alexaSmartName => {
|
438
|
+
this.createIOTAdapterSmartDevices(alexaSmartName);
|
439
|
+
});
|
440
|
+
|
441
|
+
this.levelSchemes.forEach(scheme => {
|
442
|
+
if (scheme.getAlexaName() != null) {
|
443
|
+
this.createIOTAdapterSmartDevices(scheme.getAlexaName());
|
444
|
+
}
|
445
|
+
});
|
446
|
+
}
|
447
|
+
|
448
|
+
public isNachtbeleuchtung() : boolean {
|
449
|
+
return this.nachtbeleuchtung;
|
450
|
+
}
|
451
|
+
|
452
|
+
public isTurnOffExitHouseSummer() : boolean {
|
453
|
+
return this.turnOffExitHouseSummer;
|
454
|
+
}
|
455
|
+
|
456
|
+
public isTurnOffExitHouseWinter() : boolean {
|
457
|
+
return this.turnOffExitHouseWinter;
|
458
|
+
}
|
459
|
+
|
460
|
+
public isTurnOnEnterHouseSummer() : boolean {
|
461
|
+
return this.turnOnEnterHouseSummer;
|
462
|
+
}
|
463
|
+
|
464
|
+
public isTurnOnEnterHouseWinter() : boolean {
|
465
|
+
return this.turnOnEnterHouseWinter;
|
466
|
+
}
|
467
|
+
|
468
|
+
private createState(key_in) {
|
469
|
+
var key = key_in;//.replace(/\./g,'_'); // wegen Wohnzimmer T.V.
|
470
|
+
var jarvisDatenpunkt = key;
|
471
|
+
this.adapter.createState(jarvisDatenpunkt, false, {
|
472
|
+
name: key,
|
473
|
+
desc: key,
|
474
|
+
type: 'boolean',
|
475
|
+
read: true,
|
476
|
+
write: true
|
477
|
+
});
|
478
|
+
}
|
479
|
+
|
480
|
+
public getTasterBooleanOn(): DimmerTasterScheme[] {
|
481
|
+
return this.tasterBooleanOn;
|
482
|
+
}
|
483
|
+
|
484
|
+
public getTasterBooleanOff(): string[] {
|
485
|
+
return this.tasterBooleanOff;
|
486
|
+
}
|
487
|
+
|
488
|
+
public getAlexaSchemeForOn(): DimmerAlexaScheme {
|
489
|
+
return this.alexaLevelSchemeForOn;
|
490
|
+
}
|
491
|
+
|
492
|
+
public getAlexaSmartNamesForOn() : string[] {
|
493
|
+
return this.alexaSmartNamesForOn;
|
494
|
+
}
|
495
|
+
|
496
|
+
public getAlexaSmartNamesForOff() : string[] {
|
497
|
+
return this.alexaSmartNamesForOff;
|
498
|
+
}
|
499
|
+
|
500
|
+
public getAlexaActionNamesForOn() : string[] {
|
501
|
+
return this.alexaActionNamesForOn;
|
502
|
+
}
|
503
|
+
|
504
|
+
public getAlexaActionNamesForOff() : string[] {
|
505
|
+
return this.alexaActionNamesForOff;
|
506
|
+
}
|
507
|
+
|
508
|
+
public getAlexaSchemes(): DimmerAlexaScheme[] {
|
509
|
+
return this.levelSchemes;
|
192
510
|
}
|
193
511
|
|
512
|
+
public getAlexaNamesForOnAsString() : string {
|
513
|
+
var result = "";
|
514
|
+
this.alexaSmartNamesForOn.forEach(alexaOnName => {
|
515
|
+
if (result == "") {
|
516
|
+
result += alexaOnName
|
517
|
+
} else {
|
518
|
+
result += ", " + alexaOnName;
|
519
|
+
}
|
520
|
+
});
|
521
|
+
|
522
|
+
this.alexaActionNamesForOn.forEach(alexaOnName => {
|
523
|
+
if (result == "") {
|
524
|
+
result += alexaOnName
|
525
|
+
} else {
|
526
|
+
result += ", " + alexaOnName;
|
527
|
+
}
|
528
|
+
});
|
529
|
+
|
530
|
+
return result;
|
531
|
+
}
|
532
|
+
|
533
|
+
public getAlexaNamesForOffAsString() : string {
|
534
|
+
var result = "";
|
535
|
+
|
536
|
+
this.alexaSmartNamesForOff.forEach(alexaOffName => {
|
537
|
+
if (result == "") {
|
538
|
+
result += alexaOffName
|
539
|
+
} else {
|
540
|
+
result += ", " + alexaOffName;
|
541
|
+
}
|
542
|
+
});
|
543
|
+
|
544
|
+
this.alexaActionNamesForOff.forEach(alexaOffName => {
|
545
|
+
if (result == "") {
|
546
|
+
result += alexaOffName
|
547
|
+
} else {
|
548
|
+
result += ", " + alexaOffName;
|
549
|
+
}
|
550
|
+
});
|
551
|
+
|
552
|
+
return result;
|
553
|
+
}
|
554
|
+
|
555
|
+
public turnOnHM() {
|
556
|
+
if (this.alexaLevelSchemeForOn == null) { // Schalte Licht nur ein
|
557
|
+
if (this.adapter.getState(this.baseState + ".4.LEVEL").val != 100) {
|
558
|
+
this.adapter.setState(this.baseState + ".4.LEVEL", 100);
|
559
|
+
}
|
560
|
+
} else {
|
561
|
+
this.changeLevel(this.alexaLevelSchemeForOn);
|
562
|
+
}
|
563
|
+
}
|
564
|
+
|
565
|
+
public getSwitchState(): string {
|
566
|
+
return this.baseState + ".4.LEVEL";
|
567
|
+
}
|
568
|
+
|
569
|
+
public turnOffHM() {
|
570
|
+
if (this.adapter.getState(this.baseState + ".4.LEVEL").val != 0) {
|
571
|
+
this.adapter.setState(this.baseState + ".4.LEVEL", 0);
|
572
|
+
}
|
573
|
+
}
|
574
|
+
|
575
|
+
public changeLevel(levelScheme: DimmerAlexaScheme) {
|
576
|
+
if (this.adapter.getState(this.baseState + ".4.LEVEL").val != levelScheme.getLevel()) {
|
577
|
+
this.adapter.setState(this.baseState + ".4.LEVEL", levelScheme.getLevel());
|
578
|
+
}
|
579
|
+
}
|
580
|
+
|
194
581
|
public getCategory(): string {
|
195
582
|
return deviceHomematicDimmer;
|
196
583
|
}
|
584
|
+
public getLevel(): number {
|
585
|
+
return this.adapter.getState(this.baseState + ".4.LEVEL").val // hm-rpc.1.0008DA49A7C659.3.LEVEL
|
586
|
+
}
|
197
587
|
}
|
198
588
|
|
589
|
+
|
199
590
|
export class HomematicFunkschaltaktor extends AbstractHomematic {
|
200
591
|
constructor(adapter: any, id: number, baseState: string, etage: string, raum: string, device: string) {
|
201
592
|
super(adapter, id, baseState, etage, raum, device);
|
@@ -243,15 +634,127 @@ export class HomematicTemperatursensor extends AbstractHomematic {
|
|
243
634
|
}
|
244
635
|
}
|
245
636
|
|
246
|
-
export class
|
247
|
-
|
637
|
+
export class HomematicWandschalter extends AbstractHomematic {
|
638
|
+
protected alexaSmartNamesForOn:string[];
|
639
|
+
protected alexaSmartNamesForOff: string[];
|
640
|
+
protected alexaActionNamesForOn:string[];
|
641
|
+
protected alexaActionNamesForOff: string[];
|
642
|
+
private nachtbeleuchtung:boolean;
|
643
|
+
private turnOffExitHouseSummer:boolean;
|
644
|
+
private turnOffExitHouseWinter:boolean;
|
645
|
+
private turnOnEnterHouseSummer:boolean;
|
646
|
+
private turnOnEnterHouseWinter:boolean;
|
647
|
+
|
648
|
+
constructor(adapter:any, id: number, baseState: string, etage: string, raum: string, device: string, alexaSmartNamesForOn:string[], alexaActionNamesForOn:string[], alexaSmartNamesForOff: string[],alexaActionNamesForOff: string[], nachtbeleuchtung:boolean, turnOffExitHouseSummer:boolean, turnOffExitHouseWinter:boolean, turnOnEnterHouseSummer:boolean, turnOnEnterHouseWinter:boolean) {
|
248
649
|
super(adapter, id, baseState, etage, raum, device);
|
650
|
+
this.nachtbeleuchtung = nachtbeleuchtung;
|
651
|
+
this.turnOffExitHouseSummer = turnOffExitHouseSummer;
|
652
|
+
this.turnOffExitHouseWinter = turnOffExitHouseWinter;
|
653
|
+
this.turnOnEnterHouseSummer = turnOnEnterHouseSummer;
|
654
|
+
this.turnOnEnterHouseWinter = turnOnEnterHouseWinter;
|
655
|
+
|
656
|
+
this.alexaSmartNamesForOn = alexaSmartNamesForOn;
|
657
|
+
this.alexaSmartNamesForOff = alexaSmartNamesForOff;
|
658
|
+
this.alexaActionNamesForOn = alexaActionNamesForOn;
|
659
|
+
this.alexaActionNamesForOff = alexaActionNamesForOff;
|
660
|
+
|
661
|
+
this.alexaSmartNamesForOn.forEach(alexaSmartName => {
|
662
|
+
this.createIOTAdapterSmartDevices(alexaSmartName);
|
663
|
+
});
|
664
|
+
this.alexaSmartNamesForOff.forEach(alexaSmartName => {
|
665
|
+
this.createIOTAdapterSmartDevices(alexaSmartName);
|
666
|
+
});
|
667
|
+
this.alexaActionNamesForOn.forEach(alexaSmartName => {
|
668
|
+
this.createIOTAdapterSmartDevices(alexaSmartName);
|
669
|
+
});
|
670
|
+
this.alexaActionNamesForOff.forEach(alexaSmartName => {
|
671
|
+
this.createIOTAdapterSmartDevices(alexaSmartName);
|
672
|
+
});
|
673
|
+
}
|
674
|
+
|
675
|
+
public isNachtbeleuchtung() : boolean {
|
676
|
+
return this.nachtbeleuchtung;
|
677
|
+
}
|
678
|
+
|
679
|
+
public isTurnOffExitHouseSummer() : boolean {
|
680
|
+
return this.turnOffExitHouseSummer;
|
249
681
|
}
|
250
682
|
|
683
|
+
public isTurnOffExitHouseWinter() : boolean {
|
684
|
+
return this.turnOffExitHouseWinter;
|
685
|
+
}
|
686
|
+
|
687
|
+
public isTurnOnEnterHouseSummer() : boolean {
|
688
|
+
return this.turnOnEnterHouseSummer;
|
689
|
+
}
|
690
|
+
|
691
|
+
public isTurnOnEnterHouseWinter() : boolean {
|
692
|
+
return this.turnOnEnterHouseWinter;
|
693
|
+
}
|
694
|
+
|
695
|
+
public getAlexaSmartNamesForOn() : string[] {
|
696
|
+
return this.alexaSmartNamesForOn;
|
697
|
+
}
|
698
|
+
|
699
|
+
public getAlexaSmartNamesForOff() : string[] {
|
700
|
+
return this.alexaSmartNamesForOff;
|
701
|
+
}
|
702
|
+
|
703
|
+
public getAlexaActionNamesForOn() : string[] {
|
704
|
+
return this.alexaActionNamesForOn;
|
705
|
+
}
|
706
|
+
|
707
|
+
public getAlexaActionNamesForOff() : string[] {
|
708
|
+
return this.alexaActionNamesForOff;
|
709
|
+
}
|
710
|
+
|
251
711
|
public getCategory(): string {
|
252
|
-
return
|
712
|
+
return deviceHomematicWandschalter;
|
713
|
+
}
|
714
|
+
|
715
|
+
public isSwitchedOn(): boolean {
|
716
|
+
if (this.getType() == "HM-LC-Sw1PBU-FM") {
|
717
|
+
if (this.adapter.getState(this.baseState + ".1.STATE").val == false) { // hm-rpc.0.PEQ2220753.1.STATE
|
718
|
+
return false;
|
719
|
+
}
|
720
|
+
return true;
|
721
|
+
} else if (this.getType() == "HmIP-BSM") {
|
722
|
+
if (this.adapter.getState(this.baseState + ".4.STATE").val == false) { // // hm-rpc.1.000855699C4F38.4.STATE
|
723
|
+
return false;
|
724
|
+
}
|
725
|
+
return true;
|
726
|
+
} else {
|
727
|
+
// @ts-ignore
|
728
|
+
return undefined;
|
729
|
+
}
|
730
|
+
}
|
731
|
+
|
732
|
+
public getSwitchState(): string {
|
733
|
+
if (this.getType() == "HM-LC-Sw1PBU-FM") {
|
734
|
+
return this.baseState + ".1.STATE";
|
735
|
+
} else if (this.getType() == "HmIP-BSM") {
|
736
|
+
return this.baseState + ".4.STATE";
|
737
|
+
} else {
|
738
|
+
// @ts-ignore
|
739
|
+
return undefined;
|
740
|
+
}
|
741
|
+
}
|
742
|
+
|
743
|
+
public turnOn() {
|
744
|
+
if (this.getType() == "HM-LC-Sw1PBU-FM") {
|
745
|
+
this.adapter.setState(this.baseState + ".1.STATE", true); // hm-rpc.0.PEQ2220753.1.STATE
|
746
|
+
} else if (this.getType() == "HmIP-BSM") {
|
747
|
+
this.adapter.setState(this.baseState + ".4.STATE", true); // // hm-rpc.1.000855699C4F38.4.STATE
|
748
|
+
}
|
253
749
|
}
|
254
750
|
|
751
|
+
public turnOff() {
|
752
|
+
if (this.getType() == "HM-LC-Sw1PBU-FM") {
|
753
|
+
this.adapter.setState(this.baseState + ".1.STATE", false); // hm-rpc.0.PEQ2220753.1.STATE
|
754
|
+
} else if (this.getType() == "HmIP-BSM") {
|
755
|
+
this.adapter.setState(this.baseState + ".4.STATE", false); // // hm-rpc.1.000855699C4F38.4.STATE
|
756
|
+
}
|
757
|
+
}
|
255
758
|
}
|
256
759
|
|
257
760
|
export class HomematicAccessPoint extends AbstractHomematic {
|
@@ -278,50 +781,20 @@ export class HomematicAccessPoint extends AbstractHomematic {
|
|
278
781
|
}
|
279
782
|
|
280
783
|
export class HomematicRollladen extends AbstractHomematic {
|
281
|
-
protected positionAuf: number;
|
282
|
-
protected positionMitte: number;
|
283
|
-
protected positionZu: number;
|
284
784
|
|
285
|
-
constructor(adapter: any, id: number, baseState: string, etage: string, raum: string, device: string
|
785
|
+
constructor(adapter: any, id: number, baseState: string, etage: string, raum: string, device: string) {
|
286
786
|
super(adapter, id, baseState, etage, raum, device);
|
287
|
-
this.positionAuf = positionAuf;
|
288
|
-
this.positionMitte = positionMitte;
|
289
|
-
this.positionZu = positionZu;
|
290
787
|
}
|
291
788
|
|
292
789
|
public getCategory(): string {
|
293
790
|
return deviceHomematicRollladen;
|
294
791
|
}
|
295
|
-
|
296
|
-
public auf() {
|
297
|
-
this.adapter.setState(this.getBaseState() + ".4.LEVEL", this.positionAuf);
|
298
|
-
}
|
299
|
-
|
300
|
-
public zu() {
|
301
|
-
this.adapter.setState(this.getBaseState() + ".4.LEVEL", this.positionZu);
|
302
|
-
}
|
303
|
-
|
304
|
-
public mitte() {
|
305
|
-
this.adapter.setState(this.getBaseState() + ".4.LEVEL", this.positionMitte);
|
306
|
-
}
|
307
792
|
}
|
308
793
|
|
309
794
|
export class HomematicDoor extends AbstractHomematic {
|
310
|
-
protected skipStatisticIsOpened: boolean;
|
311
|
-
protected skipStatisticIsClosed: boolean;
|
312
795
|
|
313
|
-
constructor(adapter: any, id: number, baseState: string, etage: string, raum: string, device: string
|
796
|
+
constructor(adapter: any, id: number, baseState: string, etage: string, raum: string, device: string) {
|
314
797
|
super(adapter, id, baseState, etage, raum, device);
|
315
|
-
this.skipStatisticIsOpened = skipStatisticIsOpened;
|
316
|
-
this.skipStatisticIsClosed = skipStatisticIsClosed;
|
317
|
-
}
|
318
|
-
|
319
|
-
public isSkipStatisticIsOpened(): boolean {
|
320
|
-
return this.skipStatisticIsOpened;
|
321
|
-
}
|
322
|
-
|
323
|
-
public isSkipStatisticIsClosed(): boolean {
|
324
|
-
return this.skipStatisticIsClosed;
|
325
798
|
}
|
326
799
|
|
327
800
|
public getCategory(): string {
|
@@ -333,11 +806,11 @@ export class HomematicDoor extends AbstractHomematic {
|
|
333
806
|
}
|
334
807
|
|
335
808
|
public isOpen(): boolean {
|
336
|
-
if (this.adapter.getState(this.baseState + ".1.STATE").val) {
|
337
|
-
return
|
809
|
+
if (this.adapter.getState(this.baseState + ".1.STATE").val == 0) {
|
810
|
+
return false;
|
338
811
|
}
|
339
|
-
return
|
340
|
-
}
|
812
|
+
return true;
|
813
|
+
}
|
341
814
|
}
|
342
815
|
|
343
816
|
export class HomematicFussbodenheizung extends AbstractHomematic {
|
@@ -351,40 +824,8 @@ export class HomematicFussbodenheizung extends AbstractHomematic {
|
|
351
824
|
|
352
825
|
}
|
353
826
|
|
354
|
-
export class HomematicWandschalter extends AbstractHomematic {
|
355
|
-
constructor(adapter: any, id: number, baseState: string, etage: string, raum: string, device: string) {
|
356
|
-
super(adapter, id, baseState, etage, raum, device);
|
357
|
-
}
|
358
|
-
|
359
|
-
public getCategory(): string {
|
360
|
-
return deviceHomematicWandschalter;
|
361
|
-
}
|
362
|
-
|
363
|
-
public isStatusBattery(): boolean {
|
364
|
-
return !this.adapter.getState(this.baseState + ".0.LOW_BAT").val; // // hm-rpc.0.000A9BE993E2F7.0.LOW_BAT
|
365
|
-
}
|
366
|
-
|
367
|
-
public isSwitchedOn(): boolean {
|
368
|
-
if (this.getType() == "HM-LC-Sw1PBU-FM") {
|
369
|
-
if (this.adapter.getState(this.baseState + ".1.STATE").val == false) { // hm-rpc.0.PEQ2220753.1.STATE
|
370
|
-
return false;
|
371
|
-
}
|
372
|
-
return true;
|
373
|
-
} else if (this.getType() == "HmIP-BSM") {
|
374
|
-
if (this.adapter.getState(this.baseState + ".4.STATE").val == false) { // // hm-rpc.1.000855699C4F38.4.STATE
|
375
|
-
return false;
|
376
|
-
}
|
377
|
-
return true;
|
378
|
-
} else {
|
379
|
-
// @ts-ignore
|
380
|
-
return undefined;
|
381
|
-
}
|
382
|
-
}
|
383
|
-
}
|
384
|
-
|
385
|
-
|
386
827
|
|
387
828
|
module.exports = {
|
388
|
-
HomematicWindow, HomematicSteckdose, HomematicHeizkoerper, HomematicDimmer, HomematicWandthermostat, HomematicFussbodenheizung, HomematicWandschalter, HomematicDoor, HomematicWetterstation, HomematicAccessPoint, HomematicRollladen, HomematicWandtaster, HomematicTemperatursensor, HomematicRauchmelder, HomematicPraesenzmelder, AbstractHomematic, HomematicFunkschaltaktor,
|
829
|
+
HomematicWindow, HomematicSteckdose, HomematicHeizkoerper, HomematicDimmer, HomematicWandthermostat, HomematicFussbodenheizung, HomematicWandschalter, HomematicDoor, HomematicWetterstation, HomematicAccessPoint, HomematicRollladen, HomematicWandtaster, HomematicTemperatursensor, HomematicRauchmelder, HomematicPraesenzmelder, AbstractHomematic, HomematicFunkschaltaktor, DimmerAlexaScheme, DimmerTasterScheme,
|
389
830
|
deviceHomematicWandthermostat, deviceHomematicPraesenzmelder, deviceHomematicWetterstation, deviceHomematicDoor, deviceHomematicRollladen, deviceHomematicWandschalter, deviceHomematicFussbodenheizung, deviceHomematicWandtaster, deviceHomematicAccessPoint, deviceHomematicTemperatursensor, deviceHomematicRauchmelder, deviceHomematicFunkSchaltaktor, deviceHomematicWindow, deviceHomematicSteckdose, deviceHomematicHeizkoerper, deviceHomematicDimmer
|
390
831
|
};
|