From 52054291e5525a2ac7ba738e268a9a067f74b3ac Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 16 Mar 2026 15:58:06 +0100 Subject: [PATCH] fix(ocpp20): send TransactionEvent(Started) on RequestStartTransaction (E02.FR.01) The handler accepted remote start transactions without notifying the CSMS via TransactionEvent. Per E02.FR.01, the CS SHALL send TransactionEvent with eventType=Started when a transaction begins. Also starts meter values interval for the new transaction. --- .../ocpp/2.0/OCPP20IncomingRequestService.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts b/src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts index 3ddaef2d..41281ec2 100644 --- a/src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts +++ b/src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts @@ -98,8 +98,10 @@ import { type OCPP20SetVariablesResponse, type OCPP20StatusNotificationRequest, type OCPP20StatusNotificationResponse, + OCPP20TransactionEventEnumType, type OCPP20TriggerMessageRequest, type OCPP20TriggerMessageResponse, + OCPP20TriggerReasonEnumType, type OCPP20UnlockConnectorRequest, type OCPP20UnlockConnectorResponse, type OCPP20UpdateFirmwareRequest, @@ -2417,6 +2419,18 @@ export class OCPP20IncomingRequestService extends OCPPIncomingRequestService { evseId ) + // E02.FR.01: Send TransactionEvent(Started) to CSMS + await OCPP20ServiceUtils.sendTransactionEvent( + chargingStation, + OCPP20TransactionEventEnumType.Started, + OCPP20TriggerReasonEnumType.RemoteStart, + connectorId, + transactionId + ) + + const txUpdatedInterval = this.getTxUpdatedInterval(chargingStation) + chargingStation.startTxUpdatedInterval(connectorId, txUpdatedInterval) + if (chargingProfile != null) { connectorStatus.chargingProfiles ??= [] connectorStatus.chargingProfiles.push(chargingProfile) -- 2.53.0