check last 5 consumptions
MODIFY
src/server/ocpp/services/OCPPService.ts
src/server/ocpp/services/OCPPService.ts
@@ -1472,9 +1472,14 @@ export default class OCPPService {
if (transaction.numberOfMeterValues > 1 && transaction.currentTotalConsumptionWh > 0) {
// End of charge?
if (this.chargingStationConfig.notifEndOfChargeEnabled &&
- ((transaction.currentTotalConsumptionWh > 0 && transaction.currentTotalInactivitySecs >= 120) || transaction.currentStateOfCharge === 100)) {
+ ((transaction.currentTotalConsumptionWh > 0) && (transaction.currentTotalInactivitySecs >= 300) || transaction.currentStateOfCharge === 100)) {
+ // Check last 5 consumptions
+ let consumptions = await ConsumptionStorage.getTransactionConsumptions(tenantID, { transactionId: transaction.id });
+ consumptions = consumptions.slice(-5);
+ if (consumptions.every((element) => element.instantAmps === 0)) {
// Send Notification
await this.notifyEndOfCharge(tenantID, chargingStation, transaction);
+ }
// Optimal Charge? (SoC)
} else if (this.chargingStationConfig.notifBeforeEndOfChargeEnabled &&
transaction.currentStateOfCharge >= this.chargingStationConfig.notifBeforeEndOfChargePercent) {

check last 5 consumptions