improved OICP EVSE Data
MODIFY
src/client/oicp/CpoOICPClient.ts
src/client/oicp/CpoOICPClient.ts
@@ -232,7 +232,7 @@ export default class CpoOICPClient extends OICPClient {
// - EVSEs (ChargingStations) with status notification from latest pushDate
if (processAllEVSEs) {
evsesToProcess = evses.result;
- chargeBoxIDsToProcessFromInput = evsesToProcess.map((evse) => evse.chargeBoxId);
+ chargeBoxIDsToProcessFromInput = evsesToProcess.map((evse) => evse.ChargingStationID);
} else {
let chargeBoxIDsToProcess = [];
// Get ChargingStation in Failure from previous run
@@ -245,12 +245,12 @@ export default class CpoOICPClient extends OICPClient {
for (const evse of evses.result) {
if (evse) {
// Check if Charging Station should be processed
- if (!processAllEVSEs && !chargeBoxIDsToProcess.includes(evse.chargeBoxId)) {
+ if (!processAllEVSEs && !chargeBoxIDsToProcess.includes(evse.ChargingStationID)) {
continue;
}
// Process
evsesToProcess.push(evse);
- chargeBoxIDsToProcessFromInput.push(evse.chargeBoxId);
+ chargeBoxIDsToProcessFromInput.push(evse.ChargingStationID);
}
}
}
@@ -349,7 +349,7 @@ export default class CpoOICPClient extends OICPClient {
// - EVSEs (ChargingStations) with status notification from latest pushDate
if (processAllEVSEs) {
evseStatusesToProcess = evseStatuses.result;
- chargeBoxIDsToProcessFromInput = evseStatusesToProcess.map((evseStatus) => evseStatus.chargeBoxId);
+ chargeBoxIDsToProcessFromInput = evseStatusesToProcess.map((evseStatus) => evseStatus.ChargingStationID);
} else {
let chargeBoxIDsToProcess = [];
// Get ChargingStation in Failure from previous run
@@ -362,12 +362,12 @@ export default class CpoOICPClient extends OICPClient {
for (const evseStatus of evseStatuses.result) {
if (evseStatus) {
// Check if Charging Station should be processed
- if (!processAllEVSEs && !chargeBoxIDsToProcess.includes(evseStatus.chargeBoxId)) {
+ if (!processAllEVSEs && !chargeBoxIDsToProcess.includes(evseStatus.ChargingStationID)) {
continue;
}
// Process
evseStatusesToProcess.push(evseStatus);
- chargeBoxIDsToProcessFromInput.push(evseStatus.chargeBoxId);
+ chargeBoxIDsToProcessFromInput.push(evseStatus.ChargingStationID);
}
}
}

MODIFY
src/server/oicp/oicp-services-impl/oicp-2.3.0/OICPMapping.ts
src/server/oicp/oicp-services-impl/oicp-2.3.0/OICPMapping.ts
@@ -77,8 +77,8 @@ export default class OICPMapping {
evse.deltaType; // Optional
evse.lastUpdate; // Optional
evse.EvseID = evseID;
- evse.ChargingPoolID; // Optional
- evse.ChargingStationID; // Optional
+ evse.ChargingPoolID = OICPMapping.buildEChargingPoolID(options.countryID, options.partyID, siteArea.id); // Optional
+ evse.ChargingStationID = chargingStation.id; // Optional
evse.ChargingStationNames = [
{
lang: 'en',
@@ -112,10 +112,6 @@ export default class OICPMapping {
evse.ClearinghouseID; // Optional
evse.IsHubjectCompatible = true;
evse.DynamicInfoAvailable = OICPDynamicInfoAvailable.auto;
- // Check addChargeBoxID flag
- if (options && options.addChargeBoxID) {
- evse.chargeBoxId = chargingStation.id;
- }
// Return evse
return evse;
}
@@ -148,10 +144,7 @@ export default class OICPMapping {
const evseStatus: OICPEvseStatusRecord = {} as OICPEvseStatusRecord;
evseStatus.EvseID = evseID;
evseStatus.EvseStatus = OICPMapping.convertStatus2OICPEvseStatus(connector.status);
- // Check addChargeBoxID flag
- if (options && options.addChargeBoxID) {
- evseStatus.chargeBoxId = chargingStation.id;
- }
+ evseStatus.ChargingStationID = chargingStation.id;
return evseStatus;
}
@@ -406,7 +399,7 @@ export default class OICPMapping {
// To be done
return {
Google: {
- Coordinates: 'To be done'
+ Coordinates: 'TODO'
},
};
case OICPGeoCoordinatesResponseFormat.DecimalDegree:
@@ -420,8 +413,8 @@ export default class OICPMapping {
// To be done
return {
DegreeMinuteSeconds: {
- Longitude: 'To be done',
- Latitude: 'To be done'
+ Longitude: 'TODO',
+ Latitude: 'TODO'
},
};
}
@@ -431,10 +424,9 @@ export default class OICPMapping {
* Build ChargingPoolID from charging station
* @param {*} chargingStation
*/
- public static buildEChargingPoolID(countryCode: string, partyId: string,chargingStation: ChargingStation): OICPChargingPoolID {
- if (chargingStation.siteAreaID) {
- return `${countryCode}*${partyId}*P${chargingStation.siteAreaID}`;
- }
+ public static buildEChargingPoolID(countryCode: string, partyId: string, siteAreaID: string): OICPChargingPoolID {
+ let chargingPoolID = `${countryCode}*${partyId}*P${siteAreaID}`;
+ return chargingPoolID.replace(/[\W_]+/g, '*').toUpperCase();
}
/**

improved OICP EVSE Data