iobroker.luxtronik2-controller 1.2.1 → 1.3.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 +21 -16
- package/admin/jsonConfig.json +50 -6
- 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 +505 -0
- package/admin/webcomponents/luxtronik-dhw-tank.json +42 -0
- package/admin/webcomponents/luxtronik-diagnostics-feed.js +431 -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 +2 -0
- package/build/mapping/info.js.map +2 -2
- package/build/pvManager.js +31 -17
- package/build/pvManager.js.map +2 -2
- package/io-package.json +39 -29
- package/package.json +2 -2
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,505 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* <luxtronik-dhw-tank>
|
|
3
|
+
* Warmwasser-Speicher mit Nachlade-Linie und animiertem ZIP-Countdown-Ring
|
|
4
|
+
* für `@iobroker/web-components`.
|
|
5
|
+
*/
|
|
6
|
+
import { LuxtronikBaseCard } from './luxtronik-base.js';
|
|
7
|
+
|
|
8
|
+
const RING_CIRCUMFERENCE = 2 * Math.PI * 38;
|
|
9
|
+
|
|
10
|
+
class LuxtronikDhwTank extends LuxtronikBaseCard {
|
|
11
|
+
static get stateMap() {
|
|
12
|
+
return {
|
|
13
|
+
wwTemp: 'Information.01_Temperatures.Wamwassertemperatur_Ist',
|
|
14
|
+
wwTarget: 'Information.01_Temperatures.Wamwassertemperatur_Soll',
|
|
15
|
+
wwHyst: 'Settings.03_HotWater.hotWaterTemperatureHysteresis',
|
|
16
|
+
wwStatus: 'Information.08_OperatingState.opStateHotWaterString',
|
|
17
|
+
modeCode: 'Information.08_OperatingState.WP_BZ_akt',
|
|
18
|
+
vd1: 'Information.03_Outputs.VD1out',
|
|
19
|
+
zipActive: 'Information.03_Outputs.Virtual_ZIP_Status',
|
|
20
|
+
zipRemaining: 'Information.03_Outputs.Virtual_ZIP_Remaining_Time',
|
|
21
|
+
zipDurationNormal: 'Settings.05_ZIP.zip_aktiv',
|
|
22
|
+
pvBoost: 'Information.17_PV_Surplus.pv_boost_active',
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
static get actionMap() {
|
|
27
|
+
return {
|
|
28
|
+
'activate-zip': 'Actions.Activate_Zip',
|
|
29
|
+
'force-ww': 'Actions.Zwangswarmwasser',
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
constructor() {
|
|
34
|
+
super();
|
|
35
|
+
this._zipPeakSec = 0;
|
|
36
|
+
this._pendingTarget = null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
_renderBase() {
|
|
40
|
+
const tpl = document.createElement('template');
|
|
41
|
+
tpl.innerHTML = `
|
|
42
|
+
<style>
|
|
43
|
+
:host {
|
|
44
|
+
--lux-surface: rgba(127, 127, 127, 0.11);
|
|
45
|
+
--lux-border: rgba(127, 127, 127, 0.24);
|
|
46
|
+
--lux-ww: #3b82f6;
|
|
47
|
+
--lux-hot: #ef4444;
|
|
48
|
+
--lux-warm: #f97316;
|
|
49
|
+
--lux-ok: #22c55e;
|
|
50
|
+
--lux-pv: #eab308;
|
|
51
|
+
display: block;
|
|
52
|
+
width: 100%;
|
|
53
|
+
height: 100%;
|
|
54
|
+
box-sizing: border-box;
|
|
55
|
+
font-family: inherit;
|
|
56
|
+
color: inherit;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.card {
|
|
60
|
+
width: 100%;
|
|
61
|
+
height: 100%;
|
|
62
|
+
box-sizing: border-box;
|
|
63
|
+
display: flex;
|
|
64
|
+
flex-direction: column;
|
|
65
|
+
gap: 10px;
|
|
66
|
+
padding: 12px;
|
|
67
|
+
overflow: auto;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.header {
|
|
71
|
+
display: flex;
|
|
72
|
+
justify-content: space-between;
|
|
73
|
+
align-items: center;
|
|
74
|
+
gap: 8px;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.title { font-size: 0.98rem; font-weight: 600; }
|
|
78
|
+
.badges { display: flex; gap: 6px; align-items: center; }
|
|
79
|
+
|
|
80
|
+
.pill {
|
|
81
|
+
padding: 2px 8px;
|
|
82
|
+
border-radius: 999px;
|
|
83
|
+
font-size: 0.72rem;
|
|
84
|
+
font-weight: 600;
|
|
85
|
+
background: var(--lux-surface);
|
|
86
|
+
border: 1px solid var(--lux-border);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.pill.charging { color: var(--lux-ww); border-color: rgba(59, 130, 246, 0.45); background: rgba(59, 130, 246, 0.16); }
|
|
90
|
+
.pill.ok { color: var(--lux-ok); border-color: rgba(34, 197, 94, 0.4); background: rgba(34, 197, 94, 0.14); }
|
|
91
|
+
.pill.pv { color: var(--lux-pv); border-color: rgba(234, 179, 8, 0.45); background: rgba(234, 179, 8, 0.14); }
|
|
92
|
+
.hidden { display: none !important; }
|
|
93
|
+
|
|
94
|
+
.body {
|
|
95
|
+
flex: 1;
|
|
96
|
+
display: grid;
|
|
97
|
+
grid-template-columns: 118px 1fr;
|
|
98
|
+
gap: 12px;
|
|
99
|
+
align-items: center;
|
|
100
|
+
min-height: 0;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.tank-wrap {
|
|
104
|
+
display: flex;
|
|
105
|
+
justify-content: center;
|
|
106
|
+
align-items: center;
|
|
107
|
+
height: 100%;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.tank-svg {
|
|
111
|
+
width: 112px;
|
|
112
|
+
height: 168px;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.side {
|
|
116
|
+
display: flex;
|
|
117
|
+
flex-direction: column;
|
|
118
|
+
gap: 10px;
|
|
119
|
+
align-items: stretch;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.metrics {
|
|
123
|
+
background: var(--lux-surface);
|
|
124
|
+
border: 1px solid var(--lux-border);
|
|
125
|
+
border-radius: 10px;
|
|
126
|
+
padding: 8px 10px;
|
|
127
|
+
display: flex;
|
|
128
|
+
flex-direction: column;
|
|
129
|
+
gap: 4px;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.row {
|
|
133
|
+
display: flex;
|
|
134
|
+
justify-content: space-between;
|
|
135
|
+
font-size: 0.78rem;
|
|
136
|
+
font-variant-numeric: tabular-nums;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.row .lbl { opacity: 0.72; }
|
|
140
|
+
.row .val { font-weight: 600; }
|
|
141
|
+
|
|
142
|
+
.zip-area {
|
|
143
|
+
display: flex;
|
|
144
|
+
align-items: center;
|
|
145
|
+
gap: 10px;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.zip-btn {
|
|
149
|
+
position: relative;
|
|
150
|
+
width: 88px;
|
|
151
|
+
height: 88px;
|
|
152
|
+
flex-shrink: 0;
|
|
153
|
+
border: none;
|
|
154
|
+
background: transparent;
|
|
155
|
+
padding: 0;
|
|
156
|
+
cursor: pointer;
|
|
157
|
+
color: inherit;
|
|
158
|
+
display: flex;
|
|
159
|
+
align-items: center;
|
|
160
|
+
justify-content: center;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.zip-btn:active { transform: scale(0.96); }
|
|
164
|
+
|
|
165
|
+
.zip-ring {
|
|
166
|
+
position: absolute;
|
|
167
|
+
inset: 0;
|
|
168
|
+
width: 88px;
|
|
169
|
+
height: 88px;
|
|
170
|
+
transform: rotate(-90deg);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.ring-bg {
|
|
174
|
+
fill: var(--lux-surface);
|
|
175
|
+
stroke: var(--lux-border);
|
|
176
|
+
stroke-width: 5;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.ring-fg {
|
|
180
|
+
fill: none;
|
|
181
|
+
stroke: var(--lux-ww);
|
|
182
|
+
stroke-width: 5;
|
|
183
|
+
stroke-linecap: round;
|
|
184
|
+
stroke-dasharray: ${RING_CIRCUMFERENCE.toFixed(2)};
|
|
185
|
+
stroke-dashoffset: ${RING_CIRCUMFERENCE.toFixed(2)};
|
|
186
|
+
transition: stroke-dashoffset 0.45s linear, stroke 0.25s ease;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.zip-btn.active .ring-fg { stroke: var(--lux-ok); }
|
|
190
|
+
|
|
191
|
+
.zip-center {
|
|
192
|
+
position: relative;
|
|
193
|
+
z-index: 1;
|
|
194
|
+
display: flex;
|
|
195
|
+
flex-direction: column;
|
|
196
|
+
align-items: center;
|
|
197
|
+
line-height: 1.15;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.zip-title { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em; }
|
|
201
|
+
.zip-sub { font-size: 0.78rem; font-weight: 600; opacity: 0.85; font-variant-numeric: tabular-nums; }
|
|
202
|
+
|
|
203
|
+
.side-actions {
|
|
204
|
+
display: flex;
|
|
205
|
+
flex-direction: column;
|
|
206
|
+
gap: 6px;
|
|
207
|
+
flex: 1;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.force-btn {
|
|
211
|
+
background: var(--lux-surface);
|
|
212
|
+
color: inherit;
|
|
213
|
+
border: 1px solid var(--lux-border);
|
|
214
|
+
border-radius: 8px;
|
|
215
|
+
padding: 8px 10px;
|
|
216
|
+
font-size: 0.76rem;
|
|
217
|
+
font-weight: 600;
|
|
218
|
+
cursor: pointer;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.force-btn:hover {
|
|
222
|
+
border-color: var(--lux-ww);
|
|
223
|
+
background: rgba(59, 130, 246, 0.16);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.hint {
|
|
227
|
+
font-size: 0.72rem;
|
|
228
|
+
opacity: 0.7;
|
|
229
|
+
line-height: 1.25;
|
|
230
|
+
}
|
|
231
|
+
.temp-ctrl {
|
|
232
|
+
display: flex;
|
|
233
|
+
align-items: center;
|
|
234
|
+
gap: 4px;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.step-btn {
|
|
238
|
+
width: 28px;
|
|
239
|
+
height: 28px;
|
|
240
|
+
border-radius: 7px;
|
|
241
|
+
border: 1px solid var(--lux-border);
|
|
242
|
+
background: var(--lux-surface);
|
|
243
|
+
color: inherit;
|
|
244
|
+
font-weight: 700;
|
|
245
|
+
cursor: pointer;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.temp-input {
|
|
249
|
+
flex: 1;
|
|
250
|
+
min-width: 0;
|
|
251
|
+
height: 28px;
|
|
252
|
+
box-sizing: border-box;
|
|
253
|
+
text-align: center;
|
|
254
|
+
border-radius: 7px;
|
|
255
|
+
border: 1px solid var(--lux-border);
|
|
256
|
+
background: var(--lux-surface);
|
|
257
|
+
color: inherit;
|
|
258
|
+
font-size: 0.78rem;
|
|
259
|
+
font-weight: 700;
|
|
260
|
+
font-variant-numeric: tabular-nums;
|
|
261
|
+
}
|
|
262
|
+
</style>
|
|
263
|
+
|
|
264
|
+
<div class="card">
|
|
265
|
+
<div class="header">
|
|
266
|
+
<div class="title" data-ref="title">Warmwasser</div>
|
|
267
|
+
<div class="badges">
|
|
268
|
+
<span class="pill pv hidden" data-ref="pvBadge">PV</span>
|
|
269
|
+
<span class="pill ok" data-ref="statusBadge">–</span>
|
|
270
|
+
</div>
|
|
271
|
+
</div>
|
|
272
|
+
|
|
273
|
+
<div class="body">
|
|
274
|
+
<!-- Grafischer Speicher-Zylinder -->
|
|
275
|
+
<div class="tank-wrap">
|
|
276
|
+
<svg class="tank-svg" viewBox="0 0 116 174">
|
|
277
|
+
<defs>
|
|
278
|
+
<linearGradient id="tankGrad" x1="0" y1="1" x2="0" y2="0">
|
|
279
|
+
<stop offset="0%" stop-color="#2563eb" />
|
|
280
|
+
<stop offset="55%" stop-color="#f97316" />
|
|
281
|
+
<stop offset="100%" stop-color="#ef4444" />
|
|
282
|
+
</linearGradient>
|
|
283
|
+
<clipPath id="tankClip">
|
|
284
|
+
<rect x="14" y="14" width="84" height="146" rx="22" />
|
|
285
|
+
</clipPath>
|
|
286
|
+
</defs>
|
|
287
|
+
|
|
288
|
+
<!-- Speicherhülle Hintergrund -->
|
|
289
|
+
<rect x="14" y="14" width="84" height="146" rx="22" fill="rgba(127,127,127,0.14)" />
|
|
290
|
+
|
|
291
|
+
<!-- Dynamischer Füllstand -->
|
|
292
|
+
<g clip-path="url(#tankClip)">
|
|
293
|
+
<rect x="14" y="160" width="84" height="0" fill="url(#tankGrad)" opacity="0.82" data-ref="tankFill" />
|
|
294
|
+
</g>
|
|
295
|
+
|
|
296
|
+
<!-- Nachlade-Linie (Soll - Hysterese) -->
|
|
297
|
+
<line x1="12" x2="100" y1="110" y2="110" stroke="#93c5fd" stroke-width="1.6" stroke-dasharray="4 3" data-ref="hystLine" />
|
|
298
|
+
<!-- Soll-Linie -->
|
|
299
|
+
<line x1="12" x2="100" y1="44" y2="44" stroke="#ffffff" stroke-width="1.8" opacity="0.85" data-ref="targetLine" />
|
|
300
|
+
|
|
301
|
+
<!-- Speicher-Kontur -->
|
|
302
|
+
<rect x="14" y="14" width="84" height="146" rx="22" fill="none" stroke="currentColor" stroke-opacity="0.32" stroke-width="2" />
|
|
303
|
+
|
|
304
|
+
<!-- Große Ist-Temperatur im Speicher -->
|
|
305
|
+
<text x="56" y="88" text-anchor="middle" font-size="20" font-weight="700" fill="#ffffff" style="text-shadow:0 1px 4px rgba(0,0,0,0.55)" data-ref="wwTemp">–</text>
|
|
306
|
+
<text x="56" y="106" text-anchor="middle" font-size="10" font-weight="600" fill="#ffffff" opacity="0.9" data-ref="reservePct">–</text>
|
|
307
|
+
</svg>
|
|
308
|
+
</div>
|
|
309
|
+
|
|
310
|
+
<!-- Rechte Seite: Kennwerte + ZIP-Countdown-Button -->
|
|
311
|
+
<div class="side">
|
|
312
|
+
<div class="metrics">
|
|
313
|
+
<div class="row"><span class="lbl">Sollwert</span><span class="val" data-ref="wwTarget">–</span></div>
|
|
314
|
+
<div class="row"><span class="lbl">Nachladen ab</span><span class="val" data-ref="rechargeAt">–</span></div>
|
|
315
|
+
<div class="row"><span class="lbl">Reserve</span><span class="val" data-ref="reserveK">–</span></div>
|
|
316
|
+
</div>
|
|
317
|
+
|
|
318
|
+
<div class="zip-area">
|
|
319
|
+
<button class="zip-btn" type="button" data-action="activate-zip" data-ref="zipBtn" title="Zirkulationspumpe starten">
|
|
320
|
+
<svg class="zip-ring" viewBox="0 0 88 88">
|
|
321
|
+
<circle class="ring-bg" cx="44" cy="44" r="38" />
|
|
322
|
+
<circle class="ring-fg" cx="44" cy="44" r="38" data-ref="zipRing" />
|
|
323
|
+
</svg>
|
|
324
|
+
<div class="zip-center">
|
|
325
|
+
<span class="zip-title" data-ref="zipTitle">ZIP</span>
|
|
326
|
+
<span class="zip-sub" data-ref="zipTimer">Start</span>
|
|
327
|
+
</div>
|
|
328
|
+
</button>
|
|
329
|
+
|
|
330
|
+
<div class="side-actions">
|
|
331
|
+
<div class="temp-ctrl" data-ref="tempCtrl">
|
|
332
|
+
<button class="step-btn" type="button" data-ref="btnTempMinus">−</button>
|
|
333
|
+
<input class="temp-input" type="number" min="35" max="65" step="0.5" data-ref="tempInput" />
|
|
334
|
+
<button class="step-btn" type="button" data-ref="btnTempPlus">+</button>
|
|
335
|
+
</div>
|
|
336
|
+
<button class="force-btn" type="button" data-ref="forceBtn">1× Aufheizen</button>
|
|
337
|
+
<div class="hint" data-ref="hintText">Zirkulation bereit</div>
|
|
338
|
+
</div>
|
|
339
|
+
</div>
|
|
340
|
+
</div>
|
|
341
|
+
</div>
|
|
342
|
+
</div>
|
|
343
|
+
`;
|
|
344
|
+
this.shadowRoot.appendChild(tpl.content.cloneNode(true));
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
_tempToY(temp) {
|
|
348
|
+
// Skala 20 °C (unten y=154) bis 65 °C (oben y=20)
|
|
349
|
+
const clamped = Math.max(20, Math.min(65, temp));
|
|
350
|
+
const ratio = (clamped - 20) / (65 - 20);
|
|
351
|
+
return 154 - ratio * 134;
|
|
352
|
+
}
|
|
353
|
+
_collectRefs() {
|
|
354
|
+
super._collectRefs();
|
|
355
|
+
const r = this._refs;
|
|
356
|
+
if (!r.tempInput) {
|
|
357
|
+
return;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
const clamp = val => Math.max(35, Math.min(65, Math.round(val * 2) / 2));
|
|
361
|
+
|
|
362
|
+
r.btnTempMinus.addEventListener('click', () => {
|
|
363
|
+
const cur = this._pendingTarget ?? this._toNum(this._values.wwTarget) ?? 54;
|
|
364
|
+
this._pendingTarget = clamp(cur - 1);
|
|
365
|
+
this._updateView();
|
|
366
|
+
});
|
|
367
|
+
|
|
368
|
+
r.btnTempPlus.addEventListener('click', () => {
|
|
369
|
+
const cur = this._pendingTarget ?? this._toNum(this._values.wwTarget) ?? 54;
|
|
370
|
+
this._pendingTarget = clamp(cur + 1);
|
|
371
|
+
this._updateView();
|
|
372
|
+
});
|
|
373
|
+
|
|
374
|
+
r.tempInput.addEventListener('change', () => {
|
|
375
|
+
const val = this._toNum(r.tempInput.value);
|
|
376
|
+
this._pendingTarget = val !== null ? clamp(val) : null;
|
|
377
|
+
this._updateView();
|
|
378
|
+
});
|
|
379
|
+
|
|
380
|
+
r.forceBtn.addEventListener('click', () => {
|
|
381
|
+
const liveTarget = this._toNum(this._values.wwTarget);
|
|
382
|
+
if (
|
|
383
|
+
this._pendingTarget !== null &&
|
|
384
|
+
(liveTarget === null || Math.abs(this._pendingTarget - liveTarget) >= 0.1)
|
|
385
|
+
) {
|
|
386
|
+
this._writeState('Settings.03_HotWater.temperature_hot_water_target', this._pendingTarget);
|
|
387
|
+
this._pendingTarget = null;
|
|
388
|
+
this._updateView();
|
|
389
|
+
} else {
|
|
390
|
+
this._triggerAction('force-ww');
|
|
391
|
+
}
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
_updateView() {
|
|
396
|
+
const r = this._refs;
|
|
397
|
+
if (!r.title) {
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
const v = this._values;
|
|
402
|
+
const wwIst = this._toNum(v.wwTemp);
|
|
403
|
+
const wwTarget = this._toNum(v.wwTarget);
|
|
404
|
+
const wwHyst = this._toNum(v.wwHyst);
|
|
405
|
+
const rechargeTemp = wwTarget !== null && wwHyst !== null ? wwTarget - wwHyst : null;
|
|
406
|
+
|
|
407
|
+
const isCharging = this._toNum(v.modeCode) === 1 && this._toBool(v.vd1);
|
|
408
|
+
const zipActive = this._toBool(v.zipActive);
|
|
409
|
+
const zipRem = this._toNum(v.zipRemaining) ?? 0;
|
|
410
|
+
const zipBaseDur = this._toNum(v.zipDurationNormal) ?? 120;
|
|
411
|
+
|
|
412
|
+
r.title.textContent = this._settings?.title || 'Warmwasser';
|
|
413
|
+
r.pvBadge.classList.toggle('hidden', !this._toBool(v.pvBoost));
|
|
414
|
+
r.forceBtn.classList.toggle('hidden', this._settings?.showForceButton === false);
|
|
415
|
+
|
|
416
|
+
const showForce = this._settings?.showForceButton !== false;
|
|
417
|
+
r.tempCtrl.classList.toggle('hidden', !showForce);
|
|
418
|
+
|
|
419
|
+
const shownTarget = this._pendingTarget ?? wwTarget;
|
|
420
|
+
const isTargetDirty =
|
|
421
|
+
this._pendingTarget !== null && (wwTarget === null || Math.abs(this._pendingTarget - wwTarget) >= 0.1);
|
|
422
|
+
if (document.activeElement !== r.tempInput && shownTarget !== null) {
|
|
423
|
+
r.tempInput.value = shownTarget.toFixed(1);
|
|
424
|
+
}
|
|
425
|
+
r.forceBtn.textContent = isTargetDirty ? `Aufheizen (${shownTarget.toFixed(1)}°)` : '1× Aufheizen';
|
|
426
|
+
if (isCharging) {
|
|
427
|
+
r.statusBadge.textContent = 'Lädt aktiv';
|
|
428
|
+
r.statusBadge.className = 'pill charging';
|
|
429
|
+
} else {
|
|
430
|
+
r.statusBadge.textContent = v.wwStatus || 'Bereit';
|
|
431
|
+
r.statusBadge.className = 'pill ok';
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
r.wwTemp.textContent = wwIst === null ? '–' : `${wwIst.toFixed(1)}°`;
|
|
435
|
+
r.wwTarget.textContent = this._fmtTemp(wwTarget);
|
|
436
|
+
r.rechargeAt.textContent = this._fmtTemp(rechargeTemp);
|
|
437
|
+
|
|
438
|
+
if (wwIst !== null && rechargeTemp !== null) {
|
|
439
|
+
const diff = wwIst - rechargeTemp;
|
|
440
|
+
r.reserveK.textContent = diff >= 0 ? `+${diff.toFixed(1)} K` : `${diff.toFixed(1)} K`;
|
|
441
|
+
} else {
|
|
442
|
+
r.reserveK.textContent = '–';
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
// Speicher-Füllstand & Linien im SVG
|
|
446
|
+
if (wwIst !== null) {
|
|
447
|
+
const yFill = this._tempToY(wwIst);
|
|
448
|
+
r.tankFill.setAttribute('y', yFill.toFixed(1));
|
|
449
|
+
r.tankFill.setAttribute('height', Math.max(0, 160 - yFill).toFixed(1));
|
|
450
|
+
} else {
|
|
451
|
+
r.tankFill.setAttribute('y', '160');
|
|
452
|
+
r.tankFill.setAttribute('height', '0');
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
if (wwTarget !== null) {
|
|
456
|
+
const yTarget = this._tempToY(wwTarget);
|
|
457
|
+
r.targetLine.setAttribute('y1', yTarget.toFixed(1));
|
|
458
|
+
r.targetLine.setAttribute('y2', yTarget.toFixed(1));
|
|
459
|
+
r.targetLine.style.opacity = '0.85';
|
|
460
|
+
} else {
|
|
461
|
+
r.targetLine.style.opacity = '0';
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
if (rechargeTemp !== null) {
|
|
465
|
+
const yHyst = this._tempToY(rechargeTemp);
|
|
466
|
+
r.hystLine.setAttribute('y1', yHyst.toFixed(1));
|
|
467
|
+
r.hystLine.setAttribute('y2', yHyst.toFixed(1));
|
|
468
|
+
r.hystLine.style.opacity = '0.85';
|
|
469
|
+
} else {
|
|
470
|
+
r.hystLine.style.opacity = '0';
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
if (wwIst !== null && wwTarget !== null && rechargeTemp !== null && wwTarget > rechargeTemp) {
|
|
474
|
+
const pct = Math.max(0, Math.min(100, ((wwIst - rechargeTemp) / (wwTarget - rechargeTemp)) * 100));
|
|
475
|
+
r.reservePct.textContent = `${pct.toFixed(0)}% Reserve`;
|
|
476
|
+
} else {
|
|
477
|
+
r.reservePct.textContent = '';
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
// ZIP-Countdown-Ring
|
|
481
|
+
if (zipActive && zipRem > 0) {
|
|
482
|
+
if (zipRem > this._zipPeakSec) {
|
|
483
|
+
this._zipPeakSec = zipRem;
|
|
484
|
+
}
|
|
485
|
+
const maxSec = Math.max(this._zipPeakSec, zipBaseDur, 1);
|
|
486
|
+
const frac = Math.max(0, Math.min(1, zipRem / maxSec));
|
|
487
|
+
r.zipRing.style.strokeDashoffset = (RING_CIRCUMFERENCE * (1 - frac)).toFixed(2);
|
|
488
|
+
r.zipBtn.classList.add('active');
|
|
489
|
+
r.zipTitle.textContent = 'ZIP LÄUFT';
|
|
490
|
+
r.zipTimer.textContent = this._fmtSec(zipRem);
|
|
491
|
+
r.hintText.textContent = 'Warmes Wasser liegt gleich an';
|
|
492
|
+
} else {
|
|
493
|
+
this._zipPeakSec = 0;
|
|
494
|
+
r.zipRing.style.strokeDashoffset = RING_CIRCUMFERENCE.toFixed(2);
|
|
495
|
+
r.zipBtn.classList.remove('active');
|
|
496
|
+
r.zipTitle.textContent = 'ZIP';
|
|
497
|
+
r.zipTimer.textContent = 'Start';
|
|
498
|
+
r.hintText.textContent = isCharging ? 'Speicher wird gerade aufgeheizt' : 'Zirkulation bereit';
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
if (!customElements.get('luxtronik-dhw-tank')) {
|
|
504
|
+
customElements.define('luxtronik-dhw-tank', LuxtronikDhwTank);
|
|
505
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"manifestVersion": 1,
|
|
3
|
+
"tag": "luxtronik-dhw-tank",
|
|
4
|
+
"module": "./luxtronik-dhw-tank.js",
|
|
5
|
+
"name": {
|
|
6
|
+
"en": "Luxtronik Hot Water Tank & ZIP",
|
|
7
|
+
"de": "Luxtronik Warmwasser-Speicher & ZIP"
|
|
8
|
+
},
|
|
9
|
+
"size": {
|
|
10
|
+
"width": 360,
|
|
11
|
+
"height": 250
|
|
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": "Warmwasser",
|
|
27
|
+
"label": {
|
|
28
|
+
"en": "Title",
|
|
29
|
+
"de": "Titel"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"showForceButton": {
|
|
33
|
+
"type": "checkbox",
|
|
34
|
+
"default": true,
|
|
35
|
+
"label": {
|
|
36
|
+
"en": "Show 'Heat once' button",
|
|
37
|
+
"de": "'1× Aufheizen'-Button anzeigen"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|