iobroker.eos-admin 9.0.18 → 9.0.19
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 +8 -9
- package/README.md +4 -2
- package/START_HIER_9.0.19.md +52 -0
- package/adminWww/.vite/manifest.json +114 -114
- package/adminWww/NEXOWATT_EOS_FRONTEND_MANIFEST.json +13759 -13759
- package/adminWww/assets/{AdapterUpdateDialog-ByJk9Cxj.js → AdapterUpdateDialog-JOf2z4Vg.js} +1 -1
- package/adminWww/assets/{Adapters-V2JtEPZX.js → Adapters-C9fcSdWm.js} +1 -1
- package/adminWww/assets/{ConfigManager-BKcdyJnN.js → ConfigManager-BeeLlT6D.js} +1 -1
- package/adminWww/assets/{Enums-ChbfAWzp.js → Enums-FqnXWl8U.js} +1 -1
- package/adminWww/assets/{Fields-DzaVXEvg.js → Fields-DMgrt5Pi.js} +1 -1
- package/adminWww/assets/{Files-CRpIXj4X.js → Files-CIHtt12g.js} +1 -1
- package/adminWww/assets/{Hosts-rOgfd2wo.js → Hosts-fPLBzvTy.js} +1 -1
- package/adminWww/assets/{Instances-BxLhJ6Pb.js → Instances-4XaVQlrT.js} +1 -1
- package/adminWww/assets/{Intro-BOql527d.js → Intro-5TKriiLO.js} +1 -1
- package/adminWww/assets/{Logs-WUUDY7a4.js → Logs-33zcIds-.js} +1 -1
- package/adminWww/assets/{Objects-DYaZkCK7.js → Objects-CNQPVbNG.js} +1 -1
- package/adminWww/assets/{Overview-C6hiiPbm.js → Overview-BskXGOc8.js} +1 -1
- package/adminWww/assets/{State-AH43l7fG.js → State-C8SJ_Iqo.js} +1 -1
- package/adminWww/assets/{UsedResources-jhsRMH4X.js → UsedResources-CgqRa9ei.js} +1 -1
- package/adminWww/assets/{Users-D9wyLyJ1.js → Users-0JVYWR9u.js} +1 -1
- package/adminWww/assets/{bootstrap-gVLo1K_2.js → bootstrap-D16lu6rd.js} +3 -3
- package/adminWww/assets/{hostInit-Dt_M-NAC.js → hostInit-C8YZJuzi.js} +1 -1
- package/adminWww/assets/{icons-material-DuVW_EUA.js → icons-material-CiNJ_6Ur.js} +1 -1
- package/adminWww/assets/{index-B1cnPkSO.js → index-DA9Sphgh.js} +2 -2
- package/adminWww/assets/{installSVGRenderer-GvgHjubR.js → installSVGRenderer-DPdkRa_d.js} +1 -1
- package/adminWww/assets/{mf-entry-bootstrap-0-6b32b635.js → mf-entry-bootstrap-0-a7ab91de.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.19.js +12 -0
- package/adminWww/remoteEntry.js +1 -1
- package/build/lib/eosCookieNamespace.js +12 -2
- package/build/lib/eosCookieNamespace.js.map +1 -1
- package/build/lib/eosDeviceEmsPlan.js +432 -24
- package/build/lib/eosDeviceEmsPlan.js.map +1 -1
- package/build/lib/eosDeviceEmsService.js +106 -10
- package/build/lib/eosDeviceEmsService.js.map +1 -1
- package/build/lib/eosModuleHost.js +178 -53
- package/build/lib/eosModuleHost.js.map +1 -1
- package/build/lib/web.js +19 -3
- package/build/lib/web.js.map +1 -1
- package/docs/reports/unified-9.0.19/ALIAS_MESSWERTFRISCHE.md +31 -0
- package/docs/reports/unified-9.0.19/COMMISSIONING_PLAN_REVIEW.md +56 -0
- package/docs/reports/unified-9.0.19/EMS_ABSCHLUSSREVIEW.md +43 -0
- package/docs/reports/unified-9.0.19/EMS_KATEGORIEN_ABDECKUNG.md +66 -0
- package/docs/reports/unified-9.0.19/EMS_VERGLEICH_UND_KOPPLUNG.md +25 -0
- package/docs/reports/unified-9.0.19/EVCS_STATE_OBJECTS.md +47 -0
- package/docs/reports/unified-9.0.19/GERAETE_EMS_EINRICHTUNG.md +100 -0
- package/docs/reports/unified-9.0.19/GERAETE_STARTAUSFALL.md +37 -0
- package/docs/reports/unified-9.0.19/INSTALLER_LIFECYCLE_REVIEW.md +59 -0
- package/docs/reports/unified-9.0.19/LEGACY_REGRESSION_REVIEW.md +42 -0
- package/docs/reports/unified-9.0.19/MODBUS_AUTHORIZATION_READS.md +25 -0
- package/docs/reports/unified-9.0.19/PRUEFBERICHT.md +56 -0
- package/docs/reports/unified-9.0.19/RUNTIME_START_UEBERNAHME.md +33 -0
- package/docs/reports/unified-9.0.19/SMA_RECEIVER_LIFECYCLE.md +42 -0
- package/docs/reports/unified-9.0.19/STATIC_REVIEW_DE.md +11 -0
- package/docs/reports/unified-9.0.19/TARIFF_PRICE_VALUES_REVIEW.md +31 -0
- package/docs/reports/unified-9.0.19/TARIF_VIERTELSTUNDEN_RUNTIME.md +17 -0
- package/docs/reports/unified-9.0.19/UNABHAENGIGER_REVIEW.md +49 -0
- package/docs/reports/unified-9.0.19/raw/INDEX.json +751 -0
- package/docs/reports/unified-9.0.19/raw/audit-full.log +345 -0
- package/docs/reports/unified-9.0.19/raw/audit-full.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/audit-runtime.log +23 -0
- package/docs/reports/unified-9.0.19/raw/audit-runtime.result.json +15 -0
- package/docs/reports/unified-9.0.19/raw/backend-final.log +5 -0
- package/docs/reports/unified-9.0.19/raw/backend-final.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/devices-hosted-typecheck-node22.log +0 -0
- package/docs/reports/unified-9.0.19/raw/devices-hosted-typecheck-node22.result.json +15 -0
- package/docs/reports/unified-9.0.19/raw/devices-hosted-typecheck-node24.log +0 -0
- package/docs/reports/unified-9.0.19/raw/devices-hosted-typecheck-node24.result.json +15 -0
- package/docs/reports/unified-9.0.19/raw/devices-incident-build.log +5 -0
- package/docs/reports/unified-9.0.19/raw/devices-incident-host-final.log +70 -0
- package/docs/reports/unified-9.0.19/raw/devices-incident-lease-918-before.log +26 -0
- package/docs/reports/unified-9.0.19/raw/devices-incident-lease-after.log +9 -0
- package/docs/reports/unified-9.0.19/raw/devices-incident-metadata-after.log +11 -0
- package/docs/reports/unified-9.0.19/raw/devices-incident-metadata-before.log +28 -0
- package/docs/reports/unified-9.0.19/raw/devices-incident-web-pipeline.log +22 -0
- package/docs/reports/unified-9.0.19/raw/frontend-build.log +152 -0
- package/docs/reports/unified-9.0.19/raw/frontend-build.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/installer-build.log +26 -0
- package/docs/reports/unified-9.0.19/raw/installer-build.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/keygen-source.json +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-auto-pv.log +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-auto-pv.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-charging-grid-cap-clamp.log +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-charging-grid-cap-clamp.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-charging-grid-cap-safe.log +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-charging-grid-cap-safe.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-charging-mode-recovery.log +539 -0
- package/docs/reports/unified-9.0.19/raw/legacy-charging-mode-recovery.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-core-limits-phase1.log +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-core-limits-phase1.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-core-limits-phase2.log +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-core-limits-phase2.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-core-limits-tariff-final.log +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-core-limits-tariff-final.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-energy-wallet-final.log +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-energy-wallet-final.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-farm-dispatch-loader-current.log +2 -0
- package/docs/reports/unified-9.0.19/raw/legacy-farm-dispatch-loader-current.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-final-write-envelope.log +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-final-write-envelope.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-history-http.log +39 -0
- package/docs/reports/unified-9.0.19/raw/legacy-history-http.result.json +15 -0
- package/docs/reports/unified-9.0.19/raw/legacy-import-grid-budget.log +30 -0
- package/docs/reports/unified-9.0.19/raw/legacy-import-grid-budget.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-import-grid-contract-current.log +2 -0
- package/docs/reports/unified-9.0.19/raw/legacy-import-grid-contract-current.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-live-mode-loader-current.log +203 -0
- package/docs/reports/unified-9.0.19/raw/legacy-live-mode-loader-current.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-load-grid-sanity.log +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-load-grid-sanity.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-ocpp-stability.log +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-ocpp-stability.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-ocpp21-storage-safety.log +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-ocpp21-storage-safety.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-permanent-grid-protection.log +18 -0
- package/docs/reports/unified-9.0.19/raw/legacy-permanent-grid-protection.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-storage-dp-persistence.log +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-storage-dp-persistence.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-storage-farm-dispatch-recovery.log +16 -0
- package/docs/reports/unified-9.0.19/raw/legacy-storage-farm-dispatch-recovery.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-storage-functional-safety.log +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-storage-functional-safety.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-storage-topology-loader-current.log +2 -0
- package/docs/reports/unified-9.0.19/raw/legacy-storage-topology-loader-current.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-test-loader.cjs +47 -0
- package/docs/reports/unified-9.0.19/raw/lint-final.log +16 -0
- package/docs/reports/unified-9.0.19/raw/lint-final.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/modules-build.log +5 -0
- package/docs/reports/unified-9.0.19/raw/modules-build.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/node22-tests-final.log +10719 -0
- package/docs/reports/unified-9.0.19/raw/node22-tests-final.result.json +13 -0
- package/docs/reports/unified-9.0.19/raw/node22-typecheck-final.log +7 -0
- package/docs/reports/unified-9.0.19/raw/node22-typecheck-final.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/node22-version.log +1 -0
- package/docs/reports/unified-9.0.19/raw/node24-tests-final.log +1805 -0
- package/docs/reports/unified-9.0.19/raw/node24-tests-final.result.json +13 -0
- package/docs/reports/unified-9.0.19/raw/node24-typecheck-final.log +5 -0
- package/docs/reports/unified-9.0.19/raw/node24-typecheck-final.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/node24-version.log +1 -0
- package/docs/reports/unified-9.0.19/raw/sbom-runtime.log +7 -0
- package/docs/reports/unified-9.0.19/raw/sbom-runtime.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/sbom-vendor-check.log +1 -0
- package/docs/reports/unified-9.0.19/raw/sbom-vendor-check.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/tariff-price-chain-919.log +11 -0
- package/docs/reports/unified-9.0.19/raw/tariff-price-chain-919.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/tariff-price-chain-old-918.log +68 -0
- package/docs/reports/unified-9.0.19/raw/tariff-price-chain-old-918.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/ui-docs-check.log +6 -0
- package/docs/reports/unified-9.0.19/raw/ui-docs-check.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/ui-runtime-final.log +7 -0
- package/docs/reports/unified-9.0.19/raw/ui-runtime-final.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/ui-runtime-sync.log +6 -0
- package/docs/reports/unified-9.0.19/raw/ui-runtime-sync.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/ui-sbom-check.log +6 -0
- package/docs/reports/unified-9.0.19/raw/ui-sbom-check.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/ui-sbom-final.log +6 -0
- package/docs/reports/unified-9.0.19/raw/ui-sbom-final.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/ui-secret-final.log +6 -0
- package/docs/reports/unified-9.0.19/raw/ui-secret-final.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/ui-security-final.log +8 -0
- package/docs/reports/unified-9.0.19/raw/ui-security-final.result.json +14 -0
- package/io-package.json +8 -8
- package/modules/devices/admin/ems-assignment.d.ts +8 -2
- package/modules/devices/admin/ems-assignment.js +192 -30
- package/modules/devices/admin/host-bridge.js +36 -11
- package/modules/devices/admin/index.html +26 -5
- package/modules/devices/admin/index_m.js +87 -3
- package/modules/devices/admin/style.css +17 -4
- package/modules/devices/checks/emsAssignment.check.js +10 -6
- package/modules/devices/contracts.d.ts +1 -1
- package/modules/devices/index.js +54 -17
- package/modules/devices/lib/deviceAliasFreshness.js +65 -0
- package/modules/devices/lib/deviceRuntime.js +201 -127
- package/modules/devices/lib/drivers/modbus.js +18 -3
- package/modules/devices/lib/drivers/speedwire.js +42 -22
- package/modules/devices/test/deviceAliasFreshness.test.js +149 -0
- package/modules/devices/test/emsAssignmentUi.test.js +119 -11
- package/modules/devices/test/modbusAuthorizationReads.test.js +112 -0
- package/modules/devices/test/runtimeLiveness.test.js +1 -1
- package/modules/devices/test/speedwireLifecycle.test.js +118 -0
- package/modules/devices/tsconfig.alias-semantics.json +1 -1
- package/modules/devices/tsconfig.hosted.json +1 -1
- package/package.json +9 -7
- package/release-manifests/unified/build-environment.cdx.json +1483 -7370
- package/release-manifests/unified/files.json +295 -133
- package/release-manifests/unified/frontend.cdx.json +2688 -5952
- package/release-manifests/unified/installer.cdx.json +2053 -821
- package/release-manifests/unified/obsolete-admin-assets.json +88 -6
- package/release-manifests/unified/runtime.cdx.json +40 -3283
- package/release-manifests/unified/validation.json +15 -15
- package/tools/eos-release-manifest.cjs +3 -3
- package/ui/docs/security/eslint-reviewed-findings.json +20 -20
- package/ui/ems/engine.js +54 -7
- package/ui/ems/module-manager.js +44 -21
- package/ui/ems/modules/core-limits.js +5 -3
- package/ui/ems/modules/energy-wallet.js +31 -32
- package/ui/ems/modules/storage-control.js +5 -4
- package/ui/ems/modules/tarif-vis.js +36 -24
- package/ui/ems/modules/tariff-provider.js +28 -6
- package/ui/ems/services/tariff-provider-registry.js +11 -8
- package/ui/io-package.json +1 -1
- package/ui/lib/customer-tariff.js +5 -1
- package/ui/lib/installer-lifecycle.js +134 -1
- package/ui/lib/storage-farm-overview.js +115 -0
- package/ui/lib/tariff-price.js +115 -0
- package/ui/main.js +202 -51
- package/ui/package.json +8 -2
- package/ui/www/app.js +47 -134
- package/ui/www/ems-apps.html +2 -0
- package/ui/www/ems-apps.js +14 -2
- package/ui/www/index.html +2 -0
- package/ui/www/licenses/smarthome-markdown-components.json +156 -156
- package/ui/www/manifest.webmanifest +2 -2
- package/ui/www/power-measurements.js +62 -0
- package/ui/www/settings.html +2 -0
- package/ui/www/storagefarm-summary.css +17 -0
- package/ui/www/storagefarm-summary.js +136 -0
- package/ui/www/storagefarm.html +16 -1
- package/ui/www/storagefarm.js +10 -22
- package/ui/www/tariff-display.js +161 -0
- package/adminWww/remoteEntry-eos-9.0.18.js +0 -12
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
|
|
8
8
|
*
|
|
9
9
|
* Quelle: src-ts/runtime-executables/ems/modules/core-limits.ts
|
|
10
|
-
* Quell-Hash: sha256:
|
|
10
|
+
* Quell-Hash: sha256:1b7a9c9b7f69a644713610de9afd141a124b8af89ed993c0aa5f0f9e463e61e9
|
|
11
11
|
* Erzeugung: npm run sync:ts-runtime-executables
|
|
12
12
|
*
|
|
13
13
|
* Zweck:
|
|
@@ -72,6 +72,7 @@
|
|
|
72
72
|
*/
|
|
73
73
|
|
|
74
74
|
'use strict';
|
|
75
|
+
const { readTariffPriceState } = require('../../lib/tariff-price');
|
|
75
76
|
|
|
76
77
|
|
|
77
78
|
/**
|
|
@@ -2948,10 +2949,11 @@ class CoreLimitsModule extends BaseModule {
|
|
|
2948
2949
|
|
|
2949
2950
|
const tariffActive = await readStateBool(this.adapter, 'tarif.aktiv', false);
|
|
2950
2951
|
const tariffState = await readStateString(this.adapter, 'tarif.state', '');
|
|
2951
|
-
const
|
|
2952
|
+
const tariffCurrentPriceFresh = await readStateBool(this.adapter, 'tarif.currentPriceFresh', null);
|
|
2953
|
+
const tariffCurrentPrice = tariffCurrentPriceFresh === false ? null : await readTariffPriceState(this.adapter, 'tarif.preisAktuellEurProKwh');
|
|
2952
2954
|
const tariffNegativeActive = await readStateBool(this.adapter, 'tarif.negativpreisAktiv', false);
|
|
2953
2955
|
const tariffGridImportPreferred = await readStateBool(this.adapter, 'tarif.netzbezugBevorzugt', tariffNegativeActive);
|
|
2954
|
-
const tariffNegativeMinPrice = await
|
|
2956
|
+
const tariffNegativeMinPrice = await readTariffPriceState(this.adapter, 'tarif.negativPreisMinEurProKwh');
|
|
2955
2957
|
const tariffNextNegativeFrom = await readStateString(this.adapter, 'tarif.naechstesNegativVon', '');
|
|
2956
2958
|
const tariffNextNegativeTo = await readStateString(this.adapter, 'tarif.naechstesNegativBis', '');
|
|
2957
2959
|
const tariffStatus = await readStateString(this.adapter, 'tarif.negativpreisStatus', '');
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
|
|
8
8
|
*
|
|
9
9
|
* Quelle: src-ts/runtime-executables/ems/modules/energy-wallet.ts
|
|
10
|
-
* Quell-Hash: sha256:
|
|
10
|
+
* Quell-Hash: sha256:0b1e11b104246e2b2e8584deb7d80d7ca353f61d2d770f1136eef413d04ffb69
|
|
11
11
|
* Erzeugung: npm run sync:ts-runtime-executables
|
|
12
12
|
*
|
|
13
13
|
* Zweck:
|
|
@@ -72,6 +72,7 @@
|
|
|
72
72
|
*/
|
|
73
73
|
'use strict';
|
|
74
74
|
const { BaseModule } = require('./base');
|
|
75
|
+
const { tariffPriceNumber } = require('../../lib/tariff-price');
|
|
75
76
|
function num(v, fallback = null) {
|
|
76
77
|
const n = Number(v);
|
|
77
78
|
return Number.isFinite(n) ? n : fallback;
|
|
@@ -106,13 +107,13 @@ function yearKeyLocal(date = new Date()) {
|
|
|
106
107
|
return String(date.getFullYear());
|
|
107
108
|
}
|
|
108
109
|
|
|
109
|
-
function normalizePriceEurPerKwh(value, fallback) {
|
|
110
|
-
const n =
|
|
110
|
+
function normalizePriceEurPerKwh(value, fallback, explicitEur = false) {
|
|
111
|
+
const n = tariffPriceNumber(value);
|
|
111
112
|
if (!Number.isFinite(n)) return fallback;
|
|
112
113
|
const abs = Math.abs(n);
|
|
113
114
|
// Installer geben Preise häufig in ct/kWh ein. Werte >2 und <=500 interpretieren wir als ct/kWh.
|
|
114
|
-
const eur = abs > 2 && abs <= 500 ? n / 100 : n;
|
|
115
|
-
if (!Number.isFinite(eur) || eur < -2 || eur > 5) return fallback;
|
|
115
|
+
const eur = !explicitEur && abs > 2 && abs <= 500 ? n / 100 : n;
|
|
116
|
+
if (!Number.isFinite(eur) || (explicitEur ? Math.abs(eur) > 100 : eur < -2 || eur > 5)) return fallback;
|
|
116
117
|
return eur;
|
|
117
118
|
}
|
|
118
119
|
|
|
@@ -415,37 +416,34 @@ class EnergyWalletModule extends BaseModule {
|
|
|
415
416
|
const rec = this._cacheEntry(key);
|
|
416
417
|
if (!rec) continue;
|
|
417
418
|
const raw = rec && typeof rec === 'object' && Object.prototype.hasOwnProperty.call(rec, 'value') ? rec.value : rec;
|
|
418
|
-
const n =
|
|
419
|
-
if (
|
|
419
|
+
const n = tariffPriceNumber(raw);
|
|
420
|
+
if (n !== null) return n;
|
|
420
421
|
}
|
|
421
422
|
return fallback;
|
|
422
423
|
}
|
|
423
424
|
|
|
424
425
|
|
|
425
|
-
_readStateCandidate(keys) {
|
|
426
|
-
//
|
|
427
|
-
//
|
|
428
|
-
//
|
|
429
|
-
// und ein alter Zeittarif sauber auf den festen Preis zurückfallen.
|
|
426
|
+
_readStateCandidate(keys, maxAgeSec = 7200) {
|
|
427
|
+
// A missing derived budget price must not hide a real current provider price.
|
|
428
|
+
// Inspect every candidate's own timestamp; retain a stale candidate only for
|
|
429
|
+
// diagnosis after all fresher fallbacks have been considered.
|
|
430
430
|
const list = Array.isArray(keys) ? keys : [keys];
|
|
431
431
|
const now = Date.now();
|
|
432
|
+
let staleCandidate = null;
|
|
432
433
|
for (const key of list) {
|
|
433
|
-
const
|
|
434
|
-
|
|
434
|
+
const cached = this.adapter?.stateCache && Object.prototype.hasOwnProperty.call(this.adapter.stateCache, key) ? Reflect.get(this.adapter.stateCache, key) : null;
|
|
435
|
+
const rec = cached && typeof cached === 'object' && !Array.isArray(cached) ? cached : null;
|
|
436
|
+
if (!rec || (rec.q !== undefined && rec.q !== 0)) continue;
|
|
435
437
|
const raw = rec && typeof rec === 'object' && Object.prototype.hasOwnProperty.call(rec, 'value') ? rec.value : rec;
|
|
436
|
-
const n =
|
|
437
|
-
if (
|
|
438
|
-
const
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
value: n,
|
|
444
|
-
ts,
|
|
445
|
-
ageSec: Math.max(0, Math.round((now - ts) / 1000)),
|
|
446
|
-
};
|
|
438
|
+
const n = tariffPriceNumber(raw);
|
|
439
|
+
if (n === null) continue;
|
|
440
|
+
const ts = typeof rec.ts === 'number' ? rec.ts : null;
|
|
441
|
+
if (ts === null || !Number.isFinite(ts) || ts <= 0 || ts > now + 1000) continue;
|
|
442
|
+
const candidate = { found: true, key: String(key), value: n, ts, ageSec: Math.max(0, Math.round((now - ts) / 1000)) };
|
|
443
|
+
if (candidate.ageSec <= maxAgeSec) return candidate;
|
|
444
|
+
if (!staleCandidate) staleCandidate = candidate;
|
|
447
445
|
}
|
|
448
|
-
return { found: false, key: '', value: null, ts: 0, ageSec: 0 };
|
|
446
|
+
return staleCandidate || { found: false, key: '', value: null, ts: 0, ageSec: 0 };
|
|
449
447
|
}
|
|
450
448
|
|
|
451
449
|
|
|
@@ -611,6 +609,8 @@ class EnergyWalletModule extends BaseModule {
|
|
|
611
609
|
// - Quelle, Alter und Fallback-Grund werden veröffentlicht, damit Nutzerkarte und
|
|
612
610
|
// Installateurdiagnose nicht dieselbe Warnsprache verwenden müssen.
|
|
613
611
|
const dynamicTariffActive = this._readStateBool(['settings.dynamicTariff', 'dynamicTariff'], false);
|
|
612
|
+
const maxAgeSecRaw = cfg.dynamicTariffMaxAgeSec !== undefined ? Number(cfg.dynamicTariffMaxAgeSec) : 7200;
|
|
613
|
+
const maxAgeSec = Math.round(clamp(Number.isFinite(maxAgeSecRaw) ? maxAgeSecRaw : 7200, 60, 86400));
|
|
614
614
|
const tariffCandidate = this._readStateCandidate([
|
|
615
615
|
'ems.budget.tariff.currentPriceEurKwh',
|
|
616
616
|
'tarif.preisAktuellEurProKwh',
|
|
@@ -618,12 +618,11 @@ class EnergyWalletModule extends BaseModule {
|
|
|
618
618
|
'priceCurrent',
|
|
619
619
|
'tarif.priceCurrent',
|
|
620
620
|
'tariff.priceCurrent',
|
|
621
|
-
]);
|
|
622
|
-
const
|
|
623
|
-
const
|
|
624
|
-
const
|
|
625
|
-
const
|
|
626
|
-
const tariffFresh = tariffFinite && (!tariffCandidate.found || tariffCandidate.ageSec <= maxAgeSec);
|
|
621
|
+
], maxAgeSec);
|
|
622
|
+
const canonicalEurPrice = ['ems.budget.tariff.currentPriceEurKwh', 'tarif.preisAktuellEurProKwh', 'historie.tariff.providerCurrentEurPerKwh'].includes(tariffCandidate.key);
|
|
623
|
+
const tariffNow = tariffCandidate.found ? normalizePriceEurPerKwh(tariffCandidate.value, null, canonicalEurPrice) : null;
|
|
624
|
+
const tariffFinite = tariffCandidate.found && typeof tariffNow === 'number' && Number.isFinite(tariffNow);
|
|
625
|
+
const tariffFresh = tariffFinite && tariffCandidate.ageSec <= maxAgeSec;
|
|
627
626
|
const dynamicTariffAvailable = dynamicTariffActive && tariffFinite && tariffFresh;
|
|
628
627
|
|
|
629
628
|
const fixedInput = this._readStateNumber([
|
|
@@ -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:e8d44e13782e130773163c03326564b675e324cdd0783367adaf10f6c232f9d8
|
|
11
11
|
* Erzeugung: npm run sync:ts-runtime-executables
|
|
12
12
|
*
|
|
13
13
|
* Zweck:
|
|
@@ -8188,9 +8188,10 @@ const _prevRampW = (typeof this._lastTargetW === 'number' && Number.isFinite(thi
|
|
|
8188
8188
|
const appsRoot = (rootCfg.emsApps && typeof rootCfg.emsApps === 'object') ? rootCfg.emsApps : {};
|
|
8189
8189
|
const apps = (appsRoot.apps && typeof appsRoot.apps === 'object') ? appsRoot.apps : {};
|
|
8190
8190
|
const singleApp = (apps.storage && typeof apps.storage === 'object') ? apps.storage : null;
|
|
8191
|
-
const
|
|
8191
|
+
const deviceAssignmentDisabled = rootCfg.storage?._eosDevice?.v === 1 && rootCfg.storage?.enabled === false;
|
|
8192
|
+
const singleAppActive = !deviceAssignmentDisabled && (singleApp
|
|
8192
8193
|
? (singleApp.installed === true && singleApp.enabled === true)
|
|
8193
|
-
: (rootCfg.enableStorageControl === true);
|
|
8194
|
+
: (rootCfg.enableStorageControl === true));
|
|
8194
8195
|
|
|
8195
8196
|
const farm = (this.adapter && typeof this.adapter._nwGetStorageFarmRuntimeInfo === 'function')
|
|
8196
8197
|
? this.adapter._nwGetStorageFarmRuntimeInfo()
|
|
@@ -8280,7 +8281,7 @@ const _prevRampW = (typeof this._lastTargetW === 'number' && Number.isFinite(thi
|
|
|
8280
8281
|
? (app.installed === true && app.enabled === true)
|
|
8281
8282
|
: (rootCfg.enableStorageFarm === true);
|
|
8282
8283
|
|
|
8283
|
-
return !!(enabledByConfig && configuredCount >=
|
|
8284
|
+
return !!(enabledByConfig && configuredCount >= 1);
|
|
8284
8285
|
} catch {
|
|
8285
8286
|
return false;
|
|
8286
8287
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
|
|
8
8
|
*
|
|
9
9
|
* Quelle: src-ts/runtime-executables/ems/modules/tarif-vis.ts
|
|
10
|
-
* Quell-Hash: sha256:
|
|
10
|
+
* Quell-Hash: sha256:2059a2f9ed5bc8d2350a4885ae37d34153bc6825549fc50d562d59470c5d9ace
|
|
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 { tariffPriceUnit, normalizeTariffPrice } = require('../../lib/tariff-price');
|
|
77
78
|
|
|
78
79
|
/**
|
|
79
80
|
* Speicher-Netzladen ist strikt an einen frischen, aktiven und als „günstig“
|
|
@@ -528,22 +529,28 @@ class TarifVisModule extends BaseModule {
|
|
|
528
529
|
* Zusammenhang: Gehört zu EMS-Modul (Regelungs-, Diagnose- oder Beratungslogik innerhalb der EMS-Engine) und wird von benachbarten UI-/API-/EMS-Bausteinen genutzt.
|
|
529
530
|
* Wartung/TypeScript: Änderungen an Signatur oder Rückgabe können abhängige Aufrufer beeinflussen; Aufrufstellen mitprüfen. Beim TS-Umbau Parameter, Rückgabe und genutzte State-/Config-Objekte explizit typisieren.
|
|
530
531
|
*/
|
|
531
|
-
_normalizePriceEurPerKwh(v, fallback = null) {
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
532
|
+
_normalizePriceEurPerKwh(v, fallback = null, unit = 'auto') {
|
|
533
|
+
// Preserve the established locale parser, but never interpret status values as money.
|
|
534
|
+
if (typeof v !== 'number' && typeof v !== 'string') return fallback;
|
|
535
|
+
const parsed = this._num(v, null);
|
|
536
|
+
const value = normalizeTariffPrice(parsed, tariffPriceUnit(unit));
|
|
537
|
+
return value === null ? fallback : value;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
/** Preis-Einheit aus dem tatsächlichen Mapping: eigene Provider-DPs sind EUR/kWh.
|
|
541
|
+
* Manuelle Einheiten bleiben erhalten; nicht typisierte Legacy-Quellen nutzen Auto. */
|
|
542
|
+
_priceInputUnit(key, field, providerSuffix) {
|
|
543
|
+
const entry = this.dp && typeof this.dp.getEntry === 'function' ? this.dp.getEntry(key) : null;
|
|
544
|
+
if (entry?.objectId === `${this.adapter.namespace}.tariffProvider.${providerSuffix}`) return 'EUR/kWh';
|
|
545
|
+
const units = this.adapter?.config?.units || {};
|
|
546
|
+
const configured = field === 'priceCurrent' ? units.priceCurrent : field === 'priceAverage' ? units.priceAverage
|
|
547
|
+
: field === 'priceTodayJson' ? units.priceTodayJson : field === 'priceTomorrowJson' ? units.priceTomorrowJson : '';
|
|
548
|
+
for (const candidate of [configured, entry?.unitIn, entry?.unit]) {
|
|
549
|
+
const unit = tariffPriceUnit(candidate);
|
|
550
|
+
if (unit !== 'auto') return unit;
|
|
551
|
+
}
|
|
552
|
+
return 'auto';
|
|
553
|
+
}
|
|
547
554
|
|
|
548
555
|
/**
|
|
549
556
|
* Code-Teil: Methode `_parsePriceCurve`
|
|
@@ -557,7 +564,7 @@ class TarifVisModule extends BaseModule {
|
|
|
557
564
|
* Zusammenhang: Teil von EMS-Modul: Regelung, Diagnose oder Beratung; Aufrufstellen und abhängige States/APIs beim Ändern mitprüfen.
|
|
558
565
|
* TypeScript: Parameter, Rückgabewert und verwendete Config-/State-Objekte später explizit typisieren.
|
|
559
566
|
*/
|
|
560
|
-
_parsePriceCurve(raw) {
|
|
567
|
+
_parsePriceCurve(raw, unit = 'auto') {
|
|
561
568
|
// Accepts either a JSON string or already-parsed array/object.
|
|
562
569
|
// Expected (tibber-like) schema: [{ total: 0.318, startsAt: "...", endsAt: "..." }, ...]
|
|
563
570
|
if (raw === null || raw === undefined) return [];
|
|
@@ -629,7 +636,7 @@ class TarifVisModule extends BaseModule {
|
|
|
629
636
|
continue;
|
|
630
637
|
}
|
|
631
638
|
const raw = (typeof it === 'number') ? it : Number(String(it).trim());
|
|
632
|
-
const priceEurKwh = this._normalizePriceEurPerKwh(raw, null);
|
|
639
|
+
const priceEurKwh = this._normalizePriceEurPerKwh(raw, null, unit);
|
|
633
640
|
if (!Number.isFinite(priceEurKwh)) {
|
|
634
641
|
idx++;
|
|
635
642
|
continue;
|
|
@@ -662,7 +669,12 @@ class TarifVisModule extends BaseModule {
|
|
|
662
669
|
else if (it.price.value !== undefined) pRaw = it.price.value;
|
|
663
670
|
}
|
|
664
671
|
|
|
665
|
-
|
|
672
|
+
// The normalized provider/Tibber contract is already EUR/kWh. Explicit
|
|
673
|
+
// units still take precedence for manually mapped structured curves.
|
|
674
|
+
const rowUnit = tariffPriceUnit(it.unit);
|
|
675
|
+
const curveUnit = unit !== 'auto' ? unit : rowUnit !== 'auto' ? rowUnit
|
|
676
|
+
: (typeof it.total === 'number' && typeof it.startsAt === 'string' && it.currency === 'EUR') ? 'EUR/kWh' : 'auto';
|
|
677
|
+
const price = this._normalizePriceEurPerKwh(pRaw, null, curveUnit);
|
|
666
678
|
if (typeof price !== 'number' || !Number.isFinite(price)) continue;
|
|
667
679
|
|
|
668
680
|
// Time field heuristics
|
|
@@ -1098,7 +1110,7 @@ class TarifVisModule extends BaseModule {
|
|
|
1098
1110
|
const currentPriceDirectFresh = currentPriceAgeMs === null || currentPriceAgeMs === undefined || currentPriceAgeMs <= currentPriceMaxAgeMs;
|
|
1099
1111
|
if (this.dp && typeof this.dp.getEntry === 'function' && this.dp.getEntry('tarif.preisAktuellEurProKwh')) {
|
|
1100
1112
|
const raw = this.dp.getNumberFresh('tarif.preisAktuellEurProKwh', currentPriceMaxAgeMs, null);
|
|
1101
|
-
preisAktuell = this._normalizePriceEurPerKwh(raw, null);
|
|
1113
|
+
preisAktuell = this._normalizePriceEurPerKwh(raw, null, this._priceInputUnit('tarif.preisAktuellEurProKwh', 'priceCurrent', 'currentPriceEurPerKwh'));
|
|
1102
1114
|
if (typeof preisAktuell === 'number' && Number.isFinite(preisAktuell)) preisAktuellSource = 'provider-current';
|
|
1103
1115
|
}
|
|
1104
1116
|
|
|
@@ -1108,7 +1120,7 @@ class TarifVisModule extends BaseModule {
|
|
|
1108
1120
|
: null;
|
|
1109
1121
|
if (this.dp && typeof this.dp.getEntry === 'function' && this.dp.getEntry('tarif.preisDurchschnittEurProKwh')) {
|
|
1110
1122
|
const raw = this.dp.getNumberFresh('tarif.preisDurchschnittEurProKwh', averagePriceMaxAgeMs, null);
|
|
1111
|
-
preisDurchschnitt = this._normalizePriceEurPerKwh(raw, null);
|
|
1123
|
+
preisDurchschnitt = this._normalizePriceEurPerKwh(raw, null, this._priceInputUnit('tarif.preisDurchschnittEurProKwh', 'priceAverage', 'averagePriceEurPerKwh'));
|
|
1112
1124
|
}
|
|
1113
1125
|
|
|
1114
1126
|
const preisVisOk = (typeof preisGrenzeVis === 'number' && Number.isFinite(preisGrenzeVis));
|
|
@@ -1164,8 +1176,8 @@ class TarifVisModule extends BaseModule {
|
|
|
1164
1176
|
? this.dp.getRaw('tarif.pricesTomorrowJson')
|
|
1165
1177
|
: null;
|
|
1166
1178
|
|
|
1167
|
-
const todayArr = this._parsePriceCurve(rawToday);
|
|
1168
|
-
const tomorrowArr = this._parsePriceCurve(rawTomorrow);
|
|
1179
|
+
const todayArr = this._parsePriceCurve(rawToday, this._priceInputUnit('tarif.pricesTodayJson', 'priceTodayJson', 'pricesTodayJson'));
|
|
1180
|
+
const tomorrowArr = this._parsePriceCurve(rawTomorrow, this._priceInputUnit('tarif.pricesTomorrowJson', 'priceTomorrowJson', 'pricesTomorrowJson'));
|
|
1169
1181
|
|
|
1170
1182
|
const all = [...todayArr, ...tomorrowArr]
|
|
1171
1183
|
.filter(x => x && Number.isFinite(x.startMs) && Number.isFinite(x.endMs) && Number.isFinite(x.priceEurKwh))
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
|
|
8
8
|
*
|
|
9
9
|
* Quelle: src-ts/runtime-executables/ems/modules/tariff-provider.ts
|
|
10
|
-
* Quell-Hash: sha256:
|
|
10
|
+
* Quell-Hash: sha256:217202ce9ba4fde752c10636edc4f6020ecb9af79ce98d86fedde79c0738ce64
|
|
11
11
|
* Erzeugung: npm run sync:ts-runtime-executables
|
|
12
12
|
*
|
|
13
13
|
* Zweck:
|
|
@@ -244,6 +244,10 @@ class TariffProviderModule extends BaseModule {
|
|
|
244
244
|
country: String(cfg.country || this.adapter?.config?.countryProfile?.country || 'DE').toUpperCase() === 'NL' ? 'NL' : 'DE',
|
|
245
245
|
timeZone: String(cfg.timeZone || (String(cfg.country || '').toUpperCase() === 'NL' ? 'Europe/Amsterdam' : 'Europe/Berlin')),
|
|
246
246
|
...cfg,
|
|
247
|
+
// Tibber liefert die angeforderte Viertelstundenreihe auch bei einer
|
|
248
|
+
// gespeicherten älteren 60-Minuten-Auswahl. Die Einstellung anderer
|
|
249
|
+
// Provider und der persistierte Kundenstand bleiben unverändert.
|
|
250
|
+
...(this._providerSourceId(cfg) === 'tibber' ? { resolutionMinutes: 15 } : {}),
|
|
247
251
|
// Nach ...cfg begrenzen: eine gespeicherte Alt-Konfiguration darf
|
|
248
252
|
// die 5-s-Gesamtfrist einschließlich OAuth nicht überschreiben.
|
|
249
253
|
timeoutMs: Math.max(1, Math.min(5000, Math.round(Number(cfg.timeoutMs) || 5000))),
|
|
@@ -295,9 +299,10 @@ class TariffProviderModule extends BaseModule {
|
|
|
295
299
|
const split = splitTodayTomorrow(this._intervals, nowMs, cfg && cfg.timeZone);
|
|
296
300
|
const hour = this._localHour(nowMs, cfg && cfg.timeZone);
|
|
297
301
|
// Tibber recommends caching today/tomorrow and avoiding frequent
|
|
298
|
-
// price requests. Once tomorrow is available,
|
|
299
|
-
//
|
|
300
|
-
//
|
|
302
|
+
// price requests. Once tomorrow is available, prefer a six-hour
|
|
303
|
+
// cadence; _scheduleNextFetch shortens it when the customer's
|
|
304
|
+
// freshness deadline requires an earlier refresh. During the
|
|
305
|
+
// expected publication window retry hourly until tomorrow exists.
|
|
301
306
|
if (split.tomorrow.length) return Math.max(requested, 360);
|
|
302
307
|
if (hour >= 12 && hour <= 20) return Math.max(requested, 60);
|
|
303
308
|
return Math.max(requested, 180);
|
|
@@ -314,8 +319,25 @@ class TariffProviderModule extends BaseModule {
|
|
|
314
319
|
const provider = this._providerSourceId(cfg);
|
|
315
320
|
const dayKey = Math.floor(Number(nowMs) / (24 * 60 * 60 * 1000));
|
|
316
321
|
const jitter = this._stableJitterFactor(`${this.adapter && this.adapter.namespace || 'nexowatt-ui'}:${provider}:${dayKey}:${this._consecutiveErrors}`);
|
|
317
|
-
|
|
318
|
-
|
|
322
|
+
const now = Number(nowMs);
|
|
323
|
+
let delayMs = effectiveMinutes * 60 * 1000 * jitter;
|
|
324
|
+
let boundedMinutes = effectiveMinutes;
|
|
325
|
+
// A provider's economical fetch cadence must never schedule a known
|
|
326
|
+
// successful curve beyond the customer's existing freshness deadline.
|
|
327
|
+
// Leave time for the bounded request and another attempt; apply this
|
|
328
|
+
// ceiling after jitter, without extending freshness or relabeling data.
|
|
329
|
+
if (this._lastSuccessMs > 0) {
|
|
330
|
+
const freshnessMs = Math.max(30, Math.min(4320, Number(cfg?.maxStaleMinutes) || 180)) * 60 * 1000;
|
|
331
|
+
const remainingMs = this._lastSuccessMs + freshnessMs - now;
|
|
332
|
+
const reserveMs = Math.max(10000, Math.min(300000, freshnessMs * 0.1));
|
|
333
|
+
if (remainingMs > 0) {
|
|
334
|
+
const boundedDelay = Math.min(delayMs, Math.max(60000, remainingMs - reserveMs));
|
|
335
|
+
if (boundedDelay < delayMs) boundedMinutes = boundedDelay / 60000;
|
|
336
|
+
delayMs = boundedDelay;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
this._effectiveRefreshMinutes = Math.round(boundedMinutes * 100) / 100;
|
|
340
|
+
this._nextFetchMs = Math.round(now + delayMs);
|
|
319
341
|
return this._nextFetchMs;
|
|
320
342
|
}
|
|
321
343
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
|
|
8
8
|
*
|
|
9
9
|
* Quelle: src-ts/runtime-executables/ems/services/tariff-provider-registry.ts
|
|
10
|
-
* Quell-Hash: sha256:
|
|
10
|
+
* Quell-Hash: sha256:ccedb21357657cc4dd04ef45dba76592fe81aa5154366185d65b0dd524a4cb6b
|
|
11
11
|
* Erzeugung: npm run sync:ts-runtime-executables
|
|
12
12
|
*
|
|
13
13
|
* Zweck:
|
|
@@ -62,7 +62,7 @@ const PROVIDERS = Object.freeze([
|
|
|
62
62
|
sourceType: 'graphql',
|
|
63
63
|
directApi: true,
|
|
64
64
|
requires: ['accessToken'],
|
|
65
|
-
supportsResolution: [15
|
|
65
|
+
supportsResolution: [15],
|
|
66
66
|
description: 'Direkte GraphQL-Integration; persönlicher Token oder registrierter OAuth-Client.',
|
|
67
67
|
},
|
|
68
68
|
{
|
|
@@ -297,7 +297,11 @@ function splitTodayTomorrow(intervals, nowMs = Date.now(), timeZone = 'Europe/Be
|
|
|
297
297
|
}
|
|
298
298
|
};
|
|
299
299
|
const todayKey = dateKey(nowMs);
|
|
300
|
-
|
|
300
|
+
// Advance the local calendar date, not the current instant by 24 hours.
|
|
301
|
+
// DST days have 23/25 hours; adding 24h can select today or the day after.
|
|
302
|
+
const tomorrowCalendar = new Date(`${todayKey}T12:00:00.000Z`);
|
|
303
|
+
tomorrowCalendar.setUTCDate(tomorrowCalendar.getUTCDate() + 1);
|
|
304
|
+
const tomorrowKey = tomorrowCalendar.toISOString().slice(0, 10);
|
|
301
305
|
const today = [];
|
|
302
306
|
const tomorrow = [];
|
|
303
307
|
for (const row of intervals || []) {
|
|
@@ -316,8 +320,8 @@ function currentAndAverage(intervals, nowMs = Date.now()) {
|
|
|
316
320
|
return { current: active ? Number(active.total) : null, average };
|
|
317
321
|
}
|
|
318
322
|
|
|
319
|
-
function buildTibberQuery(
|
|
320
|
-
const resolution =
|
|
323
|
+
function buildTibberQuery() {
|
|
324
|
+
const resolution = 'QUARTER_HOURLY';
|
|
321
325
|
return `query NexoWattPriceInfo { viewer { homes { id appNickname address { address1 postalCode city country } currentSubscription { priceInfo(resolution: ${resolution}) { current { total energy tax startsAt level currency } today { total energy tax startsAt level currency } tomorrow { total energy tax startsAt level currency } } } } } }`;
|
|
322
326
|
}
|
|
323
327
|
|
|
@@ -330,9 +334,8 @@ function normalizeTibber(payload, config = {}) {
|
|
|
330
334
|
const priceInfo = getByPath(home, 'currentSubscription.priceInfo');
|
|
331
335
|
if (!priceInfo || !Array.isArray(priceInfo.today) || !priceInfo.today.length || (priceInfo.tomorrow !== undefined && !Array.isArray(priceInfo.tomorrow))) throw new Error('tibber_no_price_info');
|
|
332
336
|
const rows = [...priceInfo.today, ...(priceInfo.tomorrow || [])];
|
|
333
|
-
const resolutionMinutes = Number(config.resolutionMinutes) <= 15 ? 15 : 60;
|
|
334
337
|
const intervals = normalizeRows(rows, {
|
|
335
|
-
resolutionMinutes,
|
|
338
|
+
resolutionMinutes: 15,
|
|
336
339
|
priceComponent: 'total',
|
|
337
340
|
unit: 'EUR/kWh',
|
|
338
341
|
formula: { priceIncludesVat: true },
|
|
@@ -640,7 +643,7 @@ async function fetchTibber(config = {}, signal) {
|
|
|
640
643
|
'Authorization': `Bearer ${token}`,
|
|
641
644
|
'User-Agent': String(config.userAgent || DEFAULT_USER_AGENT),
|
|
642
645
|
},
|
|
643
|
-
body: JSON.stringify({ query: buildTibberQuery(
|
|
646
|
+
body: JSON.stringify({ query: buildTibberQuery() }),
|
|
644
647
|
}, signal);
|
|
645
648
|
if (!payload || typeof payload !== 'object' || Array.isArray(payload)) throw new Error('tibber_invalid_response');
|
|
646
649
|
if (payload.errors !== undefined && !Array.isArray(payload.errors)) throw new Error('tibber_invalid_response');
|
package/ui/io-package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "nexowatt-ui",
|
|
4
|
-
"version": "9.0.
|
|
4
|
+
"version": "9.0.19",
|
|
5
5
|
"news": {
|
|
6
6
|
"9.0.18": {
|
|
7
7
|
"en": "Automatic supported-device commissioning and explicit EMS/energy-flow roles. Existing mappings and data points are preserved; new control targets require commissioning.",
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
|
|
8
8
|
*
|
|
9
9
|
* Quelle: src-ts/runtime-executables/lib/customer-tariff.ts
|
|
10
|
-
* Quell-Hash: sha256:
|
|
10
|
+
* Quell-Hash: sha256:5db65b97227afa18549301a412a220aa573ada0e57bfb766424bde7d611b3683
|
|
11
11
|
* Erzeugung: npm run sync:ts-runtime-executables
|
|
12
12
|
*
|
|
13
13
|
* Zweck:
|
|
@@ -122,6 +122,10 @@ function prepareCustomerTariffChange(root, incoming, namespace, registry) {
|
|
|
122
122
|
if (!PROVIDERS.includes(providerId))
|
|
123
123
|
invalid('Dieser Anschluss wird vom Installateur verwaltet. Bitte einen angebotenen Anbieter wählen.');
|
|
124
124
|
next.providerId = providerId;
|
|
125
|
+
// Explicit customer saves request Tibber's actual quarter-hour data, independently
|
|
126
|
+
// of a legacy hourly setting. Other provider contracts remain unchanged.
|
|
127
|
+
if (providerId === 'tibber')
|
|
128
|
+
next.resolutionMinutes = 15;
|
|
125
129
|
if (own(submitted, 'enabled') && typeof submitted.enabled !== 'boolean')
|
|
126
130
|
invalid('Die Tarifaktivierung ist ungültig.');
|
|
127
131
|
next.enabled = own(submitted, 'enabled') ? submitted.enabled : previous.enabled === true;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
|
|
8
8
|
*
|
|
9
9
|
* Quelle: src-ts/runtime-executables/lib/installer-lifecycle.ts
|
|
10
|
-
* Quell-Hash: sha256:
|
|
10
|
+
* Quell-Hash: sha256:df3487fcf381e39bedfa5d78a6ba0f47de44caa51e7e9aae0ab0cb7b420e550b
|
|
11
11
|
* Erzeugung: npm run sync:ts-runtime-executables
|
|
12
12
|
*
|
|
13
13
|
* Zweck:
|
|
@@ -25,6 +25,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
25
25
|
exports.installerRevision = installerRevision;
|
|
26
26
|
exports.assertInstallerRevision = assertInstallerRevision;
|
|
27
27
|
exports.provisionInstallerObjects = provisionInstallerObjects;
|
|
28
|
+
exports.awaitEmsTransition = awaitEmsTransition;
|
|
29
|
+
exports.assertDeviceAppActivations = assertDeviceAppActivations;
|
|
30
|
+
exports.numericMeasurement = numericMeasurement;
|
|
31
|
+
exports.activeDeviceProfileReferences = activeDeviceProfileReferences;
|
|
28
32
|
/**
|
|
29
33
|
* NexoWatt Quellcode-Erklärung (DE)
|
|
30
34
|
* Aufgabe: Schützt AppCenter-Zuordnungen vor veralteten Speicherformularen und
|
|
@@ -85,3 +89,132 @@ async function provisionInstallerObjects(options) {
|
|
|
85
89
|
throw (0, http_error_boundary_1.createPublicHttpError)(503, 'EOS_EMS_OBJECT_PROVISION_FAILED', 'Die benötigten EMS-Datenpunktobjekte konnten nicht angelegt werden. Es wurde kein erfolgreicher Abschluss gemeldet; Verbindung prüfen und erneut speichern.');
|
|
86
90
|
}
|
|
87
91
|
}
|
|
92
|
+
/** A timed-out old cycle remains fenced; callers must not start its replacement.
|
|
93
|
+
* The pending operation is still observed, so a late failure is never unhandled. */
|
|
94
|
+
async function awaitEmsTransition(operation, timeoutMs = 5000) {
|
|
95
|
+
const budget = Number.isFinite(timeoutMs) ? Math.max(1, Math.min(5000, Math.round(timeoutMs))) : 5000;
|
|
96
|
+
let timer;
|
|
97
|
+
const timeout = new Promise((_resolve, reject) => {
|
|
98
|
+
timer = setTimeout(() => { reject(new Error('EOS_EMS_CONFIG_WAIT_TIMEOUT')); }, budget);
|
|
99
|
+
});
|
|
100
|
+
try {
|
|
101
|
+
await Promise.race([operation, timeout]);
|
|
102
|
+
}
|
|
103
|
+
finally {
|
|
104
|
+
if (timer !== undefined)
|
|
105
|
+
clearTimeout(timer);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/** New device commissioning cannot silently promise an app denied by the live license. */
|
|
109
|
+
function assertDeviceAppActivations(current, planned, allowed) {
|
|
110
|
+
const before = record(record(record(current).emsApps).apps);
|
|
111
|
+
const after = record(record(record(planned).emsApps).apps);
|
|
112
|
+
for (const [id, value] of Object.entries(after)) {
|
|
113
|
+
const app = record(value);
|
|
114
|
+
const previous = record(Reflect.get(before, id));
|
|
115
|
+
if (app.installed === true && app.enabled === true &&
|
|
116
|
+
(previous.installed !== true || previous.enabled !== true) && !allowed(id)) {
|
|
117
|
+
throw (0, http_error_boundary_1.createPublicHttpError)(403, 'EOS_EMS_APP_LICENSE_REQUIRED', 'Die gewählte EMS-Funktion ist durch die aktuelle Systemfreigabe nicht verfügbar. Die Gerätezuordnung wurde nicht als aktiv übernommen.');
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
/** Measurements are numbers, never coerced boolean states, missing values or collections. */
|
|
122
|
+
function numericMeasurement(value) {
|
|
123
|
+
if (typeof value !== 'number' && typeof value !== 'string')
|
|
124
|
+
return null;
|
|
125
|
+
if (typeof value === 'string' && value.trim() === '')
|
|
126
|
+
return null;
|
|
127
|
+
const parsed = Number(value);
|
|
128
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
129
|
+
}
|
|
130
|
+
/** Collect only active controller sections, excluding pure UI links and disabled rows.
|
|
131
|
+
* Values remain exact object IDs. The hosted bridge resolves aliases with bounded reads.
|
|
132
|
+
* This prevents replacing a protocol/profile beneath a running controller. */
|
|
133
|
+
function activeDeviceProfileReferences(value) {
|
|
134
|
+
const config = record(value);
|
|
135
|
+
const apps = record(record(config.emsApps).apps);
|
|
136
|
+
const active = (id, flag) => {
|
|
137
|
+
const stored = record(Reflect.get(apps, id));
|
|
138
|
+
return Object.keys(stored).length > 0 ? stored.installed === true && stored.enabled === true : Reflect.get(config, flag) === true;
|
|
139
|
+
};
|
|
140
|
+
const singleStorage = record(config.storage);
|
|
141
|
+
const singleActive = active('storage', 'enableStorageControl') && !(record(singleStorage._eosDevice).v === 1 && singleStorage.enabled === false);
|
|
142
|
+
const read = new Set();
|
|
143
|
+
const write = new Set();
|
|
144
|
+
const writeKey = /(?:write|^set|^target|^output(?:Object)?Id$|^(?:pv)?feedInLimit|^pvLimit|^runObjectId$|^maxChargeObjectId$|^maxDischargeObjectId$|^phaseSwitchId$|^chargeEnableObjectId$|^dischargeEnableObjectId$|^feneconGridSetpoint|^e3dcSetPower|^enableId$)/i;
|
|
145
|
+
let visited = 0;
|
|
146
|
+
const walk = (item, depth = 0) => {
|
|
147
|
+
if (depth > 12 || ++visited > 20000)
|
|
148
|
+
throw new Error('EOS_DEVICES_PROFILE_CHECK_UNAVAILABLE');
|
|
149
|
+
if (Array.isArray(item)) {
|
|
150
|
+
for (const row of item)
|
|
151
|
+
walk(row, depth + 1);
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
const row = record(item);
|
|
155
|
+
if (row.enabled === false)
|
|
156
|
+
return;
|
|
157
|
+
for (const [key, child] of Object.entries(row)) {
|
|
158
|
+
if (key === '_eosDevice' || key === 'eosDeviceEms')
|
|
159
|
+
continue;
|
|
160
|
+
if (typeof child === 'string' && /(?:Id|ObjectId)$/.test(key) && child.length > 0 && child.length <= 512) {
|
|
161
|
+
(writeKey.test(key) ? write : read).add(child);
|
|
162
|
+
}
|
|
163
|
+
else if (child !== null && typeof child === 'object')
|
|
164
|
+
walk(child, depth + 1);
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
if (active('charging', 'enableChargingManagement'))
|
|
168
|
+
walk(record(config.settingsConfig).evcsList);
|
|
169
|
+
if (active('peak', 'enablePeakShaving') || record(record(config.peakShaving).atypical).enabled === true)
|
|
170
|
+
walk(config.peakShaving);
|
|
171
|
+
// The established legacy single-storage contract is app-authoritative.
|
|
172
|
+
if (singleActive)
|
|
173
|
+
walk({ ...singleStorage, enabled: true });
|
|
174
|
+
if (active('storagefarm', 'enableStorageFarm'))
|
|
175
|
+
walk({ ...record(config.storageFarm), enabled: true });
|
|
176
|
+
if (active('dynamicGrid', 'enableDynamicGrid'))
|
|
177
|
+
walk(config.dynamicGridConnection);
|
|
178
|
+
for (const [appId, flag, sections] of [
|
|
179
|
+
['thermal', 'enableThermalControl', ['thermal', 'thermalControl']],
|
|
180
|
+
['heatingrod', 'enableHeatingRodControl', ['heatingRod']],
|
|
181
|
+
['threshold', 'enableThresholdControl', ['threshold']],
|
|
182
|
+
['generator', 'enableGeneratorControl', ['generator']],
|
|
183
|
+
['bhkw', 'enableBhkwControl', ['bhkw']],
|
|
184
|
+
['relay', 'enableRelayControl', ['relay']],
|
|
185
|
+
])
|
|
186
|
+
if (active(appId, flag))
|
|
187
|
+
for (const section of sections)
|
|
188
|
+
walk(Reflect.get(config, section));
|
|
189
|
+
// Grid protection is a mandatory controller. Profile changes require unmapping
|
|
190
|
+
// its actual measurement/actuator first, never disabling protection itself.
|
|
191
|
+
walk(config.gridConstraints);
|
|
192
|
+
walk(config.nvpTopology);
|
|
193
|
+
const datapoints = record(config.datapoints);
|
|
194
|
+
for (const key of ['gridPointPower', 'gridPointPowerRaw', 'gridBuyPower', 'gridSellPower', 'gridPointImportPower', 'gridPointExportPower', 'gridPointConnected', 'gridPointWatchdog']) {
|
|
195
|
+
const id = Reflect.get(datapoints, key);
|
|
196
|
+
if (typeof id === 'string' && id.length > 0 && id.length <= 512)
|
|
197
|
+
read.add(id);
|
|
198
|
+
}
|
|
199
|
+
// These global measurement keys are real runtime fallbacks for enabled
|
|
200
|
+
// battery/charging controllers, not merely display references in that case.
|
|
201
|
+
const controllerMeasurementKeys = [];
|
|
202
|
+
if (singleActive)
|
|
203
|
+
controllerMeasurementKeys.push('batteryPower', 'storageChargePower', 'storageDischargePower', 'storageSoc', 'storageCapacityKwh');
|
|
204
|
+
if (singleActive || active('storagefarm', 'enableStorageFarm') || active('charging', 'enableChargingManagement'))
|
|
205
|
+
controllerMeasurementKeys.push('pvPower');
|
|
206
|
+
for (const key of controllerMeasurementKeys) {
|
|
207
|
+
const id = Reflect.get(datapoints, key);
|
|
208
|
+
if (typeof id === 'string' && id.length > 0 && id.length <= 512)
|
|
209
|
+
read.add(id);
|
|
210
|
+
}
|
|
211
|
+
const slots = record(record(config.vis).flowSlots);
|
|
212
|
+
for (const slot of Array.isArray(slots.consumers) ? slots.consumers : []) {
|
|
213
|
+
const ctrl = record(record(slot).ctrl);
|
|
214
|
+
if (ctrl.enabled === true)
|
|
215
|
+
walk(ctrl);
|
|
216
|
+
}
|
|
217
|
+
if (read.size + write.size > 1024)
|
|
218
|
+
throw new Error('EOS_DEVICES_PROFILE_CHECK_UNAVAILABLE');
|
|
219
|
+
return { read: [...read], write: [...write] };
|
|
220
|
+
}
|