Total parking time in hours in the OCPI CDR
MODIFY
src/client/ocpi/CpoOCPIClient.ts
src/client/ocpi/CpoOCPIClient.ts
@@ -380,9 +380,9 @@ export default class CpoOCPIClient extends OCPIClient {
id: transaction.ocpiData.session.id,
start_date_time: transaction.timestamp,
stop_date_time: transaction.stop.timestamp,
- total_parking_time: transaction.stop.totalInactivitySecs,
+ total_parking_time: transaction.stop.totalInactivitySecs / 3600, // In hours
total_time: transaction.stop.totalDurationSecs / 3600, // In hours
- total_energy: transaction.stop.totalConsumptionWh / 1000,
+ total_energy: transaction.stop.totalConsumptionWh / 1000, // In kW.h
currency: this.settings.currency,
auth_id: transaction.ocpiData.session.auth_id,
authorization_id: transaction.ocpiData.session.authorization_id,

MODIFY
src/server/ocpi/ocpi-services-impl/ocpi-2.1.1/OCPISessionsService.ts
src/server/ocpi/ocpi-services-impl/ocpi-2.1.1/OCPISessionsService.ts
@@ -213,8 +213,8 @@ export default class OCPISessionsService {
tagID: cdr.auth_id,
timestamp: cdr.stop_date_time,
totalConsumptionWh: cdr.total_energy * 1000,
- totalDurationSecs: cdr.total_time,
- totalInactivitySecs: cdr.total_parking_time,
+ totalDurationSecs: cdr.total_time * 3600,
+ totalInactivitySecs: cdr.total_parking_time * 3600,
inactivityStatus: transaction.currentInactivityStatus,
userID: transaction.userID
};

Total parking time in hours in the OCPI CDR