Trigger Smart Charging when connector turns Suspended EV
MODIFY
src/server/ocpp/services/OCPPService.ts
src/server/ocpp/services/OCPPService.ts
@@ -951,7 +951,8 @@ export default class OCPPService {
// Save
await ChargingStationStorage.saveChargingStation(tenantID, chargingStation);
// Trigger Smart Charging
- if (statusNotification.status === ChargePointStatus.CHARGING) {
+ if (statusNotification.status === ChargePointStatus.CHARGING ||
+ statusNotification.status === ChargePointStatus.SUSPENDED_EV) {
try {
// Trigger Smart Charging
await this.triggerSmartCharging(tenantID, chargingStation);
@@ -1729,6 +1730,9 @@ export default class OCPPService {
}
private async triggerSmartCharging(tenantID: string, chargingStation: ChargingStation) {
+ // Smart Charging must be active
+ const tenant: Tenant = await TenantStorage.getTenant(tenantID);
+ if (Utils.isTenantComponentActive(tenant, TenantComponents.SMART_CHARGING)) {
// Get Site Area
const siteArea = await SiteAreaStorage.getSiteArea(tenantID, chargingStation.siteAreaID);
if (siteArea && siteArea.smartCharging) {
@@ -1747,4 +1751,5 @@ export default class OCPPService {
}
}
}
+}

Trigger Smart Charging when connector turns Suspended EV