]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commitdiff
fix: use OCPP version-specific parameter keys for meter value measurands
authorJérôme Benoit <jerome.benoit@sap.com>
Thu, 26 Mar 2026 20:35:50 +0000 (21:35 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Thu, 26 Mar 2026 20:35:50 +0000 (21:35 +0100)
Remap keba-ocpp2 template configuration keys from OCPP 1.6 names to
OCPP 2.0 variable names (MeterValuesSampledData → TxUpdatedMeasurands,
MeterValueSampleInterval → TxUpdatedInterval, AuthorizeRemoteTxRequests
→ AuthorizeRemoteStart). Remove OCPP 1.6-only keys with no 2.0
equivalent. Use StandardParametersKey union to resolve the correct
key at runtime based on OCPP version.

src/assets/station-templates/keba-ocpp2.station-template.json
src/charging-station/ocpp/OCPPServiceUtils.ts

index 0df78ecca8c90c51a7ba88c4301fa0c3f00628b0..afa1d6fbb7626b811145e255b910c6efcb2240c2 100644 (file)
   "Configuration": {
     "configurationKey": [
       {
-        "key": "MeterValuesSampledData",
+        "key": "TxUpdatedMeasurands",
         "readonly": false,
         "value": "Energy.Active.Import.Register,Power.Active.Import,Current.Import,Voltage"
       },
       {
-        "key": "MeterValueSampleInterval",
+        "key": "TxUpdatedInterval",
         "readonly": false,
         "value": "30"
       },
       {
-        "key": "SupportedFeatureProfiles",
-        "readonly": true,
-        "value": "Core,FirmwareManagement,LocalAuthListManagement,SmartCharging,RemoteTrigger,Reservation"
-      },
-      {
-        "key": "LocalAuthListEnabled",
-        "readonly": false,
-        "value": "false"
-      },
-      {
-        "key": "AuthorizeRemoteTxRequests",
+        "key": "AuthorizeRemoteStart",
         "readonly": false,
         "value": "false"
       },
         "key": "WebSocketPingInterval",
         "readonly": false,
         "value": "60"
-      },
-      {
-        "key": "ReserveConnectorZeroSupported",
-        "readonly": false,
-        "value": "false"
       }
     ]
   },
index f502a87986569d49cd8d2ca09c4f73c147fbba49..b0ecd94c33a55bed0393bd62664aada3a646820e 100644 (file)
@@ -2029,17 +2029,19 @@ const getSampledValueTemplate = (
     )
     return
   }
+  const isOCPP2 =
+    chargingStation.stationInfo?.ocppVersion === OCPPVersion.VERSION_20 ||
+    chargingStation.stationInfo?.ocppVersion === OCPPVersion.VERSION_201
+  const measurandsParameterKey = isOCPP2
+    ? StandardParametersKey.TxUpdatedMeasurands
+    : StandardParametersKey.MeterValuesSampledData
   if (
     measurand !== MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER &&
-    getConfigurationKey(
-      chargingStation,
-      StandardParametersKey.MeterValuesSampledData
-    )?.value?.includes(measurand) === false
+    getConfigurationKey(chargingStation, measurandsParameterKey)?.value?.includes(measurand) ===
+      false
   ) {
     logger.debug(
-      `${chargingStation.logPrefix()} Trying to get MeterValues measurand '${measurand}' ${onPhaseStr}in template on connector id ${connectorId.toString()} not found in '${
-        StandardParametersKey.MeterValuesSampledData
-      }' OCPP parameter`
+      `${chargingStation.logPrefix()} Trying to get MeterValues measurand '${measurand}' ${onPhaseStr}in template on connector id ${connectorId.toString()} not found in '${measurandsParameterKey}' OCPP parameter`
     )
     return
   }