iobroker-ucl 1.0.33 → 1.0.36

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/homematic.js ADDED
@@ -0,0 +1,324 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.AbstractHomematic = exports.HomematicCategory = void 0;
19
+ var HomematicCategory;
20
+ (function (HomematicCategory) {
21
+ HomematicCategory[HomematicCategory["Wandthermostat"] = 0] = "Wandthermostat";
22
+ HomematicCategory[HomematicCategory["Praesenzmelder"] = 1] = "Praesenzmelder";
23
+ HomematicCategory[HomematicCategory["Window"] = 2] = "Window";
24
+ HomematicCategory[HomematicCategory["Wetterstation"] = 3] = "Wetterstation";
25
+ HomematicCategory[HomematicCategory["Door"] = 4] = "Door";
26
+ HomematicCategory[HomematicCategory["Dimmer"] = 5] = "Dimmer";
27
+ HomematicCategory[HomematicCategory["Rollladen"] = 6] = "Rollladen";
28
+ HomematicCategory[HomematicCategory["Wandschalter"] = 7] = "Wandschalter";
29
+ HomematicCategory[HomematicCategory["Heizkoerper"] = 8] = "Heizkoerper";
30
+ HomematicCategory[HomematicCategory["Fussbodenheizung"] = 9] = "Fussbodenheizung";
31
+ HomematicCategory[HomematicCategory["Wandtaster"] = 10] = "Wandtaster";
32
+ HomematicCategory[HomematicCategory["Steckdose"] = 11] = "Steckdose";
33
+ HomematicCategory[HomematicCategory["Fernbedienung"] = 12] = "Fernbedienung";
34
+ HomematicCategory[HomematicCategory["AccessPoint"] = 13] = "AccessPoint";
35
+ HomematicCategory[HomematicCategory["Wasserstand"] = 14] = "Wasserstand";
36
+ HomematicCategory[HomematicCategory["Temperatursensor"] = 15] = "Temperatursensor";
37
+ HomematicCategory[HomematicCategory["Rauchmelder"] = 16] = "Rauchmelder";
38
+ HomematicCategory[HomematicCategory["Funk_Schaltaktor"] = 17] = "Funk_Schaltaktor";
39
+ })(HomematicCategory || (exports.HomematicCategory = HomematicCategory = {}));
40
+ var AbstractHomematic = /** @class */ (function () {
41
+ function AbstractHomematic(adapter, id, baseState, etage, raum, device) {
42
+ this.adapter = adapter;
43
+ this.id = id;
44
+ this.etage = etage;
45
+ this.raum = raum;
46
+ this.device = device;
47
+ this.baseState = baseState;
48
+ }
49
+ AbstractHomematic.prototype.getDeviceId = function () {
50
+ return "H" + this.id.toString().padStart(2, '0');
51
+ };
52
+ AbstractHomematic.prototype.getDeviceIdAsRawNumber = function () {
53
+ return this.id;
54
+ };
55
+ AbstractHomematic.prototype.getBaseState = function () {
56
+ return this.baseState;
57
+ };
58
+ AbstractHomematic.prototype.getType = function () {
59
+ return ""; //getObject(this.baseState).native.TYPE;
60
+ };
61
+ AbstractHomematic.prototype.getEtage = function () {
62
+ return this.etage;
63
+ };
64
+ AbstractHomematic.prototype.getRaum = function () {
65
+ return this.raum;
66
+ };
67
+ AbstractHomematic.prototype.getDevice = function () {
68
+ return this.device;
69
+ };
70
+ AbstractHomematic.prototype.isStatusTotal = function () {
71
+ return this.isStatusReachable() && this.isStatusBattery() && this.isStatusDutyCycle();
72
+ };
73
+ AbstractHomematic.prototype.isStatusReachable = function () {
74
+ return !this.adapter.getState(this.baseState + ".0.UNREACH").val;
75
+ };
76
+ AbstractHomematic.prototype.isStatusBattery = function () {
77
+ if (this.getCategory() != HomematicCategory.Funk_Schaltaktor && this.getCategory() != HomematicCategory.Steckdose && this.getCategory() != HomematicCategory.Dimmer && this.getCategory() != HomematicCategory.Wandtaster && this.getCategory() != HomematicCategory.Fussbodenheizung && this.getCategory() != HomematicCategory.Rollladen && this.getCategory() != HomematicCategory.Wandschalter) { // Bei Dimmer gibts keine Batterie! (230V!)
78
+ return !this.adapter.getState(this.baseState + ".0.LOW_BAT").val; // // hm-rpc.0.000A9BE993E2F7.0.LOW_BAT
79
+ }
80
+ return true;
81
+ };
82
+ AbstractHomematic.prototype.isStatusDutyCycle = function () {
83
+ if (this.getType().includes("HmIP")) {
84
+ return !this.adapter.getState(this.baseState + ".0.DUTY_CYCLE").val; // hm-rpc.0.000A9BE993E2F7.0.DUTY_CYCLE
85
+ }
86
+ return true;
87
+ };
88
+ AbstractHomematic.prototype.getSignal = function () {
89
+ return this.adapter.getState(this.baseState + ".0.RSSI_DEVICE").val;
90
+ };
91
+ return AbstractHomematic;
92
+ }());
93
+ exports.AbstractHomematic = AbstractHomematic;
94
+ var HomematicWandthermostat = /** @class */ (function (_super) {
95
+ __extends(HomematicWandthermostat, _super);
96
+ function HomematicWandthermostat(adapter, id, baseState, etage, raum, device) {
97
+ return _super.call(this, adapter, id, baseState, etage, raum, device) || this;
98
+ }
99
+ HomematicWandthermostat.prototype.getTemperatureIst = function () {
100
+ return this.adapter.getState(this.baseState + ".1.ACTUAL_TEMPERATURE").val; // hm-rpc.0.000A9BE993E2F7.1.ACTUAL_TEMPERATURE
101
+ };
102
+ HomematicWandthermostat.prototype.getTemperatureSoll = function () {
103
+ return this.adapter.getState(this.baseState + ".1.SET_POINT_TEMPERATURE").val; // hm-rpc.0.000A9BE993E2F7.1.SET_POINT_TEMPERATURE
104
+ };
105
+ HomematicWandthermostat.prototype.getHumanity = function () {
106
+ return this.adapter.getState(this.baseState + ".1.HUMIDITY").val + " %"; // hm-rpc.0.000A9BE993E2F7.1.HUMIDITY
107
+ };
108
+ HomematicWandthermostat.prototype.getCategoryAsString = function () {
109
+ return "Wandthermostat";
110
+ };
111
+ HomematicWandthermostat.prototype.getCategory = function () {
112
+ return HomematicCategory.Wandthermostat;
113
+ };
114
+ return HomematicWandthermostat;
115
+ }(AbstractHomematic));
116
+ var HomematicPraesenzmelder = /** @class */ (function (_super) {
117
+ __extends(HomematicPraesenzmelder, _super);
118
+ function HomematicPraesenzmelder(adapter, id, baseState, etage, raum, device) {
119
+ return _super.call(this, adapter, id, baseState, etage, raum, device) || this;
120
+ }
121
+ HomematicPraesenzmelder.prototype.getCategoryAsString = function () {
122
+ return "Präsenzmelder";
123
+ };
124
+ HomematicPraesenzmelder.prototype.getCategory = function () {
125
+ return HomematicCategory.Praesenzmelder;
126
+ };
127
+ HomematicPraesenzmelder.prototype.getIllumination = function () {
128
+ // log("returns: " + getState(this.baseState + ".1.CURRENT_ILLUMINATION").val)
129
+ if (this.adapter.getState(this.baseState + ".1.CURRENT_ILLUMINATION").val != null) {
130
+ return this.adapter.getState(this.baseState + ".1.CURRENT_ILLUMINATION").val + " lux"; // hm-rpc.0.000C1BE98E093D.1.CURRENT_ILLUMINATION
131
+ }
132
+ return "-";
133
+ };
134
+ return HomematicPraesenzmelder;
135
+ }(AbstractHomematic));
136
+ var HomematicWetterstation = /** @class */ (function (_super) {
137
+ __extends(HomematicWetterstation, _super);
138
+ function HomematicWetterstation(adapter, id, baseState, etage, raum, device) {
139
+ return _super.call(this, adapter, id, baseState, etage, raum, device) || this;
140
+ }
141
+ HomematicWetterstation.prototype.getCategoryAsString = function () {
142
+ return "Wetterstation";
143
+ };
144
+ HomematicWetterstation.prototype.getCategory = function () {
145
+ return HomematicCategory.Wetterstation;
146
+ };
147
+ return HomematicWetterstation;
148
+ }(AbstractHomematic));
149
+ var HomematicFunkschaltaktor = /** @class */ (function (_super) {
150
+ __extends(HomematicFunkschaltaktor, _super);
151
+ function HomematicFunkschaltaktor(adapter, id, baseState, etage, raum, device) {
152
+ return _super.call(this, adapter, id, baseState, etage, raum, device) || this;
153
+ }
154
+ HomematicFunkschaltaktor.prototype.getCategoryAsString = function () {
155
+ return "Funk-Schaltaktor";
156
+ };
157
+ HomematicFunkschaltaktor.prototype.getCategory = function () {
158
+ return HomematicCategory.Funk_Schaltaktor;
159
+ };
160
+ return HomematicFunkschaltaktor;
161
+ }(AbstractHomematic));
162
+ var HomematicRauchmelder = /** @class */ (function (_super) {
163
+ __extends(HomematicRauchmelder, _super);
164
+ function HomematicRauchmelder(adapter, id, baseState, etage, raum, device) {
165
+ return _super.call(this, adapter, id, baseState, etage, raum, device) || this;
166
+ }
167
+ HomematicRauchmelder.prototype.getCategoryAsString = function () {
168
+ return "Rauchmelder";
169
+ };
170
+ HomematicRauchmelder.prototype.getCategory = function () {
171
+ return HomematicCategory.Rauchmelder;
172
+ };
173
+ return HomematicRauchmelder;
174
+ }(AbstractHomematic));
175
+ var HomematicTemperatursensor = /** @class */ (function (_super) {
176
+ __extends(HomematicTemperatursensor, _super);
177
+ function HomematicTemperatursensor(adapter, id, baseState, etage, raum, device) {
178
+ return _super.call(this, adapter, id, baseState, etage, raum, device) || this;
179
+ }
180
+ HomematicTemperatursensor.prototype.getTemperatureIst = function () {
181
+ return this.adapter.getState(this.baseState + ".1.ACTUAL_TEMPERATURE").val + " °C";
182
+ };
183
+ HomematicTemperatursensor.prototype.getHumanity = function () {
184
+ return this.adapter.getState(this.baseState + ".1.HUMIDITY").val + " %"; // hm-rpc.0.00181BE98EF50E.1.HUMIDITY
185
+ };
186
+ HomematicTemperatursensor.prototype.getCategoryAsString = function () {
187
+ return "Temperatursensor";
188
+ };
189
+ HomematicTemperatursensor.prototype.getCategory = function () {
190
+ return HomematicCategory.Temperatursensor;
191
+ };
192
+ return HomematicTemperatursensor;
193
+ }(AbstractHomematic));
194
+ var HomematicWandtaster = /** @class */ (function (_super) {
195
+ __extends(HomematicWandtaster, _super);
196
+ function HomematicWandtaster(adapter, id, baseState, etage, raum, device) {
197
+ return _super.call(this, adapter, id, baseState, etage, raum, device) || this;
198
+ }
199
+ HomematicWandtaster.prototype.getCategoryAsString = function () {
200
+ return "Wandtaster";
201
+ };
202
+ HomematicWandtaster.prototype.getCategory = function () {
203
+ return HomematicCategory.Wandtaster;
204
+ };
205
+ return HomematicWandtaster;
206
+ }(AbstractHomematic));
207
+ var HomematicAccessPoint = /** @class */ (function (_super) {
208
+ __extends(HomematicAccessPoint, _super);
209
+ function HomematicAccessPoint(adapter, id, baseState, etage, raum, device) {
210
+ return _super.call(this, adapter, id, baseState, etage, raum, device) || this;
211
+ }
212
+ HomematicAccessPoint.prototype.getCategoryAsString = function () {
213
+ return "Access Point";
214
+ };
215
+ HomematicAccessPoint.prototype.isStatusBattery = function () {
216
+ return true;
217
+ };
218
+ HomematicAccessPoint.prototype.getSignal = function () {
219
+ return "";
220
+ };
221
+ HomematicAccessPoint.prototype.getCategory = function () {
222
+ return HomematicCategory.AccessPoint;
223
+ };
224
+ return HomematicAccessPoint;
225
+ }(AbstractHomematic));
226
+ var HomematicRollladen = /** @class */ (function (_super) {
227
+ __extends(HomematicRollladen, _super);
228
+ function HomematicRollladen(adapter, id, baseState, etage, raum, device, positionAuf, positionMitte, positionZu) {
229
+ var _this = _super.call(this, adapter, id, baseState, etage, raum, device) || this;
230
+ _this.positionAuf = positionAuf;
231
+ _this.positionMitte = positionMitte;
232
+ _this.positionZu = positionZu;
233
+ return _this;
234
+ }
235
+ HomematicRollladen.prototype.getCategoryAsString = function () {
236
+ return "Rollladenschalter";
237
+ };
238
+ HomematicRollladen.prototype.getCategory = function () {
239
+ return HomematicCategory.Rollladen;
240
+ };
241
+ HomematicRollladen.prototype.auf = function () {
242
+ this.adapter.setState(this.getBaseState() + ".4.LEVEL", this.positionAuf);
243
+ };
244
+ HomematicRollladen.prototype.zu = function () {
245
+ this.adapter.setState(this.getBaseState() + ".4.LEVEL", this.positionZu);
246
+ };
247
+ HomematicRollladen.prototype.mitte = function () {
248
+ this.adapter.setState(this.getBaseState() + ".4.LEVEL", this.positionMitte);
249
+ };
250
+ return HomematicRollladen;
251
+ }(AbstractHomematic));
252
+ var HomematicDoor = /** @class */ (function (_super) {
253
+ __extends(HomematicDoor, _super);
254
+ function HomematicDoor(adapter, id, baseState, etage, raum, device, skipStatisticIsOpened, skipStatisticIsClosed) {
255
+ var _this = _super.call(this, adapter, id, baseState, etage, raum, device) || this;
256
+ _this.skipStatisticIsOpened = skipStatisticIsOpened;
257
+ _this.skipStatisticIsClosed = skipStatisticIsClosed;
258
+ return _this;
259
+ }
260
+ HomematicDoor.prototype.isSkipStatisticIsOpened = function () {
261
+ return this.skipStatisticIsOpened;
262
+ };
263
+ HomematicDoor.prototype.isSkipStatisticIsClosed = function () {
264
+ return this.skipStatisticIsClosed;
265
+ };
266
+ HomematicDoor.prototype.getCategoryAsString = function () {
267
+ return "Türsensor";
268
+ };
269
+ HomematicDoor.prototype.getCategory = function () {
270
+ return HomematicCategory.Door;
271
+ };
272
+ HomematicDoor.prototype.isOpen = function () {
273
+ if (this.adapter.getState(this.baseState + ".1.STATE").val) { // hm-rpc.0.0000DD89BE05F9.1.STATE
274
+ return true;
275
+ }
276
+ return false;
277
+ };
278
+ return HomematicDoor;
279
+ }(AbstractHomematic));
280
+ var HomematicFussbodenheizung = /** @class */ (function (_super) {
281
+ __extends(HomematicFussbodenheizung, _super);
282
+ function HomematicFussbodenheizung(adapter, id, baseState, etage, raum, device) {
283
+ return _super.call(this, adapter, id, baseState, etage, raum, device) || this;
284
+ }
285
+ HomematicFussbodenheizung.prototype.getCategoryAsString = function () {
286
+ return "Fussbodenheizung";
287
+ };
288
+ HomematicFussbodenheizung.prototype.getCategory = function () {
289
+ return HomematicCategory.Fussbodenheizung;
290
+ };
291
+ return HomematicFussbodenheizung;
292
+ }(AbstractHomematic));
293
+ var HomematicWandschalter = /** @class */ (function (_super) {
294
+ __extends(HomematicWandschalter, _super);
295
+ function HomematicWandschalter(adapter, id, baseState, etage, raum, device) {
296
+ return _super.call(this, adapter, id, baseState, etage, raum, device) || this;
297
+ }
298
+ HomematicWandschalter.prototype.getCategoryAsString = function () {
299
+ return "Wandschalter";
300
+ };
301
+ HomematicWandschalter.prototype.getCategory = function () {
302
+ return HomematicCategory.Wandschalter;
303
+ };
304
+ HomematicWandschalter.prototype.isSwitchedOn = function () {
305
+ if (this.getType() == "HM-LC-Sw1PBU-FM") {
306
+ if (this.adapter.getState(this.baseState + ".1.STATE").val == false) { // hm-rpc.0.PEQ2220753.1.STATE
307
+ return false;
308
+ }
309
+ return true;
310
+ }
311
+ else if (this.getType() == "HmIP-BSM") {
312
+ if (this.adapter.getState(this.baseState + ".4.STATE").val == false) { // // hm-rpc.1.000855699C4F38.4.STATE
313
+ return false;
314
+ }
315
+ return true;
316
+ }
317
+ else {
318
+ // @ts-ignore
319
+ return undefined;
320
+ }
321
+ };
322
+ return HomematicWandschalter;
323
+ }(AbstractHomematic));
324
+ module.exports = { HomematicWandthermostat: HomematicWandthermostat, HomematicFussbodenheizung: HomematicFussbodenheizung, HomematicWandschalter: HomematicWandschalter, HomematicDoor: HomematicDoor, HomematicWetterstation: HomematicWetterstation, HomematicAccessPoint: HomematicAccessPoint, HomematicRollladen: HomematicRollladen, HomematicWandtaster: HomematicWandtaster, HomematicTemperatursensor: HomematicTemperatursensor, HomematicRauchmelder: HomematicRauchmelder, HomematicPraesenzmelder: HomematicPraesenzmelder, HomematicCategory: HomematicCategory, AbstractHomematic: AbstractHomematic, HomematicFunkschaltaktor: HomematicFunkschaltaktor };
package/homematic.ts ADDED
@@ -0,0 +1,358 @@
1
+
2
+ export enum HomematicCategory {
3
+ Wandthermostat,
4
+ Praesenzmelder,
5
+ Window,
6
+ Wetterstation,
7
+ Door,
8
+ Dimmer, // Homematic IP Phasenabschnittdimmer-Einsatz HmIP-BDT
9
+ Rollladen,
10
+ Wandschalter,
11
+ Heizkoerper,
12
+ Fussbodenheizung,
13
+ Wandtaster,
14
+ Steckdose, Fernbedienung, AccessPoint, Wasserstand, Temperatursensor, Rauchmelder, Funk_Schaltaktor
15
+ }
16
+
17
+ export abstract class AbstractHomematic {
18
+ protected baseState: string;
19
+ protected etage: string;
20
+ protected raum: string;
21
+ protected device: string;
22
+ protected id: number;
23
+ protected adapter: any;
24
+
25
+ constructor(adapter: any, id: number, baseState: string, etage: string, raum: string, device: string) {
26
+ this.adapter = adapter;
27
+ this.id = id;
28
+ this.etage = etage;
29
+ this.raum = raum;
30
+ this.device = device;
31
+ this.baseState = baseState;
32
+ }
33
+
34
+ public getDeviceId() : string {
35
+ return "H" + this.id.toString().padStart(2, '0');
36
+ }
37
+
38
+ public getDeviceIdAsRawNumber() : number {
39
+ return this.id;
40
+ }
41
+
42
+ public getBaseState() : string {
43
+ return this.baseState;
44
+ }
45
+
46
+ public getType() : string {
47
+ return "";//getObject(this.baseState).native.TYPE;
48
+ }
49
+
50
+ public getEtage() : string {
51
+ return this.etage;
52
+ }
53
+
54
+ public getRaum() : string {
55
+ return this.raum;
56
+ }
57
+
58
+ public getDevice() : string {
59
+ return this.device;
60
+ }
61
+
62
+ public isStatusTotal() : boolean {
63
+ return this.isStatusReachable() && this.isStatusBattery() && this.isStatusDutyCycle();
64
+ }
65
+
66
+ public isStatusReachable() : boolean { // .0.UNREACH
67
+ return !this.adapter.getState(this.baseState + ".0.UNREACH").val;
68
+ }
69
+
70
+ public isStatusBattery() : boolean { // hm-rpc.0.000A9BE993E2F7.0.LOW_BAT
71
+ if (this.getCategory() != HomematicCategory.Funk_Schaltaktor && this.getCategory() != HomematicCategory.Steckdose && this.getCategory() != HomematicCategory.Dimmer && this.getCategory() != HomematicCategory.Wandtaster && this.getCategory() != HomematicCategory.Fussbodenheizung && this.getCategory() != HomematicCategory.Rollladen && this.getCategory() != HomematicCategory.Wandschalter) { // Bei Dimmer gibts keine Batterie! (230V!)
72
+ return !this.adapter.getState(this.baseState + ".0.LOW_BAT").val; // // hm-rpc.0.000A9BE993E2F7.0.LOW_BAT
73
+ }
74
+ return true;
75
+ }
76
+
77
+ public isStatusDutyCycle() : boolean {
78
+ if (this.getType().includes("HmIP")) {
79
+ return !this.adapter.getState(this.baseState + ".0.DUTY_CYCLE").val; // hm-rpc.0.000A9BE993E2F7.0.DUTY_CYCLE
80
+ }
81
+ return true;
82
+ }
83
+
84
+ public getSignal() : string { // hm-rpc.0.0000DD89BE05F9.0.RSSI_DEVICE
85
+ return this.adapter.getState(this.baseState + ".0.RSSI_DEVICE").val;
86
+ }
87
+
88
+ abstract getCategoryAsString(): string;
89
+
90
+ abstract getCategory() : HomematicCategory;
91
+
92
+ }
93
+
94
+ class HomematicWandthermostat extends AbstractHomematic {
95
+ constructor(adapter: any, id: number, baseState: string, etage: string, raum: string, device: string) {
96
+ super(adapter, id, baseState, etage, raum, device);
97
+ }
98
+
99
+ public getTemperatureIst() : number {
100
+ return this.adapter.getState(this.baseState + ".1.ACTUAL_TEMPERATURE").val; // hm-rpc.0.000A9BE993E2F7.1.ACTUAL_TEMPERATURE
101
+ }
102
+
103
+ public getTemperatureSoll() : number {
104
+ return this.adapter.getState(this.baseState + ".1.SET_POINT_TEMPERATURE").val; // hm-rpc.0.000A9BE993E2F7.1.SET_POINT_TEMPERATURE
105
+ }
106
+
107
+ public getHumanity() : string {
108
+ return this.adapter.getState(this.baseState + ".1.HUMIDITY").val + " %"; // hm-rpc.0.000A9BE993E2F7.1.HUMIDITY
109
+ }
110
+
111
+ public getCategoryAsString(): string {
112
+ return "Wandthermostat";
113
+ }
114
+
115
+ public getCategory(): HomematicCategory {
116
+ return HomematicCategory.Wandthermostat;
117
+ }
118
+ }
119
+
120
+ class HomematicPraesenzmelder extends AbstractHomematic {
121
+ constructor(adapter: any, id: number, baseState: string, etage: string, raum: string, device: string) {
122
+ super(adapter, id, baseState, etage, raum, device);
123
+ }
124
+
125
+ public getCategoryAsString(): string {
126
+ return "Präsenzmelder";
127
+ }
128
+
129
+ public getCategory(): HomematicCategory {
130
+ return HomematicCategory.Praesenzmelder;
131
+ }
132
+
133
+ public getIllumination():string {
134
+ // log("returns: " + getState(this.baseState + ".1.CURRENT_ILLUMINATION").val)
135
+ if (this.adapter.getState(this.baseState + ".1.CURRENT_ILLUMINATION").val != null) {
136
+ return this.adapter.getState(this.baseState + ".1.CURRENT_ILLUMINATION").val + " lux"; // hm-rpc.0.000C1BE98E093D.1.CURRENT_ILLUMINATION
137
+ }
138
+ return "-";
139
+ }
140
+ }
141
+
142
+ class HomematicWetterstation extends AbstractHomematic {
143
+ constructor(adapter: any, id: number, baseState: string, etage: string, raum: string, device: string) {
144
+ super(adapter, id, baseState, etage, raum, device);
145
+ }
146
+
147
+ public getCategoryAsString(): string {
148
+ return "Wetterstation";
149
+ }
150
+
151
+ public getCategory(): HomematicCategory {
152
+ return HomematicCategory.Wetterstation;
153
+ }
154
+ }
155
+
156
+ class HomematicFunkschaltaktor extends AbstractHomematic {
157
+ constructor(adapter: any, id: number, baseState: string, etage: string, raum: string, device: string) {
158
+ super(adapter, id, baseState, etage, raum, device);
159
+ }
160
+
161
+ public getCategoryAsString(): string {
162
+ return "Funk-Schaltaktor";
163
+ }
164
+
165
+ public getCategory(): HomematicCategory {
166
+ return HomematicCategory.Funk_Schaltaktor;
167
+ }
168
+ }
169
+
170
+
171
+ class HomematicRauchmelder extends AbstractHomematic {
172
+ constructor(adapter: any, id: number, baseState: string, etage: string, raum: string, device: string) {
173
+ super(adapter, id, baseState, etage, raum, device);
174
+ }
175
+
176
+ public getCategoryAsString(): string {
177
+ return "Rauchmelder";
178
+ }
179
+
180
+ public getCategory(): HomematicCategory {
181
+ return HomematicCategory.Rauchmelder;
182
+ }
183
+ }
184
+
185
+
186
+ class HomematicTemperatursensor extends AbstractHomematic {
187
+ constructor(adapter: any, id: number, baseState: string, etage: string, raum: string, device: string) {
188
+ super(adapter, id, baseState, etage, raum, device);
189
+ }
190
+
191
+ public getTemperatureIst() : string { // hm-rpc.0.00181BE98EF50E.1.ACTUAL_TEMPERATURE
192
+ return this.adapter.getState(this.baseState + ".1.ACTUAL_TEMPERATURE").val + " °C";
193
+ }
194
+
195
+ public getHumanity() : string {
196
+ return this.adapter.getState(this.baseState + ".1.HUMIDITY").val + " %"; // hm-rpc.0.00181BE98EF50E.1.HUMIDITY
197
+ }
198
+
199
+ public getCategoryAsString(): string {
200
+ return "Temperatursensor";
201
+ }
202
+
203
+ public getCategory(): HomematicCategory {
204
+ return HomematicCategory.Temperatursensor;
205
+ }
206
+ }
207
+
208
+ class HomematicWandtaster extends AbstractHomematic {
209
+ constructor(adapter: any, id: number, baseState: string, etage: string, raum: string, device: string) {
210
+ super(adapter, id, baseState, etage, raum, device);
211
+ }
212
+
213
+ public getCategoryAsString(): string {
214
+ return "Wandtaster";
215
+ }
216
+
217
+ public getCategory(): HomematicCategory {
218
+ return HomematicCategory.Wandtaster;
219
+ }
220
+ }
221
+
222
+ class HomematicAccessPoint extends AbstractHomematic {
223
+ constructor(adapter: any, id: number, baseState: string, etage: string, raum: string, device: string) {
224
+ super(adapter, id, baseState, etage, raum, device);
225
+ }
226
+
227
+ public getCategoryAsString(): string {
228
+ return "Access Point";
229
+ }
230
+
231
+ public isStatusBattery() : boolean {
232
+ return true;
233
+ }
234
+
235
+ public getSignal() : string {
236
+ return "";
237
+ }
238
+
239
+ public getCategory(): HomematicCategory {
240
+ return HomematicCategory.AccessPoint;
241
+ }
242
+ }
243
+
244
+ class HomematicRollladen extends AbstractHomematic {
245
+ protected positionAuf: number;
246
+ protected positionMitte: number;
247
+ protected positionZu: number;
248
+
249
+ constructor(adapter: any, id: number, baseState: string, etage: string, raum: string, device: string, positionAuf: number, positionMitte: number, positionZu: number) {
250
+ super(adapter, id, baseState, etage, raum, device);
251
+ this.positionAuf = positionAuf;
252
+ this.positionMitte = positionMitte;
253
+ this.positionZu = positionZu;
254
+ }
255
+
256
+ public getCategoryAsString(): string {
257
+ return "Rollladenschalter";
258
+ }
259
+
260
+ public getCategory(): HomematicCategory {
261
+ return HomematicCategory.Rollladen;
262
+ }
263
+
264
+ public auf() {
265
+ this.adapter.setState(this.getBaseState() + ".4.LEVEL", this.positionAuf);
266
+ }
267
+
268
+ public zu() {
269
+ this.adapter.setState(this.getBaseState() + ".4.LEVEL", this.positionZu);
270
+ }
271
+
272
+ public mitte() {
273
+ this.adapter.setState(this.getBaseState() + ".4.LEVEL", this.positionMitte);
274
+ }
275
+ }
276
+
277
+ class HomematicDoor extends AbstractHomematic {
278
+ protected skipStatisticIsOpened: boolean;
279
+ protected skipStatisticIsClosed: boolean;
280
+
281
+ constructor(adapter: any, id: number, baseState: string, etage: string, raum: string, device: string, skipStatisticIsOpened: boolean, skipStatisticIsClosed: boolean) {
282
+ super(adapter, id, baseState, etage, raum, device);
283
+ this.skipStatisticIsOpened = skipStatisticIsOpened;
284
+ this.skipStatisticIsClosed = skipStatisticIsClosed;
285
+ }
286
+
287
+ public isSkipStatisticIsOpened() : boolean {
288
+ return this.skipStatisticIsOpened;
289
+ }
290
+
291
+ public isSkipStatisticIsClosed() : boolean {
292
+ return this.skipStatisticIsClosed;
293
+ }
294
+
295
+ public getCategoryAsString(): string {
296
+ return "Türsensor";
297
+ }
298
+
299
+ public getCategory(): HomematicCategory {
300
+ return HomematicCategory.Door;
301
+ }
302
+
303
+ public isOpen(): boolean {
304
+ if (this.adapter.getState(this.baseState + ".1.STATE").val) { // hm-rpc.0.0000DD89BE05F9.1.STATE
305
+ return true;
306
+ }
307
+ return false;
308
+ }
309
+ }
310
+
311
+ class HomematicFussbodenheizung extends AbstractHomematic {
312
+ constructor(adapter: any, id: number, baseState: string, etage: string, raum: string, device: string) {
313
+ super(adapter, id, baseState, etage, raum, device);
314
+ }
315
+
316
+ public getCategoryAsString(): string {
317
+ return "Fussbodenheizung";
318
+ }
319
+
320
+ public getCategory(): HomematicCategory {
321
+ return HomematicCategory.Fussbodenheizung;
322
+ }
323
+ }
324
+
325
+ class HomematicWandschalter extends AbstractHomematic {
326
+ constructor(adapter: any, id: number, baseState: string, etage: string, raum: string, device: string) {
327
+ super(adapter, id, baseState, etage, raum, device);
328
+ }
329
+
330
+ public getCategoryAsString(): string {
331
+ return "Wandschalter";
332
+ }
333
+
334
+ public getCategory(): HomematicCategory {
335
+ return HomematicCategory.Wandschalter;
336
+ }
337
+
338
+ public isSwitchedOn(): boolean {
339
+ if (this.getType() == "HM-LC-Sw1PBU-FM") {
340
+ if (this.adapter.getState(this.baseState + ".1.STATE").val == false) { // hm-rpc.0.PEQ2220753.1.STATE
341
+ return false;
342
+ }
343
+ return true;
344
+ } else if (this.getType() == "HmIP-BSM") {
345
+ if (this.adapter.getState(this.baseState + ".4.STATE").val == false) { // // hm-rpc.1.000855699C4F38.4.STATE
346
+ return false;
347
+ }
348
+ return true;
349
+ } else {
350
+ // @ts-ignore
351
+ return undefined;
352
+ }
353
+ }
354
+ }
355
+
356
+
357
+ module.exports = { HomematicWandthermostat ,HomematicFussbodenheizung ,HomematicWandschalter , HomematicDoor , HomematicWetterstation ,HomematicAccessPoint , HomematicRollladen , HomematicWandtaster , HomematicTemperatursensor , HomematicRauchmelder , HomematicPraesenzmelder , HomematicCategory, AbstractHomematic, HomematicFunkschaltaktor};
358
+
@@ -317,18 +317,23 @@ var StaticIconColumn = /** @class */ (function (_super) {
317
317
  return _this;
318
318
  }
319
319
  StaticIconColumn.prototype.getOnTopBackgroundColor = function () {
320
+ // @ts-ignore
320
321
  return null;
321
322
  };
322
323
  StaticIconColumn.prototype.getColumnHeaderBackgroundColor = function () {
324
+ // @ts-ignore
323
325
  return null; // normaler Header-Hintergrundfarbe / null --> ohne, sonst "#FFFFFF"
324
326
  };
325
327
  StaticIconColumn.prototype.getCellBackgroundColor = function (row, rowIndex) {
328
+ // @ts-ignore
326
329
  return null; //"#484848";
327
330
  };
328
331
  StaticIconColumn.prototype.getOnTopCellAlignment = function () {
332
+ // @ts-ignore
329
333
  return null; //"center";
330
334
  };
331
335
  StaticIconColumn.prototype.getCellForegroundColor = function (row, rowIndex) {
336
+ // @ts-ignore
332
337
  return null; // null (für Standard) oder z.B. "#485A64";
333
338
  };
334
339
  StaticIconColumn.prototype.getCellAlignment = function (row) {
@@ -338,9 +343,11 @@ var StaticIconColumn = /** @class */ (function (_super) {
338
343
  return 40; // null oder z.B. 50 für "50 Pixel"
339
344
  };
340
345
  StaticIconColumn.prototype.getColumnnFontSize = function () {
346
+ // @ts-ignore
341
347
  return null; // null = Default
342
348
  };
343
349
  StaticIconColumn.prototype.getOnTopColumnName = function () {
350
+ // @ts-ignore
344
351
  return null; // null wenn Doppelt Header ausgeschalten
345
352
  };
346
353
  ;
@@ -359,30 +366,39 @@ var AbstractStandardTextColumn = /** @class */ (function (_super) {
359
366
  return _super.call(this, "") || this;
360
367
  }
361
368
  AbstractStandardTextColumn.prototype.getOnTopBackgroundColor = function () {
369
+ // @ts-ignore
362
370
  return null;
363
371
  };
364
372
  AbstractStandardTextColumn.prototype.getColumnHeaderBackgroundColor = function () {
373
+ // @ts-ignore
365
374
  return null; // normaler Header-Hintergrundfarbe / null --> ohne, sonst "#FFFFFF"
366
375
  };
367
376
  AbstractStandardTextColumn.prototype.getCellBackgroundColor = function (row, rowIndex) {
377
+ // @ts-ignore
368
378
  return null; //"#484848";
369
379
  };
370
380
  AbstractStandardTextColumn.prototype.getOnTopCellAlignment = function () {
381
+ // @ts-ignore
371
382
  return null; //"center";
372
383
  };
373
384
  AbstractStandardTextColumn.prototype.getCellForegroundColor = function (row, rowIndex) {
385
+ // @ts-ignore
374
386
  return null; // null (für Standard) oder z.B. "#485A64";
375
387
  };
376
388
  AbstractStandardTextColumn.prototype.getCellAlignment = function (row) {
389
+ // @ts-ignore
377
390
  return null; // null (für Standard=left) oder left, right, center
378
391
  };
379
392
  AbstractStandardTextColumn.prototype.getColumnnWidth = function () {
393
+ // @ts-ignore
380
394
  return null; // null oder z.B. 50 für "50 Pixel"
381
395
  };
382
396
  AbstractStandardTextColumn.prototype.getColumnnFontSize = function () {
397
+ // @ts-ignore
383
398
  return null; // null = Default
384
399
  };
385
400
  AbstractStandardTextColumn.prototype.getOnTopColumnName = function () {
401
+ // @ts-ignore
386
402
  return null; // null wenn Doppelt Header ausgeschalten
387
403
  };
388
404
  ;
@@ -381,19 +381,24 @@
381
381
  }
382
382
 
383
383
  public getOnTopBackgroundColor() : string {
384
+ // @ts-ignore
384
385
  return null;
385
386
  }
386
387
 
387
388
  public getColumnHeaderBackgroundColor() : string {
389
+ // @ts-ignore
388
390
  return null; // normaler Header-Hintergrundfarbe / null --> ohne, sonst "#FFFFFF"
389
391
  }
390
392
  public getCellBackgroundColor(row: Object, rowIndex: number) : string {
393
+ // @ts-ignore
391
394
  return null;//"#484848";
392
395
  }
393
396
  public getOnTopCellAlignment() : string {
397
+ // @ts-ignore
394
398
  return null;//"center";
395
399
  }
396
400
  public getCellForegroundColor(row: Object, rowIndex: number) : string {
401
+ // @ts-ignore
397
402
  return null;// null (für Standard) oder z.B. "#485A64";
398
403
  }
399
404
  public getCellAlignment(row: Object) : string {
@@ -403,9 +408,11 @@
403
408
  return 40; // null oder z.B. 50 für "50 Pixel"
404
409
  }
405
410
  public getColumnnFontSize() : number {
411
+ // @ts-ignore
406
412
  return null; // null = Default
407
413
  }
408
414
  public getOnTopColumnName() : string {
415
+ // @ts-ignore
409
416
  return null;// null wenn Doppelt Header ausgeschalten
410
417
  };
411
418
  public getOnTopColumnColSpan() : number {
@@ -423,30 +430,39 @@
423
430
  super("");
424
431
  }
425
432
  public getOnTopBackgroundColor() : string {
433
+ // @ts-ignore
426
434
  return null;
427
435
  }
428
436
  public getColumnHeaderBackgroundColor() : string {
437
+ // @ts-ignore
429
438
  return null; // normaler Header-Hintergrundfarbe / null --> ohne, sonst "#FFFFFF"
430
439
  }
431
440
  public getCellBackgroundColor(row: Object,rowIndex: number) : string {
441
+ // @ts-ignore
432
442
  return null;//"#484848";
433
443
  }
434
444
  public getOnTopCellAlignment() : string {
445
+ // @ts-ignore
435
446
  return null;//"center";
436
447
  }
437
448
  public getCellForegroundColor(row: Object,rowIndex: number) : string {
449
+ // @ts-ignore
438
450
  return null;// null (für Standard) oder z.B. "#485A64";
439
451
  }
440
452
  public getCellAlignment(row: Object) : string {
453
+ // @ts-ignore
441
454
  return null; // null (für Standard=left) oder left, right, center
442
455
  }
443
456
  public getColumnnWidth() : number {
457
+ // @ts-ignore
444
458
  return null; // null oder z.B. 50 für "50 Pixel"
445
459
  }
446
460
  public getColumnnFontSize() : number {
461
+ // @ts-ignore
447
462
  return null; // null = Default
448
463
  }
449
464
  public getOnTopColumnName() : string {
465
+ // @ts-ignore
450
466
  return null;// null wenn Doppelt Header ausgeschalten
451
467
  };
452
468
  public getOnTopColumnColSpan() : number {
package/main.js CHANGED
@@ -1,6 +1,7 @@
1
1
  var DateHelper = require('./date.js').DateHelper;
2
2
  var DateCalendarTest = require('./test.js').DateCalendarTest;
3
- var _a = require('./abstractHTML.js'), AbstractColumn = _a.AbstractColumn, HtmlTable = _a.HtmlTable, HtmlCreator = _a.HtmlCreator, StaticIconColumn = _a.StaticIconColumn, AbstractStandardTextColumn = _a.AbstractStandardTextColumn;
3
+ var _a = require('./html.js'), AbstractColumn = _a.AbstractColumn, HtmlTable = _a.HtmlTable, HtmlCreator = _a.HtmlCreator, StaticIconColumn = _a.StaticIconColumn, AbstractStandardTextColumn = _a.AbstractStandardTextColumn;
4
+ var _b = require('./homematic.js'), HomematicWandthermostat = _b.HomematicWandthermostat, HomematicFussbodenheizung = _b.HomematicFussbodenheizung, HomematicWandschalter = _b.HomematicWandschalter, HomematicDoor = _b.HomematicDoor, HomematicWetterstation = _b.HomematicWetterstation, HomematicAccessPoint = _b.HomematicAccessPoint, HomematicRollladen = _b.HomematicRollladen, HomematicWandtaster = _b.HomematicWandtaster, HomematicTemperatursensor = _b.HomematicTemperatursensor, HomematicRauchmelder = _b.HomematicRauchmelder, HomematicPraesenzmelder = _b.HomematicPraesenzmelder, HomematicCategory = _b.HomematicCategory, AbstractHomematic = _b.AbstractHomematic, HomematicFunkschaltaktor = _b.HomematicFunkschaltaktor;
4
5
  module.exports = {
5
6
  DateHelper: DateHelper,
6
7
  DateCalendarTest: DateCalendarTest,
@@ -8,5 +9,19 @@ module.exports = {
8
9
  HtmlTable: HtmlTable,
9
10
  HtmlCreator: HtmlCreator,
10
11
  StaticIconColumn: StaticIconColumn,
11
- AbstractStandardTextColumn: AbstractStandardTextColumn
12
+ AbstractStandardTextColumn: AbstractStandardTextColumn,
13
+ HomematicWandthermostat: HomematicWandthermostat,
14
+ HomematicFussbodenheizung: HomematicFussbodenheizung,
15
+ HomematicWandschalter: HomematicWandschalter,
16
+ HomematicDoor: HomematicDoor,
17
+ HomematicWetterstation: HomematicWetterstation,
18
+ HomematicAccessPoint: HomematicAccessPoint,
19
+ HomematicRollladen: HomematicRollladen,
20
+ HomematicWandtaster: HomematicWandtaster,
21
+ HomematicTemperatursensor: HomematicTemperatursensor,
22
+ HomematicRauchmelder: HomematicRauchmelder,
23
+ HomematicPraesenzmelder: HomematicPraesenzmelder,
24
+ HomematicCategory: HomematicCategory,
25
+ AbstractHomematic: AbstractHomematic,
26
+ HomematicFunkschaltaktor: HomematicFunkschaltaktor
12
27
  };
package/main.ts CHANGED
@@ -1,9 +1,11 @@
1
1
  const { DateHelper } = require('./date.js');
2
2
  const { DateCalendarTest } = require('./test.js');
3
- const { AbstractColumn, HtmlTable, HtmlCreator, StaticIconColumn, AbstractStandardTextColumn } = require('./abstractHTML.js');
3
+ const { AbstractColumn, HtmlTable, HtmlCreator, StaticIconColumn, AbstractStandardTextColumn } = require('./html.js');
4
+ const { HomematicWandthermostat ,HomematicFussbodenheizung ,HomematicWandschalter , HomematicDoor , HomematicWetterstation ,HomematicAccessPoint , HomematicRollladen , HomematicWandtaster , HomematicTemperatursensor , HomematicRauchmelder , HomematicPraesenzmelder , HomematicCategory, AbstractHomematic, HomematicFunkschaltaktor } = require('./homematic.js');
4
5
 
5
6
  module.exports = {
6
7
  DateHelper,
7
8
  DateCalendarTest,
8
- AbstractColumn, HtmlTable, HtmlCreator, StaticIconColumn, AbstractStandardTextColumn
9
+ AbstractColumn, HtmlTable, HtmlCreator, StaticIconColumn, AbstractStandardTextColumn,
10
+ HomematicWandthermostat ,HomematicFussbodenheizung ,HomematicWandschalter , HomematicDoor , HomematicWetterstation ,HomematicAccessPoint , HomematicRollladen , HomematicWandtaster , HomematicTemperatursensor , HomematicRauchmelder , HomematicPraesenzmelder , HomematicCategory, AbstractHomematic, HomematicFunkschaltaktor
9
11
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker-ucl",
3
- "version": "1.0.33",
3
+ "version": "1.0.36",
4
4
  "main": "main.js",
5
5
  "scripts": {
6
6
  "build": "tsc --build",