iobroker.eos-admin 9.0.31 → 9.0.33
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/NEXOWATT_EOS_BUILD_INFO.json +11 -11
- package/README.md +9 -7
- package/adminWww/.vite/manifest.json +39 -39
- package/adminWww/NEXOWATT_EOS_FRONTEND_MANIFEST.json +107 -107
- package/adminWww/assets/{AdapterUpdateDialog-UhaQHyF1.js → AdapterUpdateDialog-DBUqmmyD.js} +1 -1
- package/adminWww/assets/{Adapters-Di3sM_ky.js → Adapters-dDEp7o5h.js} +1 -1
- package/adminWww/assets/{ConfigManager-C2naRwDl.js → ConfigManager-DbqTWi2N.js} +1 -1
- package/adminWww/assets/{Enums-B9ucB-qg.js → Enums-DjldGElU.js} +1 -1
- package/adminWww/assets/{Fields-DN41WFbp.js → Fields-0GsPCJeU.js} +1 -1
- package/adminWww/assets/{Files-C3PbbeNR.js → Files-COnUtEbg.js} +1 -1
- package/adminWww/assets/{Hosts-DXjTE0pX.js → Hosts-CwU1LujG.js} +1 -1
- package/adminWww/assets/{Instances-PKvEjDNQ.js → Instances-CUX5mxMQ.js} +1 -1
- package/adminWww/assets/{Intro-BnYMjDZr.js → Intro-BhQmHn3A.js} +1 -1
- package/adminWww/assets/{Logs-DTo6XJF_.js → Logs-B5SpNqHq.js} +1 -1
- package/adminWww/assets/{Objects-DyEBMDK6.js → Objects-COg_cFkz.js} +1 -1
- package/adminWww/assets/{Overview-CWLYuqZx.js → Overview-CitzUjBF.js} +1 -1
- package/adminWww/assets/{State-Ca9_Ke_c.js → State-D5ljzf-T.js} +1 -1
- package/adminWww/assets/{UsedResources-20bsoxmj.js → UsedResources-BY_NF2wB.js} +1 -1
- package/adminWww/assets/{Users-yZyZX-18.js → Users-Cu93_-VF.js} +1 -1
- package/adminWww/assets/{bootstrap-BQ4OzwbT.js → bootstrap-Dwfxhm2V.js} +3 -3
- package/adminWww/assets/{hostInit-CGSSNegd.js → hostInit-3BbTwhaZ.js} +1 -1
- package/adminWww/assets/{icons-material-C3PNaipj.js → icons-material-DjqX0l_7.js} +1 -1
- package/adminWww/assets/{index-C4CShixx.js → index-nddph2Sl.js} +2 -2
- package/adminWww/assets/{installSVGRenderer-DeaOAT3W.js → installSVGRenderer-CPDIwFAL.js} +1 -1
- package/adminWww/assets/{mf-entry-bootstrap-0-c5733c2d.js → mf-entry-bootstrap-0-d1f0f40f.js} +2 -2
- package/adminWww/index.html +23 -23
- package/adminWww/mf-manifest.json +1 -1
- package/adminWww/mf-stats.json +1 -1
- package/adminWww/remoteEntry-eos-9.0.33.js +12 -0
- package/adminWww/remoteEntry.js +1 -1
- package/build/lib/eosUiProcess.js +31 -14
- package/build/lib/eosUiProcess.js.map +1 -1
- package/build/lib/eosUiProcessRpc.js +3 -1
- package/build/lib/eosUiProcessRpc.js.map +1 -1
- package/build/lib/eosUiProcessWorker.js +6 -4
- package/build/lib/eosUiProcessWorker.js.map +1 -1
- package/docs/README.md +3 -2
- package/docs/reports/unified-9.0.32/PRUEFBERICHT.md +34 -0
- package/docs/reports/unified-9.0.32/PRUEFERGEBNISSE.json +112 -0
- package/docs/reports/unified-9.0.32/raw/INDEX.json +102 -0
- package/docs/reports/unified-9.0.32/raw/backend.log +5 -0
- package/docs/reports/unified-9.0.32/raw/browser-cadence-headless.json +63 -0
- package/docs/reports/unified-9.0.32/raw/browser-flow-headless.json +328 -0
- package/docs/reports/unified-9.0.32/raw/focused.log +67 -0
- package/docs/reports/unified-9.0.32/raw/frontend.log +151 -0
- package/docs/reports/unified-9.0.32/raw/installer.log +26 -0
- package/docs/reports/unified-9.0.32/raw/lint.log +5 -0
- package/docs/reports/unified-9.0.32/raw/modules.log +5 -0
- package/docs/reports/unified-9.0.32/raw/node22-tests-final.log +17212 -0
- package/docs/reports/unified-9.0.32/raw/node22-version.log +1 -0
- package/docs/reports/unified-9.0.32/raw/node24-tests-final.log +2869 -0
- package/docs/reports/unified-9.0.32/raw/node24-version.log +1 -0
- package/docs/reports/unified-9.0.32/raw/sbom.log +2 -0
- package/docs/reports/unified-9.0.32/raw/typecheck.log +5 -0
- package/docs/reports/unified-9.0.32/raw/ui-runtime.log +8 -0
- package/docs/reports/unified-9.0.32/raw/version-parity-928-929.log +6 -0
- package/docs/reports/unified-9.0.33/PRUEFBERICHT.md +60 -0
- package/docs/reports/unified-9.0.33/PRUEFERGEBNISSE.json +112 -0
- package/docs/reports/unified-9.0.33/raw/INDEX.json +272 -0
- package/docs/reports/unified-9.0.33/raw/backend.log +5 -0
- package/docs/reports/unified-9.0.33/raw/browser/UI_REVIEW.json +147 -0
- package/docs/reports/unified-9.0.33/raw/browser/admin-bundle.log +136 -0
- package/docs/reports/unified-9.0.33/raw/browser/eos-backup-settings-browser.log +67 -0
- package/docs/reports/unified-9.0.33/raw/browser/eos-customer-tariff-startup-browser.log +43 -0
- package/docs/reports/unified-9.0.33/raw/browser/eos-energyflow-browser-smoke.log +438 -0
- package/docs/reports/unified-9.0.33/raw/browser/eos-energyflow-cadence-browser-10s.log +108 -0
- package/docs/reports/unified-9.0.33/raw/browser/eos-evcs-delete-browser.log +1 -0
- package/docs/reports/unified-9.0.33/raw/browser/eos-history-setup-browser-smoke.log +49 -0
- package/docs/reports/unified-9.0.33/raw/browser/eos-kiosk-browser.log +59 -0
- package/docs/reports/unified-9.0.33/raw/browser/eos-ocpp-admin-browser.log +71 -0
- package/docs/reports/unified-9.0.33/raw/browser/eos-ocpp-installer-discovery-browser.log +11 -0
- package/docs/reports/unified-9.0.33/raw/browser/eos-pwa-trust-browser.log +35 -0
- package/docs/reports/unified-9.0.33/raw/browser/eos-runtime-controls-browser.log +78 -0
- package/docs/reports/unified-9.0.33/raw/browser/eos-runtime-health-browser.log +49 -0
- package/docs/reports/unified-9.0.33/raw/browser/eos-runtime-login-browser.log +34 -0
- package/docs/reports/unified-9.0.33/raw/browser/smarthome.log +46 -0
- package/docs/reports/unified-9.0.33/raw/browser-ten-seconds.json +108 -0
- package/docs/reports/unified-9.0.33/raw/changed-test-coverage.json +116 -0
- package/docs/reports/unified-9.0.33/raw/connected-control-node22.jsonl +42 -0
- package/docs/reports/unified-9.0.33/raw/connected-control-summary-node22.json +103 -0
- package/docs/reports/unified-9.0.33/raw/connected-control-summary.json +103 -0
- package/docs/reports/unified-9.0.33/raw/connected-control.jsonl +42 -0
- package/docs/reports/unified-9.0.33/raw/display-ui-node22.log +162 -0
- package/docs/reports/unified-9.0.33/raw/display-ui.log +35 -0
- package/docs/reports/unified-9.0.33/raw/frontend.log +151 -0
- package/docs/reports/unified-9.0.33/raw/git-delivery-fix.log +10 -0
- package/docs/reports/unified-9.0.33/raw/installer.log +26 -0
- package/docs/reports/unified-9.0.33/raw/license-central-node24.log +173 -0
- package/docs/reports/unified-9.0.33/raw/lint-final.log +45 -0
- package/docs/reports/unified-9.0.33/raw/modules.log +5 -0
- package/docs/reports/unified-9.0.33/raw/node22-npm-version.log +1 -0
- package/docs/reports/unified-9.0.33/raw/node22-tests-final.log +17646 -0
- package/docs/reports/unified-9.0.33/raw/node22-version.log +1 -0
- package/docs/reports/unified-9.0.33/raw/node24-npm-version.log +1 -0
- package/docs/reports/unified-9.0.33/raw/node24-tests-final.log +2941 -0
- package/docs/reports/unified-9.0.33/raw/node24-version.log +1 -0
- package/docs/reports/unified-9.0.33/raw/process-final-node22.log +220 -0
- package/docs/reports/unified-9.0.33/raw/process-final-node24.log +110 -0
- package/docs/reports/unified-9.0.33/raw/ram-picker.jsonl +12 -0
- package/docs/reports/unified-9.0.33/raw/reg-combined-node22.log +622 -0
- package/docs/reports/unified-9.0.33/raw/reg-combined.log +108 -0
- package/docs/reports/unified-9.0.33/raw/sbom-final.log +8 -0
- package/docs/reports/unified-9.0.33/raw/tariff-update-all-final-node22.log +1185 -0
- package/docs/reports/unified-9.0.33/raw/typecheck-final.log +5 -0
- package/docs/reports/unified-9.0.33/raw/ui-functional-node24.log +430 -0
- package/docs/reports/unified-9.0.33/raw/ui-runtime-final-verification.log +1 -0
- package/docs/reports/unified-9.0.33/raw/update-controller-standard-7-2-5.log +4 -0
- package/docs/reports/unified-9.0.33/raw/worker-memory-eos933.log +12 -0
- package/docs/reports/unified-9.0.33/raw/worker-memory-flow932.log +12 -0
- package/docs/start/START_HIER_9.0.32.md +16 -0
- package/docs/start/START_HIER_9.0.33.md +32 -0
- package/io-package.json +12 -12
- package/package.json +8 -5
- package/release-manifests/unified/build-environment.cdx.json +7 -7
- package/release-manifests/unified/files.json +208 -129
- package/release-manifests/unified/frontend.cdx.json +7 -7
- package/release-manifests/unified/installer.cdx.json +7 -7
- package/release-manifests/unified/obsolete-admin-assets.json +198 -28
- package/release-manifests/unified/runtime.cdx.json +27 -27
- package/release-manifests/unified/validation.json +15 -15
- package/tools/eos-release-manifest.cjs +2 -2
- package/ui/ems/consumers/sg-ready.js +26 -6
- package/ui/ems/datapoints.js +12 -4
- package/ui/ems/modules/charging-management.js +58 -67
- package/ui/ems/modules/core-limits.js +59 -36
- package/ui/ems/modules/prime-mover-control.js +141 -29
- package/ui/ems/modules/storage-control.js +31 -38
- package/ui/ems/modules/storage-mapping.js +14 -13
- package/ui/ems/modules/tarif-vis.js +38 -56
- package/ui/ems/services/measurement-freshness.js +58 -21
- package/ui/ems/services/safety-envelope.js +13 -6
- package/ui/io-package.json +9 -1
- package/ui/lib/datapoint-picker.js +27 -20
- package/ui/lib/tariff-price.js +7 -1
- package/ui/lib/ts-mirrors/ems/core-limits/core-runtime.js +5 -1
- package/ui/main.js +277 -182
- package/ui/package.json +4 -3
- package/ui/www/app.js +207 -87
- package/ui/www/ems-apps.js +3 -2
- package/ui/www/index.html +1 -0
- package/ui/www/live-display.js +38 -4
- package/ui/www/manifest.webmanifest +2 -2
- package/ui/www/power-measurements.js +28 -3
- package/adminWww/remoteEntry-eos-9.0.31.js +0 -12
package/ui/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nexowatt-eos-ui-internal",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.33",
|
|
4
4
|
"description": "Internal UI and EMS module hosted by iobroker.eos-admin; not an ioBroker adapter entry point.",
|
|
5
5
|
"author": "NexoWatt",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -329,8 +329,9 @@
|
|
|
329
329
|
"test:actuator-blocked-write-propagation": "node scripts/verify-actuator-blocked-write-propagation.js",
|
|
330
330
|
"test:pv-surplus-dynamic-storage-remainder": "node scripts/verify-pv-surplus-dynamic-storage-remainder.js",
|
|
331
331
|
"test:actuator-c3-threshold-relay": "node scripts/verify-actuator-c3-threshold-relay.js",
|
|
332
|
-
"test:live-energy-flow-
|
|
333
|
-
"test:live-energy-flow-
|
|
332
|
+
"test:live-energy-flow-10s-cadence": "node scripts/verify-live-energy-flow-5s-cadence.js",
|
|
333
|
+
"test:live-energy-flow-5s-cadence": "npm run test:live-energy-flow-10s-cadence",
|
|
334
|
+
"test:live-energy-flow-15s-cadence": "npm run test:live-energy-flow-10s-cadence",
|
|
334
335
|
"test:actuator-c3-thermal-heating": "node scripts/verify-actuator-c3-thermal-heating.js",
|
|
335
336
|
"test:storage-zero-write-firewall-v2": "node scripts/verify-storage-zero-write-firewall-v2.js",
|
|
336
337
|
"test:pv-source-dedup-cap": "node scripts/verify-pv-source-dedup-cap.js",
|
package/ui/www/app.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
|
|
8
8
|
*
|
|
9
9
|
* Quelle: src-ts/runtime-executables/www/app.ts
|
|
10
|
-
* Quell-Hash: sha256:
|
|
10
|
+
* Quell-Hash: sha256:b13e9e0e7f43fd59983d78f50e86e3b7fdf8f41c942fc607fce76311572a0231
|
|
11
11
|
* Erzeugung: npm run sync:ts-runtime-executables
|
|
12
12
|
*
|
|
13
13
|
* Zweck:
|
|
@@ -470,7 +470,15 @@ const _RENDER_MIN_INTERVAL_MS = 120;
|
|
|
470
470
|
* Zusammenhang: Teil von Kunden-LIVE-Frontend: Dashboard, Energiefluss, Schnellsteuerung; Aufrufstellen und abhängige States/APIs beim Ändern mitprüfen.
|
|
471
471
|
* TypeScript: Parameter, Rückgabewert und verwendete Config-/State-Objekte später explizit typisieren.
|
|
472
472
|
*/
|
|
473
|
-
function scheduleRender(force = false){
|
|
473
|
+
function scheduleRender(force = false, telemetryFrame = false){
|
|
474
|
+
// Settings changes and modal actions must not paint intermediate meter values.
|
|
475
|
+
// Keep immediate button feedback separate from the shared dashboard frame.
|
|
476
|
+
if (!telemetryFrame && document.getElementById('energyWebSvg')) {
|
|
477
|
+
try { window.__evcsApply?.(key => state[key]?.value, state); }
|
|
478
|
+
catch (error) { console.warn('EVCS controls', error); }
|
|
479
|
+
scheduleLiveTelemetryRender(false);
|
|
480
|
+
return;
|
|
481
|
+
}
|
|
474
482
|
if (_renderScheduled && !force) return;
|
|
475
483
|
_renderScheduled = true;
|
|
476
484
|
|
|
@@ -487,54 +495,57 @@ function scheduleRender(force = false){
|
|
|
487
495
|
_renderScheduled = false;
|
|
488
496
|
if (document.visibilityState !== 'visible' || _liveTelemetryPaused) return;
|
|
489
497
|
_lastRenderTs = performance.now();
|
|
490
|
-
|
|
498
|
+
window.__nwLiveFrameNow = Date.now();
|
|
499
|
+
try { render(); } catch (_e) {}
|
|
500
|
+
finally { delete window.__nwLiveFrameNow; }
|
|
491
501
|
}, wait);
|
|
492
502
|
}
|
|
493
503
|
|
|
494
|
-
// Kundenanzeige: Messwerte des Energieflussmonitors werden bewusst nur alle
|
|
504
|
+
// Kundenanzeige: Messwerte des Energieflussmonitors werden bewusst nur alle 10 Sekunden
|
|
495
505
|
// neu gerendert. Die Backend-Messung und sämtliche EMS-Regelkreise bleiben unverändert
|
|
496
506
|
// schnell; gedrosselt wird ausschließlich die sichtbare LIVE-Darstellung, damit kurze
|
|
497
507
|
// NVP-/Speicher-Messversätze nicht als hektisches Springen erscheinen.
|
|
498
|
-
const LIVE_TELEMETRY_RENDER_INTERVAL_MS =
|
|
508
|
+
const LIVE_TELEMETRY_RENDER_INTERVAL_MS = 10000;
|
|
509
|
+
const OTHER_PAGE_TELEMETRY_INTERVAL_MS = 5000;
|
|
499
510
|
let _liveTelemetryRenderTimer = null;
|
|
500
511
|
let _lastLiveTelemetryRenderTs = null;
|
|
501
512
|
let _liveTelemetryPaused = false;
|
|
502
513
|
|
|
503
514
|
/**
|
|
504
515
|
* Code-Teil: scheduleLiveTelemetryRender
|
|
505
|
-
* Zweck: Bündelt häufige SSE-Messwertupdates auf einen festen
|
|
516
|
+
* Zweck: Bündelt häufige SSE-Messwertupdates auf einen festen 10-Sekunden-Anzeigetakt.
|
|
506
517
|
* Zusammenhang: Verändert keine Statewerte und keine Regelung; nur render() im LIVE-Frontend
|
|
507
|
-
* wird verzögert.
|
|
508
|
-
* weiterhin sofort gerendert werden.
|
|
518
|
+
* wird verzögert. Erstansicht und Verbindungswechsel werden unmittelbar sichtbar.
|
|
509
519
|
*/
|
|
510
520
|
function scheduleLiveTelemetryRender(force = false){
|
|
511
521
|
// Eine monotone Zeitbasis verhindert Verzögerungen bei NTP-/Uhrzeitkorrekturen.
|
|
512
522
|
// Eingehende SSE-Werte werden auch verborgen gepuffert, nur die Anzeige pausiert.
|
|
513
523
|
if (_liveTelemetryPaused || document.visibilityState !== 'visible') return;
|
|
514
524
|
const now = performance.now();
|
|
525
|
+
const interval = document.getElementById('energyWebSvg') ? LIVE_TELEMETRY_RENDER_INTERVAL_MS : OTHER_PAGE_TELEMETRY_INTERVAL_MS;
|
|
515
526
|
const elapsed = _lastLiveTelemetryRenderTs === null ? Infinity : now - _lastLiveTelemetryRenderTs;
|
|
516
527
|
|
|
517
|
-
if (force || elapsed >=
|
|
528
|
+
if (force || elapsed >= interval) {
|
|
518
529
|
if (_liveTelemetryRenderTimer !== null) {
|
|
519
530
|
clearTimeout(_liveTelemetryRenderTimer);
|
|
520
531
|
_liveTelemetryRenderTimer = null;
|
|
521
532
|
}
|
|
522
533
|
_lastLiveTelemetryRenderTs = now;
|
|
523
|
-
scheduleRender(true);
|
|
534
|
+
scheduleRender(true, true);
|
|
524
535
|
return;
|
|
525
536
|
}
|
|
526
537
|
|
|
527
538
|
if (_liveTelemetryRenderTimer !== null) return;
|
|
528
|
-
const wait = Math.max(0,
|
|
539
|
+
const wait = Math.max(0, interval - elapsed);
|
|
529
540
|
_liveTelemetryRenderTimer = setTimeout(() => {
|
|
530
541
|
_liveTelemetryRenderTimer = null;
|
|
531
542
|
if (_liveTelemetryPaused || document.visibilityState !== 'visible') return;
|
|
532
543
|
_lastLiveTelemetryRenderTs = performance.now();
|
|
533
|
-
scheduleRender(true);
|
|
544
|
+
scheduleRender(true, true);
|
|
534
545
|
}, wait);
|
|
535
546
|
}
|
|
536
547
|
|
|
537
|
-
// Auch ohne neue SSE-Werte alle
|
|
548
|
+
// Auch ohne neue SSE-Werte alle 10 s den aktuellen Snapshot neu bewerten. Dadurch
|
|
538
549
|
// altern echte Messzeitstempel sichtbar; das Rendering erzeugt keine neue Messung.
|
|
539
550
|
function refreshLiveMeasurementAge() {
|
|
540
551
|
if (document.visibilityState === 'visible' && document.getElementById('energyWebSvg')) scheduleLiveTelemetryRender(false);
|
|
@@ -557,7 +568,7 @@ function resumeLiveTelemetryRendering() {
|
|
|
557
568
|
scheduleLiveTelemetryRender(true);
|
|
558
569
|
}
|
|
559
570
|
// Nach Tab-Rückkehr / BFcache sofort den neuesten gepufferten Stand zeigen,
|
|
560
|
-
// danach einen einzigen
|
|
571
|
+
// danach einen einzigen 10-s-Takt. Kein Hintergrundrender und keine Timer-Duplikate.
|
|
561
572
|
document.addEventListener('visibilitychange', () => {
|
|
562
573
|
if (document.visibilityState === 'visible') resumeLiveTelemetryRendering();
|
|
563
574
|
else pauseLiveTelemetryRendering();
|
|
@@ -1862,28 +1873,13 @@ function nwFormatDashboardTimestamp(ts) {
|
|
|
1862
1873
|
*/
|
|
1863
1874
|
function nwLatestStateTimestamp(keys) {
|
|
1864
1875
|
const st = window.latestState || state || {};
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
* TypeScript: Parameter, Rückgabewert und verwendete Config-/State-Objekte später explizit typisieren.
|
|
1871
|
-
*/
|
|
1872
|
-
const scanKey = (k) => {
|
|
1873
|
-
const rec = st && st[k];
|
|
1874
|
-
const ts = rec && Number(rec.ts);
|
|
1875
|
-
if (Number.isFinite(ts) && ts > best) best = ts;
|
|
1876
|
-
};
|
|
1877
|
-
if (Array.isArray(keys)) keys.forEach(scanKey);
|
|
1878
|
-
if (!best) {
|
|
1879
|
-
try {
|
|
1880
|
-
Object.keys(st || {}).forEach((k) => {
|
|
1881
|
-
const ts = Number(st[k] && st[k].ts);
|
|
1882
|
-
if (Number.isFinite(ts) && ts > best) best = ts;
|
|
1883
|
-
});
|
|
1884
|
-
} catch (_e) {}
|
|
1876
|
+
const now = window.__nwLiveFrameNow ?? Date.now(), age = getFlowFreshMaxAgeMs(), online = window.__nwTariffLiveOnline !== false;
|
|
1877
|
+
let best = null;
|
|
1878
|
+
for (const key of keys) {
|
|
1879
|
+
if (window.NexoWattLiveDisplay.read(st, key, now, age, online) === null) continue;
|
|
1880
|
+
best = Math.max(best ?? 0, Number(st[key].ts));
|
|
1885
1881
|
}
|
|
1886
|
-
return best
|
|
1882
|
+
return best;
|
|
1887
1883
|
}
|
|
1888
1884
|
/**
|
|
1889
1885
|
* Code-Teil: nwSetLiveOnline
|
|
@@ -1902,7 +1898,7 @@ function nwSetLiveOnline(isOnline) {
|
|
|
1902
1898
|
if (dot) dot.classList.toggle('is-offline', !online);
|
|
1903
1899
|
if (!online) {
|
|
1904
1900
|
for (const id of ['pvPower', 'gridBuyPower', 'gridSellPower', 'storagePower', 'consumptionTotal', 'sidePvPower', 'sideBuildingPower', 'sideBatteryPower', 'sideGridBuyPower', 'sideGridSellPower', 'pvVal', 'gridVal', 'restVal', 'centerPower']) setText(id, '--');
|
|
1905
|
-
setText('batterySocIn', '-- %'); setText('sideStorage', '-- %'); setText('sideBatterySoc', '-- %');
|
|
1901
|
+
setText('batteryFlowDirection', ''); setText('batterySocIn', '-- %'); setText('sideStorage', '-- %'); setText('sideBatterySoc', '-- %');
|
|
1906
1902
|
setText('sideEms', 'Verbindung unterbrochen'); setText('sideGridStatus', 'Messstatus unbekannt');
|
|
1907
1903
|
}
|
|
1908
1904
|
}
|
|
@@ -1928,20 +1924,19 @@ function updateDashboardShellUi(data) {
|
|
|
1928
1924
|
const liveDot = document.getElementById('liveDot');
|
|
1929
1925
|
nwSetLiveOnline(!liveDot || liveDot.classList.contains('live'));
|
|
1930
1926
|
|
|
1931
|
-
const { pv, buy, sell, load, charge, discharge } = getLiveMeasurementView();
|
|
1927
|
+
const { pv, buy, sell, load, charge, discharge, soc } = getLiveMeasurementView();
|
|
1932
1928
|
const batterySigned = charge === null || discharge === null ? null : discharge - charge;
|
|
1933
1929
|
const evcsAvailable = nwEvcsFeatureFromConfig();
|
|
1934
1930
|
const evcsPower = evcsAvailable ? getEvcsPowerW(d) : null;
|
|
1935
1931
|
try { nwApplyCustomerFeatureVisibility(window.__nwCfg || {}, window.latestState || state || {}); } catch (_e) {}
|
|
1936
1932
|
|
|
1937
|
-
const soc = getLiveMeasurementView().soc;
|
|
1938
1933
|
const autarky = (snap.autarkyN !== undefined && snap.autarkyN !== null) ? Number(snap.autarkyN) : getFreshFlowNumber('autarky');
|
|
1939
1934
|
const selfc = (snap.selfcN !== undefined && snap.selfcN !== null) ? Number(snap.selfcN) : getFreshFlowNumber('selfConsumption');
|
|
1940
1935
|
|
|
1941
1936
|
setText('sideStorage', Number.isFinite(soc) ? `${Math.round(soc)} %` : '-- %');
|
|
1942
1937
|
setText('sideBatterySoc', Number.isFinite(soc) ? `${Math.round(soc)} %` : '-- %');
|
|
1943
1938
|
const p14 = !!d('ems.core.para14aActive') || !!d('para14a.active'), peak = String(d('peakShaving.control.status') || '').trim(), safety = String(d('chargingManagement.audit.safetyStage') || '').trim(), p14Fallback = d('para14a.communicationFallbackActive') === true;
|
|
1944
|
-
const health = window.NexoWattLiveDisplay?.status(window.latestState || state || {}, window.__nwTariffLiveOnline !== false, Date.now());
|
|
1939
|
+
const health = window.NexoWattLiveDisplay?.status(window.latestState || state || {}, window.__nwTariffLiveOnline !== false, window.__nwLiveFrameNow ?? Date.now(), getFlowFreshMaxAgeMs());
|
|
1945
1940
|
setText('sideEms', safety === 'EOS-SAFETY-STOP' ? 'Safety aktiv' : health?.ems || 'Status unbekannt');
|
|
1946
1941
|
setText('sideGridStatus', p14Fallback ? '§14a Fallback' : (p14 ? '§14a aktiv' : (peak === 'active' ? 'Peak aktiv' : health?.grid || 'Messstatus unbekannt')));
|
|
1947
1942
|
setText('sideStatusText', health?.summary || 'Betriebsstatus unbekannt');
|
|
@@ -1960,8 +1955,9 @@ function updateDashboardShellUi(data) {
|
|
|
1960
1955
|
if (evcsAvailable) setText('sideEvcsPower', evcsPower === null ? '--' : formatFlowPower(Math.abs(evcsPower)));
|
|
1961
1956
|
|
|
1962
1957
|
const ts = nwLatestStateTimestamp([
|
|
1963
|
-
'
|
|
1964
|
-
'
|
|
1958
|
+
'derived.core.pv.totalW', 'derived.core.grid.netW', 'derived.core.storage.netW', 'derived.core.building.loadTotalW',
|
|
1959
|
+
'pvPower', 'productionTotal', 'consumptionTotal', 'gridPointPower', 'gridBuyPower', 'gridSellPower',
|
|
1960
|
+
'batteryPower', 'storageChargePower', 'storageDischargePower', 'storageSoc', 'consumptionEvcs', 'evcs.totalPowerW'
|
|
1965
1961
|
]);
|
|
1966
1962
|
setText('sideTimestamp', nwFormatDashboardTimestamp(ts));
|
|
1967
1963
|
}
|
|
@@ -2957,8 +2953,9 @@ function getStateAgeMs(key) {
|
|
|
2957
2953
|
try {
|
|
2958
2954
|
const rec = state && state[key];
|
|
2959
2955
|
const ts = Number(rec && rec.ts);
|
|
2960
|
-
|
|
2961
|
-
|
|
2956
|
+
const now = window.__nwLiveFrameNow ?? Date.now();
|
|
2957
|
+
if (!Number.isFinite(ts) || ts <= 0 || ts > now + 5000) return null;
|
|
2958
|
+
return Math.max(0, now - ts);
|
|
2962
2959
|
} catch (_e) {
|
|
2963
2960
|
return null;
|
|
2964
2961
|
}
|
|
@@ -2987,7 +2984,7 @@ function getFlowFreshMaxAgeMs() {
|
|
|
2987
2984
|
*/
|
|
2988
2985
|
function getFreshFlowNumber(key, opts = {}) {
|
|
2989
2986
|
if (opts.onlyIfMapped && !isMappedDatapoint(key)) return null;
|
|
2990
|
-
return window.NexoWattLiveDisplay?.read(state, key, Date.now(), getFlowFreshMaxAgeMs(), window.__nwTariffLiveOnline !== false) ?? null;
|
|
2987
|
+
return window.NexoWattLiveDisplay?.read(state, key, window.__nwLiveFrameNow ?? Date.now(), getFlowFreshMaxAgeMs(), window.__nwTariffLiveOnline !== false) ?? null;
|
|
2991
2988
|
}
|
|
2992
2989
|
/**
|
|
2993
2990
|
* Code-Teil: getStableFlowNumber
|
|
@@ -3044,29 +3041,45 @@ function getBalanceDerivedBatteryFlow(opts = {}) {
|
|
|
3044
3041
|
const hasDirectLoad = isMappedDatapoint('consumptionTotal') || isMappedDatapoint('housePower');
|
|
3045
3042
|
if (!hasDirectLoad) return null;
|
|
3046
3043
|
|
|
3047
|
-
const load =
|
|
3048
|
-
|
|
3044
|
+
const load = (isMappedDatapoint('consumptionTotal') ? read('consumptionTotal') : null)
|
|
3045
|
+
?? (isMappedDatapoint('housePower') ? read('housePower') : null);
|
|
3046
|
+
if (load === null || load < 0) return null;
|
|
3049
3047
|
|
|
3050
|
-
const grid = getGridImportExport(read);
|
|
3051
|
-
if (!grid || grid.rawBuy === null || grid.rawSell === null) return null;
|
|
3052
3048
|
const nvp = st['ems.gridMeasurementFresh'];
|
|
3053
|
-
if (nvp && (nvp.value !== true || getStateAgeMs('ems.gridMeasurementFresh') === null || getStateAgeMs('ems.gridMeasurementFresh') > getFlowFreshMaxAgeMs())) return null;
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3049
|
+
if (nvp && (nvp.value !== true || (nvp.q !== undefined && nvp.q !== 0) || getStateAgeMs('ems.gridMeasurementFresh') === null || getStateAgeMs('ems.gridMeasurementFresh') > getFlowFreshMaxAgeMs())) return null;
|
|
3050
|
+
let net;
|
|
3051
|
+
if (Object.hasOwn(st, 'derived.core.grid.netW')) {
|
|
3052
|
+
net = read('derived.core.grid.netW');
|
|
3053
|
+
if (net === null) return null;
|
|
3054
|
+
} else {
|
|
3055
|
+
const grid = getGridImportExport(read);
|
|
3056
|
+
if (!grid || grid.rawBuy === null || grid.rawSell === null) return null;
|
|
3057
|
+
net = grid.buy - grid.sell;
|
|
3058
|
+
if (st['settings.flowInvertGrid']?.value) net = -net;
|
|
3059
|
+
}
|
|
3060
|
+
const pv = Object.hasOwn(st, 'derived.core.pv.totalW') ? read('derived.core.pv.totalW')
|
|
3061
|
+
: read('pvPower') ?? (isMappedDatapoint('productionTotal') ? read('productionTotal') : null);
|
|
3057
3062
|
if (pv === null) return null;
|
|
3058
3063
|
|
|
3059
|
-
let production = Math.
|
|
3060
|
-
|
|
3061
|
-
const
|
|
3062
|
-
if (
|
|
3064
|
+
let production = Math.abs(pv);
|
|
3065
|
+
if (Object.hasOwn(st, 'derived.core.production.extraW')) {
|
|
3066
|
+
const extra = read('derived.core.production.extraW');
|
|
3067
|
+
if (extra === null) return null;
|
|
3068
|
+
production += extra;
|
|
3069
|
+
} else {
|
|
3070
|
+
for (let i = 1; i <= 5; i++) {
|
|
3071
|
+
const key = `producer${i}Power`;
|
|
3072
|
+
const power = read(key);
|
|
3073
|
+
if (power === null && isMappedDatapoint(key)) return null;
|
|
3074
|
+
if (power !== null) production += Math.abs(power);
|
|
3075
|
+
}
|
|
3063
3076
|
}
|
|
3064
3077
|
|
|
3065
|
-
const signed = Math.round(
|
|
3078
|
+
const signed = Math.round(load - production - net);
|
|
3066
3079
|
if (!Number.isFinite(signed) || Math.abs(signed) <= deadbandW) return null;
|
|
3067
3080
|
|
|
3068
3081
|
// Plausibilitätsbremsen gegen kurze Messversätze oder unbekannte Verbraucher.
|
|
3069
|
-
const activity = production +
|
|
3082
|
+
const activity = production + load + Math.abs(net);
|
|
3070
3083
|
if (activity < 500) return null;
|
|
3071
3084
|
if (Math.abs(signed) > Math.max(3000, activity * 1.15)) return null;
|
|
3072
3085
|
if (signed < 0 && soc >= 99.5) return null;
|
|
@@ -3254,25 +3267,75 @@ function getCanonicalPvPowerW(readValue) {
|
|
|
3254
3267
|
* Keine Regelung, keine Ersatzmessung und keine Änderung der Kundenzuordnung. */
|
|
3255
3268
|
function getLiveMeasurementView() {
|
|
3256
3269
|
const fresh = key => getFreshFlowNumber(key);
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3270
|
+
let buy = null, sell = null;
|
|
3271
|
+
if (state && Object.hasOwn(state, 'derived.core.grid.netW')) {
|
|
3272
|
+
// Der Netzpunkt stammt aus demselben Messsatz wie der berechnete Verbrauch.
|
|
3273
|
+
const net = fresh('derived.core.grid.netW');
|
|
3274
|
+
if (net !== null) {
|
|
3275
|
+
buy = Math.max(0, net);
|
|
3276
|
+
sell = Math.max(0, -net);
|
|
3277
|
+
}
|
|
3278
|
+
} else {
|
|
3279
|
+
const nvp = state?.['ems.gridMeasurementFresh'];
|
|
3280
|
+
const nvpAge = nvp ? getStateAgeMs('ems.gridMeasurementFresh') : null;
|
|
3281
|
+
const nvpUsable = !nvp || (nvp.value === true && (nvp.q === undefined || nvp.q === 0) && nvpAge !== null && nvpAge <= getFlowFreshMaxAgeMs());
|
|
3282
|
+
if (nvpUsable) {
|
|
3283
|
+
const grid = getGridImportExport(fresh);
|
|
3284
|
+
if (grid.rawBuy !== null && grid.rawSell !== null) {
|
|
3285
|
+
const inverted = !!((window.latestState || state)?.['settings.flowInvertGrid']?.value);
|
|
3286
|
+
[buy, sell] = inverted ? [grid.sell, grid.buy] : [grid.buy, grid.sell];
|
|
3287
|
+
}
|
|
3288
|
+
}
|
|
3289
|
+
}
|
|
3290
|
+
const hasStorageObservation = state && Object.hasOwn(state, 'derived.core.storage.netW');
|
|
3263
3291
|
const farm = nwStorageFarmFeatureFromConfig(window.__nwCfg || {}, state || {});
|
|
3264
|
-
const farmView = farm ? window.NexoWattLiveDisplay?.farm(state, Date.now(), window.__nwTariffLiveOnline !== false) : null;
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3292
|
+
const farmView = farm ? window.NexoWattLiveDisplay?.farm(state, window.__nwLiveFrameNow ?? Date.now(), window.__nwTariffLiveOnline !== false) : null;
|
|
3293
|
+
let charge = null, discharge = null, batteryDerived = false;
|
|
3294
|
+
if (farmView) {
|
|
3295
|
+
({ charge, discharge } = farmView);
|
|
3296
|
+
} else if (hasStorageObservation) {
|
|
3297
|
+
const net = fresh('derived.core.storage.netW');
|
|
3298
|
+
if (net !== null) {
|
|
3299
|
+
charge = Math.max(0, -net);
|
|
3300
|
+
discharge = Math.max(0, net);
|
|
3301
|
+
} else if (!farm && !isMappedDatapoint('batteryPower') && !isMappedDatapoint('storageChargePower') && !isMappedDatapoint('storageDischargePower')) {
|
|
3302
|
+
const estimate = getBalanceDerivedBatteryFlow();
|
|
3303
|
+
if (estimate) {
|
|
3304
|
+
({ chargeW: charge, dischargeW: discharge } = estimate);
|
|
3305
|
+
batteryDerived = true;
|
|
3306
|
+
}
|
|
3307
|
+
}
|
|
3308
|
+
} else {
|
|
3309
|
+
const battery = getNormalizedBatteryFlow();
|
|
3310
|
+
const missing = ['missing', 'mapped-missing', 'storageFarm-missing-power', 'storageFarm-unavailable', 'stale-or-missing'];
|
|
3311
|
+
if (!missing.includes(String(battery.src)) && battery.incomplete !== true) {
|
|
3312
|
+
({ chargeW: charge, dischargeW: discharge } = battery);
|
|
3313
|
+
batteryDerived = battery.derived === true;
|
|
3314
|
+
}
|
|
3315
|
+
}
|
|
3316
|
+
// A direct meter can arrive one SSE batch before the backend publishes the new balance.
|
|
3317
|
+
// Unmapped consumptionTotal may be a mirror of the previous balance; never revive it here.
|
|
3318
|
+
const directKey = isMappedDatapoint('consumptionTotal') ? 'consumptionTotal'
|
|
3319
|
+
: isMappedDatapoint('housePower') ? 'housePower' : null;
|
|
3320
|
+
const directLoad = directKey ? fresh(directKey) : null;
|
|
3321
|
+
const canonicalKey = 'derived.core.building.loadTotalW';
|
|
3322
|
+
const canonical = state?.[canonicalKey];
|
|
3323
|
+
let load = canonical ? fresh(canonicalKey) : fresh('consumptionTotal');
|
|
3324
|
+
const directRow = directKey ? state?.[directKey] : null;
|
|
3325
|
+
const evaluatedAt = Math.max(canonical?.ts || 0, state?.['derived.core.building.loadSource']?.ts || 0, state?.['derived.core.building.quality']?.ts || 0);
|
|
3326
|
+
if (directLoad !== null && directLoad >= 0 && (!canonical || directRow.ts > evaluatedAt || directRow === window.__nwPendingDirectSample)) {
|
|
3327
|
+
load = directLoad;
|
|
3328
|
+
} else if (directKey && state?.[directKey] && state?.['derived.core.building.loadSource']?.value === 'mapped:' + directKey
|
|
3329
|
+
&& (directRow === window.__nwPendingDirectSample || directRow.ts >= (canonical?.ts ?? 0))) {
|
|
3330
|
+
// An invalidating sample for the same physical meter takes precedence immediately.
|
|
3331
|
+
load = null;
|
|
3332
|
+
}
|
|
3333
|
+
const pv = getCanonicalPvPowerW(fresh);
|
|
3268
3334
|
const soc = farmView ? farmView.soc : farm ? fresh('storageFarm.totalSoc') ?? fresh('storageFarm.medianSoc') : fresh('storageSoc');
|
|
3269
3335
|
return {
|
|
3270
|
-
pv:
|
|
3271
|
-
|
|
3272
|
-
charge: farmView ? farmView.charge : batteryAvailable ? battery.chargeW : null,
|
|
3273
|
-
discharge: farmView ? farmView.discharge : batteryAvailable ? battery.dischargeW : null,
|
|
3336
|
+
pv: pv !== null && pv >= 0 ? pv : null, load: load !== null && load >= 0 ? load : null, buy, sell,
|
|
3337
|
+
charge, discharge, batteryDerived,
|
|
3274
3338
|
soc: soc !== null && soc >= 0 && soc <= 100 ? soc : null,
|
|
3275
|
-
batteryDerived: !farmView && battery.derived === true,
|
|
3276
3339
|
};
|
|
3277
3340
|
}
|
|
3278
3341
|
|
|
@@ -3568,6 +3631,7 @@ async function chargingControlFetch(url, options = {}) {
|
|
|
3568
3631
|
}
|
|
3569
3632
|
|
|
3570
3633
|
async function bootstrap() {
|
|
3634
|
+
window.__nwFlowConnection = 'connecting';
|
|
3571
3635
|
let cfg = {};
|
|
3572
3636
|
try {
|
|
3573
3637
|
const cfgRes = await fetch('/config');
|
|
@@ -3750,8 +3814,19 @@ const refreshConfig = async () => {
|
|
|
3750
3814
|
}
|
|
3751
3815
|
}
|
|
3752
3816
|
};
|
|
3753
|
-
|
|
3754
|
-
|
|
3817
|
+
try {
|
|
3818
|
+
const response = await fetch('/api/state', { cache: 'no-store' });
|
|
3819
|
+
if (!response.ok) throw new Error('HTTP ' + response.status);
|
|
3820
|
+
const snap = await response.json();
|
|
3821
|
+
if (!snap || typeof snap !== 'object' || Array.isArray(snap)) throw new Error('invalid snapshot');
|
|
3822
|
+
state = snap;
|
|
3823
|
+
window.__nwFlowConnection = 'snapshot';
|
|
3824
|
+
document.getElementById('liveDot')?.classList.add('live');
|
|
3825
|
+
nwSetLiveOnline(true);
|
|
3826
|
+
} catch (error) {
|
|
3827
|
+
// The EventSource below still obtains a complete snapshot after an HTTP bootstrap error.
|
|
3828
|
+
console.warn('[live-state]', error);
|
|
3829
|
+
}
|
|
3755
3830
|
try { lastInstallerConfigJson = (state && state['installer.configJson'] && state['installer.configJson'].value) || null; } catch (_e) {}
|
|
3756
3831
|
// merge cfg.settings into state if missing (for initial checkbox values)
|
|
3757
3832
|
try{
|
|
@@ -3791,16 +3866,47 @@ const refreshConfig = async () => {
|
|
|
3791
3866
|
try{
|
|
3792
3867
|
const es = new EventSource((window.NW_RUNTIME?.url('/events') ?? '/events'));
|
|
3793
3868
|
const dot = document.getElementById('liveDot');
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3869
|
+
let initialized = false;
|
|
3870
|
+
let closed = false;
|
|
3871
|
+
const reconnect = () => {
|
|
3872
|
+
if (closed) return;
|
|
3873
|
+
closed = true;
|
|
3874
|
+
window.__nwFlowConnection = 'disconnected';
|
|
3875
|
+
dot?.classList.remove('live');
|
|
3876
|
+
nwSetLiveOnline(false);
|
|
3877
|
+
es.close();
|
|
3878
|
+
scheduleLiveTelemetryRender(true);
|
|
3879
|
+
setTimeout(startEvents, 3000);
|
|
3880
|
+
};
|
|
3881
|
+
es.onerror = reconnect;
|
|
3797
3882
|
es.onmessage = (ev) => {
|
|
3798
3883
|
try {
|
|
3799
3884
|
const msg = JSON.parse(ev.data);
|
|
3800
|
-
|
|
3801
|
-
const
|
|
3802
|
-
|
|
3803
|
-
|
|
3885
|
+
if (closed || !msg || !msg.payload || typeof msg.payload !== 'object' || Array.isArray(msg.payload)) return;
|
|
3886
|
+
const isInitMessage = msg.type === 'init';
|
|
3887
|
+
const isUpdateMessage = msg.type === 'update';
|
|
3888
|
+
if (isInitMessage) {
|
|
3889
|
+
if (msg.degraded === true) { reconnect(); return; }
|
|
3890
|
+
state = msg.payload;
|
|
3891
|
+
window.latestState = state;
|
|
3892
|
+
initialized = true;
|
|
3893
|
+
window.__nwPendingDirectSample = null;
|
|
3894
|
+
window.__nwFlowConnection = 'ready';
|
|
3895
|
+
dot?.classList.add('live');
|
|
3896
|
+
nwSetLiveOnline(true);
|
|
3897
|
+
} else if (isUpdateMessage && initialized) {
|
|
3898
|
+
const hasBalance = Object.hasOwn(msg.payload, 'derived.core.building.loadTotalW');
|
|
3899
|
+
if (hasBalance) window.__nwPendingDirectSample = null;
|
|
3900
|
+
if (msg.payload.consumptionTotal || msg.payload.housePower) {
|
|
3901
|
+
const key = isMappedDatapoint('consumptionTotal') ? 'consumptionTotal'
|
|
3902
|
+
: isMappedDatapoint('housePower') ? 'housePower' : null;
|
|
3903
|
+
const sample = key ? msg.payload[key] : null;
|
|
3904
|
+
if (sample && sample.ts > 0 && state[key]?.ts > sample.ts) delete msg.payload[key];
|
|
3905
|
+
else if (sample && !hasBalance) window.__nwPendingDirectSample = sample;
|
|
3906
|
+
}
|
|
3907
|
+
Object.assign(state, msg.payload);
|
|
3908
|
+
window.latestState = state;
|
|
3909
|
+
} else return;
|
|
3804
3910
|
|
|
3805
3911
|
// App-Center config changed? Refresh /config so tiles + slot layout update without reload.
|
|
3806
3912
|
try {
|
|
@@ -3815,7 +3921,14 @@ const refreshConfig = async () => {
|
|
|
3815
3921
|
else if (isUpdateMessage) scheduleLiveTelemetryRender(false);
|
|
3816
3922
|
} catch (e) { console.warn(e); }
|
|
3817
3923
|
};
|
|
3818
|
-
} catch
|
|
3924
|
+
} catch (e) {
|
|
3925
|
+
console.warn('events', e);
|
|
3926
|
+
window.__nwFlowConnection = 'disconnected';
|
|
3927
|
+
document.getElementById('liveDot')?.classList.remove('live');
|
|
3928
|
+
nwSetLiveOnline(false);
|
|
3929
|
+
scheduleLiveTelemetryRender(true);
|
|
3930
|
+
setTimeout(startEvents, 3000);
|
|
3931
|
+
}
|
|
3819
3932
|
}
|
|
3820
3933
|
startEvents();
|
|
3821
3934
|
|
|
@@ -8654,16 +8767,15 @@ function updateEnergyWeb() {
|
|
|
8654
8767
|
|
|
8655
8768
|
const measurements = getLiveMeasurementView();
|
|
8656
8769
|
let pv = measurements.pv ?? 0;
|
|
8657
|
-
|
|
8770
|
+
const buy = measurements.buy ?? 0, sell = measurements.sell ?? 0;
|
|
8658
8771
|
const load = measurements.load ?? 0;
|
|
8659
8772
|
const evcsPowerW = getEvcsPowerW(d);
|
|
8660
8773
|
let c2 = evcsPowerW ?? 0; // Nur Geometrie, niemals Ersatzmessung.
|
|
8661
8774
|
const batCharge = measurements.charge ?? 0, batDischarge = measurements.discharge ?? 0;
|
|
8662
8775
|
const soc = measurements.soc;
|
|
8663
8776
|
|
|
8664
|
-
//
|
|
8777
|
+
// Netz und Speicher wurden bereits bei der Messwertauswahl normalisiert.
|
|
8665
8778
|
const invPv = !!(s['settings.flowInvertPv']?.value);
|
|
8666
|
-
const invGrid = !!(s['settings.flowInvertGrid']?.value);
|
|
8667
8779
|
const invEv = !!(s['settings.flowInvertEv']?.value);
|
|
8668
8780
|
const subEvFromLoad = (s['settings.flowSubtractEvFromBuilding']?.value ?? true) ? true : false;
|
|
8669
8781
|
const evAvail = nwEvcsFeatureFromConfig() && ((flowExtras && flowExtras.meta) ? !!flowExtras.meta.evcsAvailable : false);
|
|
@@ -8671,7 +8783,6 @@ function updateEnergyWeb() {
|
|
|
8671
8783
|
if (invPv) pv = -pv;
|
|
8672
8784
|
if (invEv) c2 = -c2;
|
|
8673
8785
|
if (!evAvail) c2 = 0;
|
|
8674
|
-
if (invGrid) { const t=buy; buy = sell; sell = t; } // swap semantics if inverted grid
|
|
8675
8786
|
|
|
8676
8787
|
// Optionale Extra-Kreise aktualisieren (Rückgabe = Summe der optionalen Verbraucher)
|
|
8677
8788
|
const extrasConsumersSum = updateEnergyWebExtras(key => getFreshFlowNumber(key));
|
|
@@ -8680,6 +8791,10 @@ function updateEnergyWeb() {
|
|
|
8680
8791
|
// keine echte Null. Die vorhandene EV-/Verbraucher-Betragskonvention bleibt erhalten.
|
|
8681
8792
|
const flowBalance = window.NexoWattPowerMeasurements?.resolveFlowBalance({
|
|
8682
8793
|
load: measurements.load, ev: evcsPowerW === null ? null : c2,
|
|
8794
|
+
buildingQuality: measurements.load === null
|
|
8795
|
+
? (window.__nwFlowConnection === 'connecting' ? 'awaiting-snapshot'
|
|
8796
|
+
: window.NexoWattLiveDisplay?.buildingQuality?.(state, window.__nwLiveFrameNow ?? Date.now(), getFlowFreshMaxAgeMs(), window.__nwTariffLiveOnline !== false, isMappedDatapoint))
|
|
8797
|
+
: null,
|
|
8683
8798
|
consumers: extrasConsumersSum, pv: measurements.pv,
|
|
8684
8799
|
producers: state && Object.hasOwn(state, 'derived.core.production.extraW') ? getFreshFlowNumber('derived.core.production.extraW')
|
|
8685
8800
|
: window.__nwFlowExtraProductionW ?? (flowExtras?.producers?.length || flowExtras?.special?.length ? null : 0),
|
|
@@ -8737,6 +8852,11 @@ function updateEnergyWeb() {
|
|
|
8737
8852
|
// EV & Batterie Texte
|
|
8738
8853
|
T('c2Val', evcsPowerW === null ? '--' : formatFlowPower(evShowVal));
|
|
8739
8854
|
T('restVal', measurements.charge === null || measurements.discharge === null ? '--' : batShowVal ? (batRev ? ('-'+formatFlowPower(batShowVal)) : formatFlowPower(batShowVal)) : formatFlowPower(0));
|
|
8855
|
+
const hasBatteryDirection = measurements.charge !== null && measurements.discharge !== null;
|
|
8856
|
+
const grossBoth = batCharge > 0 && batDischarge > 0;
|
|
8857
|
+
const direction = !hasBatteryDirection || !batShowVal ? (grossBoth ? 'Netto 0' : '')
|
|
8858
|
+
: batRev ? (grossBoth ? 'Netto laden' : 'Laden') : (grossBoth ? 'Netto entladen' : 'Entladen');
|
|
8859
|
+
T('batteryFlowDirection', direction);
|
|
8740
8860
|
T('centerPower', loadDisplay === null ? '--' : formatFlowPower(loadDisplay));
|
|
8741
8861
|
const balanceStatus = flowBalance.mismatchW === null ? (flowBalance.status || (measurements.batteryDerived ? 'Batterieleistung aus Energiebilanz berechnet' : ''))
|
|
8742
8862
|
: `Bilanzabweichung ${formatFlowPower(Math.abs(flowBalance.mismatchW))} – Messpunkte, Vorzeichen und Zeitstempel prüfen`;
|
package/ui/www/ems-apps.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
|
|
8
8
|
*
|
|
9
9
|
* Quelle: src-ts/runtime-executables/www/ems-apps.ts
|
|
10
|
-
* Quell-Hash: sha256:
|
|
10
|
+
* Quell-Hash: sha256:088e92dabd6b0645c4860afd01899a0112e36951a07f1da3cb16c58c4fabdcb1
|
|
11
11
|
* Erzeugung: npm run sync:ts-runtime-executables
|
|
12
12
|
*
|
|
13
13
|
* Zweck:
|
|
@@ -1733,7 +1733,8 @@ function _collectFlowPowerDpIsWFromUI() {
|
|
|
1733
1733
|
}
|
|
1734
1734
|
function appCenterDraftSnapshot() {
|
|
1735
1735
|
try {
|
|
1736
|
-
|
|
1736
|
+
// The language display is updated asynchronously from the system locale and cannot be edited.
|
|
1737
|
+
const inputs = Array.from(document.querySelectorAll('main input:not(#countryProfileLanguageDisplay), main select, main textarea'))
|
|
1737
1738
|
.map(input => [input.id, input.name, input.type, input.value, input.checked,
|
|
1738
1739
|
input.multiple && input.selectedOptions ? Array.from(input.selectedOptions).map(option => option.value) : null]);
|
|
1739
1740
|
return JSON.stringify([currentConfig, inputs]);
|
package/ui/www/index.html
CHANGED
|
@@ -241,6 +241,7 @@
|
|
|
241
241
|
<text class="minor" id="batterySocIn" text-anchor="middle" y="-14">-- %</text>
|
|
242
242
|
<text class="minor" id="batteryTime" text-anchor="middle" x="300" y="480"></text>
|
|
243
243
|
<text class="val" id="restVal" text-anchor="middle" y="58">--</text>
|
|
244
|
+
<text class="minor" id="batteryFlowDirection" text-anchor="middle" y="74"></text>
|
|
244
245
|
<text class="lbl" text-anchor="middle" y="28">Batterie</text>
|
|
245
246
|
</g>
|
|
246
247
|
<!-- center node -->
|
package/ui/www/live-display.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
|
|
8
8
|
*
|
|
9
9
|
* Quelle: src-ts/runtime-executables/www/live-display.ts
|
|
10
|
-
* Quell-Hash: sha256:
|
|
10
|
+
* Quell-Hash: sha256:91b95cc8d63fc9c2d8036e465b4c666cacc61482dce5cc7d803659fd89f202f3
|
|
11
11
|
* Erzeugung: npm run sync:ts-runtime-executables
|
|
12
12
|
*
|
|
13
13
|
* Zweck:
|
|
@@ -72,6 +72,39 @@
|
|
|
72
72
|
const row = entry(snapshot, key);
|
|
73
73
|
return current(row, now, maxAge, online) ? number(row?.value) : null;
|
|
74
74
|
}
|
|
75
|
+
function buildingQuality(snapshot, now, maxAge, online, mapped) {
|
|
76
|
+
const row = entry(snapshot, 'derived.core.building.quality');
|
|
77
|
+
const value = row?.value;
|
|
78
|
+
if (!online)
|
|
79
|
+
return 'connection-lost';
|
|
80
|
+
const freshQuality = current(row, now, maxAge, true) && typeof value === 'string' ? value : null;
|
|
81
|
+
if (freshQuality === 'invalid-balance')
|
|
82
|
+
return freshQuality;
|
|
83
|
+
if (freshQuality?.startsWith('missing-')) {
|
|
84
|
+
const channels = {
|
|
85
|
+
'missing-grid': ['gridPointPower', 'gridBuyPower', 'gridSellPower'],
|
|
86
|
+
'missing-pv': ['pvPower', 'productionTotal'],
|
|
87
|
+
'missing-storage': ['batteryPower', 'storageChargePower', 'storageDischargePower'],
|
|
88
|
+
'missing-producer': ['producer1Power', 'producer2Power', 'producer3Power', 'producer4Power', 'producer5Power'],
|
|
89
|
+
};
|
|
90
|
+
const expired = channels[freshQuality]?.some(key => {
|
|
91
|
+
if (!mapped?.(key))
|
|
92
|
+
return false;
|
|
93
|
+
const sample = entry(snapshot, key);
|
|
94
|
+
const stamp = sample ? number(sample.ts) : null;
|
|
95
|
+
return stamp !== null && stamp > 0 && now - stamp > maxAge && number(sample?.value) !== null
|
|
96
|
+
&& (sample?.q === undefined || sample.q === 0);
|
|
97
|
+
});
|
|
98
|
+
return expired ? freshQuality.replace('missing-', 'expired-') : freshQuality;
|
|
99
|
+
}
|
|
100
|
+
const load = entry(snapshot, 'derived.core.building.loadTotalW') || entry(snapshot, 'consumptionTotal');
|
|
101
|
+
const ts = load ? number(load.ts) : null;
|
|
102
|
+
if (ts !== null && ts > now + 5000)
|
|
103
|
+
return 'future-load';
|
|
104
|
+
if (ts !== null && ts > 0 && now - ts > maxAge)
|
|
105
|
+
return 'expired-load';
|
|
106
|
+
return freshQuality;
|
|
107
|
+
}
|
|
75
108
|
function farm(snapshot, now, online) {
|
|
76
109
|
const row = entry(snapshot, 'storageFarm.overviewJson');
|
|
77
110
|
if (!row)
|
|
@@ -98,7 +131,7 @@
|
|
|
98
131
|
return missing;
|
|
99
132
|
}
|
|
100
133
|
}
|
|
101
|
-
function status(snapshot, online, now) {
|
|
134
|
+
function status(snapshot, online, now, gridMaxAge = 30000) {
|
|
102
135
|
if (!online)
|
|
103
136
|
return { ems: 'Verbindung unterbrochen', grid: 'Messstatus unbekannt', summary: 'Verbindung unterbrochen' };
|
|
104
137
|
const alive = entry(snapshot, 'ems.core.schedulerAlive');
|
|
@@ -108,10 +141,11 @@
|
|
|
108
141
|
const nvp = entry(snapshot, 'ems.gridMeasurementFresh');
|
|
109
142
|
const gridKnown = current(nvp, now, 30000, true) && typeof nvp?.value === 'boolean';
|
|
110
143
|
const gridFresh = gridKnown && nvp?.value === true;
|
|
144
|
+
const gridObserved = !nvp && read(snapshot, 'derived.core.grid.netW', now, gridMaxAge, true) !== null;
|
|
111
145
|
return { ems: running ? 'Aktiv' : stopped ? 'Gestoppt' : 'Status unbekannt',
|
|
112
|
-
grid: gridFresh ? 'Messung aktuell' : gridKnown ? 'Messung fehlt / veraltet' : 'Messstatus unbekannt',
|
|
146
|
+
grid: gridFresh || gridObserved ? 'Messung aktuell' : gridKnown ? 'Messung fehlt / veraltet' : 'Messstatus unbekannt',
|
|
113
147
|
summary: running && gridFresh ? 'EMS aktiv · NVP-Messung aktuell' : stopped ? 'EMS gestoppt' : 'Betriebsstatus prüfen' };
|
|
114
148
|
}
|
|
115
149
|
const host = window;
|
|
116
|
-
host.NexoWattLiveDisplay = Object.freeze({ read, farm, status });
|
|
150
|
+
host.NexoWattLiveDisplay = Object.freeze({ read, farm, status, buildingQuality });
|
|
117
151
|
})();
|