Trigger Smart Charging when receiving first meter value
MODIFY
src/server/ocpp/services/OCPPService.ts
src/server/ocpp/services/OCPPService.ts
@@ -376,6 +376,18 @@ export default class OCPPService {
await this.updateChargingStationWithTransaction(headers.tenantID, chargingStation, transaction);
// Save Charging Station
await ChargingStationStorage.saveChargingStation(headers.tenantID, chargingStation);
+ // First Meter Value and no Car -> Trigger Smart Charging to adjust the single phase Car
+ if (transaction.numberOfMeterValues === 1 && !transaction.carID) {
+ const currentType = Utils.getChargingStationCurrentType(chargingStation, null, transaction.connectorId);
+ // Single Phase car?
+ if (currentType === CurrentType.AC &&
+ transaction.currentInstantAmpsL1 > 0 &&
+ transaction.currentInstantAmpsL2 === 0 &&
+ transaction.currentInstantAmpsL3 === 0) {
+ // Yes: Trigger Smart Charging
+ await this.triggerSmartCharging(headers.tenantID, chargingStation);
+ }
+ }
// Log
Logging.logInfo({
tenantID: headers.tenantID,

MODIFY
src/types/Transaction.ts
src/types/Transaction.ts
@@ -27,6 +27,7 @@ export enum TransactionAction {
export default interface Transaction {
id?: number;
+ carID?: string;
siteID?: string;
siteAreaID?: string;
issuer: boolean;

Trigger Smart Charging when receiving first meter value