iobroker.luxtronik2-controller 0.23.2 → 0.25.0-alpha.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 +34 -17
- package/admin/jsonConfig.json +138 -4
- package/build/main.js +115 -47
- package/build/main.js.map +2 -2
- package/build/mapping/info.js +22 -8
- package/build/mapping/info.js.map +2 -2
- package/build/mapping/settings.js +56 -7
- package/build/mapping/settings.js.map +2 -2
- package/build/modbusManager.js +327 -21
- package/build/modbusManager.js.map +2 -2
- package/build/rawFunctions.js +70 -142
- package/build/rawFunctions.js.map +2 -2
- package/build/stateMapping.js.map +2 -2
- package/io-package.json +29 -28
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
|
|
14
14
|
This ioBroker adapter enables the local control, optimization, and monitoring of heat pumps with [Luxtronik 2.x / 3.x controllers](https://www.alpha-innotec.com/en/products/accessories/control/luxtronik) (e.g., Alpha Innotec, Novelan). The adapter is written entirely in TypeScript.
|
|
15
15
|
|
|
16
|
+
**If you like this project and want to support its development, feel free to drop a tip here: https://paypal.me/TJahnke**
|
|
17
|
+
|
|
16
18
|
## Acknowledgements & History
|
|
17
19
|
|
|
18
20
|
This project builds upon the preliminary work of existing open-source projects. Special thanks go to:
|
|
@@ -22,6 +24,10 @@ This project builds upon the preliminary work of existing open-source projects.
|
|
|
22
24
|
- **[UncleSamSwiss](https://github.com/UncleSamSwiss/ioBroker.luxtronik2):** For the original ioBroker adapter.
|
|
23
25
|
- **[BenPru](https://github.com/BenPru/luxtronik) & rhammen:** A special thanks to BenPru and rhammen for their continuous further development regarding the access and control of the Luxtronik controller. Without their dedication, efforts, and ideas, this adapter would not have reached the advanced state it is in today. _(If you appreciate their work, feel free to buy them a coffee! ☕) [BenPru](https://github.com/sponsors/BenPru) [rhammen](https://github.com/sponsors/rhammen)_
|
|
24
26
|
|
|
27
|
+
> **💡 No LAN cable near your heat pump? No problem!**
|
|
28
|
+
> If your Luxtronik 2.0 controller only has a free USB port instead of a nearby network socket, you can easily connect it via Wi-Fi using the clever **USB 2.0 powered WiFi/Ethernet Bridge** project by _obermolch_. It powers itself directly from the controller's USB port and bridges the connection wirelessly without extra wall power supplies.
|
|
29
|
+
> Check out the full guide and community discussion here: [ioBroker Forum: USB 2.0 powered WiFi/Ethernet Bridge für Luxtronik 2.0](https://forum.iobroker.net/topic/85773/usb-2-0-powered-wifi-ethernet-bridge-f%C3%BCr-luxtronik-2-0).
|
|
30
|
+
|
|
25
31
|
**Innovations in this version:**
|
|
26
32
|
The `luxtronik2-controller` natively integrates both classic TCP communication (Port `8888` / `8889`) and modern WebSockets (Port `8214` for firmware > V3.81), combined with an optional **Hybrid Modbus TCP** engine (Port `502`) for wear-free RAM writes. Additionally, it features intelligent cycle optimization, dynamic pump control, hardware flash-wear protection, COP/JAZ efficiency tracking, PV-management and automated datapoint management.
|
|
27
33
|
|
|
@@ -96,6 +102,34 @@ You might see red error messages in the installation log related to `node-gyp`,
|
|
|
96
102
|
//### **WORK IN PROGRESS**
|
|
97
103
|
|
|
98
104
|
## Changelog
|
|
105
|
+
|
|
106
|
+
**WORK IN PROGRESS**
|
|
107
|
+
### 0.25.0-alpha.0 (2026-11-15)
|
|
108
|
+
|
|
109
|
+
- **Operating Mode & UI Protection (`jsonConfig.json`, `main.ts`):**
|
|
110
|
+
- **Explicit Operating Mode Selection:** Added a central selector in the Connection tab with color-coded status banners to clearly distinguish between **Read-Only (Monitoring)**, **Read & Write without Modbus (Native via Port 8889)**, and **Read & Write with Modbus TCP (Hybrid RAM access)**.
|
|
111
|
+
- **Dynamic UI & Backend Write Locking:** In Read-Only mode, all write-related configuration tabs (Modbus, Idle Defaults, Cycle Optimization, HUP, ZIP, PV Surplus) are automatically grayed out and all hardware write commands are strictly blocked in the backend.
|
|
112
|
+
- **Automatic Config Migration:** Existing installations are seamlessly migrated on startup to the matching operating mode based on previously active settings.
|
|
113
|
+
- **Modbus V3.9x Smart Home Interface (SHI) & Diagnostics (`modbusManager.ts`, `settings.ts`, `info.ts`):**
|
|
114
|
+
- **Dual-Protocol Auto-Detection:** The Modbus manager now automatically detects and supports both the classic Modbus register mapping (`0..23`) and the modern **V3.90+ / V3.92.x Smart Home Interface (SHI)** register architecture (`10000+`).
|
|
115
|
+
- **Automated SHI Mode-Gating:** Writing to SHI setpoints and offsets (`10001`, `10002`, `10006`) automatically activates the required SHI control mode registers (`10000`, `10005`, `10065`) and releases heating curve control (`mode = 0`) when the offset returns to `0 K`.
|
|
116
|
+
- **Granular Register Polling & Diagnostic Scanner:** Replaced rigid block reads with individual register polling to prevent `Exception 2 (Illegal data address)` crashes on unsupported registers, and integrated a full Modbus register scanner into `Dump_Raw_To_Log`.
|
|
117
|
+
- **Core Stability, COP & Pure TCP Communication (`main.ts`, `rawFunctions.ts`, `copManager.ts`):**
|
|
118
|
+
- **Pure Native TCP Architecture:** Removed deprecated WebSocket (port 8214) code in favor of stable, password-free native TCP communication over port `8889`.
|
|
119
|
+
- **Isolated COP & Energy Tracking:** Enforced strict separation of reference states for heating, hot water, and total consumption with fallback logic for controllers affected by zero-value firmware bugs.
|
|
120
|
+
- **Bug Fixes:** Fixed Modbus RAM vs. EEPROM sync loops (`hardwareOutOfSync`), unified `°C` temperature scaling across all data sources, and fixed offline detection (`info.connection` & `errorCount`) when telemetry reads fail.
|
|
121
|
+
- **Repository Checker & i18n:** Completed missing 11-language translations in `jsonConfig.json` and updated `@iobroker/testing` to `6.3.2`.
|
|
122
|
+
|
|
123
|
+
### 0.24.0 (2026-11-09)
|
|
124
|
+
|
|
125
|
+
**🐛 Bugfixes & Tweaks**
|
|
126
|
+
|
|
127
|
+
- **Operating Mode & Write Protection (`jsonConfig.json`, `main.ts`):**
|
|
128
|
+
- **Explicit Operating Mode Selection:** Added a central "Operating Mode" selector in the Connection tab with color-coded status banners to clearly distinguish between **Read-Only (Monitoring)**, **Read & Write without Modbus (Native via Port 8889)**, and **Read & Write with Modbus TCP (Hybrid RAM access)**.
|
|
129
|
+
- **Dynamic UI Locking:** When "Read-Only" is selected, all write-related configuration tabs (Modbus, Idle Defaults, Cycle Optimization, HUP, ZIP, and PV Surplus) and their inputs are automatically grayed out and disabled. Selecting native write mode unlocks the optimization tabs while keeping the Modbus tab disabled.
|
|
130
|
+
- **Strict Backend Write Lock:** Enforced a global hardware write lock in Read-Only mode across `onReady`, `syncConfigValue`, `runOptimizationSchedule`, and `onStateChange` (while keeping diagnostic functions like debug logging, raw dumps, and firmware checks active).
|
|
131
|
+
- **Automatic Config Migration:** Existing installations are seamlessly migrated on startup to the matching operating mode based on their previously active Modbus and optimization settings.
|
|
132
|
+
|
|
99
133
|
### 0.23.2 (2026-11-07)
|
|
100
134
|
|
|
101
135
|
- **COP & Efficiency Calculation (`copManager.ts`):**
|
|
@@ -117,23 +151,6 @@ You might see red error messages in the installation log related to `node-gyp`,
|
|
|
117
151
|
- **Custom Heating Offset Baseline:** Added a new configuration field in the "Idle Defaults" tab for the default heating target temperature offset (Parallelverschiebung)[cite: 10].
|
|
118
152
|
- **Preserved Baselines:** The idle reset mechanism (`main.ts`) and the PV surplus manager (`pvManager.ts`) now respect this custom baseline (e.g., +1 K) instead of hard-resetting the offset to `0 K`[cite: 7, 13]. This ensures that your manual baseline heating curve is perfectly preserved when returning from a PV boost or entering standby.
|
|
119
153
|
|
|
120
|
-
### 0.22.8 (2026-11-07)
|
|
121
|
-
|
|
122
|
-
**🐛 Bugfixes & Tweaks**
|
|
123
|
-
|
|
124
|
-
- **COP & Efficiency Calculation (`copManager.ts`):**
|
|
125
|
-
- **Hot Water Hardware Bug Fallback:** Added a dynamic fallback mechanism to bypass a hardware bug present in several Luxtronik and Novelan firmwares where the internal electrical meter for hot water (`energy_warmwater`) permanently reports `0`.
|
|
126
|
-
- **Smart Delta Routing:** When the heat pump is actively generating hot water (`WP_BZ_akt === 1`), the COP manager now checks if the internal DHW power meter is stuck at zero. If so, it automatically intercepts the delta from the total energy meter (`energy_total`) over the last polling interval and securely routes it into the Hot Water COP bucket.
|
|
127
|
-
- **Continuous Standby Sync:** Enhanced the database tracking to ensure the total energy fallback counter is continuously synced even during standby or heating modes. This prevents idle power consumption from accumulating in the background and falsely distorting the next hot water efficiency calculation.
|
|
128
|
-
|
|
129
|
-
### 0.22.7 (2026-11-07)
|
|
130
|
-
|
|
131
|
-
**🐛 Bugfixes**
|
|
132
|
-
|
|
133
|
-
- **PV Surplus Management & Cycle Optimization:**
|
|
134
|
-
- **Zero-Drift Baseline Calculation:** Rewrote the PV boost baseline logic in `pvManager.ts`. The adapter no longer reads live datapoint states to calculate the boost, but strictly enforces the configured baseline values (`sync_warmwater_target_temperature` and `0K` for heating). This permanently resolves the "snowball effect" where the hot water target could incrementally drift up to the 70 °C safety limit.
|
|
135
|
-
- **Cycle Coupling Handshake:** Enhanced the intelligent cycle optimization (`main.ts`) during active PV surplus. At the end of a heating cycle, the adapter now seamlessly couples a hot water cycle and intelligently enforces the PV boost target (e.g., 60 °C) to maximize solar self-consumption, without interfering with the strict baseline logic.
|
|
136
|
-
|
|
137
154
|
## License
|
|
138
155
|
|
|
139
156
|
MIT License
|
package/admin/jsonConfig.json
CHANGED
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"de": "Wärmepumpen Port"
|
|
45
45
|
},
|
|
46
46
|
"help": {
|
|
47
|
-
"en": "Standard TCP: 8889
|
|
48
|
-
"de": "Standard TCP: 8889
|
|
47
|
+
"en": "Standard Native TCP: 8889 (For very old V1.x firmwares: 8888)",
|
|
48
|
+
"de": "Standard Native TCP: 8889 (Bei sehr alten V1.x Firmwares: 8888)"
|
|
49
49
|
},
|
|
50
50
|
"min": 1,
|
|
51
51
|
"max": 65535,
|
|
@@ -88,6 +88,125 @@
|
|
|
88
88
|
"lg": 12,
|
|
89
89
|
"xl": 12
|
|
90
90
|
},
|
|
91
|
+
"divider_operation_mode": {
|
|
92
|
+
"type": "divider",
|
|
93
|
+
"color": "primary",
|
|
94
|
+
"style": {
|
|
95
|
+
"marginBottom": "15px",
|
|
96
|
+
"marginTop": "15px"
|
|
97
|
+
},
|
|
98
|
+
"xs": 12,
|
|
99
|
+
"sm": 12,
|
|
100
|
+
"md": 12,
|
|
101
|
+
"lg": 12,
|
|
102
|
+
"xl": 12
|
|
103
|
+
},
|
|
104
|
+
"headerOperationMode": {
|
|
105
|
+
"type": "header",
|
|
106
|
+
"text": {
|
|
107
|
+
"en": "Operating Mode & Hardware Write Access",
|
|
108
|
+
"de": "Betriebsmodus & Hardware-Schreibzugriff"
|
|
109
|
+
},
|
|
110
|
+
"size": 4,
|
|
111
|
+
"xs": 12,
|
|
112
|
+
"sm": 12,
|
|
113
|
+
"md": 12,
|
|
114
|
+
"lg": 12,
|
|
115
|
+
"xl": 12
|
|
116
|
+
},
|
|
117
|
+
"operation_mode": {
|
|
118
|
+
"type": "select",
|
|
119
|
+
"label": "Select Operating Mode",
|
|
120
|
+
"options": [
|
|
121
|
+
{
|
|
122
|
+
"label": "🔒 Read-Only (Monitoring only – 0% flash wear, all optimizations disabled)",
|
|
123
|
+
"value": "readonly"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"label": "✍️ Read & Write: Without Modbus (Native via Port 8889 – writes to EEPROM)",
|
|
127
|
+
"value": "native"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"label": "⚡ Read & Write: With Modbus TCP (Hybrid – wear-free RAM access)",
|
|
131
|
+
"value": "modbus"
|
|
132
|
+
}
|
|
133
|
+
],
|
|
134
|
+
"default": "readonly",
|
|
135
|
+
"xs": 12,
|
|
136
|
+
"sm": 12,
|
|
137
|
+
"md": 12,
|
|
138
|
+
"lg": 12,
|
|
139
|
+
"xl": 12
|
|
140
|
+
},
|
|
141
|
+
"infoModeReadonly": {
|
|
142
|
+
"type": "staticText",
|
|
143
|
+
"text": {
|
|
144
|
+
"en": "🔒 <b>Read-Only Mode active:</b> The adapter only reads telemetry and parameters. All write-related tabs (Modbus, Idle Defaults, Cycle Optimization, HUP, ZIP, PV Surplus) are disabled and grayed out. Manual changes in the object tree are blocked.",
|
|
145
|
+
"de": "🔒 <b>Nur-Lesen-Modus aktiv:</b> Der Adapter liest ausschließlich Messwerte und Parameter aus (z.B. für Visualisierungen und COP-Berechnung). Alle schreibenden Reiter (Modbus, Vorgaben, Takt-Optimierung, HUP, ZIP, PV-Überschuss) sind komplett deaktiviert und ausgegraut. Es finden garantiert keine Schreibzugriffe auf die Wärmepumpe statt."
|
|
146
|
+
},
|
|
147
|
+
"hidden": "data.operation_mode !== 'readonly'",
|
|
148
|
+
"style": {
|
|
149
|
+
"marginTop": "10px",
|
|
150
|
+
"marginBottom": "15px",
|
|
151
|
+
"fontSize": "13px",
|
|
152
|
+
"backgroundColor": "#e3f2fd",
|
|
153
|
+
"color": "#0d47a1",
|
|
154
|
+
"padding": "12px",
|
|
155
|
+
"borderRadius": "5px",
|
|
156
|
+
"borderLeft": "5px solid #1976d2"
|
|
157
|
+
},
|
|
158
|
+
"xs": 12,
|
|
159
|
+
"sm": 12,
|
|
160
|
+
"md": 12,
|
|
161
|
+
"lg": 12,
|
|
162
|
+
"xl": 12
|
|
163
|
+
},
|
|
164
|
+
"infoModeNative": {
|
|
165
|
+
"type": "staticText",
|
|
166
|
+
"text": {
|
|
167
|
+
"en": "✍️ <b>Write Mode (Without Modbus / Native Port 8889):</b> Active optimizations and parameter changes are written directly to the Luxtronik EEPROM via port 8889. Please enable 'Idle Defaults' when using optimizations and monitor daily flash write cycles.",
|
|
168
|
+
"de": "✍️ <b>Schreibmodus (Ohne Modbus / Nativ über Port 8889):</b> Aktive Optimierungen (Takt, HUP, ZIP, PV) und Parameter-Änderungen werden direkt über Port 8889 in den EEPROM-Speicher der Luxtronik geschrieben. Der Reiter 'Modbus (Hybrid)' ist deaktiviert."
|
|
169
|
+
},
|
|
170
|
+
"hidden": "data.operation_mode !== 'native'",
|
|
171
|
+
"style": {
|
|
172
|
+
"marginTop": "10px",
|
|
173
|
+
"marginBottom": "15px",
|
|
174
|
+
"fontSize": "13px",
|
|
175
|
+
"backgroundColor": "#fff3e0",
|
|
176
|
+
"color": "#e65100",
|
|
177
|
+
"padding": "12px",
|
|
178
|
+
"borderRadius": "5px",
|
|
179
|
+
"borderLeft": "5px solid #ff9800"
|
|
180
|
+
},
|
|
181
|
+
"xs": 12,
|
|
182
|
+
"sm": 12,
|
|
183
|
+
"md": 12,
|
|
184
|
+
"lg": 12,
|
|
185
|
+
"xl": 12
|
|
186
|
+
},
|
|
187
|
+
"infoModeModbus": {
|
|
188
|
+
"type": "staticText",
|
|
189
|
+
"text": {
|
|
190
|
+
"en": "⚡ <b>Hybrid Mode (Write with Modbus TCP):</b> Volatile parameters (setpoints, offsets, coils) are written directly into the controller's RAM via Modbus TCP without causing EEPROM flash wear. Please select your active registers in the 'Modbus (Hybrid)' tab.",
|
|
191
|
+
"de": "⚡ <b>Hybrid-Modus (Schreibend mit Modbus TCP):</b> Flüchtige Parameter (Sollwerte, Parallelverschiebung, Coils) werden ohne EEPROM-Verschleiß direkt über Modbus TCP in den Arbeitsspeicher (RAM) geschrieben. Bitte wähle im Reiter 'Modbus (Hybrid)' die gewünschten Register aus."
|
|
192
|
+
},
|
|
193
|
+
"hidden": "data.operation_mode !== 'modbus'",
|
|
194
|
+
"style": {
|
|
195
|
+
"marginTop": "10px",
|
|
196
|
+
"marginBottom": "15px",
|
|
197
|
+
"fontSize": "13px",
|
|
198
|
+
"backgroundColor": "#e8f5e9",
|
|
199
|
+
"color": "#1b5e20",
|
|
200
|
+
"padding": "12px",
|
|
201
|
+
"borderRadius": "5px",
|
|
202
|
+
"borderLeft": "5px solid #4caf50"
|
|
203
|
+
},
|
|
204
|
+
"xs": 12,
|
|
205
|
+
"sm": 12,
|
|
206
|
+
"md": 12,
|
|
207
|
+
"lg": 12,
|
|
208
|
+
"xl": 12
|
|
209
|
+
},
|
|
91
210
|
"headerOption": {
|
|
92
211
|
"type": "header",
|
|
93
212
|
"text": {
|
|
@@ -235,8 +354,8 @@
|
|
|
235
354
|
"sync_modbus_holding_1": {
|
|
236
355
|
"type": "checkbox",
|
|
237
356
|
"label": {
|
|
238
|
-
"en": "Target
|
|
239
|
-
"de": "
|
|
357
|
+
"en": "Target temp room thermostat (Holding 10060)",
|
|
358
|
+
"de": "Zieltemperatur Raumthermostat (Holding 10060)"
|
|
240
359
|
},
|
|
241
360
|
"default": false,
|
|
242
361
|
"disabled": "!data.modbus_active",
|
|
@@ -584,6 +703,7 @@
|
|
|
584
703
|
},
|
|
585
704
|
"idleTab": {
|
|
586
705
|
"type": "panel",
|
|
706
|
+
"disabled": "data.operation_mode === 'readonly'",
|
|
587
707
|
"label": {
|
|
588
708
|
"en": "Idle Defaults",
|
|
589
709
|
"de": "Vorgaben"
|
|
@@ -632,6 +752,7 @@
|
|
|
632
752
|
"de": "Standardwerte im Leerlauf erzwingen"
|
|
633
753
|
},
|
|
634
754
|
"default": false,
|
|
755
|
+
"disabled": "data.operation_mode === 'readonly'",
|
|
635
756
|
"confirm": {
|
|
636
757
|
"condition": "data.idle_defaults_aktiv === true",
|
|
637
758
|
"text": {
|
|
@@ -1011,6 +1132,7 @@
|
|
|
1011
1132
|
},
|
|
1012
1133
|
"cycleOptimizationTab": {
|
|
1013
1134
|
"type": "panel",
|
|
1135
|
+
"disabled": "data.operation_mode === 'readonly'",
|
|
1014
1136
|
"label": {
|
|
1015
1137
|
"en": "Cycle Optimization",
|
|
1016
1138
|
"de": "Takt-Optimierung"
|
|
@@ -1039,6 +1161,7 @@
|
|
|
1039
1161
|
"en": "Enable intelligent cycle optimization",
|
|
1040
1162
|
"de": "Intelligente Takt-Optimierung aktivieren"
|
|
1041
1163
|
},
|
|
1164
|
+
"disabled": "data.operation_mode === 'readonly'",
|
|
1042
1165
|
"default": false,
|
|
1043
1166
|
"confirm": {
|
|
1044
1167
|
"condition": "data.regelung_aktiv === true && data.idle_defaults_aktiv !== true",
|
|
@@ -1059,6 +1182,7 @@
|
|
|
1059
1182
|
},
|
|
1060
1183
|
"Heating_after_warmwater": {
|
|
1061
1184
|
"type": "checkbox",
|
|
1185
|
+
"disabled": "data.operation_mode === 'readonly'",
|
|
1062
1186
|
"label": {
|
|
1063
1187
|
"en": "Heating after hot water",
|
|
1064
1188
|
"de": "Heizen nach Warmwasser erzwingen"
|
|
@@ -1093,6 +1217,7 @@
|
|
|
1093
1217
|
},
|
|
1094
1218
|
"hupTab": {
|
|
1095
1219
|
"type": "panel",
|
|
1220
|
+
"disabled": "data.operation_mode === 'readonly'",
|
|
1096
1221
|
"label": {
|
|
1097
1222
|
"en": "HUP control",
|
|
1098
1223
|
"de": "HUP Steuerung"
|
|
@@ -1117,6 +1242,7 @@
|
|
|
1117
1242
|
},
|
|
1118
1243
|
"hup_voltage_factor": {
|
|
1119
1244
|
"type": "select",
|
|
1245
|
+
"disabled": "data.operation_mode === 'readonly'",
|
|
1120
1246
|
"label": {
|
|
1121
1247
|
"en": "Hardware voltage scale",
|
|
1122
1248
|
"de": "Hardware Spannungs-Faktor"
|
|
@@ -1144,6 +1270,7 @@
|
|
|
1144
1270
|
},
|
|
1145
1271
|
"hup_optimierung_aktiv": {
|
|
1146
1272
|
"type": "checkbox",
|
|
1273
|
+
"disabled": "data.operation_mode === 'readonly'",
|
|
1147
1274
|
"label": {
|
|
1148
1275
|
"en": "Enable dynamic HUP spread control",
|
|
1149
1276
|
"de": "Dynamische HUP-Spreizungsregelung aktivieren"
|
|
@@ -1315,6 +1442,7 @@
|
|
|
1315
1442
|
},
|
|
1316
1443
|
"zipTab": {
|
|
1317
1444
|
"type": "panel",
|
|
1445
|
+
"disabled": "data.operation_mode === 'readonly'",
|
|
1318
1446
|
"label": {
|
|
1319
1447
|
"en": "Circulation pump",
|
|
1320
1448
|
"de": "ZIP Steuerung"
|
|
@@ -1323,6 +1451,7 @@
|
|
|
1323
1451
|
"items": {
|
|
1324
1452
|
"zip_control_mode": {
|
|
1325
1453
|
"type": "select",
|
|
1454
|
+
"disabled": "data.operation_mode === 'readonly'",
|
|
1326
1455
|
"label": {
|
|
1327
1456
|
"en": "How is your circulation pump (ZIP) controlled?",
|
|
1328
1457
|
"de": "Wie wird deine Zirkulationspumpe (ZIP) gesteuert?"
|
|
@@ -1440,6 +1569,7 @@
|
|
|
1440
1569
|
},
|
|
1441
1570
|
"zip_lWP_aktiv": {
|
|
1442
1571
|
"type": "checkbox",
|
|
1572
|
+
"disabled": "data.operation_mode === 'readonly'",
|
|
1443
1573
|
"label": {
|
|
1444
1574
|
"en": "Disable base ZIP values (Set Luxtronik timers to 0)",
|
|
1445
1575
|
"de": "Deaktiviere reguläre ZIP Werte (Luxtronik-Timer auf 0)"
|
|
@@ -1454,6 +1584,7 @@
|
|
|
1454
1584
|
},
|
|
1455
1585
|
"zip_optimierung_aktiv": {
|
|
1456
1586
|
"type": "checkbox",
|
|
1587
|
+
"disabled": "data.operation_mode === 'readonly'",
|
|
1457
1588
|
"label": {
|
|
1458
1589
|
"en": "Allow ZIP optimization",
|
|
1459
1590
|
"de": "ZIP-Optimierung zulassen"
|
|
@@ -1538,6 +1669,7 @@
|
|
|
1538
1669
|
},
|
|
1539
1670
|
"motion_sensors_aktiv": {
|
|
1540
1671
|
"type": "checkbox",
|
|
1672
|
+
"disabled": "data.operation_mode === 'readonly'",
|
|
1541
1673
|
"label": {
|
|
1542
1674
|
"en": "Actively use motion sensors",
|
|
1543
1675
|
"de": "Bewegungssensoren aktiv nutzen"
|
|
@@ -1652,6 +1784,7 @@
|
|
|
1652
1784
|
},
|
|
1653
1785
|
"pvTab": {
|
|
1654
1786
|
"type": "panel",
|
|
1787
|
+
"disabled": "data.operation_mode === 'readonly'",
|
|
1655
1788
|
"label": {
|
|
1656
1789
|
"en": "PV / Surplus",
|
|
1657
1790
|
"de": "PV-Überschuss"
|
|
@@ -1660,6 +1793,7 @@
|
|
|
1660
1793
|
"items": {
|
|
1661
1794
|
"pv_active": {
|
|
1662
1795
|
"type": "checkbox",
|
|
1796
|
+
"disabled": "data.operation_mode === 'readonly'",
|
|
1663
1797
|
"label": {
|
|
1664
1798
|
"en": "Enable PV surplus management",
|
|
1665
1799
|
"de": "PV-Überschusssteuerung aktivieren"
|
package/build/main.js
CHANGED
|
@@ -153,11 +153,29 @@ class Luxtronik2Controller extends utils.Adapter {
|
|
|
153
153
|
configUpdated = true;
|
|
154
154
|
(0, import_logger.writeLog)(`[Migration] Updated zip_control_mode to '${migratedMode}' based on legacy settings.`, "info");
|
|
155
155
|
}
|
|
156
|
+
if (config.operation_mode === void 0) {
|
|
157
|
+
if (config.modbus_active === true) {
|
|
158
|
+
config.operation_mode = "modbus";
|
|
159
|
+
} else if (config.idle_defaults_aktiv === true || config.regelung_aktiv === true || config.hup_optimierung_aktiv === true || config.pv_active === true || config.zip_optimierung_aktiv === true) {
|
|
160
|
+
config.operation_mode = "native";
|
|
161
|
+
} else {
|
|
162
|
+
config.operation_mode = "readonly";
|
|
163
|
+
}
|
|
164
|
+
configUpdated = true;
|
|
165
|
+
(0, import_logger.writeLog)(`[Migration] Set operation_mode to '${config.operation_mode}' based on legacy settings.`, "info");
|
|
166
|
+
}
|
|
167
|
+
const shouldModbusBeActive = config.operation_mode === "modbus";
|
|
168
|
+
if (config.modbus_active !== shouldModbusBeActive) {
|
|
169
|
+
config.modbus_active = shouldModbusBeActive;
|
|
170
|
+
configUpdated = true;
|
|
171
|
+
}
|
|
156
172
|
if (configUpdated) {
|
|
157
173
|
try {
|
|
158
174
|
const obj = await this.getForeignObjectAsync(`system.adapter.${this.namespace}`);
|
|
159
175
|
if (obj && obj.native) {
|
|
160
176
|
obj.native.zip_control_mode = config.zip_control_mode;
|
|
177
|
+
obj.native.operation_mode = config.operation_mode;
|
|
178
|
+
obj.native.modbus_active = config.modbus_active;
|
|
161
179
|
await this.setForeignObject(`system.adapter.${this.namespace}`, obj);
|
|
162
180
|
}
|
|
163
181
|
} catch (err) {
|
|
@@ -194,21 +212,36 @@ class Luxtronik2Controller extends utils.Adapter {
|
|
|
194
212
|
await (0, import_objectManager.ensureCustomObjectsExist)(this);
|
|
195
213
|
(0, import_backupManager.initAutoBackup)(this);
|
|
196
214
|
await this.subscribeStatesAsync("Information.12_SystemInfo.check_firmware");
|
|
197
|
-
|
|
215
|
+
const isReadOnly = config.operation_mode === "readonly";
|
|
216
|
+
if (isReadOnly) {
|
|
217
|
+
(0, import_logger.writeLog)(
|
|
218
|
+
"\u{1F512} Operating Mode: READ-ONLY. All hardware write operations and optimizations are disabled.",
|
|
219
|
+
"info"
|
|
220
|
+
);
|
|
221
|
+
await this.setState((0, import_stateMapping.getDpPath)("Regelung_Aktiv"), { val: false, ack: true });
|
|
222
|
+
} else if (config.operation_mode === "modbus") {
|
|
223
|
+
(0, import_logger.writeLog)("\u26A1 Operating Mode: READ/WRITE WITH MODBUS TCP (Hybrid).", "info");
|
|
224
|
+
await this.setState((0, import_stateMapping.getDpPath)("Regelung_Aktiv"), { val: config.regelung_aktiv === true, ack: true });
|
|
225
|
+
} else {
|
|
226
|
+
(0, import_logger.writeLog)("\u270D\uFE0F Operating Mode: READ/WRITE WITHOUT MODBUS (Native TCP Port 8889).", "info");
|
|
227
|
+
await this.setState((0, import_stateMapping.getDpPath)("Regelung_Aktiv"), { val: config.regelung_aktiv === true, ack: true });
|
|
228
|
+
}
|
|
198
229
|
const debugState = await this.getStateAsync((0, import_stateMapping.getDpPath)("Schreibe_Debug_Log"));
|
|
199
230
|
this.isDebugLogActive = (debugState == null ? void 0 : debugState.val) === true;
|
|
200
231
|
(0, import_logger.setCustomDebug)(this.isDebugLogActive);
|
|
201
|
-
await (0, import_zipManager.disableHardwareZipTimer)(this);
|
|
202
232
|
const cycleTodayState = await this.getStateAsync((0, import_stateMapping.getDpPath)("write_cycles_today"));
|
|
203
233
|
this.writeCyclesToday = cycleTodayState && typeof cycleTodayState.val === "number" ? cycleTodayState.val : 0;
|
|
204
234
|
const cycleTotalState = await this.getStateAsync((0, import_stateMapping.getDpPath)("write_cycles_total"));
|
|
205
235
|
this.writeCyclesTotal = cycleTotalState && typeof cycleTotalState.val === "number" ? cycleTotalState.val : 0;
|
|
206
236
|
this.scheduleMidnightReset();
|
|
207
|
-
|
|
208
|
-
|
|
237
|
+
if (!isReadOnly) {
|
|
238
|
+
await (0, import_zipManager.disableHardwareZipTimer)(this);
|
|
239
|
+
(0, import_zipManager.subscribeMotionSensors)(this);
|
|
240
|
+
await (0, import_pvManager.initPvManagement)(this);
|
|
241
|
+
}
|
|
209
242
|
this.subscribeStates("*");
|
|
210
243
|
this.modbusManager = new import_modbusManager.ModbusManager(this);
|
|
211
|
-
if (config.modbus_active) {
|
|
244
|
+
if (!isReadOnly && config.modbus_active) {
|
|
212
245
|
(0, import_logger.writeLog)("Checking Modbus TCP availability for hybrid operations...", "info");
|
|
213
246
|
await this.modbusManager.checkAvailability();
|
|
214
247
|
}
|
|
@@ -265,7 +298,6 @@ class Luxtronik2Controller extends utils.Adapter {
|
|
|
265
298
|
this.log.error(`Error during cyclic data retrieval loop: ${error.message}`);
|
|
266
299
|
}
|
|
267
300
|
}, intervalSeconds * 1e3);
|
|
268
|
-
await this.setState("info.connection", true, true);
|
|
269
301
|
}
|
|
270
302
|
/**
|
|
271
303
|
* Berechnet die Zeit bis Mitternacht und setzt NUR den heutigen Schreibzähler auf 0 zurück.
|
|
@@ -289,6 +321,10 @@ class Luxtronik2Controller extends utils.Adapter {
|
|
|
289
321
|
* @returns A promise that resolves when the synchronization task finishes.
|
|
290
322
|
*/
|
|
291
323
|
async syncConfigValue(mappingKey, val) {
|
|
324
|
+
const config = this.config;
|
|
325
|
+
if (config.operation_mode === "readonly") {
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
292
328
|
if (val === void 0 || val === null) {
|
|
293
329
|
return;
|
|
294
330
|
}
|
|
@@ -298,7 +334,6 @@ class Luxtronik2Controller extends utils.Adapter {
|
|
|
298
334
|
}
|
|
299
335
|
const id = (0, import_stateMapping.getDpPath)(mappingKey);
|
|
300
336
|
const state = await this.getStateAsync(id);
|
|
301
|
-
const config = this.config;
|
|
302
337
|
let appliedFactor = definition.factor;
|
|
303
338
|
if (mappingKey === "heating_system_circ_pump_voltage_nominal" || mappingKey === "heating_system_circ_pump_voltage_minimal") {
|
|
304
339
|
appliedFactor = config.hup_voltage_factor !== void 0 ? Number(config.hup_voltage_factor) : 100;
|
|
@@ -313,16 +348,16 @@ class Luxtronik2Controller extends utils.Adapter {
|
|
|
313
348
|
if (isRawWrite && definition.unit === "\xB0C" && typeof val === "number" && !appliedFactor) {
|
|
314
349
|
valueToWrite = val * 10;
|
|
315
350
|
}
|
|
351
|
+
const isModbusEnabled = Boolean(
|
|
352
|
+
this.modbusManager && this.modbusManager.isAvailable && config.modbus_active && definition.modbus && config[definition.modbus.configKey] === true
|
|
353
|
+
);
|
|
316
354
|
const writeId = definition.luxWriteId ? parseInt(definition.luxWriteId, 10) : NaN;
|
|
317
|
-
const hardwareOutOfSync = !definition.isVirtual && !isNaN(writeId) && writeId < 9990 && this.currentRawParams.length > writeId && this.currentRawParams[writeId] !== Math.round(Number(valueToWrite));
|
|
355
|
+
const hardwareOutOfSync = !isModbusEnabled && !definition.isVirtual && !isNaN(writeId) && writeId < 9990 && this.currentRawParams.length > writeId && this.currentRawParams[writeId] !== Math.round(Number(valueToWrite));
|
|
318
356
|
if (!state || state.val !== val || hardwareOutOfSync) {
|
|
319
357
|
await this.setState(id, { val, ack: true });
|
|
320
358
|
if (this.isDebugLogActive) {
|
|
321
359
|
(0, import_logger.writeLog)(`Writing value directly into heat pump controller: ${mappingKey} = ${val}`, "info");
|
|
322
360
|
}
|
|
323
|
-
const isModbusEnabled = Boolean(
|
|
324
|
-
this.modbusManager && this.modbusManager.isAvailable && config.modbus_active && definition.modbus && config[definition.modbus.configKey] === true
|
|
325
|
-
);
|
|
326
361
|
if ((definition.write === true || isModbusEnabled) && !definition.isVirtual && definition.luxWriteId) {
|
|
327
362
|
try {
|
|
328
363
|
if (isModbusEnabled && definition.modbus) {
|
|
@@ -427,6 +462,9 @@ class Luxtronik2Controller extends utils.Adapter {
|
|
|
427
462
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
428
463
|
try {
|
|
429
464
|
const config = this.config;
|
|
465
|
+
if (config.operation_mode === "readonly") {
|
|
466
|
+
return;
|
|
467
|
+
}
|
|
430
468
|
const bzState = await this.getStateAsync((0, import_stateMapping.getDpPath)("WP_BZ_akt"));
|
|
431
469
|
const bzVal = bzState && bzState.val !== null ? String(bzState.val).trim() : rawValues[80] !== void 0 ? String(rawValues[80]) : "";
|
|
432
470
|
const regelungAktivState = await this.getStateAsync((0, import_stateMapping.getDpPath)("Regelung_Aktiv"));
|
|
@@ -638,20 +676,26 @@ class Luxtronik2Controller extends utils.Adapter {
|
|
|
638
676
|
const delayHelper = (ms) => new Promise((resolve) => this.setTimeout(resolve, ms));
|
|
639
677
|
let rawParams = [];
|
|
640
678
|
let rawValues = [];
|
|
679
|
+
let lastReadError = "";
|
|
641
680
|
try {
|
|
642
681
|
rawParams = await (0, import_rawFunctions.readAllRaw)(this, 3003);
|
|
643
|
-
|
|
682
|
+
if (rawParams.length > 0) {
|
|
683
|
+
this.currentRawParams = rawParams;
|
|
684
|
+
}
|
|
644
685
|
} catch (err) {
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
);
|
|
686
|
+
lastReadError = err instanceof Error ? err.message : String(err);
|
|
687
|
+
this.log.debug(`Raw parameter acquisition response error (Command 3003): ${lastReadError}`);
|
|
648
688
|
}
|
|
649
689
|
await delayHelper(200);
|
|
650
690
|
try {
|
|
651
691
|
rawValues = await (0, import_rawFunctions.readAllRaw)(this, 3004);
|
|
652
692
|
} catch (err) {
|
|
653
|
-
|
|
654
|
-
|
|
693
|
+
lastReadError = err instanceof Error ? err.message : String(err);
|
|
694
|
+
this.log.debug(`Raw telemetry value acquisition response error (Command 3004): ${lastReadError}`);
|
|
695
|
+
}
|
|
696
|
+
if (rawParams.length === 0 && rawValues.length === 0) {
|
|
697
|
+
throw new Error(
|
|
698
|
+
`No telemetry or parameter data received from heat pump (${lastReadError || "empty response"}).`
|
|
655
699
|
);
|
|
656
700
|
}
|
|
657
701
|
const config = this.config;
|
|
@@ -677,14 +721,22 @@ class Luxtronik2Controller extends utils.Adapter {
|
|
|
677
721
|
switch (definition.dataSource) {
|
|
678
722
|
case "raw_parameter":
|
|
679
723
|
value = rawParams == null ? void 0 : rawParams[parseInt(luxId, 10)];
|
|
680
|
-
if (value !== void 0
|
|
681
|
-
|
|
724
|
+
if (value !== void 0) {
|
|
725
|
+
if (appliedFactor) {
|
|
726
|
+
value /= appliedFactor;
|
|
727
|
+
} else if (definition.unit === "\xB0C") {
|
|
728
|
+
value /= 10;
|
|
729
|
+
}
|
|
682
730
|
}
|
|
683
731
|
break;
|
|
684
732
|
case "raw_value":
|
|
685
733
|
value = rawValues == null ? void 0 : rawValues[parseInt(luxId, 10)];
|
|
686
|
-
if (value !== void 0
|
|
687
|
-
|
|
734
|
+
if (value !== void 0) {
|
|
735
|
+
if (appliedFactor) {
|
|
736
|
+
value /= appliedFactor;
|
|
737
|
+
} else if (definition.unit === "\xB0C") {
|
|
738
|
+
value /= 10;
|
|
739
|
+
}
|
|
688
740
|
}
|
|
689
741
|
break;
|
|
690
742
|
case "parameter":
|
|
@@ -697,8 +749,12 @@ class Luxtronik2Controller extends utils.Adapter {
|
|
|
697
749
|
if (/^\d+$/.test(luxId)) {
|
|
698
750
|
const idx = parseInt(luxId, 10);
|
|
699
751
|
value = definition.folder.startsWith("Settings") ? rawParams == null ? void 0 : rawParams[idx] : rawValues == null ? void 0 : rawValues[idx];
|
|
700
|
-
if (value !== void 0
|
|
701
|
-
|
|
752
|
+
if (value !== void 0) {
|
|
753
|
+
if (appliedFactor) {
|
|
754
|
+
value /= appliedFactor;
|
|
755
|
+
} else if (definition.unit === "\xB0C") {
|
|
756
|
+
value /= 10;
|
|
757
|
+
}
|
|
702
758
|
}
|
|
703
759
|
} else {
|
|
704
760
|
value = void 0;
|
|
@@ -717,7 +773,7 @@ class Luxtronik2Controller extends utils.Adapter {
|
|
|
717
773
|
value = modbusData.coils[reg] ? 1 : 0;
|
|
718
774
|
}
|
|
719
775
|
}
|
|
720
|
-
if (value !== void 0 && typeof value === "number" && appliedFactor) {
|
|
776
|
+
if (value !== void 0 && typeof value === "number" && (appliedFactor || definition.unit === "\xB0C")) {
|
|
721
777
|
value = Math.round(value * 100) / 100;
|
|
722
778
|
}
|
|
723
779
|
if (value !== void 0) {
|
|
@@ -862,18 +918,25 @@ class Luxtronik2Controller extends utils.Adapter {
|
|
|
862
918
|
if (!state) {
|
|
863
919
|
return;
|
|
864
920
|
}
|
|
921
|
+
const config = this.config;
|
|
922
|
+
const isReadOnly = config.operation_mode === "readonly";
|
|
865
923
|
if (!id.startsWith(`${this.namespace}.`)) {
|
|
924
|
+
if (isReadOnly) {
|
|
925
|
+
return;
|
|
926
|
+
}
|
|
866
927
|
(0, import_pvManager.handlePvFeedInChange)(this, id, state);
|
|
867
928
|
}
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
929
|
+
if (!isReadOnly) {
|
|
930
|
+
const isMotionSensor = await (0, import_zipManager.checkAndHandleMotionSensor)(this, id, state);
|
|
931
|
+
if (isMotionSensor) {
|
|
932
|
+
return;
|
|
933
|
+
}
|
|
871
934
|
}
|
|
872
935
|
if (!id.startsWith(`${this.namespace}.`)) {
|
|
873
936
|
return;
|
|
874
937
|
}
|
|
875
938
|
if (state.ack) {
|
|
876
|
-
if (id.endsWith("WP_BZ_akt")) {
|
|
939
|
+
if (!isReadOnly && id.endsWith("WP_BZ_akt")) {
|
|
877
940
|
await (0, import_pvManager.handlePvCycleCheck)(this, Number(state.val));
|
|
878
941
|
}
|
|
879
942
|
return;
|
|
@@ -884,11 +947,34 @@ class Luxtronik2Controller extends utils.Adapter {
|
|
|
884
947
|
void (0, import_updateManager.checkFirmwareUpdate)(this);
|
|
885
948
|
return;
|
|
886
949
|
}
|
|
950
|
+
const mappingKey = id.split(".").pop();
|
|
951
|
+
const relativeId = id.replace(`${this.namespace}.`, "");
|
|
952
|
+
if (mappingKey === "Schreibe_Debug_Log") {
|
|
953
|
+
await this.setState(relativeId, { val: state.val, ack: true });
|
|
954
|
+
this.isDebugLogActive = state.val === true;
|
|
955
|
+
(0, import_logger.setCustomDebug)(this.isDebugLogActive);
|
|
956
|
+
(0, import_logger.writeLog)(
|
|
957
|
+
`Extended debugging telemetry logging mode has been ${this.isDebugLogActive ? "enabled" : "disabled"}.`,
|
|
958
|
+
"info"
|
|
959
|
+
);
|
|
960
|
+
return;
|
|
961
|
+
}
|
|
962
|
+
if (mappingKey === "Dump_Raw_To_Log" && state.val === true) {
|
|
963
|
+
await this.setState(relativeId, { val: false, ack: true });
|
|
964
|
+
await (0, import_rawFunctions.dumpAllRawToLog)(this);
|
|
965
|
+
return;
|
|
966
|
+
}
|
|
967
|
+
if (isReadOnly) {
|
|
968
|
+
(0, import_logger.writeLog)(
|
|
969
|
+
`[Read-Only] Write attempt to '${id}' blocked! Change Operating Mode in adapter settings to enable hardware writes.`,
|
|
970
|
+
"warn"
|
|
971
|
+
);
|
|
972
|
+
return;
|
|
973
|
+
}
|
|
887
974
|
if (id.startsWith(`${this.namespace}.Custom.`)) {
|
|
888
975
|
try {
|
|
889
976
|
const obj = await this.getObjectAsync(id);
|
|
890
977
|
if (obj && obj.native && obj.native.source === "parameter") {
|
|
891
|
-
const relativeId = id.replace(`${this.namespace}.`, "");
|
|
892
978
|
await this.setState(relativeId, { val: state.val, ack: true });
|
|
893
979
|
let valueToWrite = state.val;
|
|
894
980
|
if (obj.native.customType === "boolean") {
|
|
@@ -916,7 +1002,6 @@ class Luxtronik2Controller extends utils.Adapter {
|
|
|
916
1002
|
}
|
|
917
1003
|
return;
|
|
918
1004
|
}
|
|
919
|
-
const mappingKey = id.split(".").pop();
|
|
920
1005
|
if (!mappingKey) {
|
|
921
1006
|
return;
|
|
922
1007
|
}
|
|
@@ -925,17 +1010,6 @@ class Luxtronik2Controller extends utils.Adapter {
|
|
|
925
1010
|
return;
|
|
926
1011
|
}
|
|
927
1012
|
try {
|
|
928
|
-
const relativeId = id.replace(`${this.namespace}.`, "");
|
|
929
|
-
if (mappingKey === "Schreibe_Debug_Log") {
|
|
930
|
-
await this.setState(relativeId, { val: state.val, ack: true });
|
|
931
|
-
this.isDebugLogActive = state.val === true;
|
|
932
|
-
(0, import_logger.setCustomDebug)(this.isDebugLogActive);
|
|
933
|
-
(0, import_logger.writeLog)(
|
|
934
|
-
`Extended debugging telemetry logging mode has been ${this.isDebugLogActive ? "enabled" : "disabled"}.`,
|
|
935
|
-
"info"
|
|
936
|
-
);
|
|
937
|
-
return;
|
|
938
|
-
}
|
|
939
1013
|
if (mappingKey === "Regelung_Aktiv" || mappingKey === "zip_aktiv") {
|
|
940
1014
|
await this.setState(relativeId, { val: state.val, ack: true });
|
|
941
1015
|
return;
|
|
@@ -946,11 +1020,6 @@ class Luxtronik2Controller extends utils.Adapter {
|
|
|
946
1020
|
await this.setIdleDefaults();
|
|
947
1021
|
return;
|
|
948
1022
|
}
|
|
949
|
-
if (mappingKey === "Dump_Raw_To_Log" && state.val === true) {
|
|
950
|
-
await this.setState(relativeId, { val: false, ack: true });
|
|
951
|
-
await (0, import_rawFunctions.dumpAllRawToLog)(this);
|
|
952
|
-
return;
|
|
953
|
-
}
|
|
954
1023
|
if (mappingKey === "Zwangswarmwasser") {
|
|
955
1024
|
if (state.val === true) {
|
|
956
1025
|
await (0, import_actionHandlers.handleZwangswarmwasser)(this, id);
|
|
@@ -974,7 +1043,6 @@ class Luxtronik2Controller extends utils.Adapter {
|
|
|
974
1043
|
}
|
|
975
1044
|
return;
|
|
976
1045
|
}
|
|
977
|
-
const config = this.config;
|
|
978
1046
|
const isModbusEnabled = Boolean(
|
|
979
1047
|
this.modbusManager && this.modbusManager.isAvailable && config.modbus_active && definition.modbus && config[definition.modbus.configKey] === true
|
|
980
1048
|
);
|