iobroker.luxtronik2-controller 1.2.0 → 1.3.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 +19 -11
- package/admin/jsonConfig.json +14 -14
- package/admin/webcomponents/luxtronik-base.js +242 -0
- package/admin/webcomponents/luxtronik-cop-cockpit.js +303 -0
- package/admin/webcomponents/luxtronik-cop-cockpit.json +44 -0
- package/admin/webcomponents/luxtronik-dhw-tank.js +417 -0
- package/admin/webcomponents/luxtronik-dhw-tank.json +42 -0
- package/admin/webcomponents/luxtronik-diagnostics-feed.js +412 -0
- package/admin/webcomponents/luxtronik-diagnostics-feed.json +42 -0
- package/admin/webcomponents/luxtronik-health-monitor.js +378 -0
- package/admin/webcomponents/luxtronik-health-monitor.json +44 -0
- package/admin/webcomponents/luxtronik-heatcurve-tuner.js +515 -0
- package/admin/webcomponents/luxtronik-heatcurve-tuner.json +42 -0
- package/admin/webcomponents/luxtronik-hydraulics-flow.js +464 -0
- package/admin/webcomponents/luxtronik-hydraulics-flow.json +34 -0
- package/admin/webcomponents/luxtronik-schedule-radar.js +448 -0
- package/admin/webcomponents/luxtronik-schedule-radar.json +34 -0
- package/admin/webcomponents/luxtronik-status-card.js +2 -2
- 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/io-package.json +35 -28
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -103,6 +103,25 @@ _This project is not affiliated with Alpha Innotec, Novelan, ait-deutschland Gmb
|
|
|
103
103
|
//### **WORK IN PROGRESS**
|
|
104
104
|
|
|
105
105
|
## Changelog
|
|
106
|
+
### 1.3.0 (2026-11-25)
|
|
107
|
+
|
|
108
|
+
- Fixed COP/JAZ datapoint paths (`Information.16_Efficiency.Total.*`) in `<luxtronik-status-card>` so daily COP and annual JAZ values populate correctly
|
|
109
|
+
- Added shared Web Component base class (`luxtronik-base.js`) and two new `@iobroker/web-components` widgets for Aura, VIS-2, and WebUI:
|
|
110
|
+
- `<luxtronik-hydraulics-flow>`: animated hydraulics & energy flow diagram (heating, DHW, defrost reverse flow, ZWE1, dynamic inverter speed)
|
|
111
|
+
- `<luxtronik-dhw-tank>`: hot water tank level gauge with hysteresis recharge threshold, one-shot heating trigger, and animated ZIP countdown ring
|
|
112
|
+
|
|
113
|
+
- Added five additional `@iobroker/web-components` widgets for Aura, VIS-2, and WebUI (completing the 8-widget suite):
|
|
114
|
+
- `<luxtronik-heatcurve-tuner>`: interactive live heating curve with hysteresis band, heating limit indicator, live operating point, and parallel offset slider with preview and apply controls
|
|
115
|
+
- `<luxtronik-cop-cockpit>`: COP/JAZ efficiency matrix (Total, Heating, Hot Water across Today, 7 Days, Month, Year) with live COP calculation and lifetime totals
|
|
116
|
+
- `<luxtronik-health-monitor>`: compressor cycle duration gauge (avg. min/cycle), context-aware active lock/delay/defrost timers, and EEPROM write cycle monitor
|
|
117
|
+
- `<luxtronik-schedule-radar>`: 24-hour schedule bars for heating reduction, hot water lock times, and circulation pump windows with a live time marker
|
|
118
|
+
- `<luxtronik-diagnostics-feed>`: switchable error log and outage history feed with firmware update banner, changelog preview, and optional Modbus error reset
|
|
119
|
+
|
|
120
|
+
### 1.2.1 (2026-11-24)
|
|
121
|
+
|
|
122
|
+
- 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`
|
|
123
|
+
- 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`
|
|
124
|
+
|
|
106
125
|
### 1.2.0 (2026-11-24)
|
|
107
126
|
|
|
108
127
|
- 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
|
|
@@ -123,17 +142,6 @@ _This project is not affiliated with Alpha Innotec, Novelan, ait-deutschland Gmb
|
|
|
123
142
|
- Eliminated PV boost flip-flop writes during idle and cycle transitions by delegating directly to `evaluatePvBoost` without intermediate resets to baseline
|
|
124
143
|
- Fixed raw fallback indices in `calculateTotalEnergy()` to read `rawParams[1136]/[1137]` (factor `0.01`) instead of `rawValues[156]/[157]` and added 2-decimal rounding
|
|
125
144
|
|
|
126
|
-
### 1.0.4 (2026-11-21)
|
|
127
|
-
|
|
128
|
-
- 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`)
|
|
129
|
-
- 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
|
|
130
|
-
- 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
|
|
131
|
-
- 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
|
|
132
|
-
|
|
133
|
-
### 1.0.3 (2026-11-18)
|
|
134
|
-
|
|
135
|
-
- Fixed daily COP reset in `copManager.ts` so Heating and Hot Water values reset to `0` after midnight until an active cycle starts
|
|
136
|
-
|
|
137
145
|
## License
|
|
138
146
|
|
|
139
147
|
MIT License
|
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": {
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gemeinsame Basisklasse für alle Luxtronik `@iobroker/web-components`.
|
|
3
|
+
* Kapselt Socket-Handling, State-Abos, Edit-Mode-Schutz und Formatierungs-Helfer.
|
|
4
|
+
*/
|
|
5
|
+
export class LuxtronikBaseCard extends HTMLElement {
|
|
6
|
+
static get stateMap() {
|
|
7
|
+
return {};
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
static get actionMap() {
|
|
11
|
+
return {};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
constructor() {
|
|
15
|
+
super();
|
|
16
|
+
this.attachShadow({ mode: 'open' });
|
|
17
|
+
this._socket = null;
|
|
18
|
+
this._settings = {};
|
|
19
|
+
this._theme = '';
|
|
20
|
+
this._editMode = false;
|
|
21
|
+
this._values = {};
|
|
22
|
+
this._subscriptions = [];
|
|
23
|
+
this._rendered = false;
|
|
24
|
+
this._connected = false;
|
|
25
|
+
this._refs = {};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
set socket(value) {
|
|
29
|
+
if (this._socket === value) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
this._unsubscribeAll();
|
|
33
|
+
this._socket = value;
|
|
34
|
+
if (this._connected) {
|
|
35
|
+
this._resubscribe();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
get socket() {
|
|
40
|
+
return this._socket;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
set settings(value) {
|
|
44
|
+
const prevInstance = this._getInstancePrefix();
|
|
45
|
+
this._settings = value && typeof value === 'object' ? value : {};
|
|
46
|
+
const nextInstance = this._getInstancePrefix();
|
|
47
|
+
|
|
48
|
+
if (this._connected && prevInstance !== nextInstance) {
|
|
49
|
+
this._resubscribe();
|
|
50
|
+
}
|
|
51
|
+
if (this._rendered) {
|
|
52
|
+
this._updateView();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
get settings() {
|
|
57
|
+
return this._settings;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
set theme(value) {
|
|
61
|
+
this._theme = value || '';
|
|
62
|
+
if (this._theme === 'light' || this._theme === 'dark') {
|
|
63
|
+
this.setAttribute('theme', this._theme);
|
|
64
|
+
} else {
|
|
65
|
+
this.removeAttribute('theme');
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
get theme() {
|
|
70
|
+
return this._theme;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
set editMode(value) {
|
|
74
|
+
this._editMode = Boolean(value);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
get editMode() {
|
|
78
|
+
return this._editMode;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
connectedCallback() {
|
|
82
|
+
this._connected = true;
|
|
83
|
+
if (!this._rendered) {
|
|
84
|
+
this._renderBase();
|
|
85
|
+
this._collectRefs();
|
|
86
|
+
this._rendered = true;
|
|
87
|
+
}
|
|
88
|
+
this._resubscribe();
|
|
89
|
+
this._updateView();
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
disconnectedCallback() {
|
|
93
|
+
this._connected = false;
|
|
94
|
+
this._unsubscribeAll();
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
_collectRefs() {
|
|
98
|
+
this._refs = {};
|
|
99
|
+
this.shadowRoot.querySelectorAll('[data-ref]').forEach(el => {
|
|
100
|
+
this._refs[el.getAttribute('data-ref')] = el;
|
|
101
|
+
});
|
|
102
|
+
this.shadowRoot.querySelectorAll('[data-action]').forEach(btn => {
|
|
103
|
+
btn.addEventListener('click', () => this._triggerAction(btn.getAttribute('data-action')));
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
_getInstancePrefix() {
|
|
108
|
+
const raw = this._settings?.instance;
|
|
109
|
+
if (!raw || typeof raw !== 'string') {
|
|
110
|
+
return '';
|
|
111
|
+
}
|
|
112
|
+
return raw.trim().replace(/^system\.adapter\./, '');
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
_unsubscribeAll() {
|
|
116
|
+
if (this._socket && typeof this._socket.unsubscribeState === 'function') {
|
|
117
|
+
for (const { oid, handler } of this._subscriptions) {
|
|
118
|
+
try {
|
|
119
|
+
this._socket.unsubscribeState(oid, handler);
|
|
120
|
+
} catch {
|
|
121
|
+
/* ignore */
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
this._subscriptions = [];
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
_resubscribe() {
|
|
129
|
+
this._unsubscribeAll();
|
|
130
|
+
this._values = {};
|
|
131
|
+
|
|
132
|
+
const prefix = this._getInstancePrefix();
|
|
133
|
+
if (!this._socket || !prefix) {
|
|
134
|
+
if (this._rendered) {
|
|
135
|
+
this._updateView();
|
|
136
|
+
}
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const map = this.constructor.stateMap || {};
|
|
141
|
+
for (const [key, relPath] of Object.entries(map)) {
|
|
142
|
+
const oid = `${prefix}.${relPath}`;
|
|
143
|
+
const handler = (_id, state) => {
|
|
144
|
+
this._values[key] = state ? state.val : null;
|
|
145
|
+
if (this._rendered) {
|
|
146
|
+
this._updateView();
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
this._subscriptions.push({ oid, handler });
|
|
150
|
+
|
|
151
|
+
if (typeof this._socket.subscribeState === 'function') {
|
|
152
|
+
try {
|
|
153
|
+
this._socket.subscribeState(oid, handler);
|
|
154
|
+
} catch {
|
|
155
|
+
/* ignore */
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
if (typeof this._socket.getState === 'function') {
|
|
159
|
+
Promise.resolve(this._socket.getState(oid))
|
|
160
|
+
.then(state => {
|
|
161
|
+
if (state) {
|
|
162
|
+
this._values[key] = state.val;
|
|
163
|
+
if (this._rendered) {
|
|
164
|
+
this._updateView();
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
})
|
|
168
|
+
.catch(() => {});
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
_writeState(relPath, val) {
|
|
174
|
+
if (this._editMode) {
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
const prefix = this._getInstancePrefix();
|
|
178
|
+
if (this._socket && prefix && relPath && typeof this._socket.setState === 'function') {
|
|
179
|
+
Promise.resolve(this._socket.setState(`${prefix}.${relPath}`, val, false)).catch(() => {});
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
_triggerAction(actionKey) {
|
|
184
|
+
const map = this.constructor.actionMap || {};
|
|
185
|
+
if (map[actionKey]) {
|
|
186
|
+
this._writeState(map[actionKey], true);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
_toNum(val) {
|
|
191
|
+
if (val === null || val === undefined || val === '') {
|
|
192
|
+
return null;
|
|
193
|
+
}
|
|
194
|
+
const n = parseFloat(String(val).replace(',', '.'));
|
|
195
|
+
return isNaN(n) ? null : n;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
_toBool(val) {
|
|
199
|
+
if (typeof val === 'boolean') {
|
|
200
|
+
return val;
|
|
201
|
+
}
|
|
202
|
+
if (typeof val === 'number') {
|
|
203
|
+
return val === 1;
|
|
204
|
+
}
|
|
205
|
+
const s = String(val || '')
|
|
206
|
+
.trim()
|
|
207
|
+
.toLowerCase();
|
|
208
|
+
return s === 'true' || s === '1' || s === 'ein' || s === 'on';
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
_fmtTemp(val, digits = 1) {
|
|
212
|
+
const n = this._toNum(val);
|
|
213
|
+
return n === null ? '–' : `${n.toFixed(digits)} °C`;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
_fmtNum(val, unit = '', digits = 1) {
|
|
217
|
+
const n = this._toNum(val);
|
|
218
|
+
if (n === null) {
|
|
219
|
+
return '–';
|
|
220
|
+
}
|
|
221
|
+
return unit ? `${n.toFixed(digits)} ${unit}` : n.toFixed(digits);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
_fmtSec(sec) {
|
|
225
|
+
const n = this._toNum(sec);
|
|
226
|
+
if (n === null || n <= 0) {
|
|
227
|
+
return '0:00';
|
|
228
|
+
}
|
|
229
|
+
const total = Math.round(n);
|
|
230
|
+
const m = Math.floor(total / 60);
|
|
231
|
+
const s = total % 60;
|
|
232
|
+
return `${m}:${String(s).padStart(2, '0')}`;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
_renderBase() {
|
|
236
|
+
// In Unterklassen überschreiben
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
_updateView() {
|
|
240
|
+
// In Unterklassen überschreiben
|
|
241
|
+
}
|
|
242
|
+
}
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* <luxtronik-cop-cockpit>
|
|
3
|
+
* COP- & JAZ-Vergleichsmatrix (Gesamt / Heizen / Warmwasser) inkl. Live-COP
|
|
4
|
+
* für `@iobroker/web-components`.
|
|
5
|
+
*/
|
|
6
|
+
import { LuxtronikBaseCard } from './luxtronik-base.js';
|
|
7
|
+
|
|
8
|
+
const MATRIX_ROWS = [
|
|
9
|
+
{ key: 'total', label: 'Gesamt', color: '#22c55e' },
|
|
10
|
+
{ key: 'heating', label: 'Heizen', color: '#f97316' },
|
|
11
|
+
{ key: 'water', label: 'Warmwasser', color: '#3b82f6' },
|
|
12
|
+
];
|
|
13
|
+
|
|
14
|
+
const MATRIX_COLS = [
|
|
15
|
+
{ key: 'today', label: 'Heute' },
|
|
16
|
+
{ key: '7d', label: '7 Tage' },
|
|
17
|
+
{ key: 'month', label: 'Monat' },
|
|
18
|
+
{ key: 'year', label: 'Jahr' },
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
class LuxtronikCopCockpit extends LuxtronikBaseCard {
|
|
22
|
+
static get stateMap() {
|
|
23
|
+
return {
|
|
24
|
+
total_today: 'Information.16_Efficiency.Total.cop_total_today',
|
|
25
|
+
total_7d: 'Information.16_Efficiency.Total.cop_total_7d',
|
|
26
|
+
total_month: 'Information.16_Efficiency.Total.cop_total_month',
|
|
27
|
+
total_year: 'Information.16_Efficiency.Total.cop_total_year',
|
|
28
|
+
heating_today: 'Information.16_Efficiency.Heating.cop_heating_today',
|
|
29
|
+
heating_7d: 'Information.16_Efficiency.Heating.cop_heating_7d',
|
|
30
|
+
heating_month: 'Information.16_Efficiency.Heating.cop_heating_month',
|
|
31
|
+
heating_year: 'Information.16_Efficiency.Heating.cop_heating_year',
|
|
32
|
+
water_today: 'Information.16_Efficiency.HotWater.cop_water_today',
|
|
33
|
+
water_7d: 'Information.16_Efficiency.HotWater.cop_water_7d',
|
|
34
|
+
water_month: 'Information.16_Efficiency.HotWater.cop_water_month',
|
|
35
|
+
water_year: 'Information.16_Efficiency.HotWater.cop_water_year',
|
|
36
|
+
heatPower: 'Information.12_SystemInfo.current_heat_output',
|
|
37
|
+
elecPower: 'Information.12_SystemInfo.current_power_consumption',
|
|
38
|
+
thermalTotal: 'Information.09_ThermalEnergy.thermalenergy_total',
|
|
39
|
+
energyTotal: 'Information.10_Energy.energy_total',
|
|
40
|
+
vd1: 'Information.03_Outputs.VD1out',
|
|
41
|
+
pvBoost: 'Information.17_PV_Surplus.pv_boost_active',
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
_copColor(val) {
|
|
46
|
+
if (val === null || val <= 0) {
|
|
47
|
+
return 'rgba(148, 163, 184, 0.45)';
|
|
48
|
+
}
|
|
49
|
+
if (val < 2.5) {
|
|
50
|
+
return '#ef4444';
|
|
51
|
+
}
|
|
52
|
+
if (val < 3.4) {
|
|
53
|
+
return '#f59e0b';
|
|
54
|
+
}
|
|
55
|
+
if (val < 4.3) {
|
|
56
|
+
return '#22c55e';
|
|
57
|
+
}
|
|
58
|
+
return '#06b6d4';
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
_renderBase() {
|
|
62
|
+
const headerCols = MATRIX_COLS.map(c => `<div class="col-head">${c.label}</div>`).join('');
|
|
63
|
+
const bodyRows = MATRIX_ROWS.map(row => {
|
|
64
|
+
const cells = MATRIX_COLS.map(col => {
|
|
65
|
+
const id = `${row.key}_${col.key}`;
|
|
66
|
+
return `
|
|
67
|
+
<div class="cell">
|
|
68
|
+
<div class="cell-val" data-ref="val_${id}">–</div>
|
|
69
|
+
<div class="bar-track"><div class="bar-fill" data-ref="bar_${id}"></div></div>
|
|
70
|
+
</div>
|
|
71
|
+
`;
|
|
72
|
+
}).join('');
|
|
73
|
+
return `
|
|
74
|
+
<div class="row-label">
|
|
75
|
+
<span class="dot" style="background:${row.color}"></span>
|
|
76
|
+
<span>${row.label}</span>
|
|
77
|
+
</div>
|
|
78
|
+
${cells}
|
|
79
|
+
`;
|
|
80
|
+
}).join('');
|
|
81
|
+
|
|
82
|
+
const tpl = document.createElement('template');
|
|
83
|
+
tpl.innerHTML = `
|
|
84
|
+
<style>
|
|
85
|
+
:host {
|
|
86
|
+
--lux-surface: rgba(127, 127, 127, 0.11);
|
|
87
|
+
--lux-border: rgba(127, 127, 127, 0.24);
|
|
88
|
+
--lux-pv: #eab308;
|
|
89
|
+
--lux-ok: #22c55e;
|
|
90
|
+
display: block;
|
|
91
|
+
width: 100%;
|
|
92
|
+
height: 100%;
|
|
93
|
+
box-sizing: border-box;
|
|
94
|
+
font-family: inherit;
|
|
95
|
+
color: inherit;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.card {
|
|
99
|
+
width: 100%;
|
|
100
|
+
height: 100%;
|
|
101
|
+
box-sizing: border-box;
|
|
102
|
+
display: flex;
|
|
103
|
+
flex-direction: column;
|
|
104
|
+
gap: 10px;
|
|
105
|
+
padding: 12px;
|
|
106
|
+
overflow: auto;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.header {
|
|
110
|
+
display: flex;
|
|
111
|
+
justify-content: space-between;
|
|
112
|
+
align-items: center;
|
|
113
|
+
gap: 8px;
|
|
114
|
+
flex-wrap: wrap;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.title { font-size: 0.98rem; font-weight: 600; }
|
|
118
|
+
.subtitle { font-size: 0.74rem; opacity: 0.72; }
|
|
119
|
+
.badges { display: flex; gap: 6px; align-items: center; }
|
|
120
|
+
|
|
121
|
+
.pill {
|
|
122
|
+
padding: 3px 9px;
|
|
123
|
+
border-radius: 999px;
|
|
124
|
+
font-size: 0.74rem;
|
|
125
|
+
font-weight: 700;
|
|
126
|
+
background: var(--lux-surface);
|
|
127
|
+
border: 1px solid var(--lux-border);
|
|
128
|
+
font-variant-numeric: tabular-nums;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.pill.live { color: var(--lux-ok); border-color: rgba(34, 197, 94, 0.45); background: rgba(34, 197, 94, 0.14); }
|
|
132
|
+
.pill.pv { color: var(--lux-pv); border-color: rgba(234, 179, 8, 0.45); background: rgba(234, 179, 8, 0.14); }
|
|
133
|
+
.hidden { display: none !important; }
|
|
134
|
+
|
|
135
|
+
.matrix {
|
|
136
|
+
display: grid;
|
|
137
|
+
grid-template-columns: minmax(90px, 1.15fr) repeat(4, minmax(56px, 1fr));
|
|
138
|
+
gap: 7px;
|
|
139
|
+
align-items: center;
|
|
140
|
+
flex: 1;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.col-head {
|
|
144
|
+
font-size: 0.7rem;
|
|
145
|
+
font-weight: 600;
|
|
146
|
+
opacity: 0.68;
|
|
147
|
+
text-transform: uppercase;
|
|
148
|
+
text-align: center;
|
|
149
|
+
letter-spacing: 0.03em;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.row-label {
|
|
153
|
+
display: flex;
|
|
154
|
+
align-items: center;
|
|
155
|
+
gap: 6px;
|
|
156
|
+
font-size: 0.8rem;
|
|
157
|
+
font-weight: 600;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.row-label .dot {
|
|
161
|
+
width: 8px;
|
|
162
|
+
height: 8px;
|
|
163
|
+
border-radius: 50%;
|
|
164
|
+
flex-shrink: 0;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.cell {
|
|
168
|
+
background: var(--lux-surface);
|
|
169
|
+
border: 1px solid var(--lux-border);
|
|
170
|
+
border-radius: 8px;
|
|
171
|
+
padding: 6px 6px 5px;
|
|
172
|
+
display: flex;
|
|
173
|
+
flex-direction: column;
|
|
174
|
+
gap: 4px;
|
|
175
|
+
align-items: center;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.cell-val {
|
|
179
|
+
font-size: 0.92rem;
|
|
180
|
+
font-weight: 700;
|
|
181
|
+
font-variant-numeric: tabular-nums;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.bar-track {
|
|
185
|
+
width: 100%;
|
|
186
|
+
height: 4px;
|
|
187
|
+
border-radius: 999px;
|
|
188
|
+
background: rgba(127, 127, 127, 0.22);
|
|
189
|
+
overflow: hidden;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.bar-fill {
|
|
193
|
+
height: 100%;
|
|
194
|
+
width: 0%;
|
|
195
|
+
border-radius: 999px;
|
|
196
|
+
transition: width 0.35s ease, background-color 0.35s ease;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.footer {
|
|
200
|
+
display: flex;
|
|
201
|
+
justify-content: space-between;
|
|
202
|
+
align-items: center;
|
|
203
|
+
flex-wrap: wrap;
|
|
204
|
+
gap: 8px;
|
|
205
|
+
padding-top: 6px;
|
|
206
|
+
border-top: 1px solid var(--lux-border);
|
|
207
|
+
font-size: 0.74rem;
|
|
208
|
+
opacity: 0.82;
|
|
209
|
+
font-variant-numeric: tabular-nums;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.footer strong { font-weight: 600; }
|
|
213
|
+
</style>
|
|
214
|
+
|
|
215
|
+
<div class="card">
|
|
216
|
+
<div class="header">
|
|
217
|
+
<div>
|
|
218
|
+
<div class="title" data-ref="title">Effizienz / COP</div>
|
|
219
|
+
<div class="subtitle" data-ref="subtitle">Arbeitszahlen nach Zeitraum</div>
|
|
220
|
+
</div>
|
|
221
|
+
<div class="badges">
|
|
222
|
+
<span class="pill pv hidden" data-ref="pvBadge">PV-Boost</span>
|
|
223
|
+
<span class="pill" data-ref="liveCopBadge">Live: –</span>
|
|
224
|
+
</div>
|
|
225
|
+
</div>
|
|
226
|
+
|
|
227
|
+
<div class="matrix">
|
|
228
|
+
<div></div>
|
|
229
|
+
${headerCols}
|
|
230
|
+
${bodyRows}
|
|
231
|
+
</div>
|
|
232
|
+
|
|
233
|
+
<div class="footer">
|
|
234
|
+
<span>Wärme ges.: <strong data-ref="thermalTotal">–</strong></span>
|
|
235
|
+
<span>Strom ges.: <strong data-ref="energyTotal">–</strong></span>
|
|
236
|
+
<span>Gesamt-JAZ: <strong data-ref="lifetimeJaz">–</strong></span>
|
|
237
|
+
</div>
|
|
238
|
+
</div>
|
|
239
|
+
`;
|
|
240
|
+
this.shadowRoot.appendChild(tpl.content.cloneNode(true));
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
_updateView() {
|
|
244
|
+
const r = this._refs;
|
|
245
|
+
if (!r.title) {
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
const v = this._values;
|
|
250
|
+
const maxScale = Math.max(3, this._toNum(this._settings?.maxScale) ?? 5.5);
|
|
251
|
+
|
|
252
|
+
r.title.textContent = this._settings?.title || 'Effizienz / COP';
|
|
253
|
+
r.pvBadge.classList.toggle('hidden', !this._toBool(v.pvBoost));
|
|
254
|
+
|
|
255
|
+
// Live-COP berechnen (falls Verdichter läuft und Leistungswerte vorhanden)
|
|
256
|
+
const heatW = this._toNum(v.heatPower);
|
|
257
|
+
const elecW = this._toNum(v.elecPower);
|
|
258
|
+
const vd1 = this._toBool(v.vd1);
|
|
259
|
+
|
|
260
|
+
if (vd1 && heatW !== null && heatW > 0 && elecW !== null && elecW > 50) {
|
|
261
|
+
const liveCop = heatW / elecW;
|
|
262
|
+
r.liveCopBadge.textContent = `Live COP ${liveCop.toFixed(2)}`;
|
|
263
|
+
r.liveCopBadge.className = 'pill live';
|
|
264
|
+
r.subtitle.textContent = `${(heatW / 1000).toFixed(2)} kW th. / ${(elecW / 1000).toFixed(2)} kW el.`;
|
|
265
|
+
} else {
|
|
266
|
+
r.liveCopBadge.textContent = vd1 ? 'Verdichter aktiv' : 'Standby';
|
|
267
|
+
r.liveCopBadge.className = 'pill';
|
|
268
|
+
r.subtitle.textContent = 'Arbeitszahlen nach Zeitraum';
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
// Matrix-Zellen aktualisieren
|
|
272
|
+
for (const row of MATRIX_ROWS) {
|
|
273
|
+
for (const col of MATRIX_COLS) {
|
|
274
|
+
const id = `${row.key}_${col.key}`;
|
|
275
|
+
const num = this._toNum(v[id]);
|
|
276
|
+
const valEl = r[`val_${id}`];
|
|
277
|
+
const barEl = r[`bar_${id}`];
|
|
278
|
+
|
|
279
|
+
if (num !== null && num > 0) {
|
|
280
|
+
valEl.textContent = num.toFixed(2);
|
|
281
|
+
const pct = Math.max(4, Math.min(100, (num / maxScale) * 100));
|
|
282
|
+
barEl.style.width = `${pct.toFixed(0)}%`;
|
|
283
|
+
barEl.style.backgroundColor = this._copColor(num);
|
|
284
|
+
} else {
|
|
285
|
+
valEl.textContent = '–';
|
|
286
|
+
barEl.style.width = '0%';
|
|
287
|
+
barEl.style.backgroundColor = 'transparent';
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
// Gesamtzähler & Lebenszeit-JAZ
|
|
293
|
+
const th = this._toNum(v.thermalTotal);
|
|
294
|
+
const el = this._toNum(v.energyTotal);
|
|
295
|
+
r.thermalTotal.textContent = th !== null ? `${Math.round(th).toLocaleString('de-DE')} kWh` : '–';
|
|
296
|
+
r.energyTotal.textContent = el !== null ? `${Math.round(el).toLocaleString('de-DE')} kWh` : '–';
|
|
297
|
+
r.lifetimeJaz.textContent = th !== null && el !== null && el > 0 ? (th / el).toFixed(2) : '–';
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
if (!customElements.get('luxtronik-cop-cockpit')) {
|
|
302
|
+
customElements.define('luxtronik-cop-cockpit', LuxtronikCopCockpit);
|
|
303
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"manifestVersion": 1,
|
|
3
|
+
"tag": "luxtronik-cop-cockpit",
|
|
4
|
+
"module": "./luxtronik-cop-cockpit.js",
|
|
5
|
+
"name": {
|
|
6
|
+
"en": "Luxtronik COP & Efficiency Cockpit",
|
|
7
|
+
"de": "Luxtronik COP- & Effizienz-Cockpit"
|
|
8
|
+
},
|
|
9
|
+
"size": {
|
|
10
|
+
"width": 460,
|
|
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": "Effizienz / COP",
|
|
27
|
+
"label": {
|
|
28
|
+
"en": "Title",
|
|
29
|
+
"de": "Titel"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"maxScale": {
|
|
33
|
+
"type": "number",
|
|
34
|
+
"default": 5.5,
|
|
35
|
+
"min": 3,
|
|
36
|
+
"max": 8,
|
|
37
|
+
"label": {
|
|
38
|
+
"en": "Bar max COP scale",
|
|
39
|
+
"de": "Balken-Skala Max-COP"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|