iobroker.luxtronik2-controller 1.0.3 → 1.0.4
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 +7 -4
- package/build/actionHandlers.js +6 -2
- package/build/actionHandlers.js.map +2 -2
- package/build/main.js +108 -26
- 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 +29 -12
- package/build/pvManager.js.map +2 -2
- package/build/types.js.map +1 -1
- package/io-package.json +14 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -103,6 +103,13 @@ _This project is not affiliated with Alpha Innotec, Novelan, ait-deutschland Gmb
|
|
|
103
103
|
//### **WORK IN PROGRESS**
|
|
104
104
|
|
|
105
105
|
## Changelog
|
|
106
|
+
### 1.0.4 (2026-11-21)
|
|
107
|
+
|
|
108
|
+
- Optimized V3.9x SHI Modbus Hybrid mode to achieve zero EEPROM write cycles during cycle optimization, pre-heating, and forced heating (uses volatile SHI offset `+10.0 K` via Holding 23 / `10002` instead of base point parameter `12`)
|
|
109
|
+
- Fixed startup order in `onReady()` so Modbus TCP availability is checked before PV initialization and hardware ZIP timer disable runs after initial raw parameter fetch
|
|
110
|
+
- Improved PV startup recovery to only reset setpoints if a PV boost was actually active before restart, and decoupled PV heating boost from active SHI cycle optimization
|
|
111
|
+
- Released SHI DHW mode (`10005 = 0`) when reverting hot water target to baseline and avoided unnecessary HUP voltage writes in `setIdleDefaults()` when HUP optimization is disabled
|
|
112
|
+
|
|
106
113
|
### 1.0.3 (2026-11-18)
|
|
107
114
|
|
|
108
115
|
- Fixed daily COP reset in `copManager.ts` so Heating and Hot Water values reset to `0` after midnight until an active cycle starts
|
|
@@ -121,10 +128,6 @@ _This project is not affiliated with Alpha Innotec, Novelan, ait-deutschland Gmb
|
|
|
121
128
|
|
|
122
129
|
**STABLE**
|
|
123
130
|
|
|
124
|
-
### 0.25.2 (2026-11-16)
|
|
125
|
-
|
|
126
|
-
- **Fix i18n**
|
|
127
|
-
|
|
128
131
|
## License
|
|
129
132
|
|
|
130
133
|
MIT License
|
package/build/actionHandlers.js
CHANGED
|
@@ -67,6 +67,7 @@ async function handleZwangswarmwasser(adapter, id) {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
async function handleZwangsheizen(adapter, id) {
|
|
70
|
+
var _a;
|
|
70
71
|
try {
|
|
71
72
|
const localId = id.replace(`${adapter.namespace}.`, "");
|
|
72
73
|
await adapter.setState(localId, { val: false, ack: true });
|
|
@@ -91,9 +92,12 @@ async function handleZwangsheizen(adapter, id) {
|
|
|
91
92
|
);
|
|
92
93
|
return;
|
|
93
94
|
}
|
|
94
|
-
await adapter.
|
|
95
|
+
await adapter.activateForcedHeatingBoost("ForcedHeating");
|
|
96
|
+
const isShi = Boolean(
|
|
97
|
+
adapter.config.modbus_active && ((_a = adapter.modbusManager) == null ? void 0 : _a.isAvailable) && adapter.modbusManager.protocolVersion === "shi" && adapter.config.sync_modbus_holding_23 === true
|
|
98
|
+
);
|
|
95
99
|
(0, import_logger.writeLog)(
|
|
96
|
-
`Forced heating: Triggered - Base point temporarily set to ${CONSTANTS.FORCE_HEATING_OFFSET}\xB0C.`,
|
|
100
|
+
isShi ? "Forced heating: Triggered - Volatile SHI heating offset temporarily set to +10.0 K (Modbus RAM)." : `Forced heating: Triggered - Base point temporarily set to ${CONSTANTS.FORCE_HEATING_OFFSET}\xB0C.`,
|
|
97
101
|
"info"
|
|
98
102
|
);
|
|
99
103
|
} catch (err) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/actionHandlers.ts"],
|
|
4
|
-
"sourcesContent": ["import { writeLog } from './logger';\nimport { getDpPath } from './stateMapping';\nimport type { LuxtronikAdapter } from './types';\nimport { getNumber } from './utils';\n\n// =========================================================\n// TYPEN & KONSTANTEN\n// =========================================================\n\nconst CONSTANTS = {\n\t/** Status-Code f\u00FCr den Ruhezustand der Anlage */\n\tSTATE_IDLE: 5,\n\t/** Befehlswert f\u00FCr den Fu\u00DFpunkt beim Zwangsheizen */\n\tFORCE_HEATING_OFFSET: 35,\n};\n\n// =========================================================\n// AKTIONEN\n// =========================================================\n\n/**\n * Erzwingt die Warmwasserbereitung durch tempor\u00E4re Erh\u00F6hung des Sollwerts.\n *\n * @param adapter Die Instanz des ioBroker-Adapters.\n * @param id Die ID des ausl\u00F6senden Datenpunkts.\n */\nexport async function handleZwangswarmwasser(adapter: LuxtronikAdapter, id: string): Promise<void> {\n\ttry {\n\t\tconst localId = id.replace(`${adapter.namespace}.`, '');\n\t\tawait adapter.setState(localId, { val: false, ack: true });\n\n\t\t// Hysterese zus\u00E4tzlich auslesen, um den perfekten Zielwert zu berechnen\n\t\tconst [wwIstState, wwSollState, wwHystereseState] = await Promise.all([\n\t\t\tadapter.getStateAsync(getDpPath('Wamwassertemperatur_Ist')),\n\t\t\tadapter.getStateAsync(getDpPath('Wamwassertemperatur_Soll')),\n\t\t\tadapter.getStateAsync(getDpPath('hotWaterTemperatureHysteresis')),\n\t\t]);\n\n\t\tconst wwIst = getNumber(wwIstState);\n\t\tconst wwSoll = getNumber(wwSollState);\n\t\tconst wwHysterese = getNumber(wwHystereseState, 2); // Fallback auf 2K, falls nicht gefunden\n\n\t\tif (wwIst >= wwSoll - 1) {\n\t\t\twriteLog(\n\t\t\t\t`Forced hot water: Ignored - Actual (${wwIst}\u00B0C) is already sufficient (Target: ${wwSoll}\u00B0C).`,\n\t\t\t\t'info',\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t// Neuen Sollwert berechnen: Ist-Wert + aktuelle Hysterese + 1.5K Puffer\n\t\tlet forceSoll = wwIst + wwHysterese + 1.5;\n\n\t\t// Sicherheitspr\u00FCfung: Maximaltemperatur kappen, um Regler-Fehler zu vermeiden\n\t\tconst MAX_WW_TEMP = 70;\n\t\tif (forceSoll > MAX_WW_TEMP) {\n\t\t\tforceSoll = MAX_WW_TEMP;\n\t\t}\n\n\t\t// Auf eine Nachkommastelle runden f\u00FCr saubere \u00DCbergabe\n\t\tforceSoll = Math.round(forceSoll * 10) / 10;\n\n\t\t// Statt der Hysterese wird nun der Warmwasser-Sollwert \u00FCberschrieben\n\t\tawait adapter.syncConfigValue('temperature_hot_water_target', forceSoll);\n\n\t\twriteLog(\n\t\t\t`Forced hot water: Triggered - Actual (${wwIst}\u00B0C) < Target-1 (${wwSoll - 1}\u00B0C). Target temperature temporarily set to ${forceSoll}\u00B0C.`,\n\t\t\t'info',\n\t\t);\n\t} catch (err: unknown) {\n\t\tconst msg = err instanceof Error ? err.message : String(err);\n\t\twriteLog(`Forced hot water: Error during execution - ${msg}`, 'error');\n\t}\n}\n\n/**\n * Erzwingt den Heizbetrieb durch tempor\u00E4re Erh\u00F6hung des Fu\u00DFpunktes.\n *\n * @param adapter Die Instanz des ioBroker-Adapters.\n * @param id Die ID des ausl\u00F6senden Datenpunkts.\n */\nexport async function handleZwangsheizen(adapter: LuxtronikAdapter, id: string): Promise<void> {\n\ttry {\n\t\tconst localId = id.replace(`${adapter.namespace}.`, '');\n\t\tawait adapter.setState(localId, { val: false, ack: true });\n\n\t\tconst [bzState, ruecklaufState, ruecklaufSollState, hystereseState] = await Promise.all([\n\t\t\tadapter.getStateAsync(getDpPath('WP_BZ_akt')),\n\t\t\tadapter.getStateAsync(getDpPath('temperature_return')),\n\t\t\tadapter.getStateAsync(getDpPath('temperature_target_return')),\n\t\t\tadapter.getStateAsync(getDpPath('returnTemperatureHysteresis')),\n\t\t]);\n\n\t\tconst bzVal = getNumber(bzState, -1);\n\t\tconst ruecklauf = getNumber(ruecklaufState);\n\t\tconst ruecklaufSoll = getNumber(ruecklaufSollState);\n\t\tconst hysterese = getNumber(hystereseState);\n\n\t\tif (bzVal !== CONSTANTS.STATE_IDLE) {\n\t\t\twriteLog(`Forced heating: Ignored - System is not idle (Status: ${bzVal}).`, 'info');\n\t\t\treturn;\n\t\t}\n\n\t\tif (ruecklauf >= ruecklaufSoll + hysterese) {\n\t\t\twriteLog(\n\t\t\t\t`Forced heating: Ignored - Return temperature high enough (${ruecklauf}\u00B0C >= ${ruecklaufSoll + hysterese}\u00B0C).`,\n\t\t\t\t'info',\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tawait adapter.
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAyB;AACzB,0BAA0B;AAE1B,mBAA0B;AAM1B,MAAM,YAAY;AAAA;AAAA,EAEjB,YAAY;AAAA;AAAA,EAEZ,sBAAsB;AACvB;AAYA,eAAsB,uBAAuB,SAA2B,IAA2B;AAClG,MAAI;AACH,UAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,SAAS,KAAK,EAAE;AACtD,UAAM,QAAQ,SAAS,SAAS,EAAE,KAAK,OAAO,KAAK,KAAK,CAAC;AAGzD,UAAM,CAAC,YAAY,aAAa,gBAAgB,IAAI,MAAM,QAAQ,IAAI;AAAA,MACrE,QAAQ,kBAAc,+BAAU,yBAAyB,CAAC;AAAA,MAC1D,QAAQ,kBAAc,+BAAU,0BAA0B,CAAC;AAAA,MAC3D,QAAQ,kBAAc,+BAAU,+BAA+B,CAAC;AAAA,IACjE,CAAC;AAED,UAAM,YAAQ,wBAAU,UAAU;AAClC,UAAM,aAAS,wBAAU,WAAW;AACpC,UAAM,kBAAc,wBAAU,kBAAkB,CAAC;AAEjD,QAAI,SAAS,SAAS,GAAG;AACxB;AAAA,QACC,uCAAuC,KAAK,yCAAsC,MAAM;AAAA,QACxF;AAAA,MACD;AACA;AAAA,IACD;AAGA,QAAI,YAAY,QAAQ,cAAc;AAGtC,UAAM,cAAc;AACpB,QAAI,YAAY,aAAa;AAC5B,kBAAY;AAAA,IACb;AAGA,gBAAY,KAAK,MAAM,YAAY,EAAE,IAAI;AAGzC,UAAM,QAAQ,gBAAgB,gCAAgC,SAAS;AAEvE;AAAA,MACC,yCAAyC,KAAK,sBAAmB,SAAS,CAAC,iDAA8C,SAAS;AAAA,MAClI;AAAA,IACD;AAAA,EACD,SAAS,KAAc;AACtB,UAAM,MAAM,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG;AAC3D,gCAAS,8CAA8C,GAAG,IAAI,OAAO;AAAA,EACtE;AACD;AAQA,eAAsB,mBAAmB,SAA2B,IAA2B;
|
|
4
|
+
"sourcesContent": ["import { writeLog } from './logger';\nimport { getDpPath } from './stateMapping';\nimport type { LuxtronikAdapter } from './types';\nimport { getNumber } from './utils';\n\n// =========================================================\n// TYPEN & KONSTANTEN\n// =========================================================\n\nconst CONSTANTS = {\n\t/** Status-Code f\u00FCr den Ruhezustand der Anlage */\n\tSTATE_IDLE: 5,\n\t/** Befehlswert f\u00FCr den Fu\u00DFpunkt beim Zwangsheizen */\n\tFORCE_HEATING_OFFSET: 35,\n};\n\n// =========================================================\n// AKTIONEN\n// =========================================================\n\n/**\n * Erzwingt die Warmwasserbereitung durch tempor\u00E4re Erh\u00F6hung des Sollwerts.\n *\n * @param adapter Die Instanz des ioBroker-Adapters.\n * @param id Die ID des ausl\u00F6senden Datenpunkts.\n */\nexport async function handleZwangswarmwasser(adapter: LuxtronikAdapter, id: string): Promise<void> {\n\ttry {\n\t\tconst localId = id.replace(`${adapter.namespace}.`, '');\n\t\tawait adapter.setState(localId, { val: false, ack: true });\n\n\t\t// Hysterese zus\u00E4tzlich auslesen, um den perfekten Zielwert zu berechnen\n\t\tconst [wwIstState, wwSollState, wwHystereseState] = await Promise.all([\n\t\t\tadapter.getStateAsync(getDpPath('Wamwassertemperatur_Ist')),\n\t\t\tadapter.getStateAsync(getDpPath('Wamwassertemperatur_Soll')),\n\t\t\tadapter.getStateAsync(getDpPath('hotWaterTemperatureHysteresis')),\n\t\t]);\n\n\t\tconst wwIst = getNumber(wwIstState);\n\t\tconst wwSoll = getNumber(wwSollState);\n\t\tconst wwHysterese = getNumber(wwHystereseState, 2); // Fallback auf 2K, falls nicht gefunden\n\n\t\tif (wwIst >= wwSoll - 1) {\n\t\t\twriteLog(\n\t\t\t\t`Forced hot water: Ignored - Actual (${wwIst}\u00B0C) is already sufficient (Target: ${wwSoll}\u00B0C).`,\n\t\t\t\t'info',\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t// Neuen Sollwert berechnen: Ist-Wert + aktuelle Hysterese + 1.5K Puffer\n\t\tlet forceSoll = wwIst + wwHysterese + 1.5;\n\n\t\t// Sicherheitspr\u00FCfung: Maximaltemperatur kappen, um Regler-Fehler zu vermeiden\n\t\tconst MAX_WW_TEMP = 70;\n\t\tif (forceSoll > MAX_WW_TEMP) {\n\t\t\tforceSoll = MAX_WW_TEMP;\n\t\t}\n\n\t\t// Auf eine Nachkommastelle runden f\u00FCr saubere \u00DCbergabe\n\t\tforceSoll = Math.round(forceSoll * 10) / 10;\n\n\t\t// Statt der Hysterese wird nun der Warmwasser-Sollwert \u00FCberschrieben\n\t\tawait adapter.syncConfigValue('temperature_hot_water_target', forceSoll);\n\n\t\twriteLog(\n\t\t\t`Forced hot water: Triggered - Actual (${wwIst}\u00B0C) < Target-1 (${wwSoll - 1}\u00B0C). Target temperature temporarily set to ${forceSoll}\u00B0C.`,\n\t\t\t'info',\n\t\t);\n\t} catch (err: unknown) {\n\t\tconst msg = err instanceof Error ? err.message : String(err);\n\t\twriteLog(`Forced hot water: Error during execution - ${msg}`, 'error');\n\t}\n}\n\n/**\n * Erzwingt den Heizbetrieb durch tempor\u00E4re Erh\u00F6hung des Fu\u00DFpunktes.\n *\n * @param adapter Die Instanz des ioBroker-Adapters.\n * @param id Die ID des ausl\u00F6senden Datenpunkts.\n */\nexport async function handleZwangsheizen(adapter: LuxtronikAdapter, id: string): Promise<void> {\n\ttry {\n\t\tconst localId = id.replace(`${adapter.namespace}.`, '');\n\t\tawait adapter.setState(localId, { val: false, ack: true });\n\n\t\tconst [bzState, ruecklaufState, ruecklaufSollState, hystereseState] = await Promise.all([\n\t\t\tadapter.getStateAsync(getDpPath('WP_BZ_akt')),\n\t\t\tadapter.getStateAsync(getDpPath('temperature_return')),\n\t\t\tadapter.getStateAsync(getDpPath('temperature_target_return')),\n\t\t\tadapter.getStateAsync(getDpPath('returnTemperatureHysteresis')),\n\t\t]);\n\n\t\tconst bzVal = getNumber(bzState, -1);\n\t\tconst ruecklauf = getNumber(ruecklaufState);\n\t\tconst ruecklaufSoll = getNumber(ruecklaufSollState);\n\t\tconst hysterese = getNumber(hystereseState);\n\n\t\tif (bzVal !== CONSTANTS.STATE_IDLE) {\n\t\t\twriteLog(`Forced heating: Ignored - System is not idle (Status: ${bzVal}).`, 'info');\n\t\t\treturn;\n\t\t}\n\n\t\tif (ruecklauf >= ruecklaufSoll + hysterese) {\n\t\t\twriteLog(\n\t\t\t\t`Forced heating: Ignored - Return temperature high enough (${ruecklauf}\u00B0C >= ${ruecklaufSoll + hysterese}\u00B0C).`,\n\t\t\t\t'info',\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tawait adapter.activateForcedHeatingBoost('ForcedHeating');\n\t\tconst isShi = Boolean(\n\t\t\tadapter.config.modbus_active &&\n\t\t\tadapter.modbusManager?.isAvailable &&\n\t\t\tadapter.modbusManager.protocolVersion === 'shi' &&\n\t\t\tadapter.config.sync_modbus_holding_23 === true,\n\t\t);\n\t\twriteLog(\n\t\t\tisShi\n\t\t\t\t? 'Forced heating: Triggered - Volatile SHI heating offset temporarily set to +10.0 K (Modbus RAM).'\n\t\t\t\t: `Forced heating: Triggered - Base point temporarily set to ${CONSTANTS.FORCE_HEATING_OFFSET}\u00B0C.`,\n\t\t\t'info',\n\t\t);\n\t} catch (err: unknown) {\n\t\tconst msg = err instanceof Error ? err.message : String(err);\n\t\twriteLog(`Forced heating: Error during execution - ${msg}`, 'error');\n\t}\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AA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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 über den flüchtigen SHI-Modbus-Offset (+10 K) aktiv ist */
|
|
66
|
+
forcedHeatingShiActive = 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 */
|
|
@@ -234,19 +236,21 @@ class Luxtronik2Controller extends utils.Adapter {
|
|
|
234
236
|
const cycleTotalState = await this.getStateAsync((0, import_stateMapping.getDpPath)("write_cycles_total"));
|
|
235
237
|
this.writeCyclesTotal = cycleTotalState && typeof cycleTotalState.val === "number" ? cycleTotalState.val : 0;
|
|
236
238
|
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
239
|
this.modbusManager = new import_modbusManager.ModbusManager(this);
|
|
244
240
|
if (!isReadOnly && config.modbus_active) {
|
|
245
241
|
(0, import_logger.writeLog)("Checking Modbus TCP availability for hybrid operations...", "info");
|
|
246
242
|
await this.modbusManager.checkAvailability();
|
|
247
243
|
}
|
|
244
|
+
if (!isReadOnly) {
|
|
245
|
+
(0, import_zipManager.subscribeMotionSensors)(this);
|
|
246
|
+
await (0, import_pvManager.initPvManagement)(this);
|
|
247
|
+
}
|
|
248
|
+
this.subscribeStates("*");
|
|
248
249
|
try {
|
|
249
250
|
await this.updateData();
|
|
251
|
+
if (!isReadOnly) {
|
|
252
|
+
await (0, import_zipManager.disableHardwareZipTimer)(this);
|
|
253
|
+
}
|
|
250
254
|
} catch (error) {
|
|
251
255
|
this.log.error(`Initial data retrieval failed (device offline?): ${error.message}`);
|
|
252
256
|
}
|
|
@@ -404,6 +408,82 @@ class Luxtronik2Controller extends utils.Adapter {
|
|
|
404
408
|
(0, import_logger.writeLog)(`Error occurred during setOwnStateIfDifferent operation for state ${id}: ${err.message}`, "error");
|
|
405
409
|
}
|
|
406
410
|
}
|
|
411
|
+
/**
|
|
412
|
+
* Prüft, ob das moderne V3.9x Smart Home Interface (SHI) per Modbus TCP aktiv und erreichbar ist.
|
|
413
|
+
*/
|
|
414
|
+
isShiModbusActive() {
|
|
415
|
+
const config = this.config;
|
|
416
|
+
return Boolean(
|
|
417
|
+
config.operation_mode !== "readonly" && config.modbus_active && this.modbusManager && this.modbusManager.isAvailable && this.modbusManager.protocolVersion === "shi" && config.sync_modbus_holding_23 === true
|
|
418
|
+
);
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* Aktiviert eine temporäre Heizungsanhebung (Takt-Optimierung, Vorheizen oder Zwangsheizen).
|
|
422
|
+
* Nutzt im V3.9x-SHI-Modus flüchtiges Modbus-RAM (+10.0 K über Holding 23 -> SHI 10002),
|
|
423
|
+
* sonst wie bisher den Heizkurven-Fußpunkt (35 °C).
|
|
424
|
+
*
|
|
425
|
+
* @param reason - Optionaler Kontext für das Debug-Log.
|
|
426
|
+
*/
|
|
427
|
+
async activateForcedHeatingBoost(reason = "CycleOpt") {
|
|
428
|
+
if (this.isShiModbusActive()) {
|
|
429
|
+
if (!this.forcedHeatingShiActive) {
|
|
430
|
+
await this.modbusManager.writeRegister(23, 100, false);
|
|
431
|
+
this.forcedHeatingShiActive = true;
|
|
432
|
+
const dpHeatingTemp = (0, import_stateMapping.getDpPath)("heating_temperature");
|
|
433
|
+
if (dpHeatingTemp) {
|
|
434
|
+
await this.setOwnStateIfDifferent(dpHeatingTemp, 10, true);
|
|
435
|
+
}
|
|
436
|
+
if (this.isDebugLogActive) {
|
|
437
|
+
(0, import_logger.writeLog)(
|
|
438
|
+
`[${reason}] SHI Modbus active: Setting volatile heating offset to +10.0 K (Holding 23 -> SHI 10002, 0 EEPROM writes).`,
|
|
439
|
+
"info"
|
|
440
|
+
);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
return;
|
|
444
|
+
}
|
|
445
|
+
await this.syncConfigValue("heating_curve_parallel_offset", 35);
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* Setzt eine aktive temporäre Heizungsanhebung sauber zurück.
|
|
449
|
+
* Im SHI-Modus wird der flüchtige Offset auf den Basiswert zurückgesetzt und ein aktiver PV-Boost optional wiederhergestellt.
|
|
450
|
+
*
|
|
451
|
+
* @param reapplyPv - Stellt bei aktivem PV-Boost dessen Sollwert im Anschluss sofort wieder her.
|
|
452
|
+
*/
|
|
453
|
+
async resetForcedHeatingBoost(reapplyPv = true) {
|
|
454
|
+
var _a, _b;
|
|
455
|
+
const config = this.config;
|
|
456
|
+
if (this.isShiModbusActive()) {
|
|
457
|
+
const heatingTempState = await this.getStateAsync((0, import_stateMapping.getDpPath)("heating_temperature"));
|
|
458
|
+
const isShiOffsetStuckHigh = typeof (heatingTempState == null ? void 0 : heatingTempState.val) === "number" && heatingTempState.val >= 10;
|
|
459
|
+
if (!this.forcedHeatingShiActive && !isShiOffsetStuckHigh) {
|
|
460
|
+
return;
|
|
461
|
+
}
|
|
462
|
+
this.forcedHeatingShiActive = false;
|
|
463
|
+
const baseOffset = Number((_a = config.sync_heating_temperature) != null ? _a : 0);
|
|
464
|
+
await this.modbusManager.writeRegister(23, Math.round(baseOffset * 10), false);
|
|
465
|
+
const dpHeatingTemp = (0, import_stateMapping.getDpPath)("heating_temperature");
|
|
466
|
+
if (dpHeatingTemp) {
|
|
467
|
+
await this.setOwnStateIfDifferent(dpHeatingTemp, baseOffset, true);
|
|
468
|
+
}
|
|
469
|
+
if (this.isDebugLogActive) {
|
|
470
|
+
(0, import_logger.writeLog)(
|
|
471
|
+
`[CycleOpt] SHI Modbus active: Resetting volatile heating offset back to ${baseOffset} K (Holding 23 -> SHI 10002).`,
|
|
472
|
+
"info"
|
|
473
|
+
);
|
|
474
|
+
}
|
|
475
|
+
if (reapplyPv && import_pvManager.pvIsBoostActive) {
|
|
476
|
+
await (0, import_pvManager.evaluatePvBoost)(this, true);
|
|
477
|
+
}
|
|
478
|
+
return;
|
|
479
|
+
}
|
|
480
|
+
const fusspunktState = await this.getStateAsync((0, import_stateMapping.getDpPath)("heating_curve_parallel_offset"));
|
|
481
|
+
const currentFusspunkt = typeof (fusspunktState == null ? void 0 : fusspunktState.val) === "number" ? fusspunktState.val : this.currentRawParams[12] !== void 0 ? this.currentRawParams[12] / 10 : 0;
|
|
482
|
+
if (currentFusspunkt === 35) {
|
|
483
|
+
const fallbackFusspunkt = (_b = config.fusspunkt) != null ? _b : 21.7;
|
|
484
|
+
await this.syncConfigValue("heating_curve_parallel_offset", fallbackFusspunkt);
|
|
485
|
+
}
|
|
486
|
+
}
|
|
407
487
|
/**
|
|
408
488
|
* Configures fallback factory parameter baselines for the heat pump when in an idle state.
|
|
409
489
|
*
|
|
@@ -413,17 +493,22 @@ class Luxtronik2Controller extends utils.Adapter {
|
|
|
413
493
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
414
494
|
try {
|
|
415
495
|
const config = this.config;
|
|
416
|
-
await this.
|
|
417
|
-
|
|
496
|
+
await this.resetForcedHeatingBoost(false);
|
|
497
|
+
if (!this.isShiModbusActive()) {
|
|
498
|
+
await this.syncConfigValue("heating_curve_end_point", (_a = config.endpunkt) != null ? _a : 23);
|
|
499
|
+
await this.syncConfigValue("heating_curve_parallel_offset", (_b = config.fusspunkt) != null ? _b : 21.7);
|
|
500
|
+
}
|
|
418
501
|
await this.syncConfigValue("heating_temperature", (_c = config.sync_heating_temperature) != null ? _c : 0);
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
502
|
+
if (config.hup_optimierung_aktiv === true) {
|
|
503
|
+
await this.syncConfigValue(
|
|
504
|
+
"heating_system_circ_pump_voltage_minimal",
|
|
505
|
+
(_d = config.sync_heating_system_circ_pump_voltage_minimal_heating) != null ? _d : 3
|
|
506
|
+
);
|
|
507
|
+
await this.syncConfigValue(
|
|
508
|
+
"heating_system_circ_pump_voltage_nominal",
|
|
509
|
+
(_e = config.sync_heating_system_circ_pump_voltage_nominal_heating) != null ? _e : 7
|
|
510
|
+
);
|
|
511
|
+
}
|
|
427
512
|
await this.syncConfigValue("temperature_hot_water_target", (_f = config.sync_warmwater_target_temperature) != null ? _f : 54);
|
|
428
513
|
await this.syncConfigValue("returnTemperatureHysteresis", (_g = config.sync_return_temperature_hysteresis) != null ? _g : 1.5);
|
|
429
514
|
await this.syncConfigValue("zip_aktiv", (_h = config.zip_aktiv) != null ? _h : 0);
|
|
@@ -459,7 +544,7 @@ class Luxtronik2Controller extends utils.Adapter {
|
|
|
459
544
|
* @returns A promise that resolves when the execution cycle finishes.
|
|
460
545
|
*/
|
|
461
546
|
async runOptimizationSchedule(rawValues = [], rawParams = []) {
|
|
462
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j
|
|
547
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
463
548
|
try {
|
|
464
549
|
const config = this.config;
|
|
465
550
|
if (config.operation_mode === "readonly") {
|
|
@@ -480,6 +565,8 @@ class Luxtronik2Controller extends utils.Adapter {
|
|
|
480
565
|
if (istLeerlauf) {
|
|
481
566
|
if (config.idle_defaults_aktiv === true) {
|
|
482
567
|
await this.setIdleDefaults();
|
|
568
|
+
} else if (this.forcedHeatingShiActive) {
|
|
569
|
+
await this.resetForcedHeatingBoost();
|
|
483
570
|
}
|
|
484
571
|
} else if (istHeizen) {
|
|
485
572
|
if (this.lastBzVal === "1" && config.idle_defaults_aktiv === true) {
|
|
@@ -586,12 +673,7 @@ class Luxtronik2Controller extends utils.Adapter {
|
|
|
586
673
|
const nachWasser = Boolean(nachWasserState == null ? void 0 : nachWasserState.val);
|
|
587
674
|
if (istHeizen) {
|
|
588
675
|
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
|
-
}
|
|
676
|
+
await this.resetForcedHeatingBoost();
|
|
595
677
|
}
|
|
596
678
|
if (aelterAls10 && vd1) {
|
|
597
679
|
this.lastPumpOptimization = await (0, import_hupManager.handleHupOptimization)(
|
|
@@ -629,7 +711,7 @@ class Luxtronik2Controller extends utils.Adapter {
|
|
|
629
711
|
const isHeatingAllowedByLimit = !isHeatingLimitEnabled || mitteltemperatur < thresholdHeatingLimit;
|
|
630
712
|
if (istWarmwasser && nachWasser) {
|
|
631
713
|
if (isRegelungAktiv && isHeatingAllowedByLimit) {
|
|
632
|
-
await this.
|
|
714
|
+
await this.activateForcedHeatingBoost("CycleOpt-AfterWW");
|
|
633
715
|
}
|
|
634
716
|
}
|
|
635
717
|
if (istLeerlauf) {
|
|
@@ -642,11 +724,11 @@ class Luxtronik2Controller extends utils.Adapter {
|
|
|
642
724
|
if (wwSoll - wwIst >= wwHysterese - 1.5 && ruecklauf <= ruecklaufSoll && isHeatingAllowedByLimit) {
|
|
643
725
|
if (this.isDebugLogActive) {
|
|
644
726
|
(0, import_logger.writeLog)(
|
|
645
|
-
`[CycleOpt] Pre-starting heating before WW (WW: ${wwIst}/${wwSoll}\xB0C, Hyst: ${wwHysterese}K, RL: ${ruecklauf}/${ruecklaufSoll}\xB0C)
|
|
727
|
+
`[CycleOpt] Pre-starting heating before WW (WW: ${wwIst}/${wwSoll}\xB0C, Hyst: ${wwHysterese}K, RL: ${ruecklauf}/${ruecklaufSoll}\xB0C).`,
|
|
646
728
|
"info"
|
|
647
729
|
);
|
|
648
730
|
}
|
|
649
|
-
await this.
|
|
731
|
+
await this.activateForcedHeatingBoost("CycleOpt-PreHeat");
|
|
650
732
|
}
|
|
651
733
|
}
|
|
652
734
|
}
|