iobroker.zendure-solarflow 1.10.7 → 1.11.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.
- package/README.md +14 -12
- package/build/constants/sharedStates.js +22 -0
- package/build/constants/sharedStates.js.map +2 -2
- package/build/helpers/createControlStates.js +28 -3
- package/build/helpers/createControlStates.js.map +2 -2
- package/build/main.js +2 -0
- package/build/main.js.map +2 -2
- package/build/models/ISolarFlowMqttProperties.js +1 -0
- package/build/models/ISolarFlowMqttProperties.js.map +2 -2
- package/build/services/mqttService.js +97 -55
- package/build/services/mqttService.js.map +2 -2
- package/io-package.json +14 -14
- package/package.json +1 -1
|
@@ -32,6 +32,7 @@ __export(mqttService_exports, {
|
|
|
32
32
|
connectMqttClient: () => connectMqttClient,
|
|
33
33
|
setAcMode: () => setAcMode,
|
|
34
34
|
setAcSwitch: () => setAcSwitch,
|
|
35
|
+
setAutoModel: () => setAutoModel,
|
|
35
36
|
setAutoRecover: () => setAutoRecover,
|
|
36
37
|
setBuzzerSwitch: () => setBuzzerSwitch,
|
|
37
38
|
setChargeLimit: () => setChargeLimit,
|
|
@@ -206,7 +207,7 @@ const addOrUpdatePackData = async (productKey, deviceKey, packData, isSolarFlow)
|
|
|
206
207
|
}
|
|
207
208
|
};
|
|
208
209
|
const onMessage = async (topic, message) => {
|
|
209
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma, _na, _oa, _pa, _qa, _ra, _sa, _ta, _ua, _va, _wa, _xa, _ya, _za, _Aa, _Ba, _Ca, _Da, _Ea, _Fa, _Ga, _Ha, _Ia, _Ja, _Ka, _La, _Ma;
|
|
210
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma, _na, _oa, _pa, _qa, _ra, _sa, _ta, _ua, _va, _wa, _xa, _ya, _za, _Aa, _Ba, _Ca, _Da, _Ea, _Fa, _Ga, _Ha, _Ia, _Ja, _Ka, _La, _Ma, _Na, _Oa, _Pa, _Qa, _Ra;
|
|
210
211
|
if (adapter) {
|
|
211
212
|
if (topic.toLowerCase().includes("loginOut/force")) {
|
|
212
213
|
}
|
|
@@ -235,7 +236,27 @@ const onMessage = async (topic, message) => {
|
|
|
235
236
|
"lastUpdate",
|
|
236
237
|
(/* @__PURE__ */ new Date()).getTime()
|
|
237
238
|
);
|
|
238
|
-
if (((_c = obj.properties) == null ? void 0 : _c.
|
|
239
|
+
if (((_c = obj.properties) == null ? void 0 : _c.autoModel) != null && ((_d = obj.properties) == null ? void 0 : _d.autoModel) != void 0) {
|
|
240
|
+
(0, import_adapterService.updateSolarFlowState)(
|
|
241
|
+
adapter,
|
|
242
|
+
productKey,
|
|
243
|
+
deviceKey,
|
|
244
|
+
"autoModel",
|
|
245
|
+
obj.properties.autoModel
|
|
246
|
+
);
|
|
247
|
+
(0, import_adapterService.updateSolarFlowControlState)(
|
|
248
|
+
adapter,
|
|
249
|
+
productKey,
|
|
250
|
+
deviceKey,
|
|
251
|
+
"autoModel",
|
|
252
|
+
obj.properties.autoModel
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
if (((_e = obj.properties) == null ? void 0 : _e.heatState) != null && ((_f = obj.properties) == null ? void 0 : _f.heatState) != void 0) {
|
|
256
|
+
const value = ((_g = obj.properties) == null ? void 0 : _g.heatState) == 0 ? false : true;
|
|
257
|
+
(0, import_adapterService.updateSolarFlowState)(adapter, productKey, deviceKey, "heatState", value);
|
|
258
|
+
}
|
|
259
|
+
if (((_h = obj.properties) == null ? void 0 : _h.electricLevel) != null && ((_i = obj.properties) == null ? void 0 : _i.electricLevel) != void 0) {
|
|
239
260
|
(0, import_adapterService.updateSolarFlowState)(
|
|
240
261
|
adapter,
|
|
241
262
|
productKey,
|
|
@@ -269,27 +290,27 @@ const onMessage = async (topic, message) => {
|
|
|
269
290
|
const value = obj.power / 10;
|
|
270
291
|
(0, import_adapterService.updateSolarFlowState)(adapter, productKey, deviceKey, "power", value);
|
|
271
292
|
}
|
|
272
|
-
if (((
|
|
273
|
-
const value = ((
|
|
293
|
+
if (((_j = obj.properties) == null ? void 0 : _j.packState) != null && ((_k = obj.properties) == null ? void 0 : _k.packState) != void 0) {
|
|
294
|
+
const value = ((_l = obj.properties) == null ? void 0 : _l.packState) == 0 ? "Idle" : ((_m = obj.properties) == null ? void 0 : _m.packState) == 1 ? "Charging" : ((_n = obj.properties) == null ? void 0 : _n.packState) == 2 ? "Discharging" : "Unknown";
|
|
274
295
|
(0, import_adapterService.updateSolarFlowState)(adapter, productKey, deviceKey, "packState", value);
|
|
275
296
|
}
|
|
276
|
-
if (((
|
|
277
|
-
const value = ((
|
|
297
|
+
if (((_o = obj.properties) == null ? void 0 : _o.passMode) != null && ((_p = obj.properties) == null ? void 0 : _p.passMode) != void 0) {
|
|
298
|
+
const value = ((_q = obj.properties) == null ? void 0 : _q.passMode) == 0 ? "Automatic" : ((_r = obj.properties) == null ? void 0 : _r.passMode) == 1 ? "Always off" : ((_s = obj.properties) == null ? void 0 : _s.passMode) == 2 ? "Always on" : "Unknown";
|
|
278
299
|
(0, import_adapterService.updateSolarFlowState)(adapter, productKey, deviceKey, "passMode", value);
|
|
279
300
|
(0, import_adapterService.updateSolarFlowControlState)(
|
|
280
301
|
adapter,
|
|
281
302
|
productKey,
|
|
282
303
|
deviceKey,
|
|
283
304
|
"passMode",
|
|
284
|
-
(
|
|
305
|
+
(_t = obj.properties) == null ? void 0 : _t.passMode
|
|
285
306
|
);
|
|
286
307
|
}
|
|
287
|
-
if (((
|
|
288
|
-
const value = ((
|
|
308
|
+
if (((_u = obj.properties) == null ? void 0 : _u.pass) != null && ((_v = obj.properties) == null ? void 0 : _v.pass) != void 0) {
|
|
309
|
+
const value = ((_w = obj.properties) == null ? void 0 : _w.pass) == 0 ? false : true;
|
|
289
310
|
(0, import_adapterService.updateSolarFlowState)(adapter, productKey, deviceKey, "pass", value);
|
|
290
311
|
}
|
|
291
|
-
if (((
|
|
292
|
-
const value = ((
|
|
312
|
+
if (((_x = obj.properties) == null ? void 0 : _x.autoRecover) != null && ((_y = obj.properties) == null ? void 0 : _y.autoRecover) != void 0) {
|
|
313
|
+
const value = ((_z = obj.properties) == null ? void 0 : _z.autoRecover) == 0 ? false : true;
|
|
293
314
|
(0, import_adapterService.updateSolarFlowState)(
|
|
294
315
|
adapter,
|
|
295
316
|
productKey,
|
|
@@ -305,7 +326,7 @@ const onMessage = async (topic, message) => {
|
|
|
305
326
|
value
|
|
306
327
|
);
|
|
307
328
|
}
|
|
308
|
-
if (((
|
|
329
|
+
if (((_A = obj.properties) == null ? void 0 : _A.outputHomePower) != null && ((_B = obj.properties) == null ? void 0 : _B.outputHomePower) != void 0) {
|
|
309
330
|
(0, import_adapterService.updateSolarFlowState)(
|
|
310
331
|
adapter,
|
|
311
332
|
productKey,
|
|
@@ -314,7 +335,7 @@ const onMessage = async (topic, message) => {
|
|
|
314
335
|
obj.properties.outputHomePower
|
|
315
336
|
);
|
|
316
337
|
}
|
|
317
|
-
if (((
|
|
338
|
+
if (((_C = obj.properties) == null ? void 0 : _C.energyPower) != null && ((_D = obj.properties) == null ? void 0 : _D.energyPower) != void 0) {
|
|
318
339
|
(0, import_adapterService.updateSolarFlowState)(
|
|
319
340
|
adapter,
|
|
320
341
|
productKey,
|
|
@@ -323,7 +344,7 @@ const onMessage = async (topic, message) => {
|
|
|
323
344
|
obj.properties.energyPower
|
|
324
345
|
);
|
|
325
346
|
}
|
|
326
|
-
if (((
|
|
347
|
+
if (((_E = obj.properties) == null ? void 0 : _E.outputLimit) != null && ((_F = obj.properties) == null ? void 0 : _F.outputLimit) != void 0) {
|
|
327
348
|
(0, import_adapterService.updateSolarFlowState)(
|
|
328
349
|
adapter,
|
|
329
350
|
productKey,
|
|
@@ -339,8 +360,8 @@ const onMessage = async (topic, message) => {
|
|
|
339
360
|
obj.properties.outputLimit
|
|
340
361
|
);
|
|
341
362
|
}
|
|
342
|
-
if (((
|
|
343
|
-
const value = ((
|
|
363
|
+
if (((_G = obj.properties) == null ? void 0 : _G.buzzerSwitch) != null && ((_H = obj.properties) == null ? void 0 : _H.buzzerSwitch) != void 0) {
|
|
364
|
+
const value = ((_I = obj.properties) == null ? void 0 : _I.buzzerSwitch) == 0 ? false : true;
|
|
344
365
|
(0, import_adapterService.updateSolarFlowState)(
|
|
345
366
|
adapter,
|
|
346
367
|
productKey,
|
|
@@ -356,7 +377,7 @@ const onMessage = async (topic, message) => {
|
|
|
356
377
|
value
|
|
357
378
|
);
|
|
358
379
|
}
|
|
359
|
-
if (((
|
|
380
|
+
if (((_J = obj.properties) == null ? void 0 : _J.outputPackPower) != null && ((_K = obj.properties) == null ? void 0 : _K.outputPackPower) != void 0) {
|
|
360
381
|
(0, import_adapterService.updateSolarFlowState)(
|
|
361
382
|
adapter,
|
|
362
383
|
productKey,
|
|
@@ -366,19 +387,19 @@ const onMessage = async (topic, message) => {
|
|
|
366
387
|
);
|
|
367
388
|
(0, import_adapterService.updateSolarFlowState)(adapter, productKey, deviceKey, "packInputPower", 0);
|
|
368
389
|
}
|
|
369
|
-
if (((
|
|
390
|
+
if (((_L = obj.properties) == null ? void 0 : _L.packInputPower) != null && ((_M = obj.properties) == null ? void 0 : _M.packInputPower) != void 0) {
|
|
370
391
|
let standbyUsage = 0;
|
|
371
392
|
const solarInputPower = await (adapter == null ? void 0 : adapter.getStateAsync(
|
|
372
393
|
`${productKey}.${deviceKey}.solarInputPower`
|
|
373
394
|
));
|
|
374
395
|
if (solarInputPower && Number(solarInputPower.val) < 10) {
|
|
375
|
-
standbyUsage =
|
|
396
|
+
standbyUsage = 7 - Number(solarInputPower.val);
|
|
376
397
|
}
|
|
377
|
-
const device = (
|
|
398
|
+
const device = (_N = adapter == null ? void 0 : adapter.deviceList) == null ? void 0 : _N.find(
|
|
378
399
|
(x) => x.deviceKey == deviceKey && x.productKey == productKey
|
|
379
400
|
);
|
|
380
401
|
if (device && device._connectedWithAce) {
|
|
381
|
-
standbyUsage +=
|
|
402
|
+
standbyUsage += 7;
|
|
382
403
|
}
|
|
383
404
|
(0, import_adapterService.updateSolarFlowState)(
|
|
384
405
|
adapter,
|
|
@@ -395,7 +416,7 @@ const onMessage = async (topic, message) => {
|
|
|
395
416
|
0
|
|
396
417
|
);
|
|
397
418
|
}
|
|
398
|
-
if (((
|
|
419
|
+
if (((_O = obj.properties) == null ? void 0 : _O.solarInputPower) != null && ((_P = obj.properties) == null ? void 0 : _P.solarInputPower) != void 0) {
|
|
399
420
|
(0, import_adapterService.updateSolarFlowState)(
|
|
400
421
|
adapter,
|
|
401
422
|
productKey,
|
|
@@ -404,7 +425,7 @@ const onMessage = async (topic, message) => {
|
|
|
404
425
|
obj.properties.solarInputPower
|
|
405
426
|
);
|
|
406
427
|
}
|
|
407
|
-
if (((
|
|
428
|
+
if (((_Q = obj.properties) == null ? void 0 : _Q.pvPower1) != null && ((_R = obj.properties) == null ? void 0 : _R.pvPower1) != void 0) {
|
|
408
429
|
(0, import_adapterService.updateSolarFlowState)(
|
|
409
430
|
adapter,
|
|
410
431
|
productKey,
|
|
@@ -414,7 +435,7 @@ const onMessage = async (topic, message) => {
|
|
|
414
435
|
obj.properties.pvPower1
|
|
415
436
|
);
|
|
416
437
|
}
|
|
417
|
-
if (((
|
|
438
|
+
if (((_S = obj.properties) == null ? void 0 : _S.pvPower2) != null && ((_T = obj.properties) == null ? void 0 : _T.pvPower2) != void 0) {
|
|
418
439
|
(0, import_adapterService.updateSolarFlowState)(
|
|
419
440
|
adapter,
|
|
420
441
|
productKey,
|
|
@@ -424,7 +445,7 @@ const onMessage = async (topic, message) => {
|
|
|
424
445
|
obj.properties.pvPower2
|
|
425
446
|
);
|
|
426
447
|
}
|
|
427
|
-
if (((
|
|
448
|
+
if (((_U = obj.properties) == null ? void 0 : _U.solarPower1) != null && ((_V = obj.properties) == null ? void 0 : _V.solarPower1) != void 0) {
|
|
428
449
|
(0, import_adapterService.updateSolarFlowState)(
|
|
429
450
|
adapter,
|
|
430
451
|
productKey,
|
|
@@ -433,7 +454,7 @@ const onMessage = async (topic, message) => {
|
|
|
433
454
|
obj.properties.solarPower1
|
|
434
455
|
);
|
|
435
456
|
}
|
|
436
|
-
if (((
|
|
457
|
+
if (((_W = obj.properties) == null ? void 0 : _W.solarPower2) != null && ((_X = obj.properties) == null ? void 0 : _X.solarPower2) != void 0) {
|
|
437
458
|
(0, import_adapterService.updateSolarFlowState)(
|
|
438
459
|
adapter,
|
|
439
460
|
productKey,
|
|
@@ -442,7 +463,7 @@ const onMessage = async (topic, message) => {
|
|
|
442
463
|
obj.properties.solarPower2
|
|
443
464
|
);
|
|
444
465
|
}
|
|
445
|
-
if (((
|
|
466
|
+
if (((_Y = obj.properties) == null ? void 0 : _Y.remainOutTime) != null && ((_Z = obj.properties) == null ? void 0 : _Z.remainOutTime) != void 0) {
|
|
446
467
|
(0, import_adapterService.updateSolarFlowState)(
|
|
447
468
|
adapter,
|
|
448
469
|
productKey,
|
|
@@ -451,7 +472,7 @@ const onMessage = async (topic, message) => {
|
|
|
451
472
|
obj.properties.remainOutTime
|
|
452
473
|
);
|
|
453
474
|
}
|
|
454
|
-
if (((
|
|
475
|
+
if (((__ = obj.properties) == null ? void 0 : __.remainInputTime) != null && ((_$ = obj.properties) == null ? void 0 : _$.remainInputTime) != void 0) {
|
|
455
476
|
(0, import_adapterService.updateSolarFlowState)(
|
|
456
477
|
adapter,
|
|
457
478
|
productKey,
|
|
@@ -460,7 +481,7 @@ const onMessage = async (topic, message) => {
|
|
|
460
481
|
obj.properties.remainInputTime
|
|
461
482
|
);
|
|
462
483
|
}
|
|
463
|
-
if (((
|
|
484
|
+
if (((_aa = obj.properties) == null ? void 0 : _aa.socSet) != null && ((_ba = obj.properties) == null ? void 0 : _ba.socSet) != void 0) {
|
|
464
485
|
(0, import_adapterService.updateSolarFlowState)(
|
|
465
486
|
adapter,
|
|
466
487
|
productKey,
|
|
@@ -476,7 +497,7 @@ const onMessage = async (topic, message) => {
|
|
|
476
497
|
Number(obj.properties.socSet) / 10
|
|
477
498
|
);
|
|
478
499
|
}
|
|
479
|
-
if (((
|
|
500
|
+
if (((_ca = obj.properties) == null ? void 0 : _ca.minSoc) != null && ((_da = obj.properties) == null ? void 0 : _da.minSoc) != void 0) {
|
|
480
501
|
(0, import_adapterService.updateSolarFlowState)(
|
|
481
502
|
adapter,
|
|
482
503
|
productKey,
|
|
@@ -492,7 +513,7 @@ const onMessage = async (topic, message) => {
|
|
|
492
513
|
Number(obj.properties.minSoc) / 10
|
|
493
514
|
);
|
|
494
515
|
}
|
|
495
|
-
if (((
|
|
516
|
+
if (((_ea = obj.properties) == null ? void 0 : _ea.inputLimit) != null && ((_fa = obj.properties) == null ? void 0 : _fa.inputLimit) != void 0) {
|
|
496
517
|
(0, import_adapterService.updateSolarFlowState)(
|
|
497
518
|
adapter,
|
|
498
519
|
productKey,
|
|
@@ -500,7 +521,7 @@ const onMessage = async (topic, message) => {
|
|
|
500
521
|
"inputLimit",
|
|
501
522
|
obj.properties.inputLimit
|
|
502
523
|
);
|
|
503
|
-
if (((
|
|
524
|
+
if (((_ga = productName == null ? void 0 : productName.val) == null ? void 0 : _ga.toString().toLowerCase().includes("solarflow")) || ((_ha = productName == null ? void 0 : productName.val) == null ? void 0 : _ha.toString().toLowerCase().includes("ace")) || ((_ia = productName == null ? void 0 : productName.val) == null ? void 0 : _ia.toString().toLowerCase().includes("hyper"))) {
|
|
504
525
|
(0, import_adapterService.updateSolarFlowControlState)(
|
|
505
526
|
adapter,
|
|
506
527
|
productKey,
|
|
@@ -510,7 +531,7 @@ const onMessage = async (topic, message) => {
|
|
|
510
531
|
);
|
|
511
532
|
}
|
|
512
533
|
}
|
|
513
|
-
if (((
|
|
534
|
+
if (((_ja = obj.properties) == null ? void 0 : _ja.gridInputPower) != null && ((_ka = obj.properties) == null ? void 0 : _ka.gridInputPower) != void 0) {
|
|
514
535
|
(0, import_adapterService.updateSolarFlowState)(
|
|
515
536
|
adapter,
|
|
516
537
|
productKey,
|
|
@@ -519,7 +540,7 @@ const onMessage = async (topic, message) => {
|
|
|
519
540
|
obj.properties.gridInputPower
|
|
520
541
|
);
|
|
521
542
|
}
|
|
522
|
-
if (((
|
|
543
|
+
if (((_la = obj.properties) == null ? void 0 : _la.acMode) != null && ((_ma = obj.properties) == null ? void 0 : _ma.acMode) != void 0) {
|
|
523
544
|
(0, import_adapterService.updateSolarFlowState)(
|
|
524
545
|
adapter,
|
|
525
546
|
productKey,
|
|
@@ -535,7 +556,7 @@ const onMessage = async (topic, message) => {
|
|
|
535
556
|
obj.properties.acMode
|
|
536
557
|
);
|
|
537
558
|
}
|
|
538
|
-
if (((
|
|
559
|
+
if (((_na = obj.properties) == null ? void 0 : _na.hyperTmp) != null && ((_oa = obj.properties) == null ? void 0 : _oa.hyperTmp) != void 0) {
|
|
539
560
|
(0, import_adapterService.updateSolarFlowState)(
|
|
540
561
|
adapter,
|
|
541
562
|
productKey,
|
|
@@ -544,7 +565,7 @@ const onMessage = async (topic, message) => {
|
|
|
544
565
|
obj.properties.hyperTmp / 10 - 273.15
|
|
545
566
|
);
|
|
546
567
|
}
|
|
547
|
-
if (((
|
|
568
|
+
if (((_pa = obj.properties) == null ? void 0 : _pa.acOutputPower) != null && ((_qa = obj.properties) == null ? void 0 : _qa.acOutputPower) != void 0) {
|
|
548
569
|
(0, import_adapterService.updateSolarFlowState)(
|
|
549
570
|
adapter,
|
|
550
571
|
productKey,
|
|
@@ -553,17 +574,17 @@ const onMessage = async (topic, message) => {
|
|
|
553
574
|
obj.properties.acOutputPower
|
|
554
575
|
);
|
|
555
576
|
}
|
|
556
|
-
if (((
|
|
577
|
+
if (((_ra = obj.properties) == null ? void 0 : _ra.gridPower) != null && ((_sa = obj.properties) == null ? void 0 : _sa.gridPower) != void 0) {
|
|
557
578
|
(0, import_adapterService.updateSolarFlowState)(
|
|
558
579
|
adapter,
|
|
559
580
|
productKey,
|
|
560
581
|
deviceKey,
|
|
561
|
-
"
|
|
582
|
+
"gridInputPower",
|
|
562
583
|
obj.properties.gridPower
|
|
563
584
|
);
|
|
564
585
|
}
|
|
565
|
-
if (((
|
|
566
|
-
const value = ((
|
|
586
|
+
if (((_ta = obj.properties) == null ? void 0 : _ta.acSwitch) != null && ((_ua = obj.properties) == null ? void 0 : _ua.acSwitch) != void 0) {
|
|
587
|
+
const value = ((_va = obj.properties) == null ? void 0 : _va.acSwitch) == 0 ? false : true;
|
|
567
588
|
(0, import_adapterService.updateSolarFlowState)(adapter, productKey, deviceKey, "acSwitch", value);
|
|
568
589
|
(0, import_adapterService.updateSolarFlowControlState)(
|
|
569
590
|
adapter,
|
|
@@ -573,8 +594,8 @@ const onMessage = async (topic, message) => {
|
|
|
573
594
|
value
|
|
574
595
|
);
|
|
575
596
|
}
|
|
576
|
-
if (((
|
|
577
|
-
const value = ((
|
|
597
|
+
if (((_wa = obj.properties) == null ? void 0 : _wa.dcSwitch) != null && ((_xa = obj.properties) == null ? void 0 : _xa.dcSwitch) != void 0) {
|
|
598
|
+
const value = ((_ya = obj.properties) == null ? void 0 : _ya.dcSwitch) == 0 ? false : true;
|
|
578
599
|
(0, import_adapterService.updateSolarFlowState)(adapter, productKey, deviceKey, "dcSwitch", value);
|
|
579
600
|
(0, import_adapterService.updateSolarFlowControlState)(
|
|
580
601
|
adapter,
|
|
@@ -584,7 +605,7 @@ const onMessage = async (topic, message) => {
|
|
|
584
605
|
value
|
|
585
606
|
);
|
|
586
607
|
}
|
|
587
|
-
if (((
|
|
608
|
+
if (((_za = obj.properties) == null ? void 0 : _za.dcOutputPower) != null && ((_Aa = obj.properties) == null ? void 0 : _Aa.dcOutputPower) != void 0) {
|
|
588
609
|
(0, import_adapterService.updateSolarFlowState)(
|
|
589
610
|
adapter,
|
|
590
611
|
productKey,
|
|
@@ -593,11 +614,11 @@ const onMessage = async (topic, message) => {
|
|
|
593
614
|
obj.properties.dcOutputPower
|
|
594
615
|
);
|
|
595
616
|
}
|
|
596
|
-
if (((
|
|
597
|
-
const value = ((
|
|
617
|
+
if (((_Ba = obj.properties) == null ? void 0 : _Ba.pvBrand) != null && ((_Ca = obj.properties) == null ? void 0 : _Ca.pvBrand) != void 0) {
|
|
618
|
+
const value = ((_Da = obj.properties) == null ? void 0 : _Da.pvBrand) == 0 ? "Others" : ((_Ea = obj.properties) == null ? void 0 : _Ea.pvBrand) == 1 ? "Hoymiles" : ((_Fa = obj.properties) == null ? void 0 : _Fa.pvBrand) == 2 ? "Enphase" : ((_Ga = obj.properties) == null ? void 0 : _Ga.pvBrand) == 3 ? "APSystems" : ((_Ha = obj.properties) == null ? void 0 : _Ha.pvBrand) == 4 ? "Anker" : ((_Ia = obj.properties) == null ? void 0 : _Ia.pvBrand) == 5 ? "Deye" : ((_Ja = obj.properties) == null ? void 0 : _Ja.pvBrand) == 6 ? "Bosswerk" : "Unknown";
|
|
598
619
|
(0, import_adapterService.updateSolarFlowState)(adapter, productKey, deviceKey, "pvBrand", value);
|
|
599
620
|
}
|
|
600
|
-
if (((
|
|
621
|
+
if (((_Ka = obj.properties) == null ? void 0 : _Ka.inverseMaxPower) != null && ((_La = obj.properties) == null ? void 0 : _La.inverseMaxPower) != void 0) {
|
|
601
622
|
(0, import_adapterService.updateSolarFlowState)(
|
|
602
623
|
adapter,
|
|
603
624
|
productKey,
|
|
@@ -606,7 +627,7 @@ const onMessage = async (topic, message) => {
|
|
|
606
627
|
obj.properties.inverseMaxPower
|
|
607
628
|
);
|
|
608
629
|
}
|
|
609
|
-
if (((
|
|
630
|
+
if (((_Ma = obj.properties) == null ? void 0 : _Ma.wifiState) != null && ((_Na = obj.properties) == null ? void 0 : _Na.wifiState) != void 0) {
|
|
610
631
|
(0, import_adapterService.updateSolarFlowState)(
|
|
611
632
|
adapter,
|
|
612
633
|
productKey,
|
|
@@ -615,7 +636,7 @@ const onMessage = async (topic, message) => {
|
|
|
615
636
|
obj.properties.wifiState == 1 ? "Connected" : "Disconnected"
|
|
616
637
|
);
|
|
617
638
|
}
|
|
618
|
-
if (((
|
|
639
|
+
if (((_Oa = obj.properties) == null ? void 0 : _Oa.packNum) != null && ((_Pa = obj.properties) == null ? void 0 : _Pa.packNum) != void 0) {
|
|
619
640
|
(0, import_adapterService.updateSolarFlowState)(
|
|
620
641
|
adapter,
|
|
621
642
|
productKey,
|
|
@@ -624,7 +645,7 @@ const onMessage = async (topic, message) => {
|
|
|
624
645
|
obj.properties.packNum
|
|
625
646
|
);
|
|
626
647
|
}
|
|
627
|
-
if (((
|
|
648
|
+
if (((_Qa = obj.properties) == null ? void 0 : _Qa.hubState) != null && ((_Ra = obj.properties) == null ? void 0 : _Ra.hubState) != void 0) {
|
|
628
649
|
(0, import_adapterService.updateSolarFlowState)(
|
|
629
650
|
adapter,
|
|
630
651
|
productKey,
|
|
@@ -708,8 +729,15 @@ const setHubState = async (adapter2, productKey, deviceKey, hubState) => {
|
|
|
708
729
|
}
|
|
709
730
|
};
|
|
710
731
|
const setOutputLimit = async (adapter2, productKey, deviceKey, limit) => {
|
|
711
|
-
var _a, _b, _c, _d;
|
|
732
|
+
var _a, _b, _c, _d, _e;
|
|
712
733
|
if (adapter2.mqttClient && productKey && deviceKey) {
|
|
734
|
+
const autoModel = (_a = await adapter2.getStateAsync(productKey + "." + deviceKey + ".autoModel")) == null ? void 0 : _a.val;
|
|
735
|
+
if (autoModel != 0) {
|
|
736
|
+
adapter2.log.warn(
|
|
737
|
+
"Operation mode (autoModel) is not set to '0', we can't set the output limit!"
|
|
738
|
+
);
|
|
739
|
+
return;
|
|
740
|
+
}
|
|
713
741
|
if (limit) {
|
|
714
742
|
limit = Math.round(limit);
|
|
715
743
|
} else {
|
|
@@ -729,8 +757,8 @@ const setOutputLimit = async (adapter2, productKey, deviceKey, limit) => {
|
|
|
729
757
|
limit = 0;
|
|
730
758
|
}
|
|
731
759
|
}
|
|
732
|
-
const currentLimit = (
|
|
733
|
-
const productName = (
|
|
760
|
+
const currentLimit = (_b = await adapter2.getStateAsync(productKey + "." + deviceKey + ".outputLimit")) == null ? void 0 : _b.val;
|
|
761
|
+
const productName = (_d = (_c = await adapter2.getStateAsync(productKey + "." + deviceKey + ".productName")) == null ? void 0 : _c.val) == null ? void 0 : _d.toString().toLowerCase();
|
|
734
762
|
if (currentLimit != null && currentLimit != void 0) {
|
|
735
763
|
if (currentLimit != limit) {
|
|
736
764
|
if (limit < 100 && limit != 90 && limit != 60 && limit != 30 && limit != 0) {
|
|
@@ -749,7 +777,7 @@ const setOutputLimit = async (adapter2, productKey, deviceKey, limit) => {
|
|
|
749
777
|
}
|
|
750
778
|
const topic = `iot/${productKey}/${deviceKey}/properties/write`;
|
|
751
779
|
const outputlimit = { properties: { outputLimit: limit } };
|
|
752
|
-
(
|
|
780
|
+
(_e = adapter2.mqttClient) == null ? void 0 : _e.publish(topic, JSON.stringify(outputlimit));
|
|
753
781
|
}
|
|
754
782
|
}
|
|
755
783
|
}
|
|
@@ -791,11 +819,24 @@ const setBuzzerSwitch = async (adapter2, productKey, deviceKey, buzzerOn) => {
|
|
|
791
819
|
var _a;
|
|
792
820
|
if (adapter2.mqttClient && productKey && deviceKey) {
|
|
793
821
|
const topic = `iot/${productKey}/${deviceKey}/properties/write`;
|
|
794
|
-
const
|
|
822
|
+
const setBuzzerSwitchContent = {
|
|
823
|
+
properties: { buzzerSwitch: buzzerOn ? 1 : 0 }
|
|
824
|
+
};
|
|
795
825
|
adapter2.log.debug(
|
|
796
826
|
`[setBuzzer] Setting Buzzer for device key ${deviceKey} to ${buzzerOn}!`
|
|
797
827
|
);
|
|
798
|
-
(_a = adapter2.mqttClient) == null ? void 0 : _a.publish(topic, JSON.stringify(
|
|
828
|
+
(_a = adapter2.mqttClient) == null ? void 0 : _a.publish(topic, JSON.stringify(setBuzzerSwitchContent));
|
|
829
|
+
}
|
|
830
|
+
};
|
|
831
|
+
const setAutoModel = async (adapter2, productKey, deviceKey, autoModel) => {
|
|
832
|
+
var _a;
|
|
833
|
+
if (adapter2.mqttClient && productKey && deviceKey) {
|
|
834
|
+
const topic = `iot/${productKey}/${deviceKey}/properties/write`;
|
|
835
|
+
const setAutoModelContent = { properties: { autoModel } };
|
|
836
|
+
adapter2.log.debug(
|
|
837
|
+
`[setBuzzer] Setting autoModel for device key ${deviceKey} to ${autoModel}!`
|
|
838
|
+
);
|
|
839
|
+
(_a = adapter2.mqttClient) == null ? void 0 : _a.publish(topic, JSON.stringify(setAutoModelContent));
|
|
799
840
|
}
|
|
800
841
|
};
|
|
801
842
|
const triggerFullTelemetryUpdate = async (adapter2, productKey, deviceKey) => {
|
|
@@ -1000,6 +1041,7 @@ const connectMqttClient = (_adapter) => {
|
|
|
1000
1041
|
connectMqttClient,
|
|
1001
1042
|
setAcMode,
|
|
1002
1043
|
setAcSwitch,
|
|
1044
|
+
setAutoModel,
|
|
1003
1045
|
setAutoRecover,
|
|
1004
1046
|
setBuzzerSwitch,
|
|
1005
1047
|
setChargeLimit,
|