iobroker.nexowatt-ui 0.7.45 → 0.7.47
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/ems/modules/core-limits.js +36 -24
- package/ems/modules/heating-rod-control.js +41 -37
- package/io-package.json +6 -2
- package/main.js +8 -4
- package/package.json +1 -1
- package/www/app.js +8 -5
- package/www/ems-apps.js +63 -19
- package/www/manifest.webmanifest +1 -1
- package/www/sw.js +1 -1
|
@@ -565,30 +565,42 @@ class CoreLimitsModule extends BaseModule {
|
|
|
565
565
|
return Math.max(0, this._readCacheNumber(['derived.core.pv.totalW', 'pvPower', 'productionTotal', 'storageFarm.totalPvPowerW'], 0) || 0);
|
|
566
566
|
})();
|
|
567
567
|
|
|
568
|
-
//
|
|
569
|
-
//
|
|
570
|
-
//
|
|
571
|
-
//
|
|
572
|
-
let storageChargeW =
|
|
573
|
-
let storageDischargeW =
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
const
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
568
|
+
// Speicherleistung wird zentral wie im Energiefluss aufgelöst:
|
|
569
|
+
// - getrennte Lade-/Entlade-DPs bleiben vollständig gültig
|
|
570
|
+
// - signed Batterie-DP bleibt gültig (- = Laden, + = Entladen; invertierbar)
|
|
571
|
+
// - nur wenn keine frische Messquelle vorhanden ist, wird rechnerisch über die Bilanz abgeleitet
|
|
572
|
+
let storageChargeW = 0;
|
|
573
|
+
let storageDischargeW = 0;
|
|
574
|
+
let usedCentralStorageFlow = false;
|
|
575
|
+
try {
|
|
576
|
+
const flow = (this.adapter && typeof this.adapter._nwResolveBatteryFlowFromCache === 'function')
|
|
577
|
+
? this.adapter._nwResolveBatteryFlowFromCache({ maxAgeMs: staleMs, deadbandW: 25 })
|
|
578
|
+
: null;
|
|
579
|
+
if (flow && typeof flow === 'object') {
|
|
580
|
+
usedCentralStorageFlow = true;
|
|
581
|
+
storageChargeW = Math.max(0, Math.round(Number(flow.chargeW) || 0));
|
|
582
|
+
storageDischargeW = Math.max(0, Math.round(Number(flow.dischargeW) || 0));
|
|
583
|
+
}
|
|
584
|
+
} catch (_eFlow) {}
|
|
585
|
+
|
|
586
|
+
if (!usedCentralStorageFlow) {
|
|
587
|
+
// Fallback für sehr alte Laufzeiten ohne zentralen Resolver. Keine Plausibilitäts-
|
|
588
|
+
// Unterdrückung hier: gemappte Split-DPs sind autoritativ.
|
|
589
|
+
storageChargeW = Math.max(0, this._readCacheNumberMax(['storageFarm.totalChargePowerW', 'storageChargePower'], 0) || 0);
|
|
590
|
+
storageDischargeW = Math.max(0, this._readCacheNumberMax(['storageFarm.totalDischargePowerW', 'storageDischargePower'], 0) || 0);
|
|
591
|
+
const batteryPowerW = this._readCacheNumber(['batteryPower'], null);
|
|
592
|
+
if (isFiniteNumber(batteryPowerW)) {
|
|
593
|
+
const flowBatteryMapped = !!(cfg.datapoints && String(cfg.datapoints.batteryPower || '').trim());
|
|
594
|
+
const farmActive = !!this._readCacheNumber(['storageFarm.enabled'], 0);
|
|
595
|
+
const invBattery = flowBatteryMapped && !farmActive && !!(cfg.settings && cfg.settings.flowInvertBattery);
|
|
596
|
+
const signed = Math.round(invBattery ? -batteryPowerW : batteryPowerW);
|
|
597
|
+
if (signed < -25) {
|
|
598
|
+
storageChargeW = Math.max(storageChargeW, Math.abs(signed));
|
|
599
|
+
storageDischargeW = 0;
|
|
600
|
+
} else if (signed > 25) {
|
|
601
|
+
storageDischargeW = Math.max(storageDischargeW, signed);
|
|
602
|
+
storageChargeW = 0;
|
|
603
|
+
}
|
|
592
604
|
}
|
|
593
605
|
}
|
|
594
606
|
|
|
@@ -604,42 +604,47 @@ class HeatingRodControlModule extends BaseModule {
|
|
|
604
604
|
}
|
|
605
605
|
|
|
606
606
|
_readStorageSnapshot(staleMs) {
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
if (
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
if (
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
607
|
+
let chargeW = 0;
|
|
608
|
+
let dischargeW = 0;
|
|
609
|
+
let usedCentralStorageFlow = false;
|
|
610
|
+
try {
|
|
611
|
+
const flow = (this.adapter && typeof this.adapter._nwResolveBatteryFlowFromCache === 'function')
|
|
612
|
+
? this.adapter._nwResolveBatteryFlowFromCache({ maxAgeMs: staleMs, deadbandW: 25 })
|
|
613
|
+
: null;
|
|
614
|
+
if (flow && typeof flow === 'object') {
|
|
615
|
+
usedCentralStorageFlow = true;
|
|
616
|
+
chargeW = Math.max(0, Math.round(Number(flow.chargeW) || 0));
|
|
617
|
+
dischargeW = Math.max(0, Math.round(Number(flow.dischargeW) || 0));
|
|
618
|
+
}
|
|
619
|
+
} catch (_eFlow) {}
|
|
620
|
+
|
|
621
|
+
if (!usedCentralStorageFlow) {
|
|
622
|
+
// Fallback für ältere Laufzeiten: Split-DPs und signed DP bleiben wie bisher erlaubt.
|
|
623
|
+
chargeW = Math.max(0, num(this._readNumberMaxAny([
|
|
624
|
+
'storageFarm.totalChargePowerW',
|
|
625
|
+
'storageChargePower'
|
|
626
|
+
], staleMs, null), 0));
|
|
627
|
+
|
|
628
|
+
dischargeW = Math.max(0, num(this._readNumberMaxAny([
|
|
629
|
+
'storageFarm.totalDischargePowerW',
|
|
630
|
+
'storageDischargePower'
|
|
631
|
+
], staleMs, null), 0));
|
|
632
|
+
|
|
633
|
+
const batteryPowerW = this._readNumberAny(['batteryPower'], staleMs, null);
|
|
634
|
+
if (typeof batteryPowerW === 'number' && Number.isFinite(batteryPowerW)) {
|
|
635
|
+
const cfg = (this.adapter && this.adapter.config) ? this.adapter.config : {};
|
|
636
|
+
const flowBatteryMapped = !!(cfg.datapoints && String(cfg.datapoints.batteryPower || '').trim());
|
|
637
|
+
const farmActive = !!this._readCacheNumber('storageFarm.enabled', 0);
|
|
638
|
+
const invBattery = flowBatteryMapped && !farmActive && !!(cfg.settings && cfg.settings.flowInvertBattery);
|
|
639
|
+
const signedW = Math.round(invBattery ? -batteryPowerW : batteryPowerW);
|
|
640
|
+
const noiseW = 25;
|
|
641
|
+
if (signedW < -noiseW) {
|
|
642
|
+
chargeW = Math.max(chargeW, Math.abs(signedW));
|
|
643
|
+
dischargeW = 0;
|
|
644
|
+
} else if (signedW > noiseW) {
|
|
645
|
+
dischargeW = Math.max(dischargeW, signedW);
|
|
646
|
+
chargeW = 0;
|
|
647
|
+
}
|
|
643
648
|
}
|
|
644
649
|
}
|
|
645
650
|
|
|
@@ -691,7 +696,6 @@ class HeatingRodControlModule extends BaseModule {
|
|
|
691
696
|
const exportW = gridKnown ? Math.max(0, -gridW) : 0;
|
|
692
697
|
const importW = gridKnown ? Math.max(0, gridW) : 0;
|
|
693
698
|
const storage = this._readStorageSnapshot(staleMs);
|
|
694
|
-
|
|
695
699
|
const storageTargetSocPct = clamp(num(cfg.storageTargetSocPct, 90), 0, 100);
|
|
696
700
|
const storageReserveCfgW = Math.max(0, Math.round(num(cfg.storageReserveW, 1000)));
|
|
697
701
|
const storageKnown = storage.chargeW > 0
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "nexowatt-ui",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.47",
|
|
5
5
|
"news": {
|
|
6
|
+
"0.7.47": {
|
|
7
|
+
"en": "Energy-flow datapoint resolver fixed: split charge/discharge datapoints and signed battery power are supported consistently again; calculated fallback is only used when a fresh measurement source is missing. Heating-rod reserve inputs are flushed before save.",
|
|
8
|
+
"de": "Energiefluss-Datenpunktauflösung korrigiert: getrennte Lade-/Entlade-Datenpunkte und signed Batterie-Leistung werden wieder konsistent unterstützt; der rechnerische Fallback greift nur, wenn keine frische Messquelle vorhanden ist. Heizstab-Reservefelder werden vor dem Speichern direkt übernommen."
|
|
9
|
+
},
|
|
6
10
|
"0.7.42": {
|
|
7
11
|
"en": "Feature-dependent visibility fixed: EVCS/charging station and storage farm are only shown in the customer frontend when they are actually configured. Default/legacy placeholders no longer enable wallbox UI; AI Advisor suppresses EV/wallbox hints when no wallbox is available.",
|
|
8
12
|
"de": "Anlagenabhängige Sichtbarkeit korrigiert: EVCS/Ladestation und Speicherfarm erscheinen im Kunden-Frontend nur noch, wenn sie wirklich konfiguriert sind. Default-/Legacy-Placeholder aktivieren keine Wallbox-Anzeige mehr; KI-Empfehlungen verzichten ohne Wallbox auf EV-/Wallbox-Hinweise."
|
|
@@ -1987,7 +1991,7 @@
|
|
|
1987
1991
|
}
|
|
1988
1992
|
},
|
|
1989
1993
|
"instanceObjects": [],
|
|
1990
|
-
"version": "0.7.
|
|
1994
|
+
"version": "0.7.47",
|
|
1991
1995
|
"news": {
|
|
1992
1996
|
"0.7.42": {
|
|
1993
1997
|
"en": "Feature-dependent visibility fixed: EVCS/charging station and storage farm are only shown in the customer frontend when they are actually configured. Default/legacy placeholders no longer enable wallbox UI; AI Advisor suppresses EV/wallbox hints when no wallbox is available.",
|
package/main.js
CHANGED
|
@@ -17727,13 +17727,15 @@ Technische Details: system.adapter.${c.inst}.alive=false`,
|
|
|
17727
17727
|
|
|
17728
17728
|
const preferBalance = (current) => {
|
|
17729
17729
|
try {
|
|
17730
|
-
const measured = Math.max(0, Math.abs(Number(current && current.chargeW) || 0) + Math.abs(Number(current && current.dischargeW) || 0));
|
|
17731
17730
|
const srcCur = String(current && current.src || '');
|
|
17732
|
-
const missingLike = !current || srcCur === 'missing' || srcCur === 'stale-or-missing';
|
|
17731
|
+
const missingLike = !current || srcCur === 'missing' || srcCur === 'stale-or-missing' || current.incomplete === true;
|
|
17732
|
+
if (!missingLike) return current;
|
|
17733
17733
|
const derived = fromBalance();
|
|
17734
17734
|
if (!derived) return current;
|
|
17735
|
-
|
|
17736
|
-
|
|
17735
|
+
return Object.assign({}, derived, {
|
|
17736
|
+
src: String(derived.src || 'balanceDerived') + (current && current.incomplete ? '+missing-side' : ''),
|
|
17737
|
+
fallbackFor: srcCur || 'missing'
|
|
17738
|
+
});
|
|
17737
17739
|
} catch (_ePrefer) {
|
|
17738
17740
|
return current;
|
|
17739
17741
|
}
|
|
@@ -17796,6 +17798,7 @@ Technische Details: system.adapter.${c.inst}.alive=false`,
|
|
|
17796
17798
|
if (c <= deadbandW) c = 0;
|
|
17797
17799
|
if (d <= deadbandW) d = 0;
|
|
17798
17800
|
if (inv) { const t = c; c = d; d = t; }
|
|
17801
|
+
const completePair = !!(chargeMapped && dischargeMapped && chargeRaw !== null && dischargeRaw !== null && !sameChargeDischargeId);
|
|
17799
17802
|
return preferBalance({
|
|
17800
17803
|
chargeW: Math.round(c),
|
|
17801
17804
|
dischargeW: Math.round(d),
|
|
@@ -17804,6 +17807,7 @@ Technische Details: system.adapter.${c.inst}.alive=false`,
|
|
|
17804
17807
|
inverted: inv,
|
|
17805
17808
|
fromSigned: false,
|
|
17806
17809
|
mirror: sameChargeDischargeId || !chargeMapped || !dischargeMapped,
|
|
17810
|
+
incomplete: !completePair,
|
|
17807
17811
|
staleMs: {
|
|
17808
17812
|
storageChargePower: this._nwGetCacheAgeMs('storageChargePower', now),
|
|
17809
17813
|
storageDischargePower: this._nwGetCacheAgeMs('storageDischargePower', now),
|
package/package.json
CHANGED
package/www/app.js
CHANGED
|
@@ -2109,13 +2109,15 @@ function getBalanceDerivedBatteryFlow(opts = {}) {
|
|
|
2109
2109
|
function preferBalanceDerivedBatteryFlow(current, opts = {}) {
|
|
2110
2110
|
try {
|
|
2111
2111
|
const deadbandW = Number.isFinite(Number(opts.deadbandW)) ? Math.max(180, Number(opts.deadbandW)) : 180;
|
|
2112
|
-
const measured = Math.max(0, Math.abs(Number(current && current.chargeW) || 0) + Math.abs(Number(current && current.dischargeW) || 0));
|
|
2113
2112
|
const src = String(current && current.src || '');
|
|
2114
|
-
const missingLike = !current || src === 'missing' || src === 'stale-or-missing';
|
|
2113
|
+
const missingLike = !current || src === 'missing' || src === 'stale-or-missing' || current.incomplete === true;
|
|
2114
|
+
if (!missingLike) return current;
|
|
2115
2115
|
const derived = getBalanceDerivedBatteryFlow({ deadbandW });
|
|
2116
2116
|
if (!derived) return current;
|
|
2117
|
-
|
|
2118
|
-
|
|
2117
|
+
return Object.assign({}, derived, {
|
|
2118
|
+
src: String(derived.src || 'balanceDerived') + (current && current.incomplete ? '+missing-side' : ''),
|
|
2119
|
+
fallbackFor: src || 'missing'
|
|
2120
|
+
});
|
|
2119
2121
|
} catch (_e) {
|
|
2120
2122
|
return current;
|
|
2121
2123
|
}
|
|
@@ -2180,7 +2182,8 @@ function getNormalizedBatteryFlow() {
|
|
|
2180
2182
|
if (c <= deadbandW) c = 0;
|
|
2181
2183
|
if (d <= deadbandW) d = 0;
|
|
2182
2184
|
if (inv) { const t = c; c = d; d = t; }
|
|
2183
|
-
|
|
2185
|
+
const completePair = !!(chargeMapped && dischargeMapped && charge !== null && discharge !== null && !samePair);
|
|
2186
|
+
return preferBalanceDerivedBatteryFlow({ chargeW: c, dischargeW: d, signedW: d - c, src: inv ? 'chargeDischarge(inv)' : 'chargeDischarge', inverted: inv, incomplete: !completePair }, { deadbandW });
|
|
2184
2187
|
}
|
|
2185
2188
|
|
|
2186
2189
|
if (signedBattery !== null) return preferBalanceDerivedBatteryFlow(fromSigned(signedBattery, 'batterySigned'), { deadbandW });
|
package/www/ems-apps.js
CHANGED
|
@@ -2547,8 +2547,10 @@ function _collectFlowPowerDpIsWFromUI() {
|
|
|
2547
2547
|
currentConfig.heatingRod = (currentConfig.heatingRod && typeof currentConfig.heatingRod === 'object') ? currentConfig.heatingRod : {};
|
|
2548
2548
|
const h = currentConfig.heatingRod;
|
|
2549
2549
|
h.devices = Array.isArray(h.devices) ? h.devices : [];
|
|
2550
|
-
|
|
2551
|
-
h.
|
|
2550
|
+
const _hrReserveRaw = Number(h.storageReserveW);
|
|
2551
|
+
h.storageReserveW = Math.max(0, Math.round(Number.isFinite(_hrReserveRaw) ? _hrReserveRaw : 1000));
|
|
2552
|
+
const _hrSocRaw = Number(h.storageTargetSocPct);
|
|
2553
|
+
h.storageTargetSocPct = Math.max(0, Math.min(100, Math.round(Number.isFinite(_hrSocRaw) ? _hrSocRaw : 90)));
|
|
2552
2554
|
const hMinPvRaw = Number(h.minPvPowerW ?? h.pvAutoMinPvPowerW ?? h.minCurrentPvW);
|
|
2553
2555
|
h.minPvPowerW = Math.max(0, Math.round(Number.isFinite(hMinPvRaw) ? hMinPvRaw : 800));
|
|
2554
2556
|
h.useBudgetGates = true;
|
|
@@ -2687,13 +2689,48 @@ function _collectFlowPowerDpIsWFromUI() {
|
|
|
2687
2689
|
if (opts.step != null) inp.step = String(opts.step);
|
|
2688
2690
|
if (opts.width) inp.style.width = opts.width;
|
|
2689
2691
|
if (opts.disabled) inp.disabled = true;
|
|
2690
|
-
|
|
2692
|
+
const commit = () => {
|
|
2691
2693
|
const v = (type === 'number') ? Number(inp.value) : (type === 'checkbox' ? !!inp.checked : inp.value);
|
|
2692
2694
|
onChange(v, inp);
|
|
2693
|
-
}
|
|
2695
|
+
};
|
|
2696
|
+
// Number/text fields must update the in-memory config immediately. Otherwise a
|
|
2697
|
+
// fast save or a reactive UI refresh can write the previous value again (e.g.
|
|
2698
|
+
// Heizstab Speicher-Reserve snapped back to the default 1000 W).
|
|
2699
|
+
inp.addEventListener('change', commit);
|
|
2700
|
+
if (type !== 'checkbox') inp.addEventListener('input', commit);
|
|
2701
|
+
return inp;
|
|
2702
|
+
}
|
|
2703
|
+
|
|
2704
|
+
function _mkHeatingRodNumberInput(key, value, onChange, opts = {}) {
|
|
2705
|
+
const inp = _mkCfgInput('number', value, onChange, opts);
|
|
2706
|
+
inp.dataset.heatingRodCfgKey = String(key || '');
|
|
2707
|
+
inp.id = `heatingRod_${String(key || '').replace(/[^a-zA-Z0-9_-]/g, '_')}`;
|
|
2694
2708
|
return inp;
|
|
2695
2709
|
}
|
|
2696
2710
|
|
|
2711
|
+
function flushHeatingRodConfigFromDom() {
|
|
2712
|
+
try {
|
|
2713
|
+
if (!document || !document.querySelectorAll) return;
|
|
2714
|
+
currentConfig = currentConfig || {};
|
|
2715
|
+
currentConfig.heatingRod = (currentConfig.heatingRod && typeof currentConfig.heatingRod === 'object') ? currentConfig.heatingRod : {};
|
|
2716
|
+
const h = currentConfig.heatingRod;
|
|
2717
|
+
const numericKeys = new Set([
|
|
2718
|
+
'storageReserveW', 'storageTargetSocPct', 'minPvPowerW', 'budgetSafetyReserveW',
|
|
2719
|
+
'stageUpDelaySec', 'minStageRunSec', 'cooldownAfterOffSec', 'maxGridImportW',
|
|
2720
|
+
'gridImportHoldSec', 'storageDischargeToleranceW', 'storageDischargeHoldSec'
|
|
2721
|
+
]);
|
|
2722
|
+
document.querySelectorAll('[data-heating-rod-cfg-key]').forEach((el) => {
|
|
2723
|
+
const key = String(el.dataset.heatingRodCfgKey || '').trim();
|
|
2724
|
+
if (!key || !numericKeys.has(key)) return;
|
|
2725
|
+
const n = Number(el.value);
|
|
2726
|
+
if (!Number.isFinite(n)) return;
|
|
2727
|
+
if (key === 'storageTargetSocPct') h[key] = Math.max(0, Math.min(100, Math.round(n)));
|
|
2728
|
+
else h[key] = Math.max(0, Math.round(n));
|
|
2729
|
+
});
|
|
2730
|
+
} catch (_e) {}
|
|
2731
|
+
}
|
|
2732
|
+
|
|
2733
|
+
|
|
2697
2734
|
function _mkCfgSelect(value, options, onChange, opts = {}) {
|
|
2698
2735
|
const sel = document.createElement('select');
|
|
2699
2736
|
sel.className = opts.className || 'nw-config-select';
|
|
@@ -3031,10 +3068,10 @@ function _collectFlowPowerDpIsWFromUI() {
|
|
|
3031
3068
|
autoInfo.style.flexBasis = '100%';
|
|
3032
3069
|
autoInfo.textContent = 'Zentrale EMS-Budget-Gates lesen, PV/NVP-Überschuss verfolgen und eigene PV-Auto-Stufen halten. Externe KNX-/Relais-Schaltungen werden nur beobachtet.';
|
|
3033
3070
|
grpAuto.body.appendChild(autoInfo);
|
|
3034
|
-
grpAuto.body.appendChild(_mkCfgField('Speicher-Reserve (W)',
|
|
3035
|
-
grpAuto.body.appendChild(_mkCfgField('Reserve bis SoC (%)',
|
|
3036
|
-
grpAuto.body.appendChild(_mkCfgField('PV-Auto ab PV (W)',
|
|
3037
|
-
grpAuto.body.appendChild(_mkCfgField('Sicherheitsreserve (W)',
|
|
3071
|
+
grpAuto.body.appendChild(_mkCfgField('Speicher-Reserve (W)', _mkHeatingRodNumberInput('storageReserveW', cfg.storageReserveW, (v) => { cfg.storageReserveW = Math.max(0, Math.round(Number(v) || 0)); setDirty(); }, { min: 0, step: 50, width: '150px' }), 'Bleibt für Speicherladung frei, solange der Speicher unter dem Ziel-SoC liegt.'));
|
|
3072
|
+
grpAuto.body.appendChild(_mkCfgField('Reserve bis SoC (%)', _mkHeatingRodNumberInput('storageTargetSocPct', cfg.storageTargetSocPct, (v) => { cfg.storageTargetSocPct = Math.max(0, Math.min(100, Math.round(Number(v) || 0))); setDirty(); }, { min: 0, max: 100, step: 1, width: '130px' }), 'Ab diesem SoC darf der Heizstab den Überschuss ohne Speicherreserve nutzen.'));
|
|
3073
|
+
grpAuto.body.appendChild(_mkCfgField('PV-Auto ab PV (W)', _mkHeatingRodNumberInput('minPvPowerW', cfg.minPvPowerW, (v) => { cfg.minPvPowerW = Math.max(0, Math.round(Number(v) || 0)); setDirty(); }, { min: 0, step: 50, width: '150px' }), 'Start-/Hochschaltgrenze. Unterhalb wird nicht neu zugeschaltet, laufende Auto-Stufen werden aber über Netz-/Speichergates stabil gehalten.'));
|
|
3074
|
+
grpAuto.body.appendChild(_mkCfgField('Sicherheitsreserve (W)', _mkHeatingRodNumberInput('budgetSafetyReserveW', cfg.budgetSafetyReserveW, (v) => { cfg.budgetSafetyReserveW = Math.max(0, Math.round(Number(v) || 0)); setDirty(); }, { min: 0, step: 10, width: '150px' }), 'Abzug vom Heizstab-Budget gegen Messrauschen.'));
|
|
3038
3075
|
els.heatingRodDevices.appendChild(grpAuto.wrap);
|
|
3039
3076
|
|
|
3040
3077
|
const grpSwitch = _mkCfgGroup('Robustes Schalten');
|
|
@@ -3043,13 +3080,13 @@ function _collectFlowPowerDpIsWFromUI() {
|
|
|
3043
3080
|
switchInfo.style.flexBasis = '100%';
|
|
3044
3081
|
switchInfo.textContent = 'Hysterese gegen Netz- und WR-Schwankungen: erst stabil hochfahren, bei kleinem Netzbezug halten und nur nach Haltezeit reduzieren.';
|
|
3045
3082
|
grpSwitch.body.appendChild(switchInfo);
|
|
3046
|
-
grpSwitch.body.appendChild(_mkCfgField('Stufe-hoch Wartezeit (s)',
|
|
3047
|
-
grpSwitch.body.appendChild(_mkCfgField('Min. Laufzeit Auto-Stufe (s)',
|
|
3048
|
-
grpSwitch.body.appendChild(_mkCfgField('Cooldown nach Abwurf (s)',
|
|
3049
|
-
grpSwitch.body.appendChild(_mkCfgField('Netzbezug erlaubt (W)',
|
|
3050
|
-
grpSwitch.body.appendChild(_mkCfgField('Netzbezug Haltezeit (s)',
|
|
3051
|
-
grpSwitch.body.appendChild(_mkCfgField('Speicherentladung erlaubt (W)',
|
|
3052
|
-
grpSwitch.body.appendChild(_mkCfgField('Speicherentladung Haltezeit (s)',
|
|
3083
|
+
grpSwitch.body.appendChild(_mkCfgField('Stufe-hoch Wartezeit (s)', _mkHeatingRodNumberInput('stageUpDelaySec', cfg.stageUpDelaySec, (v) => { cfg.stageUpDelaySec = Math.max(0, Math.round(Number(v) || 0)); setDirty(); }, { min: 0, step: 1, width: '150px' }), 'Maximal eine physische Stufe pro Wartezeit.'));
|
|
3084
|
+
grpSwitch.body.appendChild(_mkCfgField('Min. Laufzeit Auto-Stufe (s)', _mkHeatingRodNumberInput('minStageRunSec', cfg.minStageRunSec, (v) => { cfg.minStageRunSec = Math.max(0, Math.round(Number(v) || 0)); setDirty(); }, { min: 0, step: 1, width: '170px' }), 'Verhindert nervöses Runterschalten bei kurzen Budget-Dellen.'));
|
|
3085
|
+
grpSwitch.body.appendChild(_mkCfgField('Cooldown nach Abwurf (s)', _mkHeatingRodNumberInput('cooldownAfterOffSec', cfg.cooldownAfterOffSec, (v) => { cfg.cooldownAfterOffSec = Math.max(0, Math.round(Number(v) || 0)); setDirty(); }, { min: 0, step: 1, width: '170px' }), 'Wartezeit bevor nach komplettem AUS wieder gestartet wird.'));
|
|
3086
|
+
grpSwitch.body.appendChild(_mkCfgField('Netzbezug erlaubt (W)', _mkHeatingRodNumberInput('maxGridImportW', cfg.maxGridImportW, (v) => { cfg.maxGridImportW = Math.max(0, Math.round(Number(v) || 0)); setDirty(); }, { min: 0, step: 10, width: '150px' }), 'Kleiner erlaubter Bezug, damit der Heizstab bei NVP-Schwankungen an bleibt.'));
|
|
3087
|
+
grpSwitch.body.appendChild(_mkCfgField('Netzbezug Haltezeit (s)', _mkHeatingRodNumberInput('gridImportHoldSec', cfg.gridImportHoldSec, (v) => { cfg.gridImportHoldSec = Math.max(0, Math.round(Number(v) || 0)); setDirty(); }, { min: 0, step: 1, width: '160px' }), 'Erst wenn der Bezug so lange überschritten ist, wird eine Auto-Stufe reduziert.'));
|
|
3088
|
+
grpSwitch.body.appendChild(_mkCfgField('Speicherentladung erlaubt (W)', _mkHeatingRodNumberInput('storageDischargeToleranceW', cfg.storageDischargeToleranceW, (v) => { cfg.storageDischargeToleranceW = Math.max(0, Math.round(Number(v) || 0)); setDirty(); }, { min: 0, step: 10, width: '170px' }), 'Akku-Schutz: kurze Messdellen sind erlaubt, dauerhafte Entladung reduziert Auto-Stufen.'));
|
|
3089
|
+
grpSwitch.body.appendChild(_mkCfgField('Speicherentladung Haltezeit (s)', _mkHeatingRodNumberInput('storageDischargeHoldSec', cfg.storageDischargeHoldSec, (v) => { cfg.storageDischargeHoldSec = Math.max(0, Math.round(Number(v) || 0)); setDirty(); }, { min: 0, step: 1, width: '190px' }), 'Dauer bis zur Reduzierung bei Akku-Entladung.'));
|
|
3053
3090
|
els.heatingRodDevices.appendChild(grpSwitch.wrap);
|
|
3054
3091
|
|
|
3055
3092
|
const grpProtect = _mkCfgDetailsGroup('Erweitert: harte Schutzgrenzen', false);
|
|
@@ -7732,13 +7769,19 @@ function _collectFlowPowerDpIsWFromUI() {
|
|
|
7732
7769
|
const socId = _nwGetAlias(stDev, 'r.soc');
|
|
7733
7770
|
|
|
7734
7771
|
let storageMapped = false;
|
|
7735
|
-
|
|
7772
|
+
// Prefer the single signed battery power datapoint when it is available.
|
|
7773
|
+
// It is the safest source for the VIS/EMS balance (+ Entladen / - Laden).
|
|
7774
|
+
// Some devices expose split powerCharge/powerDischarge aliases that are
|
|
7775
|
+
// control/assist values rather than the real physical battery flow. Those
|
|
7776
|
+
// can make the house load and PV budget wrong, so use them only when no
|
|
7777
|
+
// signed datapoint exists.
|
|
7778
|
+
if (signedId) {
|
|
7779
|
+
if (_nwApplyFlowDpIfEmpty('batteryPower', signedId, { powerIsW: true })) out.changed = true;
|
|
7780
|
+
storageMapped = true;
|
|
7781
|
+
} else if (chargeId && dischargeId) {
|
|
7736
7782
|
if (_nwApplyFlowDpIfEmpty('storageChargePower', chargeId, { powerIsW: true })) out.changed = true;
|
|
7737
7783
|
if (_nwApplyFlowDpIfEmpty('storageDischargePower', dischargeId, { powerIsW: true })) out.changed = true;
|
|
7738
7784
|
storageMapped = true;
|
|
7739
|
-
} else if (signedId) {
|
|
7740
|
-
if (_nwApplyFlowDpIfEmpty('batteryPower', signedId, { powerIsW: true })) out.changed = true;
|
|
7741
|
-
storageMapped = true;
|
|
7742
7785
|
}
|
|
7743
7786
|
if (socId) {
|
|
7744
7787
|
if (_nwApplyFlowDpIfEmpty('storageSoc', socId)) out.changed = true;
|
|
@@ -8122,6 +8165,7 @@ function _collectFlowPowerDpIsWFromUI() {
|
|
|
8122
8165
|
}
|
|
8123
8166
|
|
|
8124
8167
|
// Thermik / Heizstab (PV‑Auto für Verbraucher‑Slots)
|
|
8168
|
+
try { flushHeatingRodConfigFromDom(); } catch (_e) {}
|
|
8125
8169
|
patch.thermal = deepMerge({}, currentConfig.thermal || {});
|
|
8126
8170
|
patch.heatingRod = deepMerge({}, currentConfig.heatingRod || {});
|
|
8127
8171
|
patch.bhkw = deepMerge({}, currentConfig.bhkw || {});
|
package/www/manifest.webmanifest
CHANGED
package/www/sw.js
CHANGED