iobroker-ucl 1.4.6 → 1.4.7
Sign up to get free protection for your applications and to get access to all the features.
- package/homematicFunctions.js +200 -344
- package/homematicFunctions.ts +257 -432
- package/package.json +1 -1
- package/shellyFunctions.js +309 -357
- package/shellyFunctions.ts +2 -60
package/shellyFunctions.js
CHANGED
@@ -69,7 +69,6 @@ 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
|
-
clearShellyCaches(adapter);
|
73
72
|
}
|
74
73
|
function createDatenpunktSingle(adapter, deviceRawId, attributeType, attributeName, attributeValue, category) {
|
75
74
|
var stateDatenpunkt = "0_userdata.0.devices.shelly." + category + "." + deviceRawId + "." + attributeName;
|
@@ -84,401 +83,354 @@ function createDatenpunktSingle(adapter, deviceRawId, attributeType, attributeNa
|
|
84
83
|
console.log("test");
|
85
84
|
// Sensor:
|
86
85
|
function createShellySensor(adapter, rawId, etage, raum, device, baseState) {
|
87
|
-
|
88
|
-
var stateFolderDatenpunkt = "0_userdata.0.devices.shelly." + deviceShellySensor + "." + rawId;
|
89
|
-
if (adapter.existsState(stateFolderDatenpunkt)) {
|
90
|
-
adapter.deleteState(stateFolderDatenpunkt);
|
91
|
-
}
|
92
|
-
// Neue States anlegen:
|
93
|
-
setTimeout(function () {
|
94
|
-
// Allgemein:
|
95
|
-
createShellyDevice(adapter, rawId, etage, raum, device, baseState, deviceShellySensor);
|
96
|
-
cacheSensorenArray = null;
|
97
|
-
}, 200);
|
86
|
+
createShellyDevice(adapter, rawId, etage, raum, device, baseState, deviceShellySensor);
|
98
87
|
}
|
99
88
|
exports.createShellySensor = createShellySensor;
|
100
89
|
// Rollladen:
|
101
90
|
function createShellyRollladen(adapter, rawId, etage, raum, device, baseState) {
|
102
|
-
|
103
|
-
var stateFolderDatenpunkt = "0_userdata.0.devices.shelly." + deviceShellyRollladen + "." + rawId;
|
104
|
-
if (adapter.existsState(stateFolderDatenpunkt)) {
|
105
|
-
adapter.deleteState(stateFolderDatenpunkt);
|
106
|
-
}
|
107
|
-
// Neue States anlegen:
|
108
|
-
setTimeout(function () {
|
109
|
-
// Allgemein:
|
110
|
-
createShellyDevice(adapter, rawId, etage, raum, device, baseState, deviceShellyRollladen);
|
111
|
-
cacheRollladenArray = null;
|
112
|
-
}, 200);
|
91
|
+
createShellyDevice(adapter, rawId, etage, raum, device, baseState, deviceShellyRollladen);
|
113
92
|
}
|
114
93
|
exports.createShellyRollladen = createShellyRollladen;
|
115
94
|
// Dimmer:
|
116
95
|
function createShellyDimmer(adapter, rawId, etage, raum, device, baseState, alexaSmartNamesForOn, alexaActionNamesForOn, alexaLevelSchemeForOn, alexaSmartNamesForOff, alexaActionNamesForOff, levelScheme1, levelScheme2, levelScheme3, levelScheme4, tasterBooleanOn1, tasterBooleanOn2, tasterBooleanOn3, tasterBooleanOn4, tasterBooleanOff, nachtbeleuchtung, turnOffExitHouseSummer, turnOffExitHouseWinter, turnOnEnterHouseSummer, turnOnEnterHouseWinter) {
|
117
|
-
//
|
118
|
-
|
119
|
-
|
120
|
-
|
96
|
+
// Allgemein:
|
97
|
+
createShellyDevice(adapter, rawId, etage, raum, device, baseState, deviceShellyDimmer);
|
98
|
+
// alexaLevelSchemeForOn: InstanceType<typeof ShellyDimmerAlexaScheme>
|
99
|
+
if (alexaLevelSchemeForOn != null) {
|
100
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attributeDimmer_alexaScheme_aktiv, true, deviceShellyDimmer);
|
101
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeString, attributeDimmer_alexaScheme_name, alexaLevelSchemeForOn.getAlexaName(), deviceShellyDimmer);
|
102
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeNumber, attributeDimmer_alexaScheme_level, alexaLevelSchemeForOn.getLevel(), deviceShellyDimmer);
|
103
|
+
}
|
104
|
+
else {
|
105
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attributeDimmer_alexaScheme_aktiv, false, deviceShellyDimmer);
|
106
|
+
}
|
107
|
+
// levelScheme1: InstanceType<typeof ShellyDimmerAlexaScheme>
|
108
|
+
if (levelScheme1 != null) {
|
109
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attributeDimmer_alexaScheme_aktiv1, true, deviceShellyDimmer);
|
110
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeString, attributeDimmer_alexaScheme_name1, levelScheme1.getAlexaName(), deviceShellyDimmer);
|
111
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeNumber, attributeDimmer_alexaScheme_level1, levelScheme1.getLevel(), deviceShellyDimmer);
|
112
|
+
}
|
113
|
+
else {
|
114
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attributeDimmer_alexaScheme_aktiv1, false, deviceShellyDimmer);
|
115
|
+
}
|
116
|
+
// levelScheme2: InstanceType<typeof ShellyDimmerAlexaScheme>
|
117
|
+
if (levelScheme2 != null) {
|
118
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attributeDimmer_alexaScheme_aktiv2, true, deviceShellyDimmer);
|
119
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeString, attributeDimmer_alexaScheme_name2, levelScheme2.getAlexaName(), deviceShellyDimmer);
|
120
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeNumber, attributeDimmer_alexaScheme_level2, levelScheme2.getLevel(), deviceShellyDimmer);
|
121
|
+
}
|
122
|
+
else {
|
123
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attributeDimmer_alexaScheme_aktiv2, false, deviceShellyDimmer);
|
124
|
+
}
|
125
|
+
// levelScheme3: InstanceType<typeof ShellyDimmerAlexaScheme>
|
126
|
+
if (levelScheme3 != null) {
|
127
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attributeDimmer_alexaScheme_aktiv3, true, deviceShellyDimmer);
|
128
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeString, attributeDimmer_alexaScheme_name3, levelScheme3.getAlexaName(), deviceShellyDimmer);
|
129
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeNumber, attributeDimmer_alexaScheme_level3, levelScheme3.getLevel(), deviceShellyDimmer);
|
130
|
+
}
|
131
|
+
else {
|
132
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attributeDimmer_alexaScheme_aktiv3, false, deviceShellyDimmer);
|
133
|
+
}
|
134
|
+
// levelScheme4: InstanceType<typeof ShellyDimmerAlexaScheme>
|
135
|
+
if (levelScheme4 != null) {
|
136
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attributeDimmer_alexaScheme_aktiv4, true, deviceShellyDimmer);
|
137
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeString, attributeDimmer_alexaScheme_name4, levelScheme4.getAlexaName(), deviceShellyDimmer);
|
138
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeNumber, attributeDimmer_alexaScheme_level4, levelScheme4.getLevel(), deviceShellyDimmer);
|
139
|
+
}
|
140
|
+
else {
|
141
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attributeDimmer_alexaScheme_aktiv4, false, deviceShellyDimmer);
|
121
142
|
}
|
122
|
-
//
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
143
|
+
// tasterBooleanOn1: InstanceType<typeof ShellyDimmerTasterScheme>
|
144
|
+
if (tasterBooleanOn1 != null) {
|
145
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attributeDimmer_tasterScheme_aktiv1, true, deviceShellyDimmer);
|
146
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeString, attributeDimmer_tasterScheme_name1, tasterBooleanOn1.getTasterBooleanOnName(), deviceShellyDimmer);
|
147
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeNumber, attributeDimmer_tasterScheme_level1, tasterBooleanOn1.getLevel(), deviceShellyDimmer);
|
148
|
+
}
|
149
|
+
else {
|
150
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attributeDimmer_tasterScheme_aktiv1, false, deviceShellyDimmer);
|
151
|
+
}
|
152
|
+
// tasterBooleanOn2: InstanceType<typeof ShellyDimmerTasterScheme>
|
153
|
+
if (tasterBooleanOn2 != null) {
|
154
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attributeDimmer_tasterScheme_aktiv2, true, deviceShellyDimmer);
|
155
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeString, attributeDimmer_tasterScheme_name2, tasterBooleanOn1.getTasterBooleanOnName(), deviceShellyDimmer);
|
156
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeNumber, attributeDimmer_tasterScheme_level2, tasterBooleanOn1.getLevel(), deviceShellyDimmer);
|
157
|
+
}
|
158
|
+
else {
|
159
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attributeDimmer_tasterScheme_aktiv2, false, deviceShellyDimmer);
|
160
|
+
}
|
161
|
+
// tasterBooleanOn3: InstanceType<typeof ShellyDimmerTasterScheme>
|
162
|
+
if (tasterBooleanOn3 != null) {
|
163
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attributeDimmer_tasterScheme_aktiv3, true, deviceShellyDimmer);
|
164
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeString, attributeDimmer_tasterScheme_name3, tasterBooleanOn1.getTasterBooleanOnName(), deviceShellyDimmer);
|
165
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeNumber, attributeDimmer_tasterScheme_level3, tasterBooleanOn1.getLevel(), deviceShellyDimmer);
|
166
|
+
}
|
167
|
+
else {
|
168
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attributeDimmer_tasterScheme_aktiv3, false, deviceShellyDimmer);
|
169
|
+
}
|
170
|
+
// tasterBooleanOn4: InstanceType<typeof ShellyDimmerTasterScheme>
|
171
|
+
if (tasterBooleanOn4 != null) {
|
172
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attributeDimmer_tasterScheme_aktiv4, true, deviceShellyDimmer);
|
173
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeString, attributeDimmer_tasterScheme_name4, tasterBooleanOn1.getTasterBooleanOnName(), deviceShellyDimmer);
|
174
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeNumber, attributeDimmer_tasterScheme_level4, tasterBooleanOn1.getLevel(), deviceShellyDimmer);
|
175
|
+
}
|
176
|
+
else {
|
177
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attributeDimmer_tasterScheme_aktiv4, false, deviceShellyDimmer);
|
178
|
+
}
|
179
|
+
// alexaSmartNamesForOn:string[]
|
180
|
+
var db_alexaSmartNamesForOn = null;
|
181
|
+
alexaSmartNamesForOn.forEach(function (value) {
|
182
|
+
if (db_alexaSmartNamesForOn == null) {
|
183
|
+
// @ts-ignore
|
184
|
+
db_alexaSmartNamesForOn = value;
|
131
185
|
}
|
132
186
|
else {
|
133
|
-
|
187
|
+
// @ts-ignore
|
188
|
+
db_alexaSmartNamesForOn += "|" + value;
|
134
189
|
}
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
190
|
+
});
|
191
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_AlexaSmartNamesForOn, db_alexaSmartNamesForOn, deviceShellyDimmer);
|
192
|
+
// alexaActionNamesForOn:string[]
|
193
|
+
var db_alexaActionNamesForOn = null;
|
194
|
+
alexaActionNamesForOn.forEach(function (value) {
|
195
|
+
if (db_alexaActionNamesForOn == null) {
|
196
|
+
// @ts-ignore
|
197
|
+
db_alexaActionNamesForOn = value;
|
140
198
|
}
|
141
199
|
else {
|
142
|
-
|
200
|
+
// @ts-ignore
|
201
|
+
db_alexaActionNamesForOn += "|" + value;
|
143
202
|
}
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
203
|
+
});
|
204
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_AlexaActionNamesForOn, db_alexaActionNamesForOn, deviceShellyDimmer);
|
205
|
+
// alexaSmartNamesForOff:string[]
|
206
|
+
var db_alexaSmartNamesForOff = null;
|
207
|
+
alexaSmartNamesForOff.forEach(function (value) {
|
208
|
+
if (db_alexaSmartNamesForOff == null) {
|
209
|
+
// @ts-ignore
|
210
|
+
db_alexaSmartNamesForOff = value;
|
149
211
|
}
|
150
212
|
else {
|
151
|
-
|
213
|
+
// @ts-ignore
|
214
|
+
db_alexaSmartNamesForOff += "|" + value;
|
152
215
|
}
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
216
|
+
});
|
217
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_AlexaSmartNamesForOff, db_alexaSmartNamesForOff, deviceShellyDimmer);
|
218
|
+
// alexaActionNamesForOff:string[]
|
219
|
+
var db_alexaActionNamesForOff = null;
|
220
|
+
alexaActionNamesForOff.forEach(function (value) {
|
221
|
+
if (db_alexaActionNamesForOff == null) {
|
222
|
+
// @ts-ignore
|
223
|
+
db_alexaActionNamesForOff = value;
|
158
224
|
}
|
159
225
|
else {
|
160
|
-
|
226
|
+
// @ts-ignore
|
227
|
+
db_alexaActionNamesForOff += "|" + value;
|
161
228
|
}
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
229
|
+
});
|
230
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_AlexaActionNamesForOff, db_alexaActionNamesForOff, deviceShellyDimmer);
|
231
|
+
// additionalStates4TurnOff: string[]
|
232
|
+
var db_additionalStates4TurnOff = null;
|
233
|
+
tasterBooleanOff.forEach(function (value) {
|
234
|
+
if (db_additionalStates4TurnOff == null) {
|
235
|
+
// @ts-ignore
|
236
|
+
db_additionalStates4TurnOff = value;
|
167
237
|
}
|
168
238
|
else {
|
169
|
-
|
239
|
+
// @ts-ignore
|
240
|
+
db_additionalStates4TurnOff += "|" + value;
|
170
241
|
}
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
242
|
+
});
|
243
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_TasterBooleanOff, db_additionalStates4TurnOff, deviceShellyDimmer);
|
244
|
+
// Weitere:
|
245
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_Nachtbeleuchtung, nachtbeleuchtung, deviceShellyDimmer);
|
246
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOffExitHouseSummer, turnOffExitHouseSummer, deviceShellyDimmer);
|
247
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOffExitHouseWinter, turnOffExitHouseWinter, deviceShellyDimmer);
|
248
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOnEnterHouseSummer, turnOnEnterHouseSummer, deviceShellyDimmer);
|
249
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOnEnterHouseWinter, turnOnEnterHouseWinter, deviceShellyDimmer);
|
250
|
+
}
|
251
|
+
exports.createShellyDimmer = createShellyDimmer;
|
252
|
+
// Lampe Weiss:
|
253
|
+
function createShellyLampe(adapter, rawId, etage, raum, device, baseState, channel, alexaSmartNamesForOn, alexaActionNamesForOn, alexaSmartNamesForOff, alexaActionNamesForOff, additionalStates4TurnOn, additionalStates4TurnOff, nachtbeleuchtung, turnOffExitHouseSummer, turnOffExitHouseWinter, turnOnEnterHouseSummer, turnOnEnterHouseWinter) {
|
254
|
+
// Allgemein:
|
255
|
+
createShellyDevice(adapter, rawId, etage, raum, device, baseState, deviceShellyLampeWeiss);
|
256
|
+
// attributeChannel
|
257
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeNumber, attributeChannel, channel, deviceShellyLampeWeiss);
|
258
|
+
// alexaSmartNamesForOn:string[]
|
259
|
+
var db_alexaSmartNamesForOn = null;
|
260
|
+
alexaSmartNamesForOn.forEach(function (value) {
|
261
|
+
if (db_alexaSmartNamesForOn == null) {
|
262
|
+
// @ts-ignore
|
263
|
+
db_alexaSmartNamesForOn = value;
|
176
264
|
}
|
177
265
|
else {
|
178
|
-
|
266
|
+
// @ts-ignore
|
267
|
+
db_alexaSmartNamesForOn += "|" + value;
|
179
268
|
}
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
269
|
+
});
|
270
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_AlexaSmartNamesForOn, db_alexaSmartNamesForOn, deviceShellyLampeWeiss);
|
271
|
+
// alexaActionNamesForOn:string[]
|
272
|
+
var db_alexaActionNamesForOn = null;
|
273
|
+
alexaActionNamesForOn.forEach(function (value) {
|
274
|
+
if (db_alexaActionNamesForOn == null) {
|
275
|
+
// @ts-ignore
|
276
|
+
db_alexaActionNamesForOn = value;
|
185
277
|
}
|
186
278
|
else {
|
187
|
-
|
279
|
+
// @ts-ignore
|
280
|
+
db_alexaActionNamesForOn += "|" + value;
|
188
281
|
}
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
282
|
+
});
|
283
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_AlexaActionNamesForOn, db_alexaActionNamesForOn, deviceShellyLampeWeiss);
|
284
|
+
// alexaSmartNamesForOff:string[]
|
285
|
+
var db_alexaSmartNamesForOff = null;
|
286
|
+
alexaSmartNamesForOff.forEach(function (value) {
|
287
|
+
if (db_alexaSmartNamesForOff == null) {
|
288
|
+
// @ts-ignore
|
289
|
+
db_alexaSmartNamesForOff = value;
|
194
290
|
}
|
195
291
|
else {
|
196
|
-
|
292
|
+
// @ts-ignore
|
293
|
+
db_alexaSmartNamesForOff += "|" + value;
|
197
294
|
}
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
295
|
+
});
|
296
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_AlexaSmartNamesForOff, db_alexaSmartNamesForOff, deviceShellyLampeWeiss);
|
297
|
+
// alexaActionNamesForOff:string[]
|
298
|
+
var db_alexaActionNamesForOff = null;
|
299
|
+
alexaActionNamesForOff.forEach(function (value) {
|
300
|
+
if (db_alexaActionNamesForOff == null) {
|
301
|
+
// @ts-ignore
|
302
|
+
db_alexaActionNamesForOff = value;
|
203
303
|
}
|
204
304
|
else {
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
db_alexaSmartNamesForOff += "|" + value;
|
243
|
-
}
|
244
|
-
});
|
245
|
-
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_AlexaSmartNamesForOff, db_alexaSmartNamesForOff, deviceShellyDimmer);
|
246
|
-
// alexaActionNamesForOff:string[]
|
247
|
-
var db_alexaActionNamesForOff = null;
|
248
|
-
alexaActionNamesForOff.forEach(function (value) {
|
249
|
-
if (db_alexaActionNamesForOff == null) {
|
250
|
-
// @ts-ignore
|
251
|
-
db_alexaActionNamesForOff = value;
|
252
|
-
}
|
253
|
-
else {
|
254
|
-
// @ts-ignore
|
255
|
-
db_alexaActionNamesForOff += "|" + value;
|
256
|
-
}
|
257
|
-
});
|
258
|
-
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_AlexaActionNamesForOff, db_alexaActionNamesForOff, deviceShellyDimmer);
|
259
|
-
// additionalStates4TurnOff: string[]
|
260
|
-
var db_additionalStates4TurnOff = null;
|
261
|
-
tasterBooleanOff.forEach(function (value) {
|
262
|
-
if (db_additionalStates4TurnOff == null) {
|
263
|
-
// @ts-ignore
|
264
|
-
db_additionalStates4TurnOff = value;
|
265
|
-
}
|
266
|
-
else {
|
267
|
-
// @ts-ignore
|
268
|
-
db_additionalStates4TurnOff += "|" + value;
|
269
|
-
}
|
270
|
-
});
|
271
|
-
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_TasterBooleanOff, db_additionalStates4TurnOff, deviceShellyDimmer);
|
272
|
-
// Weitere:
|
273
|
-
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_Nachtbeleuchtung, nachtbeleuchtung, deviceShellyDimmer);
|
274
|
-
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOffExitHouseSummer, turnOffExitHouseSummer, deviceShellyDimmer);
|
275
|
-
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOffExitHouseWinter, turnOffExitHouseWinter, deviceShellyDimmer);
|
276
|
-
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOnEnterHouseSummer, turnOnEnterHouseSummer, deviceShellyDimmer);
|
277
|
-
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOnEnterHouseWinter, turnOnEnterHouseWinter, deviceShellyDimmer);
|
278
|
-
cacheDimmerArray = null;
|
279
|
-
}, 200);
|
280
|
-
}
|
281
|
-
exports.createShellyDimmer = createShellyDimmer;
|
282
|
-
// Lampe Weiss:
|
283
|
-
function createShellyLampe(adapter, rawId, etage, raum, device, baseState, channel, alexaSmartNamesForOn, alexaActionNamesForOn, alexaSmartNamesForOff, alexaActionNamesForOff, additionalStates4TurnOn, additionalStates4TurnOff, nachtbeleuchtung, turnOffExitHouseSummer, turnOffExitHouseWinter, turnOnEnterHouseSummer, turnOnEnterHouseWinter) {
|
284
|
-
// Bei Update alte States löschen:
|
285
|
-
var stateFolderDatenpunkt = "0_userdata.0.devices.shelly." + deviceShellyLampeWeiss + "." + rawId;
|
286
|
-
if (adapter.existsState(stateFolderDatenpunkt)) {
|
287
|
-
adapter.deleteState(stateFolderDatenpunkt);
|
288
|
-
}
|
289
|
-
// Neue States anlegen:
|
290
|
-
setTimeout(function () {
|
291
|
-
// Allgemein:
|
292
|
-
createShellyDevice(adapter, rawId, etage, raum, device, baseState, deviceShellyLampeWeiss);
|
293
|
-
// attributeChannel
|
294
|
-
createDatenpunktSingle(adapter, rawId, attributeTypeNumber, attributeChannel, channel, deviceShellyLampeWeiss);
|
295
|
-
// alexaSmartNamesForOn:string[]
|
296
|
-
var db_alexaSmartNamesForOn = null;
|
297
|
-
alexaSmartNamesForOn.forEach(function (value) {
|
298
|
-
if (db_alexaSmartNamesForOn == null) {
|
299
|
-
// @ts-ignore
|
300
|
-
db_alexaSmartNamesForOn = value;
|
301
|
-
}
|
302
|
-
else {
|
303
|
-
// @ts-ignore
|
304
|
-
db_alexaSmartNamesForOn += "|" + value;
|
305
|
-
}
|
306
|
-
});
|
307
|
-
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_AlexaSmartNamesForOn, db_alexaSmartNamesForOn, deviceShellyLampeWeiss);
|
308
|
-
// alexaActionNamesForOn:string[]
|
309
|
-
var db_alexaActionNamesForOn = null;
|
310
|
-
alexaActionNamesForOn.forEach(function (value) {
|
311
|
-
if (db_alexaActionNamesForOn == null) {
|
312
|
-
// @ts-ignore
|
313
|
-
db_alexaActionNamesForOn = value;
|
314
|
-
}
|
315
|
-
else {
|
316
|
-
// @ts-ignore
|
317
|
-
db_alexaActionNamesForOn += "|" + value;
|
318
|
-
}
|
319
|
-
});
|
320
|
-
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_AlexaActionNamesForOn, db_alexaActionNamesForOn, deviceShellyLampeWeiss);
|
321
|
-
// alexaSmartNamesForOff:string[]
|
322
|
-
var db_alexaSmartNamesForOff = null;
|
323
|
-
alexaSmartNamesForOff.forEach(function (value) {
|
324
|
-
if (db_alexaSmartNamesForOff == null) {
|
325
|
-
// @ts-ignore
|
326
|
-
db_alexaSmartNamesForOff = value;
|
327
|
-
}
|
328
|
-
else {
|
329
|
-
// @ts-ignore
|
330
|
-
db_alexaSmartNamesForOff += "|" + value;
|
331
|
-
}
|
332
|
-
});
|
333
|
-
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_AlexaSmartNamesForOff, db_alexaSmartNamesForOff, deviceShellyLampeWeiss);
|
334
|
-
// alexaActionNamesForOff:string[]
|
335
|
-
var db_alexaActionNamesForOff = null;
|
336
|
-
alexaActionNamesForOff.forEach(function (value) {
|
337
|
-
if (db_alexaActionNamesForOff == null) {
|
338
|
-
// @ts-ignore
|
339
|
-
db_alexaActionNamesForOff = value;
|
340
|
-
}
|
341
|
-
else {
|
342
|
-
// @ts-ignore
|
343
|
-
db_alexaActionNamesForOff += "|" + value;
|
344
|
-
}
|
345
|
-
});
|
346
|
-
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_AlexaActionNamesForOff, db_alexaActionNamesForOff, deviceShellyLampeWeiss);
|
347
|
-
// additionalStates4TurnOn: string[]
|
348
|
-
var db_additionalStates4TurnOn = null;
|
349
|
-
additionalStates4TurnOn.forEach(function (value) {
|
350
|
-
if (db_additionalStates4TurnOn == null) {
|
351
|
-
// @ts-ignore
|
352
|
-
db_additionalStates4TurnOn = value;
|
353
|
-
}
|
354
|
-
else {
|
355
|
-
// @ts-ignore
|
356
|
-
db_additionalStates4TurnOn += "|" + value;
|
357
|
-
}
|
358
|
-
});
|
359
|
-
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_TasterBooleanOn, db_additionalStates4TurnOn, deviceShellyLampeWeiss);
|
360
|
-
// additionalStates4TurnOff: string[]
|
361
|
-
var db_additionalStates4TurnOff = null;
|
362
|
-
additionalStates4TurnOff.forEach(function (value) {
|
363
|
-
if (db_additionalStates4TurnOff == null) {
|
364
|
-
// @ts-ignore
|
365
|
-
db_additionalStates4TurnOff = value;
|
366
|
-
}
|
367
|
-
else {
|
368
|
-
// @ts-ignore
|
369
|
-
db_additionalStates4TurnOff += "|" + value;
|
370
|
-
}
|
371
|
-
});
|
372
|
-
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_TasterBooleanOff, db_additionalStates4TurnOff, deviceShellyLampeWeiss);
|
373
|
-
// Weitere:
|
374
|
-
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_Nachtbeleuchtung, nachtbeleuchtung, deviceShellyLampeWeiss);
|
375
|
-
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOffExitHouseSummer, turnOffExitHouseSummer, deviceShellyLampeWeiss);
|
376
|
-
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOffExitHouseWinter, turnOffExitHouseWinter, deviceShellyLampeWeiss);
|
377
|
-
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOnEnterHouseSummer, turnOnEnterHouseSummer, deviceShellyLampeWeiss);
|
378
|
-
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOnEnterHouseWinter, turnOnEnterHouseWinter, deviceShellyLampeWeiss);
|
379
|
-
cacheLampenWeissArray = null;
|
380
|
-
}, 200);
|
305
|
+
// @ts-ignore
|
306
|
+
db_alexaActionNamesForOff += "|" + value;
|
307
|
+
}
|
308
|
+
});
|
309
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_AlexaActionNamesForOff, db_alexaActionNamesForOff, deviceShellyLampeWeiss);
|
310
|
+
// additionalStates4TurnOn: string[]
|
311
|
+
var db_additionalStates4TurnOn = null;
|
312
|
+
additionalStates4TurnOn.forEach(function (value) {
|
313
|
+
if (db_additionalStates4TurnOn == null) {
|
314
|
+
// @ts-ignore
|
315
|
+
db_additionalStates4TurnOn = value;
|
316
|
+
}
|
317
|
+
else {
|
318
|
+
// @ts-ignore
|
319
|
+
db_additionalStates4TurnOn += "|" + value;
|
320
|
+
}
|
321
|
+
});
|
322
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_TasterBooleanOn, db_additionalStates4TurnOn, deviceShellyLampeWeiss);
|
323
|
+
// additionalStates4TurnOff: string[]
|
324
|
+
var db_additionalStates4TurnOff = null;
|
325
|
+
additionalStates4TurnOff.forEach(function (value) {
|
326
|
+
if (db_additionalStates4TurnOff == null) {
|
327
|
+
// @ts-ignore
|
328
|
+
db_additionalStates4TurnOff = value;
|
329
|
+
}
|
330
|
+
else {
|
331
|
+
// @ts-ignore
|
332
|
+
db_additionalStates4TurnOff += "|" + value;
|
333
|
+
}
|
334
|
+
});
|
335
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_TasterBooleanOff, db_additionalStates4TurnOff, deviceShellyLampeWeiss);
|
336
|
+
// Weitere:
|
337
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_Nachtbeleuchtung, nachtbeleuchtung, deviceShellyLampeWeiss);
|
338
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOffExitHouseSummer, turnOffExitHouseSummer, deviceShellyLampeWeiss);
|
339
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOffExitHouseWinter, turnOffExitHouseWinter, deviceShellyLampeWeiss);
|
340
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOnEnterHouseSummer, turnOnEnterHouseSummer, deviceShellyLampeWeiss);
|
341
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOnEnterHouseWinter, turnOnEnterHouseWinter, deviceShellyLampeWeiss);
|
381
342
|
}
|
382
343
|
exports.createShellyLampe = createShellyLampe;
|
383
344
|
// Steckdose:
|
384
345
|
function createShellySteckdose(adapter, rawId, etage, raum, device, baseState, channel, alexaSmartNamesForOn, alexaActionNamesForOn, alexaSmartNamesForOff, alexaActionNamesForOff, additionalStates4TurnOn, additionalStates4TurnOff, nachtbeleuchtung, turnOffExitHouseSummer, turnOffExitHouseWinter, turnOnEnterHouseSummer, turnOnEnterHouseWinter) {
|
385
|
-
//
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_TasterBooleanOff, db_additionalStates4TurnOff, deviceShellySteckdose);
|
474
|
-
// Weitere:
|
475
|
-
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_Nachtbeleuchtung, nachtbeleuchtung, deviceShellySteckdose);
|
476
|
-
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOffExitHouseSummer, turnOffExitHouseSummer, deviceShellySteckdose);
|
477
|
-
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOffExitHouseWinter, turnOffExitHouseWinter, deviceShellySteckdose);
|
478
|
-
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOnEnterHouseSummer, turnOnEnterHouseSummer, deviceShellySteckdose);
|
479
|
-
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOnEnterHouseWinter, turnOnEnterHouseWinter, deviceShellySteckdose);
|
480
|
-
clearShellyCaches(adapter);
|
481
|
-
}, 200);
|
346
|
+
// Allgemein:
|
347
|
+
createShellyDevice(adapter, rawId, etage, raum, device, baseState, deviceShellySteckdose);
|
348
|
+
// attributeChannel
|
349
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeNumber, attributeChannel, channel, deviceShellySteckdose);
|
350
|
+
// alexaSmartNamesForOn:string[]
|
351
|
+
var db_alexaSmartNamesForOn = null;
|
352
|
+
alexaSmartNamesForOn.forEach(function (value) {
|
353
|
+
if (db_alexaSmartNamesForOn == null) {
|
354
|
+
// @ts-ignore
|
355
|
+
db_alexaSmartNamesForOn = value;
|
356
|
+
}
|
357
|
+
else {
|
358
|
+
// @ts-ignore
|
359
|
+
db_alexaSmartNamesForOn += "|" + value;
|
360
|
+
}
|
361
|
+
});
|
362
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_AlexaSmartNamesForOn, db_alexaSmartNamesForOn, deviceShellySteckdose);
|
363
|
+
// alexaActionNamesForOn:string[]
|
364
|
+
var db_alexaActionNamesForOn = null;
|
365
|
+
alexaActionNamesForOn.forEach(function (value) {
|
366
|
+
if (db_alexaActionNamesForOn == null) {
|
367
|
+
// @ts-ignore
|
368
|
+
db_alexaActionNamesForOn = value;
|
369
|
+
}
|
370
|
+
else {
|
371
|
+
// @ts-ignore
|
372
|
+
db_alexaActionNamesForOn += "|" + value;
|
373
|
+
}
|
374
|
+
});
|
375
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_AlexaActionNamesForOn, db_alexaActionNamesForOn, deviceShellySteckdose);
|
376
|
+
// alexaSmartNamesForOff:string[]
|
377
|
+
var db_alexaSmartNamesForOff = null;
|
378
|
+
alexaSmartNamesForOff.forEach(function (value) {
|
379
|
+
if (db_alexaSmartNamesForOff == null) {
|
380
|
+
// @ts-ignore
|
381
|
+
db_alexaSmartNamesForOff = value;
|
382
|
+
}
|
383
|
+
else {
|
384
|
+
// @ts-ignore
|
385
|
+
db_alexaSmartNamesForOff += "|" + value;
|
386
|
+
}
|
387
|
+
});
|
388
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_AlexaSmartNamesForOff, db_alexaSmartNamesForOff, deviceShellySteckdose);
|
389
|
+
// alexaActionNamesForOff:string[]
|
390
|
+
var db_alexaActionNamesForOff = null;
|
391
|
+
alexaActionNamesForOff.forEach(function (value) {
|
392
|
+
if (db_alexaActionNamesForOff == null) {
|
393
|
+
// @ts-ignore
|
394
|
+
db_alexaActionNamesForOff = value;
|
395
|
+
}
|
396
|
+
else {
|
397
|
+
// @ts-ignore
|
398
|
+
db_alexaActionNamesForOff += "|" + value;
|
399
|
+
}
|
400
|
+
});
|
401
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_AlexaActionNamesForOff, db_alexaActionNamesForOff, deviceShellySteckdose);
|
402
|
+
// additionalStates4TurnOn: string[]
|
403
|
+
var db_additionalStates4TurnOn = null;
|
404
|
+
additionalStates4TurnOn.forEach(function (value) {
|
405
|
+
if (db_additionalStates4TurnOn == null) {
|
406
|
+
// @ts-ignore
|
407
|
+
db_additionalStates4TurnOn = value;
|
408
|
+
}
|
409
|
+
else {
|
410
|
+
// @ts-ignore
|
411
|
+
db_additionalStates4TurnOn += "|" + value;
|
412
|
+
}
|
413
|
+
});
|
414
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_TasterBooleanOn, db_additionalStates4TurnOn, deviceShellySteckdose);
|
415
|
+
// additionalStates4TurnOff: string[]
|
416
|
+
var db_additionalStates4TurnOff = null;
|
417
|
+
additionalStates4TurnOff.forEach(function (value) {
|
418
|
+
if (db_additionalStates4TurnOff == null) {
|
419
|
+
// @ts-ignore
|
420
|
+
db_additionalStates4TurnOff = value;
|
421
|
+
}
|
422
|
+
else {
|
423
|
+
// @ts-ignore
|
424
|
+
db_additionalStates4TurnOff += "|" + value;
|
425
|
+
}
|
426
|
+
});
|
427
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeString, attribute_TasterBooleanOff, db_additionalStates4TurnOff, deviceShellySteckdose);
|
428
|
+
// Weitere:
|
429
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_Nachtbeleuchtung, nachtbeleuchtung, deviceShellySteckdose);
|
430
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOffExitHouseSummer, turnOffExitHouseSummer, deviceShellySteckdose);
|
431
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOffExitHouseWinter, turnOffExitHouseWinter, deviceShellySteckdose);
|
432
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOnEnterHouseSummer, turnOnEnterHouseSummer, deviceShellySteckdose);
|
433
|
+
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attribute_TurnOnEnterHouseWinter, turnOnEnterHouseWinter, deviceShellySteckdose);
|
482
434
|
}
|
483
435
|
exports.createShellySteckdose = createShellySteckdose;
|
484
436
|
var cacheRollladenArray = null;
|