iobroker.luxtronik2-controller 1.2.1 → 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 +14 -7
- 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/io-package.json +22 -15
- package/package.json +1 -1
|
@@ -0,0 +1,515 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* <luxtronik-heatcurve-tuner>
|
|
3
|
+
* Interaktive Live-Heizkurve mit Hysterese-Band, Heizgrenze und Parallelverschiebungs-Slider
|
|
4
|
+
* für `@iobroker/web-components`.
|
|
5
|
+
*/
|
|
6
|
+
import { LuxtronikBaseCard } from './luxtronik-base.js';
|
|
7
|
+
|
|
8
|
+
const CHART = {
|
|
9
|
+
left: 40,
|
|
10
|
+
right: 446,
|
|
11
|
+
top: 16,
|
|
12
|
+
bottom: 168,
|
|
13
|
+
tOutMin: -20,
|
|
14
|
+
tOutMax: 20,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
class LuxtronikHeatcurveTuner extends LuxtronikBaseCard {
|
|
18
|
+
static get stateMap() {
|
|
19
|
+
return {
|
|
20
|
+
basePoint: 'Settings.02_Heating.heating_curve_parallel_offset',
|
|
21
|
+
endPoint: 'Settings.02_Heating.heating_curve_end_point',
|
|
22
|
+
offset: 'Settings.02_Heating.heating_temperature',
|
|
23
|
+
hysteresis: 'Settings.02_Heating.returnTemperatureHysteresis',
|
|
24
|
+
heatingLimitActive: 'Settings.02_Heating.heatingLimit',
|
|
25
|
+
heatingLimitTemp: 'Settings.02_Heating.thresholdHeatingLimit',
|
|
26
|
+
outsideTemp: 'Information.01_Temperatures.temperature_outside',
|
|
27
|
+
avgOutsideTemp: 'Information.01_Temperatures.Mitteltemperatur',
|
|
28
|
+
returnTemp: 'Information.01_Temperatures.temperature_return',
|
|
29
|
+
returnTarget: 'Information.01_Temperatures.temperature_target_return',
|
|
30
|
+
heatingStatus: 'Information.08_OperatingState.opStateHeatingString',
|
|
31
|
+
pvBoost: 'Information.17_PV_Surplus.pv_boost_active',
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
constructor() {
|
|
36
|
+
super();
|
|
37
|
+
this._pendingOffset = null;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
_renderBase() {
|
|
41
|
+
const tpl = document.createElement('template');
|
|
42
|
+
tpl.innerHTML = `
|
|
43
|
+
<style>
|
|
44
|
+
:host {
|
|
45
|
+
--lux-surface: rgba(127, 127, 127, 0.11);
|
|
46
|
+
--lux-border: rgba(127, 127, 127, 0.24);
|
|
47
|
+
--lux-heating: #f97316;
|
|
48
|
+
--lux-target: #3b82f6;
|
|
49
|
+
--lux-limit: #06b6d4;
|
|
50
|
+
--lux-ok: #22c55e;
|
|
51
|
+
--lux-pv: #eab308;
|
|
52
|
+
display: block;
|
|
53
|
+
width: 100%;
|
|
54
|
+
height: 100%;
|
|
55
|
+
box-sizing: border-box;
|
|
56
|
+
font-family: inherit;
|
|
57
|
+
color: inherit;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.card {
|
|
61
|
+
width: 100%;
|
|
62
|
+
height: 100%;
|
|
63
|
+
box-sizing: border-box;
|
|
64
|
+
display: flex;
|
|
65
|
+
flex-direction: column;
|
|
66
|
+
gap: 8px;
|
|
67
|
+
padding: 12px;
|
|
68
|
+
overflow: auto;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.header {
|
|
72
|
+
display: flex;
|
|
73
|
+
justify-content: space-between;
|
|
74
|
+
align-items: center;
|
|
75
|
+
gap: 8px;
|
|
76
|
+
flex-wrap: wrap;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.title { font-size: 0.98rem; font-weight: 600; }
|
|
80
|
+
.subtitle { font-size: 0.74rem; opacity: 0.74; font-variant-numeric: tabular-nums; }
|
|
81
|
+
.badges { display: flex; gap: 6px; align-items: center; }
|
|
82
|
+
|
|
83
|
+
.pill {
|
|
84
|
+
padding: 2px 8px;
|
|
85
|
+
border-radius: 999px;
|
|
86
|
+
font-size: 0.72rem;
|
|
87
|
+
font-weight: 600;
|
|
88
|
+
background: var(--lux-surface);
|
|
89
|
+
border: 1px solid var(--lux-border);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.pill.ok { color: var(--lux-ok); border-color: rgba(34, 197, 94, 0.4); background: rgba(34, 197, 94, 0.14); }
|
|
93
|
+
.pill.pv { color: var(--lux-pv); border-color: rgba(234, 179, 8, 0.45); background: rgba(234, 179, 8, 0.14); }
|
|
94
|
+
.hidden { display: none !important; }
|
|
95
|
+
|
|
96
|
+
.chart-wrap {
|
|
97
|
+
flex: 1;
|
|
98
|
+
min-height: 150px;
|
|
99
|
+
background: var(--lux-surface);
|
|
100
|
+
border: 1px solid var(--lux-border);
|
|
101
|
+
border-radius: 10px;
|
|
102
|
+
padding: 6px;
|
|
103
|
+
box-sizing: border-box;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
svg {
|
|
107
|
+
width: 100%;
|
|
108
|
+
height: 100%;
|
|
109
|
+
display: block;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.grid-line { stroke: currentColor; stroke-opacity: 0.14; stroke-width: 1; }
|
|
113
|
+
.axis-lbl { font-size: 9.5px; fill: currentColor; opacity: 0.68; font-variant-numeric: tabular-nums; }
|
|
114
|
+
.hyst-band { fill: var(--lux-heating); fill-opacity: 0.16; }
|
|
115
|
+
.curve-main { fill: none; stroke: var(--lux-heating); stroke-width: 2.4; stroke-linecap: round; }
|
|
116
|
+
.curve-preview { fill: none; stroke: var(--lux-pv); stroke-width: 2.2; stroke-dasharray: 5 4; stroke-linecap: round; }
|
|
117
|
+
.limit-line { stroke: var(--lux-limit); stroke-width: 1.4; stroke-dasharray: 4 3; }
|
|
118
|
+
.limit-lbl { font-size: 9px; font-weight: 600; fill: var(--lux-limit); }
|
|
119
|
+
|
|
120
|
+
.live-pulse {
|
|
121
|
+
fill: var(--lux-ok);
|
|
122
|
+
fill-opacity: 0.25;
|
|
123
|
+
transform-box: fill-box;
|
|
124
|
+
transform-origin: center;
|
|
125
|
+
animation: pulse 2s ease-out infinite;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
@keyframes pulse {
|
|
129
|
+
0% { transform: scale(1); opacity: 0.65; }
|
|
130
|
+
100% { transform: scale(2.1); opacity: 0; }
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.legend {
|
|
134
|
+
display: flex;
|
|
135
|
+
justify-content: space-between;
|
|
136
|
+
align-items: center;
|
|
137
|
+
flex-wrap: wrap;
|
|
138
|
+
gap: 8px;
|
|
139
|
+
font-size: 0.72rem;
|
|
140
|
+
opacity: 0.82;
|
|
141
|
+
font-variant-numeric: tabular-nums;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.legend-items { display: flex; gap: 10px; flex-wrap: wrap; }
|
|
145
|
+
.leg { display: inline-flex; align-items: center; gap: 4px; }
|
|
146
|
+
.swatch { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
|
|
147
|
+
|
|
148
|
+
.tuner {
|
|
149
|
+
background: var(--lux-surface);
|
|
150
|
+
border: 1px solid var(--lux-border);
|
|
151
|
+
border-radius: 10px;
|
|
152
|
+
padding: 8px 10px;
|
|
153
|
+
display: flex;
|
|
154
|
+
flex-direction: column;
|
|
155
|
+
gap: 6px;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.tuner-head {
|
|
159
|
+
display: flex;
|
|
160
|
+
justify-content: space-between;
|
|
161
|
+
align-items: center;
|
|
162
|
+
font-size: 0.78rem;
|
|
163
|
+
font-variant-numeric: tabular-nums;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.tuner-val { font-weight: 700; color: var(--lux-heating); }
|
|
167
|
+
.tuner-val.dirty { color: var(--lux-pv); }
|
|
168
|
+
|
|
169
|
+
.slider-row {
|
|
170
|
+
display: flex;
|
|
171
|
+
align-items: center;
|
|
172
|
+
gap: 8px;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
input[type="range"] {
|
|
176
|
+
flex: 1;
|
|
177
|
+
accent-color: var(--lux-heating);
|
|
178
|
+
cursor: pointer;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.btn {
|
|
182
|
+
background: var(--lux-surface);
|
|
183
|
+
color: inherit;
|
|
184
|
+
border: 1px solid var(--lux-border);
|
|
185
|
+
border-radius: 7px;
|
|
186
|
+
padding: 5px 9px;
|
|
187
|
+
font-size: 0.74rem;
|
|
188
|
+
font-weight: 600;
|
|
189
|
+
cursor: pointer;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.btn.primary {
|
|
193
|
+
border-color: rgba(234, 179, 8, 0.55);
|
|
194
|
+
background: rgba(234, 179, 8, 0.18);
|
|
195
|
+
color: var(--lux-pv);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.btn:disabled {
|
|
199
|
+
opacity: 0.4;
|
|
200
|
+
cursor: default;
|
|
201
|
+
}
|
|
202
|
+
</style>
|
|
203
|
+
|
|
204
|
+
<div class="card">
|
|
205
|
+
<div class="header">
|
|
206
|
+
<div>
|
|
207
|
+
<div class="title" data-ref="title">Heizkurve</div>
|
|
208
|
+
<div class="subtitle" data-ref="subtitle">Fußpunkt – · Endpunkt –</div>
|
|
209
|
+
</div>
|
|
210
|
+
<div class="badges">
|
|
211
|
+
<span class="pill pv hidden" data-ref="pvBadge">PV-Boost</span>
|
|
212
|
+
<span class="pill ok" data-ref="statusBadge">–</span>
|
|
213
|
+
</div>
|
|
214
|
+
</div>
|
|
215
|
+
|
|
216
|
+
<div class="chart-wrap">
|
|
217
|
+
<svg viewBox="0 0 460 194" preserveAspectRatio="xMidYMid meet">
|
|
218
|
+
<g data-ref="gridLayer"></g>
|
|
219
|
+
<!-- Hysterese-Korridor -->
|
|
220
|
+
<polygon class="hyst-band" data-ref="hystPoly" points="" />
|
|
221
|
+
<!-- Heizgrenze -->
|
|
222
|
+
<line class="limit-line hidden" data-ref="limitLine" x1="0" x2="0" y1="${CHART.top}" y2="${CHART.bottom}" />
|
|
223
|
+
<text class="limit-lbl hidden" data-ref="limitLabel" x="0" y="${CHART.top + 10}" text-anchor="start">Heizgrenze</text>
|
|
224
|
+
<!-- Aktive Heizkurve -->
|
|
225
|
+
<line class="curve-main" data-ref="curveLine" x1="0" y1="0" x2="0" y2="0" />
|
|
226
|
+
<!-- Gestrichelte Vorschau-Kurve bei Slider-Änderung -->
|
|
227
|
+
<line class="curve-preview hidden" data-ref="previewLine" x1="0" y1="0" x2="0" y2="0" />
|
|
228
|
+
<!-- Regler Rücklauf-Soll Punkt -->
|
|
229
|
+
<circle class="hidden" data-ref="targetDot" r="4.2" fill="#3b82f6" stroke="#ffffff" stroke-width="1.2" />
|
|
230
|
+
<!-- Live-Arbeitspunkt (Außen / Rücklauf-Ist) -->
|
|
231
|
+
<g class="hidden" data-ref="liveGroup">
|
|
232
|
+
<circle class="live-pulse" data-ref="livePulse" r="6" />
|
|
233
|
+
<circle data-ref="liveDot" r="4.8" fill="#22c55e" stroke="#ffffff" stroke-width="1.4" />
|
|
234
|
+
</g>
|
|
235
|
+
</svg>
|
|
236
|
+
</div>
|
|
237
|
+
|
|
238
|
+
<div class="legend">
|
|
239
|
+
<div class="legend-items">
|
|
240
|
+
<span class="leg"><span class="swatch" style="background:#22c55e"></span>Ist: <strong data-ref="legIst">–</strong></span>
|
|
241
|
+
<span class="leg"><span class="swatch" style="background:#3b82f6"></span>Soll: <strong data-ref="legSoll">–</strong></span>
|
|
242
|
+
<span class="leg"><span class="swatch" style="background:#f97316"></span>Hyst: <strong data-ref="legHyst">–</strong></span>
|
|
243
|
+
</div>
|
|
244
|
+
<span data-ref="legOut">Außen: –</span>
|
|
245
|
+
</div>
|
|
246
|
+
|
|
247
|
+
<div class="tuner" data-ref="tunerBar">
|
|
248
|
+
<div class="tuner-head">
|
|
249
|
+
<span>Parallelverschiebung (Offset)</span>
|
|
250
|
+
<span class="tuner-val" data-ref="offsetLabel">0.0 K</span>
|
|
251
|
+
</div>
|
|
252
|
+
<div class="slider-row">
|
|
253
|
+
<button class="btn" type="button" data-ref="btnMinus">−</button>
|
|
254
|
+
<input type="range" min="-5" max="5" step="0.5" value="0" data-ref="offsetSlider" />
|
|
255
|
+
<button class="btn" type="button" data-ref="btnPlus">+</button>
|
|
256
|
+
<button class="btn primary" type="button" data-ref="btnApply" disabled>Übernehmen</button>
|
|
257
|
+
<button class="btn hidden" type="button" data-ref="btnCancel">✕</button>
|
|
258
|
+
</div>
|
|
259
|
+
</div>
|
|
260
|
+
</div>
|
|
261
|
+
`;
|
|
262
|
+
this.shadowRoot.appendChild(tpl.content.cloneNode(true));
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
_collectRefs() {
|
|
266
|
+
super._collectRefs();
|
|
267
|
+
const r = this._refs;
|
|
268
|
+
if (!r.offsetSlider) {
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
r.offsetSlider.addEventListener('input', () => {
|
|
273
|
+
this._pendingOffset = parseFloat(r.offsetSlider.value);
|
|
274
|
+
this._updateView();
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
r.btnMinus.addEventListener('click', () => {
|
|
278
|
+
const cur = this._pendingOffset ?? this._toNum(this._values.offset) ?? 0;
|
|
279
|
+
const minVal = parseFloat(r.offsetSlider.min);
|
|
280
|
+
this._pendingOffset = Math.max(minVal, Math.round((cur - 0.5) * 10) / 10);
|
|
281
|
+
this._updateView();
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
r.btnPlus.addEventListener('click', () => {
|
|
285
|
+
const cur = this._pendingOffset ?? this._toNum(this._values.offset) ?? 0;
|
|
286
|
+
const maxVal = parseFloat(r.offsetSlider.max);
|
|
287
|
+
this._pendingOffset = Math.min(maxVal, Math.round((cur + 0.5) * 10) / 10);
|
|
288
|
+
this._updateView();
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
r.btnApply.addEventListener('click', () => {
|
|
292
|
+
if (this._pendingOffset === null) {
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
const val = Math.round(this._pendingOffset * 10) / 10;
|
|
296
|
+
this._writeState('Settings.02_Heating.heating_temperature', val);
|
|
297
|
+
this._pendingOffset = null;
|
|
298
|
+
this._updateView();
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
r.btnCancel.addEventListener('click', () => {
|
|
302
|
+
this._pendingOffset = null;
|
|
303
|
+
this._updateView();
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
_curveTemp(tOut, fp, ep, offset) {
|
|
308
|
+
return fp + ((ep - fp) * (20 - tOut)) / 40 + offset;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
_xForOutside(tOut) {
|
|
312
|
+
// +20 °C links, -20 °C rechts (klassische Heizkurven-Ausrichtung)
|
|
313
|
+
const ratio = (CHART.tOutMax - tOut) / (CHART.tOutMax - CHART.tOutMin);
|
|
314
|
+
return CHART.left + Math.max(0, Math.min(1, ratio)) * (CHART.right - CHART.left);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
_yForTemp(temp, yMin, yMax) {
|
|
318
|
+
const ratio = (temp - yMin) / Math.max(1, yMax - yMin);
|
|
319
|
+
return CHART.bottom - Math.max(0, Math.min(1, ratio)) * (CHART.bottom - CHART.top);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
_drawGrid(yMin, yMax) {
|
|
323
|
+
const svgNs = 'http://www.w3.org/2000/svg';
|
|
324
|
+
const layer = this._refs.gridLayer;
|
|
325
|
+
while (layer.firstChild) {
|
|
326
|
+
layer.removeChild(layer.firstChild);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
// Vertikale Gitterlinien (+20, +10, 0, -10, -20 °C)
|
|
330
|
+
const xTicks = [20, 10, 0, -10, -20];
|
|
331
|
+
for (const t of xTicks) {
|
|
332
|
+
const x = this._xForOutside(t);
|
|
333
|
+
const line = document.createElementNS(svgNs, 'line');
|
|
334
|
+
line.setAttribute('class', 'grid-line');
|
|
335
|
+
line.setAttribute('x1', x.toFixed(1));
|
|
336
|
+
line.setAttribute('x2', x.toFixed(1));
|
|
337
|
+
line.setAttribute('y1', String(CHART.top));
|
|
338
|
+
line.setAttribute('y2', String(CHART.bottom));
|
|
339
|
+
layer.appendChild(line);
|
|
340
|
+
|
|
341
|
+
const lbl = document.createElementNS(svgNs, 'text');
|
|
342
|
+
lbl.setAttribute('class', 'axis-lbl');
|
|
343
|
+
lbl.setAttribute('x', x.toFixed(1));
|
|
344
|
+
lbl.setAttribute('y', String(CHART.bottom + 14));
|
|
345
|
+
lbl.setAttribute('text-anchor', 'middle');
|
|
346
|
+
lbl.textContent = `${t}°`;
|
|
347
|
+
layer.appendChild(lbl);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
// Horizontale Gitterlinien (4 gleichmäßige Schritte)
|
|
351
|
+
const steps = 4;
|
|
352
|
+
for (let i = 0; i <= steps; i++) {
|
|
353
|
+
const val = yMin + ((yMax - yMin) * i) / steps;
|
|
354
|
+
const y = this._yForTemp(val, yMin, yMax);
|
|
355
|
+
const line = document.createElementNS(svgNs, 'line');
|
|
356
|
+
line.setAttribute('class', 'grid-line');
|
|
357
|
+
line.setAttribute('x1', String(CHART.left));
|
|
358
|
+
line.setAttribute('x2', String(CHART.right));
|
|
359
|
+
line.setAttribute('y1', y.toFixed(1));
|
|
360
|
+
line.setAttribute('y2', y.toFixed(1));
|
|
361
|
+
layer.appendChild(line);
|
|
362
|
+
|
|
363
|
+
const lbl = document.createElementNS(svgNs, 'text');
|
|
364
|
+
lbl.setAttribute('class', 'axis-lbl');
|
|
365
|
+
lbl.setAttribute('x', String(CHART.left - 6));
|
|
366
|
+
lbl.setAttribute('y', (y + 3).toFixed(1));
|
|
367
|
+
lbl.setAttribute('text-anchor', 'end');
|
|
368
|
+
lbl.textContent = `${val.toFixed(0)}°`;
|
|
369
|
+
layer.appendChild(lbl);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
_updateView() {
|
|
374
|
+
const r = this._refs;
|
|
375
|
+
if (!r.title) {
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
const v = this._values;
|
|
380
|
+
const fp = this._toNum(v.basePoint);
|
|
381
|
+
const ep = this._toNum(v.endPoint);
|
|
382
|
+
const liveOffset = this._toNum(v.offset) ?? 0;
|
|
383
|
+
const hyst = this._toNum(v.hysteresis) ?? 1.5;
|
|
384
|
+
const tOut = this._toNum(v.outsideTemp);
|
|
385
|
+
const tAvg = this._toNum(v.avgOutsideTemp);
|
|
386
|
+
const rlIst = this._toNum(v.returnTemp);
|
|
387
|
+
const rlSoll = this._toNum(v.returnTarget);
|
|
388
|
+
const limitOn = this._toBool(v.heatingLimitActive);
|
|
389
|
+
const limitTemp = this._toNum(v.heatingLimitTemp);
|
|
390
|
+
|
|
391
|
+
r.title.textContent = this._settings?.title || 'Heizkurve';
|
|
392
|
+
r.subtitle.textContent = `Fußpunkt ${this._fmtTemp(fp)} · Endpunkt ${this._fmtTemp(ep)} · Offset ${liveOffset >= 0 ? '+' : ''}${liveOffset.toFixed(1)} K`;
|
|
393
|
+
r.statusBadge.textContent = v.heatingStatus || '–';
|
|
394
|
+
r.pvBadge.classList.toggle('hidden', !this._toBool(v.pvBoost));
|
|
395
|
+
r.tunerBar.classList.toggle('hidden', this._settings?.allowEdit === false);
|
|
396
|
+
|
|
397
|
+
r.legIst.textContent = this._fmtTemp(rlIst);
|
|
398
|
+
r.legSoll.textContent = this._fmtTemp(rlSoll);
|
|
399
|
+
r.legHyst.textContent = `±${hyst.toFixed(1)} K`;
|
|
400
|
+
r.legOut.textContent = `Außen: ${this._fmtTemp(tOut)}${tAvg !== null ? ` (Ø ${tAvg.toFixed(1)}°)` : ''}`;
|
|
401
|
+
|
|
402
|
+
// Slider & Dirty-Zustand
|
|
403
|
+
const sliderMin = Math.min(-5, Math.floor(liveOffset - 2));
|
|
404
|
+
const sliderMax = Math.max(5, Math.ceil(liveOffset + 2));
|
|
405
|
+
r.offsetSlider.min = String(sliderMin);
|
|
406
|
+
r.offsetSlider.max = String(sliderMax);
|
|
407
|
+
|
|
408
|
+
const shownOffset = this._pendingOffset !== null ? this._pendingOffset : liveOffset;
|
|
409
|
+
const isDirty = this._pendingOffset !== null && Math.abs(this._pendingOffset - liveOffset) >= 0.05;
|
|
410
|
+
r.offsetSlider.value = String(shownOffset);
|
|
411
|
+
r.offsetLabel.textContent = `${shownOffset >= 0 ? '+' : ''}${shownOffset.toFixed(1)} K${isDirty ? ' (Vorschau)' : ''}`;
|
|
412
|
+
r.offsetLabel.classList.toggle('dirty', isDirty);
|
|
413
|
+
r.btnApply.disabled = !isDirty || this._editMode;
|
|
414
|
+
r.btnCancel.classList.toggle('hidden', !isDirty);
|
|
415
|
+
|
|
416
|
+
if (fp === null || ep === null) {
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
// Dynamische Y-Skalierung
|
|
421
|
+
const cLeft = this._curveTemp(20, fp, ep, liveOffset);
|
|
422
|
+
const cRight = this._curveTemp(-20, fp, ep, liveOffset);
|
|
423
|
+
const pLeft = this._curveTemp(20, fp, ep, shownOffset);
|
|
424
|
+
const pRight = this._curveTemp(-20, fp, ep, shownOffset);
|
|
425
|
+
|
|
426
|
+
const sampleVals = [cLeft - hyst, cLeft + hyst, cRight - hyst, cRight + hyst, pLeft, pRight];
|
|
427
|
+
if (rlIst !== null) {
|
|
428
|
+
sampleVals.push(rlIst);
|
|
429
|
+
}
|
|
430
|
+
if (rlSoll !== null) {
|
|
431
|
+
sampleVals.push(rlSoll);
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
const rawMin = Math.min(...sampleVals);
|
|
435
|
+
const rawMax = Math.max(...sampleVals);
|
|
436
|
+
const yMin = Math.floor((rawMin - 2) / 2) * 2;
|
|
437
|
+
const yMax = Math.max(yMin + 10, Math.ceil((rawMax + 2) / 2) * 2);
|
|
438
|
+
|
|
439
|
+
this._drawGrid(yMin, yMax);
|
|
440
|
+
|
|
441
|
+
const xL = CHART.left;
|
|
442
|
+
const xR = CHART.right;
|
|
443
|
+
|
|
444
|
+
// Aktive Kurve
|
|
445
|
+
const yL = this._yForTemp(cLeft, yMin, yMax);
|
|
446
|
+
const yR = this._yForTemp(cRight, yMin, yMax);
|
|
447
|
+
r.curveLine.setAttribute('x1', xL.toFixed(1));
|
|
448
|
+
r.curveLine.setAttribute('y1', yL.toFixed(1));
|
|
449
|
+
r.curveLine.setAttribute('x2', xR.toFixed(1));
|
|
450
|
+
r.curveLine.setAttribute('y2', yR.toFixed(1));
|
|
451
|
+
|
|
452
|
+
// Hysterese-Band
|
|
453
|
+
const yLHigh = this._yForTemp(cLeft + hyst, yMin, yMax);
|
|
454
|
+
const yLLow = this._yForTemp(cLeft - hyst, yMin, yMax);
|
|
455
|
+
const yRHigh = this._yForTemp(cRight + hyst, yMin, yMax);
|
|
456
|
+
const yRLow = this._yForTemp(cRight - hyst, yMin, yMax);
|
|
457
|
+
r.hystPoly.setAttribute(
|
|
458
|
+
'points',
|
|
459
|
+
`${xL.toFixed(1)},${yLHigh.toFixed(1)} ${xR.toFixed(1)},${yRHigh.toFixed(1)} ${xR.toFixed(1)},${yRLow.toFixed(1)} ${xL.toFixed(1)},${yLLow.toFixed(1)}`,
|
|
460
|
+
);
|
|
461
|
+
|
|
462
|
+
// Vorschau-Kurve
|
|
463
|
+
if (isDirty) {
|
|
464
|
+
r.previewLine.classList.remove('hidden');
|
|
465
|
+
r.previewLine.setAttribute('x1', xL.toFixed(1));
|
|
466
|
+
r.previewLine.setAttribute('y1', this._yForTemp(pLeft, yMin, yMax).toFixed(1));
|
|
467
|
+
r.previewLine.setAttribute('x2', xR.toFixed(1));
|
|
468
|
+
r.previewLine.setAttribute('y2', this._yForTemp(pRight, yMin, yMax).toFixed(1));
|
|
469
|
+
} else {
|
|
470
|
+
r.previewLine.classList.add('hidden');
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
// Heizgrenze
|
|
474
|
+
if (limitOn && limitTemp !== null && limitTemp >= CHART.tOutMin && limitTemp <= CHART.tOutMax) {
|
|
475
|
+
const xLim = this._xForOutside(limitTemp);
|
|
476
|
+
r.limitLine.classList.remove('hidden');
|
|
477
|
+
r.limitLine.setAttribute('x1', xLim.toFixed(1));
|
|
478
|
+
r.limitLine.setAttribute('x2', xLim.toFixed(1));
|
|
479
|
+
r.limitLabel.classList.remove('hidden');
|
|
480
|
+
r.limitLabel.setAttribute('x', (xLim + 4).toFixed(1));
|
|
481
|
+
r.limitLabel.textContent = `HG ${limitTemp.toFixed(1)}°`;
|
|
482
|
+
} else {
|
|
483
|
+
r.limitLine.classList.add('hidden');
|
|
484
|
+
r.limitLabel.classList.add('hidden');
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
// Regler-Sollpunkt
|
|
488
|
+
if (tOut !== null && rlSoll !== null) {
|
|
489
|
+
const xOut = this._xForOutside(tOut);
|
|
490
|
+
const ySoll = this._yForTemp(rlSoll, yMin, yMax);
|
|
491
|
+
r.targetDot.classList.remove('hidden');
|
|
492
|
+
r.targetDot.setAttribute('cx', xOut.toFixed(1));
|
|
493
|
+
r.targetDot.setAttribute('cy', ySoll.toFixed(1));
|
|
494
|
+
} else {
|
|
495
|
+
r.targetDot.classList.add('hidden');
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
// Live-Arbeitspunkt
|
|
499
|
+
if (tOut !== null && rlIst !== null) {
|
|
500
|
+
const xOut = this._xForOutside(tOut);
|
|
501
|
+
const yIst = this._yForTemp(rlIst, yMin, yMax);
|
|
502
|
+
r.liveGroup.classList.remove('hidden');
|
|
503
|
+
r.liveDot.setAttribute('cx', xOut.toFixed(1));
|
|
504
|
+
r.liveDot.setAttribute('cy', yIst.toFixed(1));
|
|
505
|
+
r.livePulse.setAttribute('cx', xOut.toFixed(1));
|
|
506
|
+
r.livePulse.setAttribute('cy', yIst.toFixed(1));
|
|
507
|
+
} else {
|
|
508
|
+
r.liveGroup.classList.add('hidden');
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
if (!customElements.get('luxtronik-heatcurve-tuner')) {
|
|
514
|
+
customElements.define('luxtronik-heatcurve-tuner', LuxtronikHeatcurveTuner);
|
|
515
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"manifestVersion": 1,
|
|
3
|
+
"tag": "luxtronik-heatcurve-tuner",
|
|
4
|
+
"module": "./luxtronik-heatcurve-tuner.js",
|
|
5
|
+
"name": {
|
|
6
|
+
"en": "Luxtronik Live Heating Curve & Offset",
|
|
7
|
+
"de": "Luxtronik Live-Heizkurve & Offset"
|
|
8
|
+
},
|
|
9
|
+
"size": {
|
|
10
|
+
"width": 500,
|
|
11
|
+
"height": 340
|
|
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": "Heizkurve",
|
|
27
|
+
"label": {
|
|
28
|
+
"en": "Title",
|
|
29
|
+
"de": "Titel"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"allowEdit": {
|
|
33
|
+
"type": "checkbox",
|
|
34
|
+
"default": true,
|
|
35
|
+
"label": {
|
|
36
|
+
"en": "Allow offset adjustment",
|
|
37
|
+
"de": "Parallelverschiebung verstellbar"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|