iobroker.luxtronik2-controller 1.1.1 → 1.2.1
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 +11 -10
- package/admin/i18n/de.json +1 -0
- package/admin/jsonConfig.json +42 -15
- package/admin/webcomponents/luxtronik-status-card.js +505 -0
- package/admin/webcomponents/luxtronik-status-card.json +42 -0
- package/build/mapping/info.js +1 -10
- package/build/mapping/info.js.map +2 -2
- package/build/modbusManager.js +11 -4
- package/build/modbusManager.js.map +2 -2
- package/build/pvManager.js +101 -0
- package/build/pvManager.js.map +2 -2
- package/io-package.json +33 -28
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -103,6 +103,17 @@ _This project is not affiliated with Alpha Innotec, Novelan, ait-deutschland Gmb
|
|
|
103
103
|
//### **WORK IN PROGRESS**
|
|
104
104
|
|
|
105
105
|
## Changelog
|
|
106
|
+
### 1.2.1 (2026-11-24)
|
|
107
|
+
|
|
108
|
+
- Fixed `temperature_target_return` being overwritten with `35.0 °C` in SHI Modbus mode when `sync_modbus_holding_1` (`10060`, room thermostat target) is enabled by removing the duplicate Modbus mapping from `src/mapping/info.ts`
|
|
109
|
+
- Cleaned up SHI holding register mapping in `src/modbusManager.ts` and added an SHI mode check (`10000 === 1`) when reading register `10001` for `heating_flow_out_temperature_target` (`sync_modbus_holding_2`) so its inactive `35.0 °C` default does not overwrite `P0017`
|
|
110
|
+
|
|
111
|
+
### 1.2.0 (2026-11-24)
|
|
112
|
+
|
|
113
|
+
- Added configurable sunset cutoff buffer (`pv_sunset_cutoff_active`, `pv_sunset_buffer`) to PV surplus management to prevent starting new PV boosts shortly before local sunset using `system.config` coordinates
|
|
114
|
+
- Added `@iobroker/web-components` status card (`<luxtronik-status-card>`) for Aura, VIS-2, and WebUI displaying live temperatures, operating mode, PV boost status, COP/JAZ values, and quick actions
|
|
115
|
+
- Updated Cycle Optimization description in `jsonConfig.json` to reflect the dynamic hysteresis-based offset instead of the legacy `35 °C` wording
|
|
116
|
+
|
|
106
117
|
### 1.1.1 (2026-11-24)
|
|
107
118
|
|
|
108
119
|
- Fixed temporary hot water start impulses (`forceSoll` & `Zwangswarmwasser`) overshooting the actual target temperature by immediately restoring the baseline or active PV boost target once hot water generation is actively running (`WP_BZ_akt = 1` & `VD1`)
|
|
@@ -124,16 +135,6 @@ _This project is not affiliated with Alpha Innotec, Novelan, ait-deutschland Gmb
|
|
|
124
135
|
- 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
|
|
125
136
|
- 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
|
|
126
137
|
|
|
127
|
-
### 1.0.3 (2026-11-18)
|
|
128
|
-
|
|
129
|
-
- Fixed daily COP reset in `copManager.ts` so Heating and Hot Water values reset to `0` after midnight until an active cycle starts
|
|
130
|
-
|
|
131
|
-
### 1.0.2 (2026-11-17)
|
|
132
|
-
|
|
133
|
-
- Fixed `node:` protocol imports (`node:fs`, `node:path`) and repository checker lint issues
|
|
134
|
-
- Completed and synchronized i18n translations across all supported languages
|
|
135
|
-
- Fixed `jsonConfig` label keys in `generateConfig.ts` to prevent inline language object overrides during build
|
|
136
|
-
|
|
137
138
|
## License
|
|
138
139
|
|
|
139
140
|
MIT License
|
package/admin/i18n/de.json
CHANGED
|
@@ -74,6 +74,7 @@
|
|
|
74
74
|
"Brauchwasserthermostat BWT": "Warmwasserthermostat BWT",
|
|
75
75
|
"Broadcast address": "Broadcast-Adresse",
|
|
76
76
|
"Broadcast-Adresse": "Broadcast Address",
|
|
77
|
+
"By default, the Luxtronik controller treats heating and domestic hot water (DHW) cycles as separate operations. This adapter coordinates both runs so the compressor transitions seamlessly without unnecessary stop/start cycles.<br><br>➔ <i>Trigger rule:</i> If <b>(DHW Target - DHW Actual) ≥ (DHW Hysteresis - 1.5 K)</b>, <b>Heating Return ≤ Return Target</b>, heating is enabled (no heating limit/off/vacation), and DHW is allowed within the next 25 minutes (no lock time), heating is gently pre-started by temporarily raising the heating parallel offset by <b>Heating Hysteresis + 0.5 K</b> (automatically reset once the compressor runs stably).": "Standardmäßig behandelt die Luxtronik-Steuerung Heiz- und Warmwassertakte als getrennte Vorgänge. Dieser Adapter koordiniert beide Abläufe, sodass der Verdichter nahtlos umschaltet und unnötige Starts vermieden werden.<br><br>➔ <i>Auslöseregel:</i> Wenn <b>(WW-Soll - WW-Ist) ≥ (WW-Hysterese - 1,5 K)</b> und <b>Rücklauf ≤ Rücklauf-Soll</b> gilt, die Heizung freigegeben ist (keine Heizgrenze/Aus/Urlaub) und Warmwasser innerhalb der nächsten 25 Minuten erlaubt ist (keine Sperrzeit), wird der Heizbetrieb sanft vorgezogen, indem die Parallelverschiebung temporär um <b>Heiz-Hysterese + 0,5 K</b> angehoben wird (und automatisch zurückgesetzt wird, sobald der Verdichter stabil läuft).",
|
|
77
78
|
"By default, the Luxtronik controller treats heating and domestic hot water (DHW) cycles as separate operations. This adapter coordinates the run so the compressor transitions seamlessly into heating without shutting down.<br><br>➔ <i>Trigger rule:</i> If <b>(DHW Target - DHW Actual) ≥ (DHW Hysteresis - 1.5 K)</b> and <b>Heating Return ≤ Return Target</b> and outdoor heating threshold is not active, heating is triggered directly with Return Target temporarily set to 35°C to force compressor operation.": "Standardmäßig behandelt die Luxtronik-Steuerung Heiz- und Warmwassertakte strikt getrennt. Dieser Adapter koppelt die Vorgänge, sodass der Verdichter ohne Zwischenstopp direkt in den Heizbetrieb übergeht.<br><br>➔ <i>Auslöser-Regel:</i> Wenn <b>(WW Soll - WW Ist) ≥ (WW Hysterese - 1,5 K)</b> und <b>Heizung Rücklauf ≤ Rücklauf Soll</b> und die Heizgrenze nicht aktiv ist, wird direkt der Heizbetrieb gestartet und der Rücklauf-Sollwert temporär auf 35°C gesetzt, um das Heizen zu erzwingen.",
|
|
78
79
|
"COP Heating (Current Month)": "COP Heizen (Aktueller Monat)",
|
|
79
80
|
"COP Heating (Last 7 Days)": "COP Heizen (Letzte 7 Tage)",
|
package/admin/jsonConfig.json
CHANGED
|
@@ -309,20 +309,6 @@
|
|
|
309
309
|
"lg": 12,
|
|
310
310
|
"xl": 12
|
|
311
311
|
},
|
|
312
|
-
"sync_modbus_holding_1": {
|
|
313
|
-
"type": "checkbox",
|
|
314
|
-
"label": {
|
|
315
|
-
"en": "Target temp room thermostat (Holding 10060)",
|
|
316
|
-
"de": "Zieltemperatur Raumthermostat (Holding 10060)"
|
|
317
|
-
},
|
|
318
|
-
"default": false,
|
|
319
|
-
"disabled": "!data.modbus_active",
|
|
320
|
-
"xs": 12,
|
|
321
|
-
"sm": 6,
|
|
322
|
-
"md": 4,
|
|
323
|
-
"lg": 3,
|
|
324
|
-
"xl": 3
|
|
325
|
-
},
|
|
326
312
|
"sync_modbus_holding_0": {
|
|
327
313
|
"type": "checkbox",
|
|
328
314
|
"label": {
|
|
@@ -421,6 +407,20 @@
|
|
|
421
407
|
"lg": 3,
|
|
422
408
|
"xl": 3
|
|
423
409
|
},
|
|
410
|
+
"sync_modbus_holding_1": {
|
|
411
|
+
"type": "checkbox",
|
|
412
|
+
"label": {
|
|
413
|
+
"en": "Target temp room thermostat (Holding 10060)",
|
|
414
|
+
"de": "Zieltemperatur Raumthermostat (Holding 10060)"
|
|
415
|
+
},
|
|
416
|
+
"default": false,
|
|
417
|
+
"disabled": "!data.modbus_active",
|
|
418
|
+
"xs": 12,
|
|
419
|
+
"sm": 6,
|
|
420
|
+
"md": 4,
|
|
421
|
+
"lg": 3,
|
|
422
|
+
"xl": 3
|
|
423
|
+
},
|
|
424
424
|
"sync_modbus_holding_5": {
|
|
425
425
|
"type": "checkbox",
|
|
426
426
|
"label": {
|
|
@@ -1030,7 +1030,7 @@
|
|
|
1030
1030
|
"items": {
|
|
1031
1031
|
"informationCycleOptimization": {
|
|
1032
1032
|
"type": "staticText",
|
|
1033
|
-
"text": "By default, the Luxtronik controller treats heating and domestic hot water (DHW) cycles as separate operations. This adapter coordinates
|
|
1033
|
+
"text": "By default, the Luxtronik controller treats heating and domestic hot water (DHW) cycles as separate operations. This adapter coordinates both runs so the compressor transitions seamlessly without unnecessary stop/start cycles.<br><br>➔ <i>Trigger rule:</i> If <b>(DHW Target - DHW Actual) ≥ (DHW Hysteresis - 1.5 K)</b>, <b>Heating Return ≤ Return Target</b>, heating is enabled (no heating limit/off/vacation), and DHW is allowed within the next 25 minutes (no lock time), heating is gently pre-started by temporarily raising the heating parallel offset by <b>Heating Hysteresis + 0.5 K</b> (automatically reset once the compressor runs stably).",
|
|
1034
1034
|
"style": {
|
|
1035
1035
|
"marginBottom": "20px",
|
|
1036
1036
|
"fontSize": "14px"
|
|
@@ -1762,6 +1762,33 @@
|
|
|
1762
1762
|
"lg": 12,
|
|
1763
1763
|
"xl": 12
|
|
1764
1764
|
},
|
|
1765
|
+
"pv_sunset_cutoff_active": {
|
|
1766
|
+
"type": "checkbox",
|
|
1767
|
+
"label": "Block new boost before sunset",
|
|
1768
|
+
"help": "Prevents starting a new PV boost shortly before sunset using your ioBroker system coordinates.",
|
|
1769
|
+
"newLine": true,
|
|
1770
|
+
"default": false,
|
|
1771
|
+
"hidden": "!data.pv_active",
|
|
1772
|
+
"xs": 12,
|
|
1773
|
+
"sm": 12,
|
|
1774
|
+
"md": 6,
|
|
1775
|
+
"lg": 6,
|
|
1776
|
+
"xl": 6
|
|
1777
|
+
},
|
|
1778
|
+
"pv_sunset_buffer": {
|
|
1779
|
+
"type": "number",
|
|
1780
|
+
"label": "Buffer before sunset (Minutes)",
|
|
1781
|
+
"help": "No new PV boost will be started within this time window before local sunset.",
|
|
1782
|
+
"min": 0,
|
|
1783
|
+
"max": 240,
|
|
1784
|
+
"default": 60,
|
|
1785
|
+
"hidden": "!data.pv_active || !data.pv_sunset_cutoff_active",
|
|
1786
|
+
"xs": 12,
|
|
1787
|
+
"sm": 12,
|
|
1788
|
+
"md": 6,
|
|
1789
|
+
"lg": 6,
|
|
1790
|
+
"xl": 6
|
|
1791
|
+
},
|
|
1765
1792
|
"header_pv_stop": {
|
|
1766
1793
|
"type": "header",
|
|
1767
1794
|
"text": "Deactivation (Reset)",
|
|
@@ -0,0 +1,505 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* <luxtronik-status-card>
|
|
3
|
+
* `@iobroker/web-components` ES-Modul für ioBroker Aura, VIS-2 und WebUI.
|
|
4
|
+
*/
|
|
5
|
+
const STATE_MAP = {
|
|
6
|
+
modeCode: 'Information.08_OperatingState.WP_BZ_akt',
|
|
7
|
+
duration: 'Information.08_OperatingState.heatpump_duration',
|
|
8
|
+
heatingStatus: 'Information.08_OperatingState.opStateHeatingString',
|
|
9
|
+
wwStatus: 'Information.08_OperatingState.opStateHotWaterString',
|
|
10
|
+
supplyTemp: 'Information.01_Temperatures.temperature_supply',
|
|
11
|
+
returnTemp: 'Information.01_Temperatures.temperature_return',
|
|
12
|
+
returnTarget: 'Information.01_Temperatures.temperature_target_return',
|
|
13
|
+
spread: 'Information.01_Temperatures.spreizung_vorlauf_ruecklauf',
|
|
14
|
+
outsideTemp: 'Information.01_Temperatures.temperature_outside',
|
|
15
|
+
wwTemp: 'Information.01_Temperatures.Wamwassertemperatur_Ist',
|
|
16
|
+
wwTarget: 'Information.01_Temperatures.Wamwassertemperatur_Soll',
|
|
17
|
+
compressor: 'Information.03_Outputs.VD1out',
|
|
18
|
+
zipActive: 'Information.03_Outputs.Virtual_ZIP_Status',
|
|
19
|
+
hupVoltage: 'Settings.04_HUP.heating_system_circ_pump_voltage_nominal',
|
|
20
|
+
copToday: 'Information.16_Efficiency.cop_total_today',
|
|
21
|
+
jazYear: 'Information.16_Efficiency.cop_total_year',
|
|
22
|
+
pvBoost: 'Information.17_PV_Surplus.pv_boost_active',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const ACTION_MAP = {
|
|
26
|
+
'force-ww': 'Actions.Zwangswarmwasser',
|
|
27
|
+
'force-heating': 'Actions.Zwangsheizen',
|
|
28
|
+
'activate-zip': 'Actions.Activate_Zip',
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const MODE_META = {
|
|
32
|
+
0: { text: 'Heizbetrieb', cls: 'mode-heating' },
|
|
33
|
+
1: { text: 'Warmwasser', cls: 'mode-ww' },
|
|
34
|
+
2: { text: 'Schwimmbad / PV', cls: 'mode-ww' },
|
|
35
|
+
3: { text: 'EVU-Sperre', cls: 'mode-idle' },
|
|
36
|
+
4: { text: 'Abtauen', cls: 'mode-defrost' },
|
|
37
|
+
5: { text: 'Kein Bedarf', cls: 'mode-idle' },
|
|
38
|
+
6: { text: '2. Erzeuger', cls: 'mode-heating' },
|
|
39
|
+
7: { text: 'Kühlbetrieb', cls: 'mode-defrost' },
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
class LuxtronikStatusCard extends HTMLElement {
|
|
43
|
+
constructor() {
|
|
44
|
+
super();
|
|
45
|
+
this.attachShadow({ mode: 'open' });
|
|
46
|
+
this._socket = null;
|
|
47
|
+
this._settings = {};
|
|
48
|
+
this._theme = '';
|
|
49
|
+
this._editMode = false;
|
|
50
|
+
this._values = {};
|
|
51
|
+
this._subscriptions = [];
|
|
52
|
+
this._rendered = false;
|
|
53
|
+
this._connected = false;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
set socket(value) {
|
|
57
|
+
if (this._socket === value) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
this._unsubscribeAll();
|
|
61
|
+
this._socket = value;
|
|
62
|
+
if (this._connected) {
|
|
63
|
+
this._resubscribe();
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
get socket() {
|
|
68
|
+
return this._socket;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
set settings(value) {
|
|
72
|
+
const prevInstance = this._getInstancePrefix();
|
|
73
|
+
this._settings = value && typeof value === 'object' ? value : {};
|
|
74
|
+
const nextInstance = this._getInstancePrefix();
|
|
75
|
+
|
|
76
|
+
if (this._connected && prevInstance !== nextInstance) {
|
|
77
|
+
this._resubscribe();
|
|
78
|
+
}
|
|
79
|
+
if (this._rendered) {
|
|
80
|
+
this._updateView();
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
get settings() {
|
|
85
|
+
return this._settings;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
set theme(value) {
|
|
89
|
+
this._theme = value || '';
|
|
90
|
+
if (this._theme === 'light' || this._theme === 'dark') {
|
|
91
|
+
this.setAttribute('theme', this._theme);
|
|
92
|
+
} else {
|
|
93
|
+
this.removeAttribute('theme');
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
get theme() {
|
|
98
|
+
return this._theme;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
set editMode(value) {
|
|
102
|
+
this._editMode = Boolean(value);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
get editMode() {
|
|
106
|
+
return this._editMode;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
connectedCallback() {
|
|
110
|
+
this._connected = true;
|
|
111
|
+
if (!this._rendered) {
|
|
112
|
+
this._renderBase();
|
|
113
|
+
this._rendered = true;
|
|
114
|
+
}
|
|
115
|
+
this._resubscribe();
|
|
116
|
+
this._updateView();
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
disconnectedCallback() {
|
|
120
|
+
this._connected = false;
|
|
121
|
+
this._unsubscribeAll();
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
_getInstancePrefix() {
|
|
125
|
+
const raw = this._settings?.instance;
|
|
126
|
+
if (!raw || typeof raw !== 'string') {
|
|
127
|
+
return '';
|
|
128
|
+
}
|
|
129
|
+
return raw.trim().replace(/^system\.adapter\./, '');
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
_unsubscribeAll() {
|
|
133
|
+
if (this._socket && typeof this._socket.unsubscribeState === 'function') {
|
|
134
|
+
for (const { oid, handler } of this._subscriptions) {
|
|
135
|
+
try {
|
|
136
|
+
this._socket.unsubscribeState(oid, handler);
|
|
137
|
+
} catch {
|
|
138
|
+
/* ignore */
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
this._subscriptions = [];
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
_resubscribe() {
|
|
146
|
+
this._unsubscribeAll();
|
|
147
|
+
this._values = {};
|
|
148
|
+
|
|
149
|
+
const prefix = this._getInstancePrefix();
|
|
150
|
+
if (!this._socket || !prefix) {
|
|
151
|
+
if (this._rendered) {
|
|
152
|
+
this._updateView();
|
|
153
|
+
}
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
for (const [key, relPath] of Object.entries(STATE_MAP)) {
|
|
158
|
+
const oid = `${prefix}.${relPath}`;
|
|
159
|
+
const handler = (_id, state) => {
|
|
160
|
+
this._values[key] = state ? state.val : null;
|
|
161
|
+
if (this._rendered) {
|
|
162
|
+
this._updateView();
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
this._subscriptions.push({ oid, handler });
|
|
166
|
+
|
|
167
|
+
if (typeof this._socket.subscribeState === 'function') {
|
|
168
|
+
try {
|
|
169
|
+
this._socket.subscribeState(oid, handler);
|
|
170
|
+
} catch {
|
|
171
|
+
/* ignore */
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
if (typeof this._socket.getState === 'function') {
|
|
175
|
+
Promise.resolve(this._socket.getState(oid))
|
|
176
|
+
.then(state => {
|
|
177
|
+
if (state) {
|
|
178
|
+
this._values[key] = state.val;
|
|
179
|
+
if (this._rendered) {
|
|
180
|
+
this._updateView();
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
})
|
|
184
|
+
.catch(() => {});
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
_triggerAction(actionKey) {
|
|
190
|
+
if (this._editMode) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
const prefix = this._getInstancePrefix();
|
|
194
|
+
const relPath = ACTION_MAP[actionKey];
|
|
195
|
+
if (this._socket && prefix && relPath && typeof this._socket.setState === 'function') {
|
|
196
|
+
Promise.resolve(this._socket.setState(`${prefix}.${relPath}`, true, false)).catch(() => {});
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
_toNum(val) {
|
|
201
|
+
if (val === null || val === undefined || val === '') {
|
|
202
|
+
return null;
|
|
203
|
+
}
|
|
204
|
+
const n = parseFloat(String(val).replace(',', '.'));
|
|
205
|
+
return isNaN(n) ? null : n;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
_toBool(val) {
|
|
209
|
+
if (typeof val === 'boolean') {
|
|
210
|
+
return val;
|
|
211
|
+
}
|
|
212
|
+
if (typeof val === 'number') {
|
|
213
|
+
return val === 1;
|
|
214
|
+
}
|
|
215
|
+
const s = String(val || '')
|
|
216
|
+
.trim()
|
|
217
|
+
.toLowerCase();
|
|
218
|
+
return s === 'true' || s === '1' || s === 'ein' || s === 'on';
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
_fmtTemp(val, digits = 1) {
|
|
222
|
+
const n = this._toNum(val);
|
|
223
|
+
return n === null ? '–' : `${n.toFixed(digits)} °C`;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
_fmtNum(val, unit = '', digits = 1) {
|
|
227
|
+
const n = this._toNum(val);
|
|
228
|
+
if (n === null) {
|
|
229
|
+
return '–';
|
|
230
|
+
}
|
|
231
|
+
return unit ? `${n.toFixed(digits)} ${unit}` : n.toFixed(digits);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
_renderBase() {
|
|
235
|
+
const template = document.createElement('template');
|
|
236
|
+
template.innerHTML = `
|
|
237
|
+
<style>
|
|
238
|
+
:host {
|
|
239
|
+
--lux-surface: rgba(127, 127, 127, 0.12);
|
|
240
|
+
--lux-border: rgba(127, 127, 127, 0.22);
|
|
241
|
+
--lux-muted: rgba(127, 127, 127, 0.85);
|
|
242
|
+
--lux-heating: #f97316;
|
|
243
|
+
--lux-ww: #3b82f6;
|
|
244
|
+
--lux-defrost: #06b6d4;
|
|
245
|
+
--lux-ok: #22c55e;
|
|
246
|
+
--lux-pv: #eab308;
|
|
247
|
+
display: block;
|
|
248
|
+
width: 100%;
|
|
249
|
+
height: 100%;
|
|
250
|
+
box-sizing: border-box;
|
|
251
|
+
font-family: inherit;
|
|
252
|
+
color: inherit;
|
|
253
|
+
container-type: inline-size;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.card {
|
|
257
|
+
width: 100%;
|
|
258
|
+
height: 100%;
|
|
259
|
+
box-sizing: border-box;
|
|
260
|
+
display: flex;
|
|
261
|
+
flex-direction: column;
|
|
262
|
+
gap: 10px;
|
|
263
|
+
padding: 12px;
|
|
264
|
+
overflow: auto;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.header {
|
|
268
|
+
display: flex;
|
|
269
|
+
justify-content: space-between;
|
|
270
|
+
align-items: center;
|
|
271
|
+
gap: 8px;
|
|
272
|
+
flex-wrap: wrap;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.title { font-size: 1rem; font-weight: 600; }
|
|
276
|
+
.subtitle { font-size: 0.78rem; opacity: 0.72; }
|
|
277
|
+
|
|
278
|
+
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
|
|
279
|
+
|
|
280
|
+
.pill {
|
|
281
|
+
display: inline-flex;
|
|
282
|
+
align-items: center;
|
|
283
|
+
gap: 6px;
|
|
284
|
+
padding: 3px 9px;
|
|
285
|
+
border-radius: 999px;
|
|
286
|
+
font-size: 0.76rem;
|
|
287
|
+
font-weight: 600;
|
|
288
|
+
border: 1px solid var(--lux-border);
|
|
289
|
+
background: var(--lux-surface);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
|
|
293
|
+
.pill.mode-heating { color: var(--lux-heating); border-color: rgba(249, 115, 22, 0.4); background: rgba(249, 115, 22, 0.14); }
|
|
294
|
+
.pill.mode-ww { color: var(--lux-ww); border-color: rgba(59, 130, 246, 0.4); background: rgba(59, 130, 246, 0.14); }
|
|
295
|
+
.pill.mode-defrost { color: var(--lux-defrost); border-color: rgba(6, 182, 212, 0.4); background: rgba(6, 182, 212, 0.14); }
|
|
296
|
+
.pill.pv-active { color: var(--lux-pv); border-color: rgba(234, 179, 8, 0.45); background: rgba(234, 179, 8, 0.14); }
|
|
297
|
+
|
|
298
|
+
.hidden { display: none !important; }
|
|
299
|
+
|
|
300
|
+
.grid {
|
|
301
|
+
display: grid;
|
|
302
|
+
grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
|
|
303
|
+
gap: 8px;
|
|
304
|
+
flex: 1;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.section {
|
|
308
|
+
background: var(--lux-surface);
|
|
309
|
+
border: 1px solid var(--lux-border);
|
|
310
|
+
border-radius: 10px;
|
|
311
|
+
padding: 10px;
|
|
312
|
+
display: flex;
|
|
313
|
+
flex-direction: column;
|
|
314
|
+
gap: 6px;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.section-head {
|
|
318
|
+
display: flex;
|
|
319
|
+
justify-content: space-between;
|
|
320
|
+
align-items: center;
|
|
321
|
+
font-size: 0.72rem;
|
|
322
|
+
font-weight: 600;
|
|
323
|
+
opacity: 0.75;
|
|
324
|
+
text-transform: uppercase;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.status-tag {
|
|
328
|
+
text-transform: none;
|
|
329
|
+
padding: 1px 6px;
|
|
330
|
+
border-radius: 6px;
|
|
331
|
+
background: rgba(34, 197, 94, 0.16);
|
|
332
|
+
color: var(--lux-ok);
|
|
333
|
+
opacity: 1;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.primary-metric {
|
|
337
|
+
display: flex;
|
|
338
|
+
align-items: baseline;
|
|
339
|
+
justify-content: space-between;
|
|
340
|
+
gap: 6px;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
.big-val { font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; }
|
|
344
|
+
.target-val { font-size: 0.78rem; opacity: 0.72; font-variant-numeric: tabular-nums; }
|
|
345
|
+
|
|
346
|
+
.rows {
|
|
347
|
+
display: flex;
|
|
348
|
+
flex-direction: column;
|
|
349
|
+
gap: 3px;
|
|
350
|
+
border-top: 1px solid var(--lux-border);
|
|
351
|
+
padding-top: 6px;
|
|
352
|
+
margin-top: auto;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
.row { display: flex; justify-content: space-between; font-size: 0.78rem; font-variant-numeric: tabular-nums; }
|
|
356
|
+
.row .label { opacity: 0.72; }
|
|
357
|
+
.row .val { font-weight: 500; }
|
|
358
|
+
|
|
359
|
+
.bar-track { height: 5px; border-radius: 999px; background: var(--lux-border); overflow: hidden; }
|
|
360
|
+
.bar-fill { height: 100%; width: 0%; background: var(--lux-ww); transition: width 0.3s ease; }
|
|
361
|
+
|
|
362
|
+
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
|
|
363
|
+
.btn {
|
|
364
|
+
flex: 1 1 95px;
|
|
365
|
+
background: var(--lux-surface);
|
|
366
|
+
color: inherit;
|
|
367
|
+
border: 1px solid var(--lux-border);
|
|
368
|
+
border-radius: 8px;
|
|
369
|
+
padding: 6px 8px;
|
|
370
|
+
font-size: 0.76rem;
|
|
371
|
+
font-weight: 600;
|
|
372
|
+
cursor: pointer;
|
|
373
|
+
}
|
|
374
|
+
.btn:hover { border-color: var(--lux-ww); background: rgba(59, 130, 246, 0.15); }
|
|
375
|
+
</style>
|
|
376
|
+
|
|
377
|
+
<div class="card">
|
|
378
|
+
<div class="header">
|
|
379
|
+
<div>
|
|
380
|
+
<div class="title" data-ref="title">Wärmepumpe</div>
|
|
381
|
+
<div class="subtitle" data-ref="subtitle">Bitte Instanz auswählen</div>
|
|
382
|
+
</div>
|
|
383
|
+
<div class="badges">
|
|
384
|
+
<span class="pill pv-active hidden" data-ref="pvBadge">PV-Boost</span>
|
|
385
|
+
<span class="pill mode-idle" data-ref="modePill">
|
|
386
|
+
<span class="dot"></span>
|
|
387
|
+
<span data-ref="modeText">–</span>
|
|
388
|
+
</span>
|
|
389
|
+
</div>
|
|
390
|
+
</div>
|
|
391
|
+
|
|
392
|
+
<div class="grid">
|
|
393
|
+
<div class="section">
|
|
394
|
+
<div class="section-head"><span>Heizkreis</span><span class="status-tag" data-ref="heatingStatus">–</span></div>
|
|
395
|
+
<div class="primary-metric">
|
|
396
|
+
<span class="big-val" data-ref="returnTemp">–</span>
|
|
397
|
+
<span class="target-val">Soll <span data-ref="returnTarget">–</span></span>
|
|
398
|
+
</div>
|
|
399
|
+
<div class="rows">
|
|
400
|
+
<div class="row"><span class="label">Vorlauf</span><span class="val" data-ref="supplyTemp">–</span></div>
|
|
401
|
+
<div class="row"><span class="label">Spreizung</span><span class="val" data-ref="spread">–</span></div>
|
|
402
|
+
<div class="row"><span class="label">HUP / VD1</span><span class="val" data-ref="hupVd1">–</span></div>
|
|
403
|
+
</div>
|
|
404
|
+
</div>
|
|
405
|
+
|
|
406
|
+
<div class="section">
|
|
407
|
+
<div class="section-head"><span>Warmwasser</span><span class="status-tag" data-ref="wwStatus">–</span></div>
|
|
408
|
+
<div class="primary-metric">
|
|
409
|
+
<span class="big-val" data-ref="wwTemp">–</span>
|
|
410
|
+
<span class="target-val">Soll <span data-ref="wwTarget">–</span></span>
|
|
411
|
+
</div>
|
|
412
|
+
<div class="bar-track"><div class="bar-fill" data-ref="wwBar"></div></div>
|
|
413
|
+
<div class="rows">
|
|
414
|
+
<div class="row"><span class="label">Zirkulation</span><span class="val" data-ref="zipState">Aus</span></div>
|
|
415
|
+
</div>
|
|
416
|
+
</div>
|
|
417
|
+
|
|
418
|
+
<div class="section">
|
|
419
|
+
<div class="section-head"><span>Umgebung & COP</span></div>
|
|
420
|
+
<div class="primary-metric">
|
|
421
|
+
<span class="big-val" data-ref="outsideTemp">–</span>
|
|
422
|
+
<span class="target-val">Außen</span>
|
|
423
|
+
</div>
|
|
424
|
+
<div class="rows">
|
|
425
|
+
<div class="row"><span class="label">COP Heute</span><span class="val" data-ref="copToday">–</span></div>
|
|
426
|
+
<div class="row"><span class="label">JAZ Jahr</span><span class="val" data-ref="jazYear">–</span></div>
|
|
427
|
+
</div>
|
|
428
|
+
</div>
|
|
429
|
+
</div>
|
|
430
|
+
|
|
431
|
+
<div class="actions hidden" data-ref="actionsBar">
|
|
432
|
+
<button class="btn" type="button" data-action="force-ww">Zwangswarmwasser</button>
|
|
433
|
+
<button class="btn" type="button" data-action="force-heating">Zwangsheizen</button>
|
|
434
|
+
<button class="btn" type="button" data-action="activate-zip">ZIP starten</button>
|
|
435
|
+
</div>
|
|
436
|
+
</div>
|
|
437
|
+
`;
|
|
438
|
+
|
|
439
|
+
this.shadowRoot.appendChild(template.content.cloneNode(true));
|
|
440
|
+
this._refs = {};
|
|
441
|
+
this.shadowRoot.querySelectorAll('[data-ref]').forEach(el => {
|
|
442
|
+
this._refs[el.getAttribute('data-ref')] = el;
|
|
443
|
+
});
|
|
444
|
+
this.shadowRoot.querySelectorAll('[data-action]').forEach(btn => {
|
|
445
|
+
btn.addEventListener('click', () => this._triggerAction(btn.getAttribute('data-action')));
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
_updateView() {
|
|
450
|
+
if (!this._refs) {
|
|
451
|
+
return;
|
|
452
|
+
}
|
|
453
|
+
const prefix = this._getInstancePrefix();
|
|
454
|
+
const v = this._values;
|
|
455
|
+
const modeCode = this._toNum(v.modeCode);
|
|
456
|
+
const modeInfo =
|
|
457
|
+
modeCode !== null && MODE_META[modeCode] ? MODE_META[modeCode] : { text: '–', cls: 'mode-idle' };
|
|
458
|
+
|
|
459
|
+
this._refs.title.textContent = this._settings?.title || 'Wärmepumpe';
|
|
460
|
+
this._refs.subtitle.textContent = !prefix
|
|
461
|
+
? 'Bitte Instanz in den Einstellungen wählen'
|
|
462
|
+
: v.duration
|
|
463
|
+
? `Seit ${v.duration}`
|
|
464
|
+
: prefix;
|
|
465
|
+
|
|
466
|
+
this._refs.modeText.textContent = modeInfo.text;
|
|
467
|
+
this._refs.modePill.className = `pill ${modeInfo.cls}`;
|
|
468
|
+
this._refs.pvBadge.classList.toggle('hidden', !this._toBool(v.pvBoost));
|
|
469
|
+
|
|
470
|
+
const supplyNum = this._toNum(v.supplyTemp);
|
|
471
|
+
const returnNum = this._toNum(v.returnTemp);
|
|
472
|
+
const spreadNum =
|
|
473
|
+
this._toNum(v.spread) ?? (supplyNum !== null && returnNum !== null ? supplyNum - returnNum : null);
|
|
474
|
+
|
|
475
|
+
this._refs.heatingStatus.textContent = v.heatingStatus || '–';
|
|
476
|
+
this._refs.returnTemp.textContent = this._fmtTemp(returnNum);
|
|
477
|
+
this._refs.returnTarget.textContent = this._fmtTemp(v.returnTarget);
|
|
478
|
+
this._refs.supplyTemp.textContent = this._fmtTemp(supplyNum);
|
|
479
|
+
this._refs.spread.textContent = spreadNum === null ? '–' : `${spreadNum.toFixed(1)} K`;
|
|
480
|
+
this._refs.hupVd1.textContent = `${this._fmtNum(v.hupVoltage, 'V', 1)} / ${this._toBool(v.compressor) ? 'Ein' : 'Aus'}`;
|
|
481
|
+
|
|
482
|
+
const wwNum = this._toNum(v.wwTemp);
|
|
483
|
+
const wwTargetNum = this._toNum(v.wwTarget);
|
|
484
|
+
this._refs.wwStatus.textContent = v.wwStatus || '–';
|
|
485
|
+
this._refs.wwTemp.textContent = this._fmtTemp(wwNum);
|
|
486
|
+
this._refs.wwTarget.textContent = this._fmtTemp(wwTargetNum);
|
|
487
|
+
this._refs.zipState.textContent = this._toBool(v.zipActive) ? 'Aktiv' : 'Aus';
|
|
488
|
+
|
|
489
|
+
if (wwNum !== null && wwTargetNum !== null && wwTargetNum > 20) {
|
|
490
|
+
const pct = Math.max(0, Math.min(100, ((wwNum - 20) / (wwTargetNum - 20)) * 100));
|
|
491
|
+
this._refs.wwBar.style.width = `${pct.toFixed(0)}%`;
|
|
492
|
+
} else {
|
|
493
|
+
this._refs.wwBar.style.width = '0%';
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
this._refs.outsideTemp.textContent = this._fmtTemp(v.outsideTemp);
|
|
497
|
+
this._refs.copToday.textContent = this._fmtNum(v.copToday, '', 2);
|
|
498
|
+
this._refs.jazYear.textContent = this._fmtNum(v.jazYear, '', 2);
|
|
499
|
+
this._refs.actionsBar.classList.toggle('hidden', this._settings?.showActions === false);
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
if (!customElements.get('luxtronik-status-card')) {
|
|
504
|
+
customElements.define('luxtronik-status-card', LuxtronikStatusCard);
|
|
505
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"manifestVersion": 1,
|
|
3
|
+
"tag": "luxtronik-status-card",
|
|
4
|
+
"module": "./luxtronik-status-card.js",
|
|
5
|
+
"name": {
|
|
6
|
+
"en": "Luxtronik Status Overview",
|
|
7
|
+
"de": "Luxtronik Status-Übersicht"
|
|
8
|
+
},
|
|
9
|
+
"size": {
|
|
10
|
+
"width": 420,
|
|
11
|
+
"height": 280
|
|
12
|
+
},
|
|
13
|
+
"settings": {
|
|
14
|
+
"type": "panel",
|
|
15
|
+
"items": {
|
|
16
|
+
"instance": {
|
|
17
|
+
"type": "instance",
|
|
18
|
+
"adapter": "luxtronik2-controller",
|
|
19
|
+
"label": {
|
|
20
|
+
"en": "Adapter instance",
|
|
21
|
+
"de": "Adapter-Instanz"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"title": {
|
|
25
|
+
"type": "text",
|
|
26
|
+
"default": "Wärmepumpe",
|
|
27
|
+
"label": {
|
|
28
|
+
"en": "Title",
|
|
29
|
+
"de": "Titel"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"showActions": {
|
|
33
|
+
"type": "checkbox",
|
|
34
|
+
"default": true,
|
|
35
|
+
"label": {
|
|
36
|
+
"en": "Show action buttons",
|
|
37
|
+
"de": "Aktions-Buttons anzeigen"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|