iobroker.luxtronik2-controller 1.0.3 → 1.1.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 +16 -8
- package/build/actionHandlers.js +14 -6
- package/build/actionHandlers.js.map +2 -2
- package/build/main.js +305 -82
- package/build/main.js.map +2 -2
- package/build/mapping/settings.js +2 -2
- package/build/mapping/settings.js.map +1 -1
- package/build/modbusManager.js +32 -4
- package/build/modbusManager.js.map +3 -3
- package/build/pvManager.js +55 -26
- package/build/pvManager.js.map +2 -2
- package/build/types.js.map +1 -1
- package/build/virtualStates.js +6 -6
- package/build/virtualStates.js.map +2 -2
- package/io-package.json +27 -27
- package/package.json +1 -1
package/build/main.js
CHANGED
|
@@ -62,6 +62,8 @@ class Luxtronik2Controller extends utils.Adapter {
|
|
|
62
62
|
updateRunning = false;
|
|
63
63
|
/** Timestamp tracking the last dynamic pump voltage optimization execution */
|
|
64
64
|
lastPumpOptimization = 0;
|
|
65
|
+
/** Merkt sich, ob Takt-Optimierung oder Zwangsheizen aktuell einen temporären Heiz-Offset hält */
|
|
66
|
+
forcedHeatingBoostActive = false;
|
|
65
67
|
/** Internal array storing pending serial hardware write tasks */
|
|
66
68
|
writeQueue = [];
|
|
67
69
|
/** Lock flag indicating that the write queue is currently being processed */
|
|
@@ -81,6 +83,10 @@ class Luxtronik2Controller extends utils.Adapter {
|
|
|
81
83
|
zipEndTime;
|
|
82
84
|
/** Cron-Job Handle für die Firmware-Update-Prüfung */
|
|
83
85
|
updateCronJob;
|
|
86
|
+
/** Merker für Heizgrund */
|
|
87
|
+
forcedHeatingReason = "";
|
|
88
|
+
/** Merkt sich den ursprünglichen WW-Sollwert, falls forceSoll temporär erhöht hat */
|
|
89
|
+
forcedWwOriginalTarget = null;
|
|
84
90
|
/**
|
|
85
91
|
* Initializes a new instance of the Luxtronik2Controller class.
|
|
86
92
|
*
|
|
@@ -234,19 +240,21 @@ class Luxtronik2Controller extends utils.Adapter {
|
|
|
234
240
|
const cycleTotalState = await this.getStateAsync((0, import_stateMapping.getDpPath)("write_cycles_total"));
|
|
235
241
|
this.writeCyclesTotal = cycleTotalState && typeof cycleTotalState.val === "number" ? cycleTotalState.val : 0;
|
|
236
242
|
this.scheduleMidnightReset();
|
|
237
|
-
if (!isReadOnly) {
|
|
238
|
-
await (0, import_zipManager.disableHardwareZipTimer)(this);
|
|
239
|
-
(0, import_zipManager.subscribeMotionSensors)(this);
|
|
240
|
-
await (0, import_pvManager.initPvManagement)(this);
|
|
241
|
-
}
|
|
242
|
-
this.subscribeStates("*");
|
|
243
243
|
this.modbusManager = new import_modbusManager.ModbusManager(this);
|
|
244
244
|
if (!isReadOnly && config.modbus_active) {
|
|
245
245
|
(0, import_logger.writeLog)("Checking Modbus TCP availability for hybrid operations...", "info");
|
|
246
246
|
await this.modbusManager.checkAvailability();
|
|
247
247
|
}
|
|
248
|
+
if (!isReadOnly) {
|
|
249
|
+
(0, import_zipManager.subscribeMotionSensors)(this);
|
|
250
|
+
await (0, import_pvManager.initPvManagement)(this);
|
|
251
|
+
}
|
|
252
|
+
this.subscribeStates("*");
|
|
248
253
|
try {
|
|
249
254
|
await this.updateData();
|
|
255
|
+
if (!isReadOnly) {
|
|
256
|
+
await (0, import_zipManager.disableHardwareZipTimer)(this);
|
|
257
|
+
}
|
|
250
258
|
} catch (error) {
|
|
251
259
|
this.log.error(`Initial data retrieval failed (device offline?): ${error.message}`);
|
|
252
260
|
}
|
|
@@ -404,6 +412,15 @@ class Luxtronik2Controller extends utils.Adapter {
|
|
|
404
412
|
(0, import_logger.writeLog)(`Error occurred during setOwnStateIfDifferent operation for state ${id}: ${err.message}`, "error");
|
|
405
413
|
}
|
|
406
414
|
}
|
|
415
|
+
/**
|
|
416
|
+
* Prüft, ob das moderne V3.9x Smart Home Interface (SHI) per Modbus TCP aktiv und erreichbar ist.
|
|
417
|
+
*/
|
|
418
|
+
isShiModbusActive() {
|
|
419
|
+
const config = this.config;
|
|
420
|
+
return Boolean(
|
|
421
|
+
config.operation_mode !== "readonly" && config.modbus_active && this.modbusManager && this.modbusManager.isAvailable && this.modbusManager.protocolVersion === "shi" && config.sync_modbus_holding_23 === true
|
|
422
|
+
);
|
|
423
|
+
}
|
|
407
424
|
/**
|
|
408
425
|
* Configures fallback factory parameter baselines for the heat pump when in an idle state.
|
|
409
426
|
*
|
|
@@ -412,40 +429,230 @@ class Luxtronik2Controller extends utils.Adapter {
|
|
|
412
429
|
async setIdleDefaults() {
|
|
413
430
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
414
431
|
try {
|
|
432
|
+
this.forcedWwOriginalTarget = null;
|
|
415
433
|
const config = this.config;
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
434
|
+
const isPvControlling = import_pvManager.pvIsBoostActive && !import_pvManager.pvWaitingForCycleEnd;
|
|
435
|
+
if (!this.isShiModbusActive()) {
|
|
436
|
+
await this.syncConfigValue("heating_curve_end_point", (_a = config.endpunkt) != null ? _a : 23);
|
|
437
|
+
await this.syncConfigValue("heating_curve_parallel_offset", (_b = config.fusspunkt) != null ? _b : 21.7);
|
|
438
|
+
}
|
|
439
|
+
if (config.hup_optimierung_aktiv === true) {
|
|
440
|
+
await this.syncConfigValue(
|
|
441
|
+
"heating_system_circ_pump_voltage_minimal",
|
|
442
|
+
(_c = config.sync_heating_system_circ_pump_voltage_minimal_heating) != null ? _c : 3
|
|
443
|
+
);
|
|
444
|
+
await this.syncConfigValue(
|
|
445
|
+
"heating_system_circ_pump_voltage_nominal",
|
|
446
|
+
(_d = config.sync_heating_system_circ_pump_voltage_nominal_heating) != null ? _d : 7
|
|
447
|
+
);
|
|
448
|
+
}
|
|
449
|
+
await this.syncConfigValue("returnTemperatureHysteresis", (_e = config.sync_return_temperature_hysteresis) != null ? _e : 1.5);
|
|
450
|
+
await this.syncConfigValue("zip_aktiv", (_f = config.zip_aktiv) != null ? _f : 0);
|
|
451
|
+
await this.syncConfigValue("Heizen_nach_Wasser", (_g = config.Heating_after_warmwater) != null ? _g : false);
|
|
452
|
+
if (isPvControlling) {
|
|
453
|
+
this.forcedHeatingBoostActive = false;
|
|
454
|
+
this.forcedHeatingReason = "";
|
|
432
455
|
await (0, import_pvManager.evaluatePvBoost)(this, true);
|
|
456
|
+
} else {
|
|
457
|
+
const baseOffset = parseFloat(String((_h = config.sync_heating_temperature) != null ? _h : 0).replace(",", ".")) || 0;
|
|
458
|
+
const baseWw = parseFloat(String((_i = config.sync_warmwater_target_temperature) != null ? _i : 54).replace(",", ".")) || 54;
|
|
459
|
+
await this.resetForcedHeatingBoost(false);
|
|
460
|
+
await this.syncConfigValue("heating_temperature", baseOffset);
|
|
461
|
+
await this.syncConfigValue("temperature_hot_water_target", baseWw);
|
|
433
462
|
}
|
|
434
463
|
} catch (err) {
|
|
435
464
|
(0, import_logger.writeLog)(`Failed to apply the baseline idle configuration defaults: ${err.message}`, "error");
|
|
436
465
|
}
|
|
437
466
|
}
|
|
438
467
|
/**
|
|
439
|
-
*
|
|
468
|
+
* Prüft, ob die Heizung aktuell generell heizen darf (nicht Aus/Urlaub, nicht Heizgrenze/Frostschutz).
|
|
469
|
+
*
|
|
470
|
+
* @param rawValues - Aktuelle Rohwerte (CMD 3004).
|
|
471
|
+
* @param rawParams - Aktuelle Rohparameter (CMD 3003).
|
|
472
|
+
* @param isHeatingAllowedByLimit - Ergebnis der konfigurierten Heizgrenzen-Prüfung.
|
|
473
|
+
* @returns true, wenn Heizen erlaubt ist.
|
|
474
|
+
*/
|
|
475
|
+
isHeatingAllowed(rawValues, rawParams, isHeatingAllowedByLimit) {
|
|
476
|
+
if (!isHeatingAllowedByLimit) {
|
|
477
|
+
return false;
|
|
478
|
+
}
|
|
479
|
+
const heatingOpMode = rawParams[3];
|
|
480
|
+
if (heatingOpMode === 3 || heatingOpMode === 4) {
|
|
481
|
+
return false;
|
|
482
|
+
}
|
|
483
|
+
const opStateHeating = rawValues[125];
|
|
484
|
+
if (opStateHeating === 2 || opStateHeating === 3 || opStateHeating === 4) {
|
|
485
|
+
return false;
|
|
486
|
+
}
|
|
487
|
+
return true;
|
|
488
|
+
}
|
|
489
|
+
/**
|
|
490
|
+
* Prüft anhand der Luxtronik-WW-Zeitschaltuhr (P405..P505 = Sperrzeiten),
|
|
491
|
+
* ob Warmwasser zum angegebenen Zeitpunkt gesperrt ist (inkl. Mitternachts-Übergang).
|
|
492
|
+
*
|
|
493
|
+
* @param rawParams - Aktuelle Rohparameter (CMD 3003).
|
|
494
|
+
* @param targetDate - Zu prüfender Zeitpunkt.
|
|
495
|
+
* @returns true, wenn zu diesem Zeitpunkt eine WW-Sperrzeit aktiv ist.
|
|
496
|
+
*/
|
|
497
|
+
isHotWaterLockedAt(rawParams, targetDate) {
|
|
498
|
+
var _a;
|
|
499
|
+
if (!rawParams || rawParams.length <= 505) {
|
|
500
|
+
return false;
|
|
501
|
+
}
|
|
502
|
+
const tableMode = (_a = rawParams[405]) != null ? _a : 0;
|
|
503
|
+
const dayOfWeek = targetDate.getDay();
|
|
504
|
+
const prevDayOfWeek = (dayOfWeek + 6) % 7;
|
|
505
|
+
const secOfDay = targetDate.getHours() * 3600 + targetDate.getMinutes() * 60 + targetDate.getSeconds();
|
|
506
|
+
const getBaseIndex = (day) => {
|
|
507
|
+
if (tableMode === 1) {
|
|
508
|
+
return day >= 1 && day <= 5 ? 416 : 426;
|
|
509
|
+
}
|
|
510
|
+
if (tableMode === 2) {
|
|
511
|
+
return 436 + day * 10;
|
|
512
|
+
}
|
|
513
|
+
return 406;
|
|
514
|
+
};
|
|
515
|
+
const todayBase = getBaseIndex(dayOfWeek);
|
|
516
|
+
for (let i = 0; i < 5; i++) {
|
|
517
|
+
const start = rawParams[todayBase + i * 2];
|
|
518
|
+
const end = rawParams[todayBase + i * 2 + 1];
|
|
519
|
+
if (start === void 0 || end === void 0 || start === end) {
|
|
520
|
+
continue;
|
|
521
|
+
}
|
|
522
|
+
if (start < end) {
|
|
523
|
+
if (secOfDay >= start && secOfDay < end) {
|
|
524
|
+
return true;
|
|
525
|
+
}
|
|
526
|
+
} else {
|
|
527
|
+
if (secOfDay >= start) {
|
|
528
|
+
return true;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
const prevBase = getBaseIndex(prevDayOfWeek);
|
|
533
|
+
for (let i = 0; i < 5; i++) {
|
|
534
|
+
const start = rawParams[prevBase + i * 2];
|
|
535
|
+
const end = rawParams[prevBase + i * 2 + 1];
|
|
536
|
+
if (start === void 0 || end === void 0 || start <= end) {
|
|
537
|
+
continue;
|
|
538
|
+
}
|
|
539
|
+
if (secOfDay < end) {
|
|
540
|
+
return true;
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
return false;
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* Prüft, ob Warmwasser aktuell (leadMinutes = 0) oder in X Minuten freigegeben ist.
|
|
547
|
+
*
|
|
548
|
+
* @param rawValues - Aktuelle Rohwerte (CMD 3004).
|
|
549
|
+
* @param rawParams - Aktuelle Rohparameter (CMD 3003).
|
|
550
|
+
* @param leadMinutes - Vorschau in Minuten (0 = jetzt sofort, z.B. 25 = Vorheiz-Check).
|
|
551
|
+
* @returns true, wenn Warmwasser erlaubt ist.
|
|
552
|
+
*/
|
|
553
|
+
isHotWaterAllowed(rawValues, rawParams, leadMinutes = 0) {
|
|
554
|
+
const wwOpMode = rawParams[4];
|
|
555
|
+
if (wwOpMode === 3 || wwOpMode === 4) {
|
|
556
|
+
return false;
|
|
557
|
+
}
|
|
558
|
+
if (wwOpMode === 2) {
|
|
559
|
+
return true;
|
|
560
|
+
}
|
|
561
|
+
if (leadMinutes <= 0) {
|
|
562
|
+
const opStateWw = rawValues[124];
|
|
563
|
+
if (opStateWw !== void 0) {
|
|
564
|
+
return opStateWw !== 0 && opStateWw !== 3;
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
const targetDate = new Date(Date.now() + leadMinutes * 6e4);
|
|
568
|
+
return !this.isHotWaterLockedAt(rawParams, targetDate);
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* Aktiviert eine temporäre Heizungsanhebung (Takt-Optimierung, Vorheizen oder Zwangsheizen)
|
|
572
|
+
* über die Parallelverschiebung (`heating_temperature`) mit automatischem, relativem Offset.
|
|
573
|
+
*
|
|
574
|
+
* @param reason - Optionaler Kontext für das Debug-Log.
|
|
575
|
+
* @param deltaK - Relative Anhebung in Kelvin über dem Basis-Offset (z.B. Hysterese + 0.5 K).
|
|
576
|
+
*/
|
|
577
|
+
async activateForcedHeatingBoost(reason = "CycleOpt", deltaK = 2) {
|
|
578
|
+
var _a;
|
|
579
|
+
this.forcedHeatingReason = reason;
|
|
580
|
+
const config = this.config;
|
|
581
|
+
const baseOffset = parseFloat(String((_a = config.sync_heating_temperature) != null ? _a : 0).replace(",", ".")) || 0;
|
|
582
|
+
const maxAllowedOffset = this.isShiModbusActive() ? 10 : 5;
|
|
583
|
+
let targetOffset = Math.round((baseOffset + Math.max(0.5, deltaK)) * 10) / 10;
|
|
584
|
+
targetOffset = Math.min(targetOffset, maxAllowedOffset);
|
|
585
|
+
if (import_pvManager.pvIsBoostActive) {
|
|
586
|
+
const currentState = await this.getStateAsync((0, import_stateMapping.getDpPath)("heating_temperature"));
|
|
587
|
+
if (typeof (currentState == null ? void 0 : currentState.val) === "number" && currentState.val > targetOffset) {
|
|
588
|
+
targetOffset = currentState.val;
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
const currentHeatingState = await this.getStateAsync((0, import_stateMapping.getDpPath)("heating_temperature"));
|
|
592
|
+
if (this.forcedHeatingBoostActive && (currentHeatingState == null ? void 0 : currentHeatingState.val) === targetOffset) {
|
|
593
|
+
return;
|
|
594
|
+
}
|
|
595
|
+
this.forcedHeatingBoostActive = true;
|
|
596
|
+
await this.syncConfigValue("heating_temperature", targetOffset);
|
|
597
|
+
if (this.isDebugLogActive) {
|
|
598
|
+
(0, import_logger.writeLog)(
|
|
599
|
+
`[${reason}] Setting dynamic heating offset to +${targetOffset} K (base: ${baseOffset} K, delta: +${deltaK} K, SHI: ${this.isShiModbusActive()}).`,
|
|
600
|
+
"info"
|
|
601
|
+
);
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
/**
|
|
605
|
+
* Setzt eine aktive temporäre Heizungsanhebung sauber auf den Basis-Offset zurück
|
|
606
|
+
* und stellt einen eventuell aktiven PV-Boost wieder her.
|
|
440
607
|
*
|
|
441
|
-
* @
|
|
608
|
+
* @param reapplyPv - Stellt bei aktivem PV-Boost dessen Sollwert im Anschluss sofort wieder her.
|
|
442
609
|
*/
|
|
443
|
-
async
|
|
610
|
+
async resetForcedHeatingBoost(reapplyPv = true) {
|
|
611
|
+
var _a;
|
|
612
|
+
if (!this.forcedHeatingBoostActive) {
|
|
613
|
+
return;
|
|
614
|
+
}
|
|
615
|
+
this.forcedHeatingBoostActive = false;
|
|
616
|
+
this.forcedHeatingReason = "";
|
|
617
|
+
if (reapplyPv && import_pvManager.pvIsBoostActive && !import_pvManager.pvWaitingForCycleEnd) {
|
|
618
|
+
await (0, import_pvManager.evaluatePvBoost)(this, true);
|
|
619
|
+
return;
|
|
620
|
+
}
|
|
621
|
+
const config = this.config;
|
|
622
|
+
const baseOffset = parseFloat(String((_a = config.sync_heating_temperature) != null ? _a : 0).replace(",", ".")) || 0;
|
|
623
|
+
await this.syncConfigValue("heating_temperature", baseOffset);
|
|
624
|
+
if (this.isDebugLogActive) {
|
|
625
|
+
(0, import_logger.writeLog)(`[CycleOpt] Resetting temporary heating offset back to ${baseOffset} K.`, "info");
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
/**
|
|
629
|
+
* Setzt eine temporäre WW-Anhebung (z.B. durch forceSoll) nach dem WW-Takt zurück,
|
|
630
|
+
* ohne einen aktiven PV-Boost unnötig umzuschalten.
|
|
631
|
+
*/
|
|
632
|
+
async restoreForcedWwTarget() {
|
|
633
|
+
var _a, _b;
|
|
634
|
+
const config = this.config;
|
|
635
|
+
const fallbackWw = parseFloat(String((_a = config.sync_warmwater_target_temperature) != null ? _a : 54).replace(",", ".")) || 54;
|
|
636
|
+
const targetWw = (_b = this.forcedWwOriginalTarget) != null ? _b : fallbackWw;
|
|
637
|
+
this.forcedWwOriginalTarget = null;
|
|
638
|
+
if (import_pvManager.pvIsBoostActive && !import_pvManager.pvWaitingForCycleEnd) {
|
|
639
|
+
await (0, import_pvManager.evaluatePvBoost)(this, true);
|
|
640
|
+
return;
|
|
641
|
+
}
|
|
642
|
+
await this.syncConfigValue("temperature_hot_water_target", targetWw);
|
|
643
|
+
}
|
|
644
|
+
/**
|
|
645
|
+
* Prüft, ob der aktuelle Betriebszustand (WP_BZ_akt) mindestens `minutes` Minuten anliegt.
|
|
646
|
+
*
|
|
647
|
+
* @param minutes - Mindestdauer in Minuten.
|
|
648
|
+
* @returns true, wenn die letzte Änderung mindestens `minutes` Minuten zurückliegt.
|
|
649
|
+
*/
|
|
650
|
+
async istBetriebszustandAelterAls(minutes) {
|
|
444
651
|
var _a;
|
|
445
652
|
try {
|
|
446
653
|
const state = await this.getStateAsync((0, import_stateMapping.getDpPath)("WP_BZ_akt"));
|
|
447
654
|
const lastChange = (_a = state == null ? void 0 : state.lc) != null ? _a : 0;
|
|
448
|
-
return (Date.now() - lastChange) / 6e4 >=
|
|
655
|
+
return (Date.now() - lastChange) / 6e4 >= minutes;
|
|
449
656
|
} catch {
|
|
450
657
|
return false;
|
|
451
658
|
}
|
|
@@ -459,12 +666,13 @@ class Luxtronik2Controller extends utils.Adapter {
|
|
|
459
666
|
* @returns A promise that resolves when the execution cycle finishes.
|
|
460
667
|
*/
|
|
461
668
|
async runOptimizationSchedule(rawValues = [], rawParams = []) {
|
|
462
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
669
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
463
670
|
try {
|
|
464
671
|
const config = this.config;
|
|
465
672
|
if (config.operation_mode === "readonly") {
|
|
466
673
|
return;
|
|
467
674
|
}
|
|
675
|
+
const effectiveParams = rawParams.length > 0 ? rawParams : this.currentRawParams;
|
|
468
676
|
const bzState = await this.getStateAsync((0, import_stateMapping.getDpPath)("WP_BZ_akt"));
|
|
469
677
|
const bzVal = bzState && bzState.val !== null ? String(bzState.val).trim() : rawValues[80] !== void 0 ? String(rawValues[80]) : "";
|
|
470
678
|
const regelungAktivState = await this.getStateAsync((0, import_stateMapping.getDpPath)("Regelung_Aktiv"));
|
|
@@ -480,59 +688,64 @@ class Luxtronik2Controller extends utils.Adapter {
|
|
|
480
688
|
if (istLeerlauf) {
|
|
481
689
|
if (config.idle_defaults_aktiv === true) {
|
|
482
690
|
await this.setIdleDefaults();
|
|
691
|
+
} else {
|
|
692
|
+
if (this.forcedHeatingBoostActive) {
|
|
693
|
+
await this.resetForcedHeatingBoost();
|
|
694
|
+
}
|
|
695
|
+
if (this.forcedWwOriginalTarget !== null) {
|
|
696
|
+
await this.restoreForcedWwTarget();
|
|
697
|
+
}
|
|
483
698
|
}
|
|
484
699
|
} else if (istHeizen) {
|
|
485
|
-
if (this.lastBzVal === "1" && config.idle_defaults_aktiv === true) {
|
|
486
|
-
await this.
|
|
487
|
-
"temperature_hot_water_target",
|
|
488
|
-
(_a = config.sync_warmwater_target_temperature) != null ? _a : 54
|
|
489
|
-
);
|
|
490
|
-
if (import_pvManager.pvIsBoostActive) {
|
|
491
|
-
await (0, import_pvManager.evaluatePvBoost)(this, true);
|
|
492
|
-
}
|
|
700
|
+
if (this.lastBzVal === "1" && (config.idle_defaults_aktiv === true || this.forcedWwOriginalTarget !== null)) {
|
|
701
|
+
await this.restoreForcedWwTarget();
|
|
493
702
|
}
|
|
494
703
|
if (config.zip_optimierung_aktiv === true) {
|
|
495
|
-
await this.syncConfigValue("zip_aktiv", (
|
|
704
|
+
await this.syncConfigValue("zip_aktiv", (_a = config.zip_aktiv) != null ? _a : 0);
|
|
496
705
|
}
|
|
497
706
|
if (config.hup_optimierung_aktiv === true) {
|
|
498
707
|
await this.syncConfigValue(
|
|
499
708
|
"heating_system_circ_pump_voltage_minimal",
|
|
500
|
-
(
|
|
709
|
+
(_b = config.sync_heating_system_circ_pump_voltage_minimal_heating) != null ? _b : 3
|
|
501
710
|
);
|
|
502
711
|
await this.syncConfigValue(
|
|
503
712
|
"heating_system_circ_pump_voltage_nominal",
|
|
504
|
-
(
|
|
713
|
+
(_c = config.sync_heating_system_circ_pump_voltage_nominal_heating) != null ? _c : 7
|
|
505
714
|
);
|
|
506
715
|
}
|
|
507
716
|
if (isRegelungAktiv) {
|
|
508
|
-
await this.syncConfigValue("Heizen_nach_Wasser", (
|
|
717
|
+
await this.syncConfigValue("Heizen_nach_Wasser", (_d = config.Heating_after_warmwater) != null ? _d : false);
|
|
509
718
|
}
|
|
510
719
|
} else if (istWarmwasser) {
|
|
720
|
+
const nachWasserTransition = await this.getStateAsync((0, import_stateMapping.getDpPath)("Heizen_nach_Wasser"));
|
|
721
|
+
if (!(nachWasserTransition == null ? void 0 : nachWasserTransition.val) && this.forcedHeatingBoostActive) {
|
|
722
|
+
await this.resetForcedHeatingBoost();
|
|
723
|
+
}
|
|
511
724
|
if (config.zip_optimierung_aktiv === true) {
|
|
512
725
|
const mode = config.zip_control_mode || "controller";
|
|
513
726
|
const actors = config.actors || [];
|
|
514
727
|
const validActors = actors.filter(
|
|
515
728
|
(a) => a.zip_external_relay_id && a.zip_external_relay_id.trim() !== ""
|
|
516
729
|
);
|
|
517
|
-
const canRunWearFree = mode === "actor" && validActors.length > 0 || mode === "modbus" && ((
|
|
730
|
+
const canRunWearFree = mode === "actor" && validActors.length > 0 || mode === "modbus" && ((_e = this.modbusManager) == null ? void 0 : _e.isAvailable);
|
|
518
731
|
if (canRunWearFree) {
|
|
519
732
|
if (this.isDebugLogActive) {
|
|
520
733
|
this.log.debug(
|
|
521
734
|
`[ZIP] Wear-free mode (${mode}) active. Starting circulation synchronous to hot water generation.`
|
|
522
735
|
);
|
|
523
736
|
}
|
|
524
|
-
await this.syncConfigValue("zip_aktiv", (
|
|
737
|
+
await this.syncConfigValue("zip_aktiv", (_f = config.zip_aktiv_ww) != null ? _f : 120);
|
|
525
738
|
await this.setOwnStateIfDifferent((0, import_stateMapping.getDpPath)("Activate_Zip"), true, false);
|
|
526
739
|
}
|
|
527
740
|
}
|
|
528
741
|
if (config.hup_optimierung_aktiv === true) {
|
|
529
742
|
await this.syncConfigValue(
|
|
530
743
|
"heating_system_circ_pump_voltage_minimal",
|
|
531
|
-
(
|
|
744
|
+
(_g = config.sync_heating_system_circ_pump_voltage_minimal_water) != null ? _g : 3
|
|
532
745
|
);
|
|
533
746
|
await this.syncConfigValue(
|
|
534
747
|
"heating_system_circ_pump_voltage_nominal",
|
|
535
|
-
(
|
|
748
|
+
(_h = config.sync_heating_system_circ_pump_voltage_nominal_water) != null ? _h : 10
|
|
536
749
|
);
|
|
537
750
|
}
|
|
538
751
|
}
|
|
@@ -553,7 +766,8 @@ class Luxtronik2Controller extends utils.Adapter {
|
|
|
553
766
|
mitteltempState,
|
|
554
767
|
thresholdHeatingLimitState,
|
|
555
768
|
heatingLimitState,
|
|
556
|
-
aelterAls10
|
|
769
|
+
aelterAls10,
|
|
770
|
+
aelterAls3
|
|
557
771
|
] = await Promise.all([
|
|
558
772
|
this.getStateAsync((0, import_stateMapping.getDpPath)("Wamwassertemperatur_Soll")),
|
|
559
773
|
this.getStateAsync((0, import_stateMapping.getDpPath)("temperature_hot_water_target")),
|
|
@@ -569,31 +783,30 @@ class Luxtronik2Controller extends utils.Adapter {
|
|
|
569
783
|
this.getStateAsync((0, import_stateMapping.getDpPath)("Mitteltemperatur")),
|
|
570
784
|
this.getStateAsync((0, import_stateMapping.getDpPath)("thresholdHeatingLimit")),
|
|
571
785
|
this.getStateAsync((0, import_stateMapping.getDpPath)("heatingLimit")),
|
|
572
|
-
this.
|
|
786
|
+
this.istBetriebszustandAelterAls(10),
|
|
787
|
+
this.istBetriebszustandAelterAls(3)
|
|
573
788
|
]);
|
|
574
|
-
const wwSoll = typeof (wwSollState == null ? void 0 : wwSollState.val) === "number" ? wwSollState.val : typeof (wwTargetParamState == null ? void 0 : wwTargetParamState.val) === "number" ? wwTargetParamState.val : rawValues[18] !== void 0 ? rawValues[18] / 10 :
|
|
789
|
+
const wwSoll = typeof (wwSollState == null ? void 0 : wwSollState.val) === "number" ? wwSollState.val : typeof (wwTargetParamState == null ? void 0 : wwTargetParamState.val) === "number" ? wwTargetParamState.val : rawValues[18] !== void 0 ? rawValues[18] / 10 : effectiveParams[105] !== void 0 ? effectiveParams[105] / 10 : 54;
|
|
575
790
|
const wwIst = typeof (wwIstState == null ? void 0 : wwIstState.val) === "number" ? wwIstState.val : rawValues[17] !== void 0 ? rawValues[17] / 10 : 0;
|
|
576
791
|
const ruecklauf = typeof (ruecklaufState == null ? void 0 : ruecklaufState.val) === "number" ? ruecklaufState.val : rawValues[11] !== void 0 ? rawValues[11] / 10 : 0;
|
|
577
792
|
const ruecklaufSoll = typeof (ruecklaufSollState == null ? void 0 : ruecklaufSollState.val) === "number" ? ruecklaufSollState.val : rawValues[12] !== void 0 ? rawValues[12] / 10 : 0;
|
|
578
793
|
const spreizung = typeof (spreizungState == null ? void 0 : spreizungState.val) === "number" ? spreizungState.val : rawValues[10] !== void 0 && rawValues[11] !== void 0 ? (rawValues[10] - rawValues[11]) / 10 : 0;
|
|
579
794
|
const vd1 = (vd1State == null ? void 0 : vd1State.val) !== void 0 && (vd1State == null ? void 0 : vd1State.val) !== null ? vd1State.val === 1 || vd1State.val === true || String(vd1State.val).toLowerCase() === "true" : rawValues[44] === 1;
|
|
580
|
-
const wwHysterese = typeof (wwHystereseState == null ? void 0 : wwHystereseState.val) === "number" ? wwHystereseState.val :
|
|
581
|
-
const currentHupVolt = (
|
|
582
|
-
const heizenHysterese = typeof (heizenHystereseState == null ? void 0 : heizenHystereseState.val) === "number" ? heizenHystereseState.val :
|
|
795
|
+
const wwHysterese = typeof (wwHystereseState == null ? void 0 : wwHystereseState.val) === "number" ? wwHystereseState.val : effectiveParams[74] !== void 0 ? effectiveParams[74] / 10 : 2;
|
|
796
|
+
const currentHupVolt = (_i = currentHupVoltState == null ? void 0 : currentHupVoltState.val) != null ? _i : 7;
|
|
797
|
+
const heizenHysterese = typeof (heizenHystereseState == null ? void 0 : heizenHystereseState.val) === "number" ? heizenHystereseState.val : effectiveParams[88] !== void 0 ? effectiveParams[88] / 10 : 1.5;
|
|
583
798
|
const mitteltemperatur = typeof (mitteltempState == null ? void 0 : mitteltempState.val) === "number" ? mitteltempState.val : rawValues[16] !== void 0 ? rawValues[16] / 10 : 0;
|
|
584
|
-
const thresholdHeatingLimit = typeof (thresholdHeatingLimitState == null ? void 0 : thresholdHeatingLimitState.val) === "number" ? thresholdHeatingLimitState.val :
|
|
585
|
-
const isHeatingLimitEnabled = (heatingLimitState == null ? void 0 : heatingLimitState.val) !== void 0 && (heatingLimitState == null ? void 0 : heatingLimitState.val) !== null ? heatingLimitState.val === 1 || heatingLimitState.val === true || String(heatingLimitState.val) === "1" || String(heatingLimitState.val).toLowerCase() === "true" :
|
|
799
|
+
const thresholdHeatingLimit = typeof (thresholdHeatingLimitState == null ? void 0 : thresholdHeatingLimitState.val) === "number" ? thresholdHeatingLimitState.val : effectiveParams[700] !== void 0 ? effectiveParams[700] / 10 : 15;
|
|
800
|
+
const isHeatingLimitEnabled = (heatingLimitState == null ? void 0 : heatingLimitState.val) !== void 0 && (heatingLimitState == null ? void 0 : heatingLimitState.val) !== null ? heatingLimitState.val === 1 || heatingLimitState.val === true || String(heatingLimitState.val) === "1" || String(heatingLimitState.val).toLowerCase() === "true" : effectiveParams[699] === 1;
|
|
586
801
|
const nachWasser = Boolean(nachWasserState == null ? void 0 : nachWasserState.val);
|
|
802
|
+
const isHeatingAllowedByLimit = !isHeatingLimitEnabled || mitteltemperatur < thresholdHeatingLimit;
|
|
803
|
+
const heatingAllowed = this.isHeatingAllowed(rawValues, effectiveParams, isHeatingAllowedByLimit);
|
|
804
|
+
const wwAllowedNow = this.isHotWaterAllowed(rawValues, effectiveParams, 0);
|
|
805
|
+
const wwAllowedSoon = this.isHotWaterAllowed(rawValues, effectiveParams, 25);
|
|
806
|
+
const dynamicDeltaK = Math.round((heizenHysterese + 0.5) * 10) / 10;
|
|
587
807
|
if (istHeizen) {
|
|
588
808
|
if (aelterAls10 && vd1) {
|
|
589
|
-
|
|
590
|
-
const currentFusspunkt = typeof (fusspunktState == null ? void 0 : fusspunktState.val) === "number" ? fusspunktState.val : rawParams[13] !== void 0 ? rawParams[13] / 10 : 0;
|
|
591
|
-
if (currentFusspunkt === 35) {
|
|
592
|
-
const fallbackFusspunkt = (_k = config.fusspunkt) != null ? _k : 21.7;
|
|
593
|
-
await this.syncConfigValue("heating_curve_parallel_offset", fallbackFusspunkt);
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
if (aelterAls10 && vd1) {
|
|
809
|
+
await this.resetForcedHeatingBoost();
|
|
597
810
|
this.lastPumpOptimization = await (0, import_hupManager.handleHupOptimization)(
|
|
598
811
|
this,
|
|
599
812
|
istHeizen,
|
|
@@ -603,33 +816,41 @@ class Luxtronik2Controller extends utils.Adapter {
|
|
|
603
816
|
);
|
|
604
817
|
}
|
|
605
818
|
if (isRegelungAktiv) {
|
|
606
|
-
|
|
607
|
-
|
|
819
|
+
const rlZielErreicht = ruecklauf >= ruecklaufSoll + heizenHysterese - 0.1;
|
|
820
|
+
if (rlZielErreicht) {
|
|
821
|
+
if (aelterAls3) {
|
|
608
822
|
await this.syncConfigValue("Heizen_nach_Wasser", false);
|
|
609
823
|
}
|
|
824
|
+
if (aelterAls3 && wwAllowedNow && wwSoll - wwIst > 2) {
|
|
825
|
+
if (this.forcedWwOriginalTarget === null) {
|
|
826
|
+
const fallbackWw = parseFloat(
|
|
827
|
+
String((_j = config.sync_warmwater_target_temperature) != null ? _j : 54).replace(",", ".")
|
|
828
|
+
) || 54;
|
|
829
|
+
this.forcedWwOriginalTarget = config.idle_defaults_aktiv === true ? fallbackWw : wwSoll;
|
|
830
|
+
}
|
|
831
|
+
let forceSoll = wwIst + wwHysterese + 1.5;
|
|
832
|
+
if (import_pvManager.pvIsBoostActive) {
|
|
833
|
+
const baseWw = parseFloat(
|
|
834
|
+
String((_k = config.sync_warmwater_target_temperature) != null ? _k : 54).replace(",", ".")
|
|
835
|
+
) || 54;
|
|
836
|
+
const boostWw = parseFloat(String((_l = config.pv_boost_ww) != null ? _l : 0).replace(",", ".")) || 0;
|
|
837
|
+
const pvTarget = baseWw + boostWw;
|
|
838
|
+
forceSoll = Math.max(forceSoll, pvTarget);
|
|
839
|
+
}
|
|
840
|
+
if (forceSoll > 70) {
|
|
841
|
+
forceSoll = 70;
|
|
842
|
+
}
|
|
843
|
+
forceSoll = Math.round(forceSoll * 10) / 10;
|
|
844
|
+
await this.syncConfigValue("temperature_hot_water_target", forceSoll);
|
|
845
|
+
}
|
|
610
846
|
} else if (!nachWasser && config.Heating_after_warmwater === true) {
|
|
611
847
|
await this.syncConfigValue("Heizen_nach_Wasser", true);
|
|
612
848
|
}
|
|
613
|
-
if (wwSoll - wwIst > 2 && ruecklauf >= ruecklaufSoll + heizenHysterese - 0.1) {
|
|
614
|
-
let forceSoll = wwIst + wwHysterese + 1.5;
|
|
615
|
-
if (import_pvManager.pvIsBoostActive) {
|
|
616
|
-
const baseWw = parseFloat(String(config.sync_warmwater_target_temperature).replace(",", ".")) || 54;
|
|
617
|
-
const boostWw = parseFloat(String(config.pv_boost_ww).replace(",", ".")) || 0;
|
|
618
|
-
const pvTarget = baseWw + boostWw;
|
|
619
|
-
forceSoll = Math.max(forceSoll, pvTarget);
|
|
620
|
-
}
|
|
621
|
-
if (forceSoll > 70) {
|
|
622
|
-
forceSoll = 70;
|
|
623
|
-
}
|
|
624
|
-
forceSoll = Math.round(forceSoll * 10) / 10;
|
|
625
|
-
await this.syncConfigValue("temperature_hot_water_target", forceSoll);
|
|
626
|
-
}
|
|
627
849
|
}
|
|
628
850
|
}
|
|
629
|
-
const isHeatingAllowedByLimit = !isHeatingLimitEnabled || mitteltemperatur < thresholdHeatingLimit;
|
|
630
851
|
if (istWarmwasser && nachWasser) {
|
|
631
|
-
if (isRegelungAktiv &&
|
|
632
|
-
await this.
|
|
852
|
+
if (isRegelungAktiv && heatingAllowed) {
|
|
853
|
+
await this.activateForcedHeatingBoost("CycleOpt-AfterWW", dynamicDeltaK);
|
|
633
854
|
}
|
|
634
855
|
}
|
|
635
856
|
if (istLeerlauf) {
|
|
@@ -639,14 +860,16 @@ class Luxtronik2Controller extends utils.Adapter {
|
|
|
639
860
|
}
|
|
640
861
|
}
|
|
641
862
|
if (isRegelungAktiv) {
|
|
642
|
-
if (wwSoll - wwIst >= wwHysterese - 1.5 && ruecklauf <= ruecklaufSoll
|
|
863
|
+
if (wwAllowedSoon && heatingAllowed && wwSoll - wwIst >= wwHysterese - 1.5 && ruecklauf <= ruecklaufSoll) {
|
|
643
864
|
if (this.isDebugLogActive) {
|
|
644
865
|
(0, import_logger.writeLog)(
|
|
645
|
-
`[CycleOpt] Pre-starting heating before WW (WW: ${wwIst}/${wwSoll}\xB0C, Hyst: ${wwHysterese}K, RL: ${ruecklauf}/${ruecklaufSoll}\xB0C
|
|
866
|
+
`[CycleOpt] Pre-starting heating before WW (WW: ${wwIst}/${wwSoll}\xB0C, Hyst: ${wwHysterese}K, RL: ${ruecklauf}/${ruecklaufSoll}\xB0C, Offset: +${dynamicDeltaK}K).`,
|
|
646
867
|
"info"
|
|
647
868
|
);
|
|
648
869
|
}
|
|
649
|
-
await this.
|
|
870
|
+
await this.activateForcedHeatingBoost("CycleOpt-PreHeat", dynamicDeltaK);
|
|
871
|
+
} else if (this.forcedHeatingBoostActive && this.forcedHeatingReason === "CycleOpt-PreHeat") {
|
|
872
|
+
await this.resetForcedHeatingBoost();
|
|
650
873
|
}
|
|
651
874
|
}
|
|
652
875
|
}
|
|
@@ -831,7 +1054,7 @@ class Luxtronik2Controller extends utils.Adapter {
|
|
|
831
1054
|
}
|
|
832
1055
|
await Promise.all(statePromises);
|
|
833
1056
|
await (0, import_virtualStates.calculateTotalThermalEnergy)(this, rawValues);
|
|
834
|
-
await (0, import_virtualStates.calculateTotalEnergy)(this,
|
|
1057
|
+
await (0, import_virtualStates.calculateTotalEnergy)(this, rawParams);
|
|
835
1058
|
const fehlerDp = (0, import_stateMapping.getDpPath)("Fehlerspeicher");
|
|
836
1059
|
const oldFehlerState = fehlerDp ? await this.getStateAsync(fehlerDp) : null;
|
|
837
1060
|
const oldFehlerVal = oldFehlerState == null ? void 0 : oldFehlerState.val;
|