From: Jérôme Benoit Date: Wed, 15 Nov 2023 23:12:45 +0000 (+0100) Subject: fix: fallback to minimum measurand value at meterValues generation X-Git-Tag: v1.2.25~23 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=5bb45fe6de9568b7f9cb52435654b624e0125251;p=e-mobility-charging-stations-simulator.git fix: fallback to minimum measurand value at meterValues generation Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts b/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts index 502fd6a5..c329a2c8 100644 --- a/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts +++ b/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts @@ -303,6 +303,7 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils { { limitationEnabled: chargingStation.stationInfo?.customValueLimitationMeterValues, + defaultValue: connectorMinimumPower / unitDivider, }, ) / chargingStation.getNumberOfPhases(), powerSampledValueTemplate.fluctuationPercent ?? @@ -317,6 +318,7 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils { { limitationEnabled: chargingStation.stationInfo?.customValueLimitationMeterValues, + defaultValue: connectorMinimumPowerPerPhase / unitDivider, }, ), powerPerPhaseSampledValueTemplates.L1.fluctuationPercent ?? @@ -331,6 +333,7 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils { { limitationEnabled: chargingStation.stationInfo?.customValueLimitationMeterValues, + defaultValue: connectorMinimumPowerPerPhase / unitDivider, }, ), powerPerPhaseSampledValueTemplates.L2.fluctuationPercent ?? @@ -345,6 +348,7 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils { { limitationEnabled: chargingStation.stationInfo?.customValueLimitationMeterValues, + defaultValue: connectorMinimumPowerPerPhase / unitDivider, }, ), powerPerPhaseSampledValueTemplates.L3.fluctuationPercent ?? @@ -380,6 +384,7 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils { { limitationEnabled: chargingStation.stationInfo?.customValueLimitationMeterValues, + defaultValue: connectorMinimumPower / unitDivider, }, ), powerSampledValueTemplate.fluctuationPercent ?? @@ -406,6 +411,7 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils { { limitationEnabled: chargingStation.stationInfo?.customValueLimitationMeterValues, + defaultValue: connectorMinimumPower / unitDivider, }, ), powerSampledValueTemplate.fluctuationPercent ?? @@ -555,6 +561,7 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils { { limitationEnabled: chargingStation.stationInfo?.customValueLimitationMeterValues, + defaultValue: connectorMinimumAmperage, }, ), currentSampledValueTemplate.fluctuationPercent ?? @@ -569,6 +576,7 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils { { limitationEnabled: chargingStation.stationInfo?.customValueLimitationMeterValues, + defaultValue: connectorMinimumAmperage, }, ), currentPerPhaseSampledValueTemplates.L1.fluctuationPercent ?? @@ -583,6 +591,7 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils { { limitationEnabled: chargingStation.stationInfo?.customValueLimitationMeterValues, + defaultValue: connectorMinimumAmperage, }, ), currentPerPhaseSampledValueTemplates.L2.fluctuationPercent ?? @@ -597,6 +606,7 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils { { limitationEnabled: chargingStation.stationInfo?.customValueLimitationMeterValues, + defaultValue: connectorMinimumAmperage, }, ), currentPerPhaseSampledValueTemplates.L3.fluctuationPercent ?? @@ -623,6 +633,7 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils { { limitationEnabled: chargingStation.stationInfo?.customValueLimitationMeterValues, + defaultValue: connectorMinimumAmperage, }, ), currentSampledValueTemplate.fluctuationPercent ?? @@ -651,6 +662,7 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils { { limitationEnabled: chargingStation.stationInfo?.customValueLimitationMeterValues, + defaultValue: connectorMinimumAmperage, }, ), currentSampledValueTemplate.fluctuationPercent ??