iobroker.zendure-solarflow 1.6.7 → 1.7.0

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.
@@ -21,29 +21,30 @@ __export(createSolarFlowStates_exports, {
21
21
  createSolarFlowStates: () => createSolarFlowStates
22
22
  });
23
23
  module.exports = __toCommonJS(createSolarFlowStates_exports);
24
+ var import_adapterService = require("../services/adapterService");
24
25
  var import_createCalculationStates = require("./createCalculationStates");
25
26
  var import_createControlStates = require("./createControlStates");
26
- const createSolarFlowStates = async (adapter, productKey, deviceKey) => {
27
- productKey = productKey.replace(adapter.FORBIDDEN_CHARS, "");
28
- deviceKey = deviceKey.replace(adapter.FORBIDDEN_CHARS, "");
27
+ const createSolarFlowStates = async (adapter, device, type) => {
28
+ const productKey = device.productKey.replace(adapter.FORBIDDEN_CHARS, "");
29
+ const deviceKey = device.deviceKey.replace(adapter.FORBIDDEN_CHARS, "");
29
30
  adapter.log.debug(
30
31
  `[createSolarFlowStates] Creating or updating SolarFlow states for productKey ${productKey} and deviceKey ${deviceKey}.`
31
32
  );
32
- await (adapter == null ? void 0 : adapter.extendObjectAsync(productKey, {
33
+ await (adapter == null ? void 0 : adapter.extendObject(productKey, {
33
34
  type: "device",
34
35
  common: {
35
36
  name: { de: "Produkt " + productKey, en: "Product " + productKey }
36
37
  },
37
38
  native: {}
38
39
  }));
39
- await (adapter == null ? void 0 : adapter.extendObjectAsync(productKey + "." + deviceKey, {
40
+ await (adapter == null ? void 0 : adapter.extendObject(productKey + "." + deviceKey, {
40
41
  type: "channel",
41
42
  common: {
42
43
  name: { de: "Device Key " + deviceKey, en: "Device Key " + deviceKey }
43
44
  },
44
45
  native: {}
45
46
  }));
46
- await (adapter == null ? void 0 : adapter.extendObjectAsync(`${productKey}.${deviceKey}.calculations`, {
47
+ await (adapter == null ? void 0 : adapter.extendObject(`${productKey}.${deviceKey}.calculations`, {
47
48
  type: "channel",
48
49
  common: {
49
50
  name: {
@@ -53,7 +54,7 @@ const createSolarFlowStates = async (adapter, productKey, deviceKey) => {
53
54
  },
54
55
  native: {}
55
56
  }));
56
- await (adapter == null ? void 0 : adapter.extendObjectAsync(`${productKey}.${deviceKey}.packData`, {
57
+ await (adapter == null ? void 0 : adapter.extendObject(`${productKey}.${deviceKey}.packData`, {
57
58
  type: "channel",
58
59
  common: {
59
60
  name: {
@@ -63,7 +64,7 @@ const createSolarFlowStates = async (adapter, productKey, deviceKey) => {
63
64
  },
64
65
  native: {}
65
66
  }));
66
- await (adapter == null ? void 0 : adapter.extendObjectAsync(`${productKey}.${deviceKey}.lastUpdate`, {
67
+ await (adapter == null ? void 0 : adapter.extendObject(`${productKey}.${deviceKey}.lastUpdate`, {
67
68
  type: "state",
68
69
  common: {
69
70
  name: { de: "Letztes Update", en: "Last Update" },
@@ -75,7 +76,7 @@ const createSolarFlowStates = async (adapter, productKey, deviceKey) => {
75
76
  },
76
77
  native: {}
77
78
  }));
78
- await (adapter == null ? void 0 : adapter.extendObjectAsync(`${productKey}.${deviceKey}.buzzerSwitch`, {
79
+ await (adapter == null ? void 0 : adapter.extendObject(`${productKey}.${deviceKey}.buzzerSwitch`, {
79
80
  type: "state",
80
81
  common: {
81
82
  name: {
@@ -83,153 +84,143 @@ const createSolarFlowStates = async (adapter, productKey, deviceKey) => {
83
84
  en: "Enable buzzer on HUB"
84
85
  },
85
86
  type: "boolean",
86
- desc: "passMode",
87
+ desc: "buzzerSwitch",
87
88
  role: "value",
88
89
  read: true,
89
90
  write: false
90
91
  },
91
92
  native: {}
92
93
  }));
93
- await (adapter == null ? void 0 : adapter.extendObjectAsync(`${productKey}.${deviceKey}.passMode`, {
94
+ await (adapter == null ? void 0 : adapter.extendObject(`${productKey}.${deviceKey}.packState`, {
94
95
  type: "state",
95
96
  common: {
96
- name: {
97
- de: "Einstellung des Bypass Modus",
98
- en: "Setting of bypass mode"
99
- },
97
+ name: { de: "Systemstatus", en: "Status of system" },
100
98
  type: "string",
101
- desc: "passMode",
99
+ desc: "packState",
102
100
  role: "value",
103
101
  read: true,
104
102
  write: false
105
103
  },
106
104
  native: {}
107
105
  }));
108
- await (adapter == null ? void 0 : adapter.extendObjectAsync(`${productKey}.${deviceKey}.pass`, {
106
+ await (adapter == null ? void 0 : adapter.extendObject(`${productKey}.${deviceKey}.electricLevel`, {
109
107
  type: "state",
110
108
  common: {
111
- name: { de: "Bypass an/aus", en: "Bypass on/off" },
112
- type: "boolean",
113
- desc: "pass",
114
- role: "value",
109
+ name: { de: "SOC Gesamtsystem", en: "SOC of the system" },
110
+ type: "number",
111
+ desc: "electricLevel",
112
+ role: "value.battery",
115
113
  read: true,
116
- write: false
114
+ write: false,
115
+ unit: "%"
117
116
  },
118
117
  native: {}
119
118
  }));
120
- await (adapter == null ? void 0 : adapter.extendObjectAsync(`${productKey}.${deviceKey}.autoRecover`, {
119
+ if (device.electricity) {
120
+ await (0, import_adapterService.updateSolarFlowState)(
121
+ adapter,
122
+ device.productKey,
123
+ device.deviceKey,
124
+ "electricLevel",
125
+ device.electricity
126
+ );
127
+ }
128
+ await (adapter == null ? void 0 : adapter.extendObject(`${productKey}.${deviceKey}.name`, {
121
129
  type: "state",
122
130
  common: {
123
- name: {
124
- de: "Am n\xE4chsten Tag Bypass auf Automatik",
125
- en: "Automatic recovery of bypass"
126
- },
127
- type: "boolean",
128
- desc: "autoRecover",
131
+ name: { de: "Name", en: "Name" },
132
+ type: "string",
133
+ desc: "name",
129
134
  role: "value",
130
135
  read: true,
131
136
  write: false
132
137
  },
133
138
  native: {}
134
139
  }));
135
- await (adapter == null ? void 0 : adapter.extendObjectAsync(`${productKey}.${deviceKey}.packState`, {
140
+ await (adapter == null ? void 0 : adapter.extendObject(`${productKey}.${deviceKey}.snNumber`, {
136
141
  type: "state",
137
142
  common: {
138
- name: { de: "Systemstatus", en: "Status of system" },
143
+ name: { de: "Seriennnummer", en: "Serial ID" },
139
144
  type: "string",
140
- desc: "packState",
145
+ desc: "snNumber",
141
146
  role: "value",
142
147
  read: true,
143
148
  write: false
144
149
  },
145
150
  native: {}
146
151
  }));
147
- await (adapter == null ? void 0 : adapter.extendObjectAsync(`${productKey}.${deviceKey}.electricLevel`, {
152
+ if (device.snNumber) {
153
+ await (0, import_adapterService.updateSolarFlowState)(
154
+ adapter,
155
+ device.productKey,
156
+ device.deviceKey,
157
+ "snNumber",
158
+ device.snNumber.toString()
159
+ );
160
+ }
161
+ await (adapter == null ? void 0 : adapter.extendObject(`${productKey}.${deviceKey}.productName`, {
148
162
  type: "state",
149
163
  common: {
150
- name: { de: "SOC Gesamtsystem", en: "SOC of the system" },
151
- type: "number",
152
- desc: "electricLevel",
153
- role: "value.battery",
164
+ name: { de: "Produkt Name", en: "Product name" },
165
+ type: "string",
166
+ desc: "productName",
167
+ role: "value",
154
168
  read: true,
155
- write: false,
156
- unit: "%"
169
+ write: false
157
170
  },
158
171
  native: {}
159
172
  }));
160
- await (adapter == null ? void 0 : adapter.extendObjectAsync(`${productKey}.${deviceKey}.name`, {
173
+ await (0, import_adapterService.updateSolarFlowState)(
174
+ adapter,
175
+ device.productKey,
176
+ device.deviceKey,
177
+ "productName",
178
+ device.productName
179
+ );
180
+ await (adapter == null ? void 0 : adapter.extendObject(`${productKey}.${deviceKey}.registeredServer`, {
161
181
  type: "state",
162
182
  common: {
163
- name: { de: "Name", en: "Name" },
183
+ name: { de: "Registrierter Server", en: "Registered server" },
164
184
  type: "string",
165
- desc: "name",
185
+ desc: "registeredServer",
166
186
  role: "value",
167
187
  read: true,
168
188
  write: false
169
189
  },
170
190
  native: {}
171
191
  }));
172
- await (adapter == null ? void 0 : adapter.extendObjectAsync(`${productKey}.${deviceKey}.snNumber`, {
192
+ await (adapter == null ? void 0 : adapter.extendObject(`${productKey}.${deviceKey}.outputPackPower`, {
173
193
  type: "state",
174
194
  common: {
175
- name: { de: "Seriennnummer", en: "Serial ID" },
176
- type: "string",
177
- desc: "snNumber",
178
- role: "value",
195
+ name: { de: "Ladeleistung zur Batterie", en: "charge power" },
196
+ type: "number",
197
+ desc: "outputPackPower",
198
+ role: "value.power",
179
199
  read: true,
180
- write: false
200
+ write: false,
201
+ unit: "W"
181
202
  },
182
203
  native: {}
183
204
  }));
184
- await (adapter == null ? void 0 : adapter.extendObjectAsync(`${productKey}.${deviceKey}.productName`, {
205
+ await (adapter == null ? void 0 : adapter.extendObject(`${productKey}.${deviceKey}.packInputPower`, {
185
206
  type: "state",
186
207
  common: {
187
- name: { de: "Produkt Name", en: "Product name" },
188
- type: "string",
189
- desc: "productName",
190
- role: "value",
208
+ name: { de: "Entladeleistung aus Batterie", en: "discharge power" },
209
+ type: "number",
210
+ desc: "packInputPower",
211
+ role: "value.power",
191
212
  read: true,
192
- write: false
213
+ write: false,
214
+ unit: "W"
193
215
  },
194
216
  native: {}
195
217
  }));
196
- await (adapter == null ? void 0 : adapter.extendObjectAsync(
197
- `${productKey}.${deviceKey}.registeredServer`,
198
- {
199
- type: "state",
200
- common: {
201
- name: { de: "Registrierter Server", en: "Registered server" },
202
- type: "string",
203
- desc: "registeredServer",
204
- role: "value",
205
- read: true,
206
- write: false
207
- },
208
- native: {}
209
- }
210
- ));
211
- await (adapter == null ? void 0 : adapter.extendObjectAsync(
212
- `${productKey}.${deviceKey}.outputHomePower`,
213
- {
214
- type: "state",
215
- common: {
216
- name: { de: "Ausgangsleistung", en: "output power" },
217
- type: "number",
218
- desc: "outputHomePower",
219
- role: "value.power",
220
- read: true,
221
- write: false,
222
- unit: "W"
223
- },
224
- native: {}
225
- }
226
- ));
227
- await (adapter == null ? void 0 : adapter.extendObjectAsync(`${productKey}.${deviceKey}.outputLimit`, {
218
+ await (adapter == null ? void 0 : adapter.extendObject(`${productKey}.${deviceKey}.solarInputPower`, {
228
219
  type: "state",
229
220
  common: {
230
- name: { de: "Limit der Ausgangsleistung", en: "limit of output power" },
221
+ name: { de: "Leistung der Solarmodule", en: "solar power" },
231
222
  type: "number",
232
- desc: "outputLimit",
223
+ desc: "solarInputPower",
233
224
  role: "value.power",
234
225
  read: true,
235
226
  write: false,
@@ -237,55 +228,7 @@ const createSolarFlowStates = async (adapter, productKey, deviceKey) => {
237
228
  },
238
229
  native: {}
239
230
  }));
240
- await (adapter == null ? void 0 : adapter.extendObjectAsync(
241
- `${productKey}.${deviceKey}.outputPackPower`,
242
- {
243
- type: "state",
244
- common: {
245
- name: { de: "Ladeleistung zur Batterie", en: "charge power" },
246
- type: "number",
247
- desc: "outputPackPower",
248
- role: "value.power",
249
- read: true,
250
- write: false,
251
- unit: "W"
252
- },
253
- native: {}
254
- }
255
- ));
256
- await (adapter == null ? void 0 : adapter.extendObjectAsync(
257
- `${productKey}.${deviceKey}.packInputPower`,
258
- {
259
- type: "state",
260
- common: {
261
- name: { de: "Entladeleistung aus Batterie", en: "discharge power" },
262
- type: "number",
263
- desc: "packInputPower",
264
- role: "value.power",
265
- read: true,
266
- write: false,
267
- unit: "W"
268
- },
269
- native: {}
270
- }
271
- ));
272
- await (adapter == null ? void 0 : adapter.extendObjectAsync(
273
- `${productKey}.${deviceKey}.solarInputPower`,
274
- {
275
- type: "state",
276
- common: {
277
- name: { de: "Leistung der Solarmodule", en: "solar power" },
278
- type: "number",
279
- desc: "solarInputPower",
280
- role: "value.power",
281
- read: true,
282
- write: false,
283
- unit: "W"
284
- },
285
- native: {}
286
- }
287
- ));
288
- await (adapter == null ? void 0 : adapter.extendObjectAsync(`${productKey}.${deviceKey}.pvPower1`, {
231
+ await (adapter == null ? void 0 : adapter.extendObject(`${productKey}.${deviceKey}.pvPower1`, {
289
232
  type: "state",
290
233
  common: {
291
234
  name: { de: "Leistung PV 1", en: "solar power channel 1" },
@@ -298,7 +241,7 @@ const createSolarFlowStates = async (adapter, productKey, deviceKey) => {
298
241
  },
299
242
  native: {}
300
243
  }));
301
- await (adapter == null ? void 0 : adapter.extendObjectAsync(`${productKey}.${deviceKey}.pvPower2`, {
244
+ await (adapter == null ? void 0 : adapter.extendObject(`${productKey}.${deviceKey}.pvPower2`, {
302
245
  type: "state",
303
246
  common: {
304
247
  name: { de: "Leistung PV 2", en: "solar power channel 2" },
@@ -311,22 +254,19 @@ const createSolarFlowStates = async (adapter, productKey, deviceKey) => {
311
254
  },
312
255
  native: {}
313
256
  }));
314
- await (adapter == null ? void 0 : adapter.extendObjectAsync(
315
- `${productKey}.${deviceKey}.remainInputTime`,
316
- {
317
- type: "state",
318
- common: {
319
- name: { de: "Erwartete Ladedauer", en: "remaining charge time" },
320
- type: "number",
321
- desc: "remainInputTime",
322
- role: "value.interval",
323
- read: true,
324
- write: false
325
- },
326
- native: {}
327
- }
328
- ));
329
- await (adapter == null ? void 0 : adapter.extendObjectAsync(`${productKey}.${deviceKey}.remainOutTime`, {
257
+ await (adapter == null ? void 0 : adapter.extendObject(`${productKey}.${deviceKey}.remainInputTime`, {
258
+ type: "state",
259
+ common: {
260
+ name: { de: "Erwartete Ladedauer", en: "remaining charge time" },
261
+ type: "number",
262
+ desc: "remainInputTime",
263
+ role: "value.interval",
264
+ read: true,
265
+ write: false
266
+ },
267
+ native: {}
268
+ }));
269
+ await (adapter == null ? void 0 : adapter.extendObject(`${productKey}.${deviceKey}.remainOutTime`, {
330
270
  type: "state",
331
271
  common: {
332
272
  name: {
@@ -341,7 +281,7 @@ const createSolarFlowStates = async (adapter, productKey, deviceKey) => {
341
281
  },
342
282
  native: {}
343
283
  }));
344
- await (adapter == null ? void 0 : adapter.extendObjectAsync(`${productKey}.${deviceKey}.socSet`, {
284
+ await (adapter == null ? void 0 : adapter.extendObject(`${productKey}.${deviceKey}.socSet`, {
345
285
  type: "state",
346
286
  common: {
347
287
  name: { de: "Max. SOC", en: "max. SOC" },
@@ -354,7 +294,7 @@ const createSolarFlowStates = async (adapter, productKey, deviceKey) => {
354
294
  },
355
295
  native: {}
356
296
  }));
357
- await (adapter == null ? void 0 : adapter.extendObjectAsync(`${productKey}.${deviceKey}.minSoc`, {
297
+ await (adapter == null ? void 0 : adapter.extendObject(`${productKey}.${deviceKey}.minSoc`, {
358
298
  type: "state",
359
299
  common: {
360
300
  name: { de: "Min. SOC", en: "min. SOC" },
@@ -367,37 +307,22 @@ const createSolarFlowStates = async (adapter, productKey, deviceKey) => {
367
307
  },
368
308
  native: {}
369
309
  }));
370
- await (adapter == null ? void 0 : adapter.extendObjectAsync(`${productKey}.${deviceKey}.pvBrand`, {
310
+ await (adapter == null ? void 0 : adapter.extendObject(`${productKey}.${deviceKey}.inverseMaxPower`, {
371
311
  type: "state",
372
312
  common: {
373
- name: { de: "Wechselrichter Hersteller", en: "brand of inverter" },
374
- type: "string",
375
- desc: "pvBrand",
313
+ name: {
314
+ de: "Maximal akzeptabler Eingang des PV-Mikrowechselrichters",
315
+ en: "highest acceptable input power"
316
+ },
317
+ type: "number",
318
+ desc: "inverseMaxPower",
376
319
  role: "value",
377
320
  read: true,
378
321
  write: false
379
322
  },
380
323
  native: {}
381
324
  }));
382
- await (adapter == null ? void 0 : adapter.extendObjectAsync(
383
- `${productKey}.${deviceKey}.inverseMaxPower`,
384
- {
385
- type: "state",
386
- common: {
387
- name: {
388
- de: "Maximal akzeptabler Eingang des PV-Mikrowechselrichters",
389
- en: "highest acceptable input power"
390
- },
391
- type: "number",
392
- desc: "inverseMaxPower",
393
- role: "value",
394
- read: true,
395
- write: false
396
- },
397
- native: {}
398
- }
399
- ));
400
- await (adapter == null ? void 0 : adapter.extendObjectAsync(`${productKey}.${deviceKey}.wifiState`, {
325
+ await (adapter == null ? void 0 : adapter.extendObject(`${productKey}.${deviceKey}.wifiState`, {
401
326
  type: "state",
402
327
  common: {
403
328
  name: {
@@ -412,7 +337,14 @@ const createSolarFlowStates = async (adapter, productKey, deviceKey) => {
412
337
  },
413
338
  native: {}
414
339
  }));
415
- await (adapter == null ? void 0 : adapter.extendObjectAsync(`${productKey}.${deviceKey}.hubState`, {
340
+ await (0, import_adapterService.updateSolarFlowState)(
341
+ adapter,
342
+ device.productKey,
343
+ device.deviceKey,
344
+ "wifiStatus",
345
+ device.wifiStatus ? "Connected" : "Disconnected"
346
+ );
347
+ await (adapter == null ? void 0 : adapter.extendObject(`${productKey}.${deviceKey}.hubState`, {
416
348
  type: "state",
417
349
  common: {
418
350
  name: {
@@ -427,10 +359,189 @@ const createSolarFlowStates = async (adapter, productKey, deviceKey) => {
427
359
  },
428
360
  native: {}
429
361
  }));
362
+ if (type == "solarflow") {
363
+ await (adapter == null ? void 0 : adapter.extendObject(`${productKey}.${deviceKey}.pvBrand`, {
364
+ type: "state",
365
+ common: {
366
+ name: { de: "Wechselrichter Hersteller", en: "brand of inverter" },
367
+ type: "string",
368
+ desc: "pvBrand",
369
+ role: "value",
370
+ read: true,
371
+ write: false
372
+ },
373
+ native: {}
374
+ }));
375
+ }
376
+ if (type == "ace") {
377
+ await (adapter == null ? void 0 : adapter.extendObject(`${productKey}.${deviceKey}.dcOutputPower`, {
378
+ type: "state",
379
+ common: {
380
+ name: {
381
+ de: "Aktuelle DC Ausgangsleistung",
382
+ en: "Current DC output power"
383
+ },
384
+ type: "number",
385
+ desc: "dcOutputPower",
386
+ role: "value.power",
387
+ read: true,
388
+ write: false,
389
+ unit: "W"
390
+ },
391
+ native: {}
392
+ }));
393
+ await (adapter == null ? void 0 : adapter.extendObject(`${productKey}.${deviceKey}.dcSwitch`, {
394
+ type: "state",
395
+ common: {
396
+ name: {
397
+ de: "DC Schalter",
398
+ en: "DC switch"
399
+ },
400
+ type: "boolean",
401
+ desc: "dcSwitch",
402
+ role: "value",
403
+ read: true,
404
+ write: false
405
+ },
406
+ native: {}
407
+ }));
408
+ }
409
+ if (type == "solarflow" || type == "hyper") {
410
+ await (adapter == null ? void 0 : adapter.extendObject(`${productKey}.${deviceKey}.passMode`, {
411
+ type: "state",
412
+ common: {
413
+ name: {
414
+ de: "Einstellung des Bypass Modus",
415
+ en: "Setting of bypass mode"
416
+ },
417
+ type: "string",
418
+ desc: "passMode",
419
+ role: "value",
420
+ read: true,
421
+ write: false
422
+ },
423
+ native: {}
424
+ }));
425
+ await (adapter == null ? void 0 : adapter.extendObject(`${productKey}.${deviceKey}.pass`, {
426
+ type: "state",
427
+ common: {
428
+ name: { de: "Bypass an/aus", en: "Bypass on/off" },
429
+ type: "boolean",
430
+ desc: "pass",
431
+ role: "value",
432
+ read: true,
433
+ write: false
434
+ },
435
+ native: {}
436
+ }));
437
+ await (adapter == null ? void 0 : adapter.extendObject(`${productKey}.${deviceKey}.autoRecover`, {
438
+ type: "state",
439
+ common: {
440
+ name: {
441
+ de: "Am n\xE4chsten Tag Bypass auf Automatik",
442
+ en: "Automatic recovery of bypass"
443
+ },
444
+ type: "boolean",
445
+ desc: "autoRecover",
446
+ role: "value",
447
+ read: true,
448
+ write: false
449
+ },
450
+ native: {}
451
+ }));
452
+ await (adapter == null ? void 0 : adapter.extendObject(`${productKey}.${deviceKey}.outputHomePower`, {
453
+ type: "state",
454
+ common: {
455
+ name: { de: "Ausgangsleistung", en: "output power" },
456
+ type: "number",
457
+ desc: "outputHomePower",
458
+ role: "value.power",
459
+ read: true,
460
+ write: false,
461
+ unit: "W"
462
+ },
463
+ native: {}
464
+ }));
465
+ await (adapter == null ? void 0 : adapter.extendObject(`${productKey}.${deviceKey}.outputLimit`, {
466
+ type: "state",
467
+ common: {
468
+ name: { de: "Limit der Ausgangsleistung", en: "limit of output power" },
469
+ type: "number",
470
+ desc: "outputLimit",
471
+ role: "value.power",
472
+ read: true,
473
+ write: false,
474
+ unit: "W"
475
+ },
476
+ native: {}
477
+ }));
478
+ }
479
+ if (type == "ace" || type == "hyper") {
480
+ await (adapter == null ? void 0 : adapter.extendObject(`${productKey}.${deviceKey}.inputLimit`, {
481
+ type: "state",
482
+ common: {
483
+ name: { de: "Limit der Eingangsleistung", en: "limit of input power" },
484
+ type: "number",
485
+ desc: "inputLimit",
486
+ role: "value.power",
487
+ read: true,
488
+ write: false,
489
+ unit: "W"
490
+ },
491
+ native: {}
492
+ }));
493
+ await (adapter == null ? void 0 : adapter.extendObject(`${productKey}.${deviceKey}.gridInputPower`, {
494
+ type: "state",
495
+ common: {
496
+ name: {
497
+ de: "Aktuelle AC Eingangsleistung",
498
+ en: "current ac input power"
499
+ },
500
+ type: "number",
501
+ desc: "gridInputPower",
502
+ role: "value.power",
503
+ read: true,
504
+ write: false,
505
+ unit: "W"
506
+ },
507
+ native: {}
508
+ }));
509
+ await (adapter == null ? void 0 : adapter.extendObject(`${productKey}.${deviceKey}.acOutputPower`, {
510
+ type: "state",
511
+ common: {
512
+ name: {
513
+ de: "Aktuelle AC Ausgangsleistung",
514
+ en: "Current AC output power"
515
+ },
516
+ type: "number",
517
+ desc: "acOutputPower",
518
+ role: "value.power",
519
+ read: true,
520
+ write: false,
521
+ unit: "W"
522
+ },
523
+ native: {}
524
+ }));
525
+ await (adapter == null ? void 0 : adapter.extendObject(`${productKey}.${deviceKey}.acSwitch`, {
526
+ type: "state",
527
+ common: {
528
+ name: {
529
+ de: "AC Schalter",
530
+ en: "AC switch"
531
+ },
532
+ type: "boolean",
533
+ desc: "acSwitch",
534
+ role: "value",
535
+ read: true,
536
+ write: false
537
+ },
538
+ native: {}
539
+ }));
540
+ }
430
541
  if (!adapter.config.useFallbackService) {
431
- await (0, import_createControlStates.createControlStates)(adapter, productKey, deviceKey);
542
+ await (0, import_createControlStates.createControlStates)(adapter, productKey, deviceKey, type);
432
543
  }
433
- if (adapter.config.useCalculation) {
544
+ if (adapter.config.useCalculation && (type == "solarflow" || type == "hyper")) {
434
545
  await (0, import_createCalculationStates.createCalculationStates)(adapter, productKey, deviceKey);
435
546
  } else {
436
547
  }