iobroker.eos-admin 9.0.31 → 9.0.34
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 +10 -11
- package/README.md +7 -7
- package/adminWww/.vite/manifest.json +233 -224
- package/adminWww/NEXOWATT_EOS_FRONTEND_MANIFEST.json +13897 -13887
- package/adminWww/assets/AccessTime-CuR73YC3.js +1 -0
- package/adminWww/assets/{AdapterUpdateDialog-UhaQHyF1.js → AdapterUpdateDialog-5L75o18m.js} +5 -5
- package/adminWww/assets/{Adapters-Di3sM_ky.js → Adapters-FcghjF7E.js} +5 -5
- package/adminWww/assets/ConfigManager-BnHarBfH.js +1 -0
- package/adminWww/assets/Enums-BjLbLLQL.js +92 -0
- package/adminWww/assets/Fields-DDE1hVOa.js +1 -0
- package/adminWww/assets/Files-CDjnR4q6.js +1 -0
- package/adminWww/assets/{Hosts-DXjTE0pX.js → Hosts-CJKQaNrD.js} +6 -6
- package/adminWww/assets/Instances-DZNl369k.js +4 -0
- package/adminWww/assets/Intro-CjAmMGDB.js +2 -0
- package/adminWww/assets/KeyboardArrowRight-ifvmV1ZL.js +1 -0
- package/adminWww/assets/{Logs-DTo6XJF_.js → Logs-rUAV7SwM.js} +2 -2
- package/adminWww/assets/MoreHoriz-CS7nODK8.js +1 -0
- package/adminWww/assets/{Objects-DyEBMDK6.js → Objects-CqOH6rT_.js} +4 -4
- package/adminWww/assets/Overview-BOtXqsMy.js +3 -0
- package/adminWww/assets/Pageview-wzrLQZ-j.js +1 -0
- package/adminWww/assets/PersonOff-YtHcY0sV.js +1 -0
- package/adminWww/assets/Star-D8VNXawT.js +1 -0
- package/adminWww/assets/State-C8ncThop.js +1 -0
- package/adminWww/assets/UsedResources-lUYJqy4F.js +2 -0
- package/adminWww/assets/Users-CK1Cax82.js +1 -0
- package/adminWww/assets/ViewCompact-D7bHgn99.js +1 -0
- package/adminWww/assets/ViewSidebar-CjClbCI5.js +1 -0
- package/adminWww/assets/WifiTethering-DJ9VO12W.js +1 -0
- package/adminWww/assets/{bootstrap-BQ4OzwbT.js → bootstrap-CC0Qr-kr.js} +25 -25
- package/adminWww/assets/date-fns-BtR4dG_j.js +1 -0
- package/adminWww/assets/en-US-BjjaEI6N.js +1 -0
- package/adminWww/assets/{hostInit-CGSSNegd.js → hostInit-DqGL6nY8.js} +1 -1
- package/adminWww/assets/icons-material-07rWS63O.js +1 -0
- package/adminWww/assets/{index-C4CShixx.js → index-BhhkToP2.js} +2 -2
- package/adminWww/assets/{installSVGRenderer-DeaOAT3W.js → installSVGRenderer-B4-7lSQZ.js} +1 -1
- package/adminWww/assets/isSameWeek-WMSJR5Qs.js +1 -0
- package/adminWww/assets/locale-DN6Bdkdt.js +1 -0
- package/adminWww/assets/{mf-entry-bootstrap-0-c5733c2d.js → mf-entry-bootstrap-0-1afd2287.js} +2 -2
- package/adminWww/assets/sentry-CPzCHrwe.js +1 -0
- package/adminWww/assets/setYear-DDSuW45e.js +1 -0
- 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.31.js → remoteEntry-eos-9.0.34.js} +1 -1
- package/adminWww/remoteEntry.js +1 -1
- package/build/lib/eosDeviceEmsPlan.js +285 -9
- package/build/lib/eosDeviceEmsPlan.js.map +1 -1
- package/build/lib/eosDeviceEmsService.js +29 -2
- package/build/lib/eosDeviceEmsService.js.map +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/reports/unified-9.0.34/PRUEFBERICHT.md +40 -0
- package/docs/reports/unified-9.0.34/PRUEFERGEBNISSE.json +112 -0
- package/docs/reports/unified-9.0.34/raw/INDEX.json +137 -0
- package/docs/reports/unified-9.0.34/raw/backend.log +5 -0
- package/docs/reports/unified-9.0.34/raw/dashboard-interval.json +108 -0
- package/docs/reports/unified-9.0.34/raw/fixtures-verification.log +44 -0
- package/docs/reports/unified-9.0.34/raw/frontend.log +152 -0
- package/docs/reports/unified-9.0.34/raw/installer.log +26 -0
- package/docs/reports/unified-9.0.34/raw/lint.log +45 -0
- package/docs/reports/unified-9.0.34/raw/mira-dashboard-browser.json +1 -0
- package/docs/reports/unified-9.0.34/raw/mira-devices-browser.log +9 -0
- package/docs/reports/unified-9.0.34/raw/mira-memory-process.json +379 -0
- package/docs/reports/unified-9.0.34/raw/modules.log +5 -0
- package/docs/reports/unified-9.0.34/raw/node22-mira.log +216 -0
- package/docs/reports/unified-9.0.34/raw/node22-protocol-to-ems.log +8 -0
- package/docs/reports/unified-9.0.34/raw/node22-tests-final.log +17850 -0
- package/docs/reports/unified-9.0.34/raw/node22-version.log +1 -0
- package/docs/reports/unified-9.0.34/raw/node24-mira.log +40 -0
- package/docs/reports/unified-9.0.34/raw/node24-protocol-to-ems.log +6 -0
- package/docs/reports/unified-9.0.34/raw/node24-tests-final.log +2973 -0
- package/docs/reports/unified-9.0.34/raw/node24-version.log +1 -0
- package/docs/reports/unified-9.0.34/raw/protocol-to-ems.cjs +364 -0
- package/docs/reports/unified-9.0.34/raw/release-metadata.log +13 -0
- package/docs/reports/unified-9.0.34/raw/sbom.log +8 -0
- package/docs/reports/unified-9.0.34/raw/typecheck.log +5 -0
- package/docs/reports/unified-9.0.34/raw/ui-runtime.log +8 -0
- package/docs/start/START_HIER_9.0.32.md +16 -0
- package/docs/start/START_HIER_9.0.33.md +32 -0
- package/docs/start/START_HIER_9.0.34.md +25 -0
- package/io-package.json +16 -16
- package/modules/devices/admin/alias-contract-v1.json +22 -0
- package/modules/devices/admin/ems-assignment.js +6 -1
- package/modules/devices/admin/host-bridge.js +2 -0
- package/modules/devices/admin/index.html +16 -0
- package/modules/devices/admin/index_m.js +168 -9
- package/modules/devices/admin/templates.json +976 -0
- package/modules/devices/checks/emsAssignment.check.js +52 -2
- package/modules/devices/index.js +5 -1
- package/modules/devices/lib/alias-contract-v1.json +22 -0
- package/modules/devices/lib/deviceRuntime.js +17 -7
- package/modules/devices/lib/drivers/modbus.js +1 -1
- package/modules/devices/lib/drivers/modbusRtuBus.js +7 -1
- package/modules/devices/lib/drivers/ovumMira.js +148 -0
- package/modules/devices/lib/ovumMiraAliases.js +61 -0
- package/modules/devices/lib/ovumMiraConnection.js +32 -0
- package/modules/devices/lib/templates.json +976 -0
- package/modules/devices/test/aliasContractV1.test.js +4 -4
- package/modules/devices/test/deviceAliasSemantics.test.js +2 -2
- package/modules/devices/test/fixtures/approved-additive-templates.json +3 -1
- package/modules/devices/test/ovumMiraPairing.test.js +76 -0
- package/modules/devices/test/ovumMiraTemplates.test.js +110 -0
- package/modules/devices/test/ovumMiraTransport.test.js +162 -0
- package/package.json +10 -5
- package/release-manifests/unified/build-environment.cdx.json +7 -7
- package/release-manifests/unified/files.json +302 -180
- 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 +281 -28
- package/release-manifests/unified/runtime.cdx.json +28 -28
- package/release-manifests/unified/validation.json +15 -15
- package/tools/eos-release-manifest.cjs +2 -2
- package/ui/ems/consumers/ovum-mira.js +164 -0
- 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/para14a.js +3 -2
- package/ui/ems/modules/prime-mover-control.js +141 -29
- package/ui/ems/modules/stage-a-diagnostics.js +4 -2
- 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/modules/thermal-control.js +91 -10
- package/ui/ems/services/measurement-freshness.js +58 -21
- package/ui/ems/services/safety-envelope.js +13 -6
- package/ui/io-package.json +13 -1
- package/ui/lib/datapoint-picker.js +27 -20
- package/ui/lib/installer-lifecycle.js +11 -2
- 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 +313 -188
- package/ui/package.json +4 -3
- package/ui/www/app.js +238 -100
- package/ui/www/ems-apps.js +30 -10
- package/ui/www/index.html +1 -0
- package/ui/www/licenses/smarthome-markdown-components.json +156 -156
- 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/assets/AddLink-0L0E-LsA.js +0 -1
- package/adminWww/assets/ColorLens-DA51K29x.js +0 -1
- package/adminWww/assets/ConfigManager-C2naRwDl.js +0 -1
- package/adminWww/assets/Enums-B9ucB-qg.js +0 -92
- package/adminWww/assets/Fields-DN41WFbp.js +0 -1
- package/adminWww/assets/FileCopy-B16lEuur.js +0 -1
- package/adminWww/assets/Files-C3PbbeNR.js +0 -1
- package/adminWww/assets/Instances-PKvEjDNQ.js +0 -4
- package/adminWww/assets/Intro-BnYMjDZr.js +0 -2
- package/adminWww/assets/Lens-9lkeoWGk.js +0 -1
- package/adminWww/assets/LinearScale-Be5h2beh.js +0 -1
- package/adminWww/assets/North-C2whbHM-.js +0 -1
- package/adminWww/assets/Overview-CWLYuqZx.js +0 -3
- package/adminWww/assets/PersonOff-DqBq0Fho.js +0 -1
- package/adminWww/assets/PlaylistAdd-O8k92YBd.js +0 -1
- package/adminWww/assets/State-Ca9_Ke_c.js +0 -1
- package/adminWww/assets/UsedResources-20bsoxmj.js +0 -2
- package/adminWww/assets/Users-yZyZX-18.js +0 -1
- package/adminWww/assets/date-fns-C1dqkno9.js +0 -1
- package/adminWww/assets/icons-material-C3PNaipj.js +0 -1
- package/adminWww/assets/isSameWeek-Crh37s7U.js +0 -1
- package/adminWww/assets/isWithinInterval-Bo1WiDfq.js +0 -1
- package/adminWww/assets/locale-hLcz_Xh2.js +0 -1
- package/adminWww/assets/sentry-DwQQLI7N.js +0 -1
- package/adminWww/assets/startOfWeek-DJph8SIW.js +0 -1
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
|
|
8
8
|
*
|
|
9
9
|
* Quelle: src-ts/runtime-executables/ems/modules/prime-mover-control.ts
|
|
10
|
-
* Quell-Hash: sha256:
|
|
10
|
+
* Quell-Hash: sha256:3f1030aba5b5f1e62a544da0f09dcecd353268007757398e3c7fdda3064afd79
|
|
11
11
|
* Erzeugung: npm run sync:ts-runtime-executables
|
|
12
12
|
*
|
|
13
13
|
* Zweck:
|
|
@@ -86,6 +86,8 @@ class PrimeMoverControlModule extends BaseModule {
|
|
|
86
86
|
this.runtime = new Map();
|
|
87
87
|
this.actuatorContract = new ActuatorCommandContract();
|
|
88
88
|
this.stateCache = new Map();
|
|
89
|
+
this.pendingPulses = new Map();
|
|
90
|
+
this.loadedPulseState = new Set();
|
|
89
91
|
this.maxDevices = 10;
|
|
90
92
|
this.inited = false;
|
|
91
93
|
this.adapter = adapter;
|
|
@@ -95,6 +97,8 @@ class PrimeMoverControlModule extends BaseModule {
|
|
|
95
97
|
async init() {
|
|
96
98
|
await this.ensureObjects();
|
|
97
99
|
await this.loadConfig();
|
|
100
|
+
for (const device of this.devices)
|
|
101
|
+
await this.restorePulse(device);
|
|
98
102
|
this.inited = true;
|
|
99
103
|
}
|
|
100
104
|
root() { return this.spec.kind; }
|
|
@@ -149,6 +153,7 @@ class PrimeMoverControlModule extends BaseModule {
|
|
|
149
153
|
['retryCount', 'Wiederholungen', 'number', 'value', 0, ''],
|
|
150
154
|
['faultLocked', 'Fehlerverriegelung', 'boolean', 'indicator', false, ''],
|
|
151
155
|
['faultUntil', 'Fehlerverriegelung bis', 'number', 'value.time', 0, ''],
|
|
156
|
+
['pulseResetPending', 'Ausstehende Rücknahme eines Start-/Stoppimpulses', 'string', 'json', '', ''],
|
|
152
157
|
['writeContractStatus', 'Aktor Vertragsstatus', 'string', 'text', '', ''],
|
|
153
158
|
['minRunRemainingSec', 'Verbleibende Mindestlaufzeit', 'number', 'value.interval', 0, 's'],
|
|
154
159
|
['minOffRemainingSec', 'Verbleibender Mindeststillstand', 'number', 'value.interval', 0, 's'],
|
|
@@ -241,7 +246,7 @@ class PrimeMoverControlModule extends BaseModule {
|
|
|
241
246
|
const existing = this.runtime.get(id);
|
|
242
247
|
if (existing)
|
|
243
248
|
return existing;
|
|
244
|
-
const created = { wasRunning: null, stateSinceTs: 0, lastOnMs: 0, lastOffMs: 0, lastCmdMs: 0, lastCmd: '', reconstructed: false };
|
|
249
|
+
const created = { wasRunning: null, stateSinceTs: 0, lastOnMs: 0, lastOffMs: 0, lastCmdMs: 0, lastCmd: '', restoredPulse: false, reconstructed: false };
|
|
245
250
|
this.runtime.set(id, created);
|
|
246
251
|
return created;
|
|
247
252
|
}
|
|
@@ -430,6 +435,8 @@ class PrimeMoverControlModule extends BaseModule {
|
|
|
430
435
|
if (isActuatorAuthorityBlockedResult(result)) {
|
|
431
436
|
return { accepted: false, blocked: true, error: text(result.reason || 'blocked-by-authority') };
|
|
432
437
|
}
|
|
438
|
+
if (result === false || result?.accepted === false)
|
|
439
|
+
return { accepted: false, blocked: false, error: 'write-rejected' };
|
|
433
440
|
return { accepted: true, blocked: false, error: '' };
|
|
434
441
|
}
|
|
435
442
|
catch (error) {
|
|
@@ -450,30 +457,123 @@ class PrimeMoverControlModule extends BaseModule {
|
|
|
450
457
|
releaseAuthority,
|
|
451
458
|
};
|
|
452
459
|
}
|
|
453
|
-
async
|
|
454
|
-
if (
|
|
455
|
-
return
|
|
456
|
-
|
|
457
|
-
|
|
460
|
+
async restorePulse(device) {
|
|
461
|
+
if (this.loadedPulseState.has(device.id))
|
|
462
|
+
return true;
|
|
463
|
+
try {
|
|
464
|
+
const saved = await this.adapter.getStateAsync(`${this.deviceBase(device)}.pulseResetPending`);
|
|
465
|
+
if (saved?.val) {
|
|
466
|
+
const entry = JSON.parse(saved.val);
|
|
467
|
+
const expected = entry?.command === 'start' ? device.startWriteId : entry?.command === 'stop' ? device.stopWriteId : '';
|
|
468
|
+
if (device.commandProfile !== 'pulse' || !expected || entry.objectId !== expected
|
|
469
|
+
|| typeof entry.manual !== 'boolean' || !Number.isFinite(entry.issuedAt)) {
|
|
470
|
+
await this.setIfChanged(`${this.deviceBase(device)}.writeContractStatus`, 'pulse-reset-mapping-changed');
|
|
471
|
+
return false;
|
|
472
|
+
}
|
|
473
|
+
const pulse = { objectId: expected, command: entry.command, manual: entry.manual, issuedAt: entry.issuedAt, due: 0, busy: false, released: false, recovered: true };
|
|
474
|
+
const runtime = this.getRuntime(device.id);
|
|
475
|
+
runtime.lastCmd = pulse.command;
|
|
476
|
+
runtime.lastCmdMs = pulse.issuedAt;
|
|
477
|
+
runtime.restoredPulse = true;
|
|
478
|
+
this.pendingPulses.set(device.id, pulse);
|
|
479
|
+
await this.resetPulse(device, pulse);
|
|
480
|
+
}
|
|
481
|
+
else if (device.enabled && device.commandProfile === 'pulse') {
|
|
482
|
+
const base = this.deviceBase(device);
|
|
483
|
+
const [lastCommand, lastTimestamp] = await Promise.all([
|
|
484
|
+
this.adapter.getStateAsync(`${base}.lastCommand`), this.adapter.getStateAsync(`${base}.lastCommandTs`),
|
|
485
|
+
]);
|
|
486
|
+
if ((lastCommand?.val === 'start' || lastCommand?.val === 'stop') && Number.isFinite(lastTimestamp?.val)) {
|
|
487
|
+
const runtime = this.getRuntime(device.id);
|
|
488
|
+
runtime.lastCmd = lastCommand.val;
|
|
489
|
+
runtime.lastCmdMs = lastTimestamp.val;
|
|
490
|
+
runtime.restoredPulse = true;
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
this.loadedPulseState.add(device.id);
|
|
494
|
+
return true;
|
|
495
|
+
}
|
|
496
|
+
catch (_error) {
|
|
497
|
+
await this.setIfChanged(`${this.deviceBase(device)}.writeContractStatus`, 'pulse-reset-state-unavailable');
|
|
498
|
+
return false;
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
async resetPulse(device, pulse) {
|
|
502
|
+
if (this.adapter._nwShuttingDown || pulse.busy || this.pendingPulses.get(device.id) !== pulse)
|
|
503
|
+
return;
|
|
504
|
+
pulse.busy = true;
|
|
505
|
+
try {
|
|
506
|
+
if (!pulse.released) {
|
|
507
|
+
const owner = pulse.manual ? this.manualOwner(device) : this.automaticOwner(device);
|
|
508
|
+
const attempt = await withActuatorShadowContext(this.adapter, {
|
|
509
|
+
...this.writeContext(device, owner, 'pulse-reset', pulse.manual, true),
|
|
510
|
+
kind: `${this.root()}-pulse-reset`,
|
|
511
|
+
}, () => this.rawWrite(pulse.objectId, false));
|
|
512
|
+
if (!attempt.accepted) {
|
|
513
|
+
await this.setIfChanged(`${this.deviceBase(device)}.writeContractStatus`, 'pulse-reset-retry');
|
|
514
|
+
return;
|
|
515
|
+
}
|
|
516
|
+
pulse.released = true;
|
|
517
|
+
}
|
|
518
|
+
// Only acknowledge a recovered manual request after the contact has been lowered.
|
|
519
|
+
// A failed database read/clear leaves the journal intact for the next attempt.
|
|
520
|
+
if (pulse.recovered && pulse.manual) {
|
|
521
|
+
const id = `${this.userBase(device)}.command`;
|
|
522
|
+
const command = await this.adapter.getStateAsync(id);
|
|
523
|
+
if (command?.val === pulse.command && Number.isFinite(command.ts) && command.ts <= pulse.issuedAt) {
|
|
524
|
+
await this.adapter.setStateAsync(id, '', true);
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
await this.adapter.setStateAsync(`${this.deviceBase(device)}.pulseResetPending`, '', true);
|
|
528
|
+
this.pendingPulses.delete(device.id);
|
|
529
|
+
const status = `${this.deviceBase(device)}.writeContractStatus`;
|
|
530
|
+
if (pulse.recovered || this.stateCache.get(status) === 'pulse-reset-retry')
|
|
531
|
+
await this.setIfChanged(status, 'pulse-reset-complete');
|
|
532
|
+
}
|
|
533
|
+
catch (_error) {
|
|
534
|
+
await this.setIfChanged(`${this.deviceBase(device)}.writeContractStatus`, 'pulse-reset-retry');
|
|
535
|
+
}
|
|
536
|
+
finally {
|
|
537
|
+
pulse.due = Date.now() + Math.max(250, Math.min(5000, device.retryDelayMs));
|
|
538
|
+
pulse.busy = false;
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
async pulseWrite(device, objectId, owner, reason, manual, desiredRunning) {
|
|
542
|
+
if (!objectId || this.adapter._nwShuttingDown || this.pendingPulses.has(device.id)) {
|
|
543
|
+
return { accepted: false, blocked: false, error: 'pulse-reset-pending-or-unavailable' };
|
|
544
|
+
}
|
|
545
|
+
const entry = { objectId, command: desiredRunning ? 'start' : 'stop', manual, issuedAt: Date.now() };
|
|
546
|
+
const pulse = { ...entry, due: 0, busy: true, released: false, recovered: false };
|
|
547
|
+
this.pendingPulses.set(device.id, pulse);
|
|
548
|
+
try {
|
|
549
|
+
// Persist before energising: a process or controller restart cannot lose the OFF obligation.
|
|
550
|
+
await this.adapter.setStateAsync(`${this.deviceBase(device)}.pulseResetPending`, JSON.stringify(entry), true);
|
|
551
|
+
}
|
|
552
|
+
catch (_error) {
|
|
553
|
+
this.pendingPulses.delete(device.id);
|
|
554
|
+
this.loadedPulseState.delete(device.id);
|
|
555
|
+
return { accepted: false, blocked: false, error: 'pulse-reset-state-unavailable' };
|
|
556
|
+
}
|
|
557
|
+
try {
|
|
558
|
+
if (this.adapter._nwShuttingDown)
|
|
559
|
+
return { accepted: false, blocked: false, error: 'shutdown' };
|
|
560
|
+
const attempt = await withActuatorShadowContext(this.adapter, this.writeContext(device, owner, reason, manual, false), () => this.rawWrite(objectId, true));
|
|
561
|
+
if (!attempt.accepted) {
|
|
562
|
+
// A rejected authority request never reached the output. Transport errors may have.
|
|
563
|
+
pulse.released = attempt.blocked;
|
|
564
|
+
pulse.busy = false;
|
|
565
|
+
await this.resetPulse(device, pulse);
|
|
566
|
+
return attempt;
|
|
567
|
+
}
|
|
568
|
+
pulse.due = Date.now() + device.pulseMs;
|
|
569
|
+
const schedule = this.adapter._nwSetTimeout || this.adapter.setTimeout;
|
|
570
|
+
if (typeof schedule === 'function')
|
|
571
|
+
schedule.call(this.adapter, () => { void this.resetPulse(device, pulse); }, device.pulseMs);
|
|
458
572
|
return attempt;
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
// Ein kuenstlicher Safety-Owner wuerde mit einer laufenden manuellen Lease
|
|
464
|
-
// konkurrieren und koennte den Reset selbst blockieren.
|
|
465
|
-
await withActuatorShadowContext(this.adapter, {
|
|
466
|
-
...this.writeContext(device, owner, `${reason}:pulse-reset`, manual, true),
|
|
467
|
-
kind: `${this.root()}-pulse-reset`,
|
|
468
|
-
}, () => this.rawWrite(objectId, false));
|
|
469
|
-
};
|
|
470
|
-
if (typeof this.adapter?._nwSetTimeout === 'function')
|
|
471
|
-
this.adapter._nwSetTimeout(() => { void reset(); }, device.pulseMs);
|
|
472
|
-
else if (typeof this.adapter?.setTimeout === 'function' && !this.adapter._nwShuttingDown)
|
|
473
|
-
this.adapter.setTimeout(() => { void reset(); }, device.pulseMs);
|
|
474
|
-
else
|
|
475
|
-
this.adapter?.log?.warn?.(`[${this.root()}] pulse reset for '${objectId}' could not be scheduled safely`);
|
|
476
|
-
return attempt;
|
|
573
|
+
}
|
|
574
|
+
finally {
|
|
575
|
+
pulse.busy = false;
|
|
576
|
+
}
|
|
477
577
|
}
|
|
478
578
|
async writeDesired(device, desiredRunning, owner, reason, manual) {
|
|
479
579
|
if (device.commandProfile === 'run-level') {
|
|
@@ -495,7 +595,7 @@ class PrimeMoverControlModule extends BaseModule {
|
|
|
495
595
|
return neutral;
|
|
496
596
|
return withActuatorShadowContext(this.adapter, this.writeContext(device, owner, reason, manual, !desiredRunning), () => this.rawWrite(active, true));
|
|
497
597
|
}
|
|
498
|
-
return this.pulseWrite(device, desiredRunning ? device.startWriteId : device.stopWriteId, owner, reason, manual);
|
|
598
|
+
return this.pulseWrite(device, desiredRunning ? device.startWriteId : device.stopWriteId, owner, reason, manual, desiredRunning);
|
|
499
599
|
}
|
|
500
600
|
async requestState(device, desiredRunning, reason, manual, readback) {
|
|
501
601
|
const owner = manual ? this.manualOwner(device) : this.automaticOwner(device);
|
|
@@ -509,7 +609,7 @@ class PrimeMoverControlModule extends BaseModule {
|
|
|
509
609
|
return confirmed;
|
|
510
610
|
}
|
|
511
611
|
const runtime = this.getRuntime(device.id);
|
|
512
|
-
if (!manual && device.requireReadback !== true && runtime.lastCmd === command && runtime.lastCmdMs > 0) {
|
|
612
|
+
if (!manual && (device.requireReadback !== true || runtime.restoredPulse) && runtime.lastCmd === command && runtime.lastCmdMs > 0) {
|
|
513
613
|
const settleRemainingMs = device.commandTimeoutMs - (now - runtime.lastCmdMs);
|
|
514
614
|
if (settleRemainingMs > 0) {
|
|
515
615
|
const deferred = this.actuatorContract.defer(key, desiredRunning, now, settleRemainingMs, 'command-settle-wait');
|
|
@@ -547,6 +647,7 @@ class PrimeMoverControlModule extends BaseModule {
|
|
|
547
647
|
});
|
|
548
648
|
runtime.lastCmdMs = Date.now();
|
|
549
649
|
runtime.lastCmd = command;
|
|
650
|
+
runtime.restoredPulse = false;
|
|
550
651
|
await this.setIfChanged(`${this.deviceBase(device)}.lastCommand`, command);
|
|
551
652
|
await this.setIfChanged(`${this.deviceBase(device)}.lastCommandTs`, runtime.lastCmdMs);
|
|
552
653
|
await this.setIfChanged(`${this.deviceBase(device)}.reason`, reason);
|
|
@@ -595,6 +696,14 @@ class PrimeMoverControlModule extends BaseModule {
|
|
|
595
696
|
return;
|
|
596
697
|
const now = Date.now();
|
|
597
698
|
for (const device of this.devices) {
|
|
699
|
+
if (!await this.restorePulse(device))
|
|
700
|
+
continue;
|
|
701
|
+
const pending = this.pendingPulses.get(device.id);
|
|
702
|
+
if (pending && pending.due <= now) {
|
|
703
|
+
await this.resetPulse(device, pending);
|
|
704
|
+
if (this.pendingPulses.has(device.id))
|
|
705
|
+
continue;
|
|
706
|
+
}
|
|
598
707
|
if (!device.enabled)
|
|
599
708
|
continue;
|
|
600
709
|
const base = this.deviceBase(device);
|
|
@@ -637,12 +746,15 @@ class PrimeMoverControlModule extends BaseModule {
|
|
|
637
746
|
const mode = this.normalizeMode(modeState?.val);
|
|
638
747
|
const commandState = await this.adapter.getStateAsync(`${user}.command`).catch(() => null);
|
|
639
748
|
const command = text(commandState?.val).toLowerCase();
|
|
640
|
-
if (command === 'start' || command === 'stop') {
|
|
749
|
+
if ((command === 'start' || command === 'stop') && !this.pendingPulses.has(device.id)) {
|
|
641
750
|
if (mode === 'manual')
|
|
642
751
|
await this.requestState(device, command === 'start', `manual:${command}`, true, running);
|
|
643
752
|
else
|
|
644
753
|
await this.setIfChanged(`${base}.reason`, 'manual:ignored_not_manual');
|
|
645
|
-
|
|
754
|
+
// A new manual command can arrive during the device write; consume only the observed request.
|
|
755
|
+
const current = await this.adapter.getStateAsync(`${user}.command`);
|
|
756
|
+
if (current?.val === commandState?.val && current?.ts === commandState?.ts)
|
|
757
|
+
await this.adapter.setStateAsync(`${user}.command`, '', true);
|
|
646
758
|
}
|
|
647
759
|
let status = '';
|
|
648
760
|
let reason = '';
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
|
|
8
8
|
*
|
|
9
9
|
* Quelle: src-ts/runtime-executables/ems/modules/stage-a-diagnostics.ts
|
|
10
|
-
* Quell-Hash: sha256:
|
|
10
|
+
* Quell-Hash: sha256:0ca3286ca23dbb9360f7cde905e26b38e36ddab99221175fffb4d6d9ad36e544
|
|
11
11
|
* Erzeugung: npm run sync:ts-runtime-executables
|
|
12
12
|
*
|
|
13
13
|
* Zweck:
|
|
@@ -47,7 +47,7 @@ const ACTUATOR_FIELDS = new Set([
|
|
|
47
47
|
'e3dcPowerLimitsUsedObjectId', 'e3dcMaxChargePowerObjectId',
|
|
48
48
|
'e3dcMaxDischargePowerObjectId', 'setSignedPowerId',
|
|
49
49
|
'setChargePowerId', 'setDischargePowerId', 'switchWriteId', 'setpointWriteId',
|
|
50
|
-
'sgReadyAWriteId', 'sgReadyBWriteId', 'sgReady1WriteId', 'sgReady2WriteId',
|
|
50
|
+
'sgReadyAWriteId', 'sgReadyBWriteId', 'sgReady1WriteId', 'sgReady2WriteId', 'miraPvStatusId', 'miraPowerTargetId',
|
|
51
51
|
'writeId', 'writeObjectId', 'writeDp', 'dpWriteId',
|
|
52
52
|
'stageWriteId', 'setpointId', 'outputObjectId', 'commandObjectId', 'commandStateId',
|
|
53
53
|
'enableId', 'startWriteId', 'stopWriteId', 'runWriteId', 'startObjectId',
|
|
@@ -89,6 +89,8 @@ function ownerFromPath(path, row) {
|
|
|
89
89
|
return `storageFarm.${rowId || raw}`;
|
|
90
90
|
if (lower.includes('storage'))
|
|
91
91
|
return `storage.${rowId || raw}`;
|
|
92
|
+
if (lower.includes('thermal') && row?.ovumMira === true && Number.isInteger(row.slot))
|
|
93
|
+
return `thermal.c${row.slot}`;
|
|
92
94
|
if (lower.includes('thermal'))
|
|
93
95
|
return `thermal.${rowId || raw}`;
|
|
94
96
|
if (lower.includes('heatingrod'))
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
|
|
8
8
|
*
|
|
9
9
|
* Quelle: src-ts/runtime-executables/ems/modules/storage-control.ts
|
|
10
|
-
* Quell-Hash: sha256:
|
|
10
|
+
* Quell-Hash: sha256:0e05be0f979975a11f1064b0a4eca4959906ecdd5ead8eab6afccd67d1a6965e
|
|
11
11
|
* Erzeugung: npm run sync:ts-runtime-executables
|
|
12
12
|
*
|
|
13
13
|
* Zweck:
|
|
@@ -74,6 +74,7 @@
|
|
|
74
74
|
'use strict';
|
|
75
75
|
|
|
76
76
|
const { BaseModule } = require('./base');
|
|
77
|
+
const { readFlowMeasurement } = require('../../lib/flow-measurement');
|
|
77
78
|
const { dynamicGridHasControl } = require('../services/dynamic-grid-ownership');
|
|
78
79
|
const { evaluateArbitrageRequest, selectConfiguredArbitrageRequest, configuredArbitrageFallbackProfile } = require('../services/arbitrage-control');
|
|
79
80
|
const { withActuatorShadowContext } = require('../services/actuator-shadow-arbiter');
|
|
@@ -930,13 +931,17 @@ function resolveStorageAntiExportTarget(input = {}) {
|
|
|
930
931
|
// einen zuvor akzeptierten Entladebefehl, darf kein neuer Entladevorgang
|
|
931
932
|
// gestartet werden. Das ist kein Abbruch einer laufenden Regelung, sondern
|
|
932
933
|
// verhindert einen neuen, physikalisch nicht begruendbaren Exportbefehl.
|
|
933
|
-
|
|
934
|
+
// An old self-consumption command cannot prove current battery discharge
|
|
935
|
+
// once its configured meter is unavailable and the NVP is exporting.
|
|
936
|
+
const stopWithoutFeedback = input.dischargeFeedbackLost === true && nvpW < -deadbandW;
|
|
937
|
+
if (belowTarget && (!physicalBaseKnown || stopWithoutFeedback)) {
|
|
934
938
|
return {
|
|
935
939
|
active: true,
|
|
936
940
|
requestedW,
|
|
937
941
|
targetW: 0,
|
|
938
|
-
status: 'block-new-discharge-without-anchor',
|
|
939
|
-
reason:
|
|
942
|
+
status: stopWithoutFeedback ? 'stop-export-without-feedback' : 'block-new-discharge-without-anchor',
|
|
943
|
+
reason: stopWithoutFeedback ? 'NVP-Anti-Export: Entladung gestoppt, konfigurierte Batterie-Istmessung fehlt'
|
|
944
|
+
: `NVP-Anti-Export: keine neue Entladung ohne Ist-/Kommandoanker bei NVP ${Math.round(nvpW)} W`,
|
|
940
945
|
nvpW,
|
|
941
946
|
targetNvpW,
|
|
942
947
|
nvpErrorW,
|
|
@@ -944,7 +949,7 @@ function resolveStorageAntiExportTarget(input = {}) {
|
|
|
944
949
|
graceMs,
|
|
945
950
|
exportActive,
|
|
946
951
|
belowTarget: true,
|
|
947
|
-
explicitStop:
|
|
952
|
+
explicitStop: stopWithoutFeedback,
|
|
948
953
|
capped: true,
|
|
949
954
|
capW: 0,
|
|
950
955
|
proportionalTargetW: 0,
|
|
@@ -2135,8 +2140,10 @@ class SpeicherRegelungModule extends BaseModule {
|
|
|
2135
2140
|
// bleiben weiterhin hart am NVP und an den Speichergrenzen begrenzt.
|
|
2136
2141
|
const storageCoupling = String(cfg.coupling || 'ac').trim().toLowerCase() === 'dc' ? 'dc' : 'ac';
|
|
2137
2142
|
const dcPvMapped = storageCoupling === 'dc' && !!String(cfg.dcPvPowerObjectId || '').trim();
|
|
2138
|
-
const
|
|
2139
|
-
const dcPvPowerAge =
|
|
2143
|
+
const dcPvSampleTs = dcPvMapped ? this.dp?.getVerifiedMeasurementTimestampMs?.('st.dcPvPowerW', now) : null;
|
|
2144
|
+
const dcPvPowerAge = Number.isFinite(dcPvSampleTs) ? now - dcPvSampleTs : null;
|
|
2145
|
+
const dcPvPowerW = dcPvPowerAge !== null && dcPvPowerAge >= 0 && dcPvPowerAge <= staleMs
|
|
2146
|
+
? this.dp.getNumber('st.dcPvPowerW', null) : null;
|
|
2140
2147
|
await this._setIfChanged('speicher.regelung.speicherKopplung', storageCoupling);
|
|
2141
2148
|
await this._setIfChanged('speicher.regelung.dcPvPowerW', (typeof dcPvPowerW === 'number' && Number.isFinite(dcPvPowerW)) ? Math.round(dcPvPowerW) : 0);
|
|
2142
2149
|
await this._setIfChanged('speicher.regelung.dcPvPowerAlterMs', (typeof dcPvPowerAge === 'number' && Number.isFinite(dcPvPowerAge)) ? Math.round(dcPvPowerAge) : null);
|
|
@@ -5667,7 +5674,15 @@ const _prevRampW = (typeof this._lastTargetW === 'number' && Number.isFinite(thi
|
|
|
5667
5674
|
const antiExportCommandAnchorW = lastAcceptedDischargeW > 0
|
|
5668
5675
|
? lastAcceptedDischargeW
|
|
5669
5676
|
: heldDischargeAnchorW;
|
|
5677
|
+
const signedFeedbackConfigured = !farmEnabled && source === 'eigenverbrauch'
|
|
5678
|
+
&& this._getStorageVendorProfile(cfg) === 'generic' && !!this.dp?.getEntry?.('st.batteryPowerW');
|
|
5679
|
+
const directTimestamp = signedFeedbackConfigured && battPowerFeedbackSource === 'single-storage'
|
|
5680
|
+
&& typeof this.dp?.getVerifiedMeasurementTimestampMs === 'function'
|
|
5681
|
+
? this.dp.getVerifiedMeasurementTimestampMs('st.batteryPowerW', now) : battPowerSampleTs;
|
|
5682
|
+
const dischargeFeedbackLost = signedFeedbackConfigured && (!battPowerTrusted || !Number.isFinite(directTimestamp)
|
|
5683
|
+
|| directTimestamp <= 0 || directTimestamp > now || now - directTimestamp > staleMs);
|
|
5670
5684
|
storageAntiExportDiag = resolveStorageAntiExportTarget({
|
|
5685
|
+
dischargeFeedbackLost,
|
|
5671
5686
|
requestedTargetW: targetBeforeAntiExportW,
|
|
5672
5687
|
commandAnchorW: antiExportCommandAnchorW,
|
|
5673
5688
|
storageActualW: antiExportStorageActualW,
|
|
@@ -7298,35 +7313,12 @@ const _prevRampW = (typeof this._lastTargetW === 'number' && Number.isFinite(thi
|
|
|
7298
7313
|
return null;
|
|
7299
7314
|
}
|
|
7300
7315
|
};
|
|
7316
|
+
const getCacheSample = (key) => readFlowMeasurement(adapter.stateCache, key, now, staleMs);
|
|
7301
7317
|
const getCacheAgeMs = (key) => {
|
|
7302
|
-
|
|
7303
|
-
|
|
7304
|
-
const age = adapter._nwGetCacheAgeMs(key, now);
|
|
7305
|
-
return finite(age) ? Math.max(0, Number(age)) : null;
|
|
7306
|
-
}
|
|
7307
|
-
} catch {
|
|
7308
|
-
// Fallback auf den lokalen State-Cache.
|
|
7309
|
-
}
|
|
7310
|
-
const rec = getCacheRecord(key);
|
|
7311
|
-
const ts = Number(rec && rec.ts);
|
|
7312
|
-
return Number.isFinite(ts) && ts > 0 ? Math.max(0, now - ts) : null;
|
|
7313
|
-
};
|
|
7314
|
-
const getCacheValue = (key, fallback = null) => {
|
|
7315
|
-
try {
|
|
7316
|
-
if (adapter && typeof adapter._nwGetNumberFromCacheFresh === 'function') {
|
|
7317
|
-
const value = adapter._nwGetNumberFromCacheFresh(key, staleMs, fallback, now);
|
|
7318
|
-
return finite(value) ? Number(value) : fallback;
|
|
7319
|
-
}
|
|
7320
|
-
} catch {
|
|
7321
|
-
// Fallback auf den lokalen State-Cache.
|
|
7322
|
-
}
|
|
7323
|
-
const rec = getCacheRecord(key);
|
|
7324
|
-
const value = strictFiniteNumber(rec && rec.value, null);
|
|
7325
|
-
const age = getCacheAgeMs(key);
|
|
7326
|
-
if (value === null) return fallback;
|
|
7327
|
-
if (age !== null && age > staleMs) return fallback;
|
|
7328
|
-
return value;
|
|
7318
|
+
const sample = getCacheSample(key);
|
|
7319
|
+
return sample ? now - sample.ts : null;
|
|
7329
7320
|
};
|
|
7321
|
+
const getCacheValue = (key, fallback = null) => getCacheSample(key)?.value ?? fallback;
|
|
7330
7322
|
const getCacheString = (key) => {
|
|
7331
7323
|
const rec = getCacheRecord(key);
|
|
7332
7324
|
if (!rec || rec.value === null || rec.value === undefined) return '';
|
|
@@ -7402,8 +7394,8 @@ const _prevRampW = (typeof this._lastTargetW === 'number' && Number.isFinite(thi
|
|
|
7402
7394
|
const pvCandidates = [];
|
|
7403
7395
|
const pushPv = (value, source, ageMs, priority = 0) => {
|
|
7404
7396
|
if (!finite(value) || Number(value) < 0) return;
|
|
7405
|
-
const age =
|
|
7406
|
-
if (age
|
|
7397
|
+
const age = strictFiniteNumber(ageMs, null);
|
|
7398
|
+
if (age === null || age < 0 || age > staleMs) return;
|
|
7407
7399
|
pvCandidates.push({ w: Math.max(0, Number(value)), source, ageMs: age, priority });
|
|
7408
7400
|
};
|
|
7409
7401
|
|
|
@@ -7421,7 +7413,8 @@ const _prevRampW = (typeof this._lastTargetW === 'number' && Number.isFinite(thi
|
|
|
7421
7413
|
pushPv(
|
|
7422
7414
|
this.dp.getNumberFresh('ps.pvW', staleMs, null),
|
|
7423
7415
|
'ps.pvW',
|
|
7424
|
-
typeof this.dp.
|
|
7416
|
+
typeof this.dp.getVerifiedMeasurementTimestampMs === 'function'
|
|
7417
|
+
? now - (this.dp.getVerifiedMeasurementTimestampMs('ps.pvW', now) ?? -Infinity) : null,
|
|
7425
7418
|
70,
|
|
7426
7419
|
);
|
|
7427
7420
|
}
|
|
@@ -7437,7 +7430,7 @@ const _prevRampW = (typeof this._lastTargetW === 'number' && Number.isFinite(thi
|
|
|
7437
7430
|
|
|
7438
7431
|
const ages = [loadAgeMs, pvAgeMs, nvpAgeMs].filter((v) => finite(v)).map(Number);
|
|
7439
7432
|
const measurementSkewMs = ages.length >= 2 ? Math.max(...ages) - Math.min(...ages) : 0;
|
|
7440
|
-
const nvpFresh = rawNvpW !== null &&
|
|
7433
|
+
const nvpFresh = rawNvpW !== null && nvpAgeMs !== null && nvpAgeMs >= 0 && nvpAgeMs <= staleMs;
|
|
7441
7434
|
const loadFresh = loadW !== null && (loadAgeMs === null || loadAgeMs <= staleMs);
|
|
7442
7435
|
const pvFresh = pvW !== null && (pvAgeMs === null || pvAgeMs <= staleMs);
|
|
7443
7436
|
const aligned = measurementSkewMs <= maxSkewMs;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
|
|
8
8
|
*
|
|
9
9
|
* Quelle: src-ts/runtime-executables/ems/modules/storage-mapping.ts
|
|
10
|
-
* Quell-Hash: sha256:
|
|
10
|
+
* Quell-Hash: sha256:28e7bb224e3422ced7408bdf6231a491db4180efab7b605b12b140b4ccbeb087
|
|
11
11
|
* Erzeugung: npm run sync:ts-runtime-executables
|
|
12
12
|
*
|
|
13
13
|
* Zweck:
|
|
@@ -92,19 +92,20 @@ class SpeicherMappingModule extends BaseModule {
|
|
|
92
92
|
await this._setIfChanged('speicher.socAlterMs', Math.round(socAge));
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
//
|
|
96
|
-
//
|
|
97
|
-
// oder den gemischten AC-Ausgang als PV-Quelle missverstehen.
|
|
98
|
-
// Wichtig: Der Wert wird nur bei aktivem DC-/Hybrid-Typ und gemapptem DP genutzt;
|
|
99
|
-
// alte Mapping-Reste aus AC-Konfigurationen werden bewusst auf 0 gespiegelt.
|
|
95
|
+
// Repeated equal measurements keep their physical timestamp. An unmapped,
|
|
96
|
+
// invalid or missing source must not create a measured 0 W after restart.
|
|
100
97
|
const cfg = this._getCfg();
|
|
101
|
-
const
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
|
|
98
|
+
const mapped = cfg.coupling === 'dc' && !!String(cfg.dp?.dcPvPowerObjectId || '').trim();
|
|
99
|
+
const now = Date.now();
|
|
100
|
+
const ts = mapped ? this.dp.getVerifiedMeasurementTimestampMs?.('st.dcPvPowerW', now) : null;
|
|
101
|
+
const value = Number.isFinite(ts) ? this.dp.getNumber('st.dcPvPowerW', null) : null;
|
|
102
|
+
const observation = Number.isFinite(value) ? { val: Math.round(value), ts } : { val: null, ts: null };
|
|
103
|
+
const last = this._lastDcPvObservation;
|
|
104
|
+
if (!last || last.val !== observation.val || last.ts !== observation.ts) {
|
|
105
|
+
await this.adapter.setStateAsync('speicher.dcPvPowerW', { val: observation.val, ack: true, ts: observation.ts ?? now });
|
|
106
|
+
this._lastDcPvObservation = observation;
|
|
107
107
|
}
|
|
108
|
+
|
|
108
109
|
}
|
|
109
110
|
|
|
110
111
|
async _ensureStates() {
|
|
@@ -150,7 +151,7 @@ class SpeicherMappingModule extends BaseModule {
|
|
|
150
151
|
{ id: `${base}.mapping.e3dcMaxDischargePowerId`, name: 'E3/DC EMS.MAX_DISCHARGE_POWER Datenpunkt-ID', type: 'string', role: 'text', def: '' },
|
|
151
152
|
|
|
152
153
|
{ id: `${base}.socPct`, name: 'Speicher Ladezustand (SoC)', type: 'number', role: 'value.battery', def: 0 },
|
|
153
|
-
{ id: `${base}.dcPvPowerW`, name: 'DC-/Hybrid-PV Erzeugungsleistung', type: 'number', role: 'value.power', def:
|
|
154
|
+
{ id: `${base}.dcPvPowerW`, name: 'DC-/Hybrid-PV Erzeugungsleistung', type: 'number', role: 'value.power', def: null },
|
|
154
155
|
{ id: `${base}.socAlterMs`, name: 'SoC Alter (ms)', type: 'number', role: 'value.interval', def: 0 },
|
|
155
156
|
];
|
|
156
157
|
|