): boolean {
if (connectorId < 0) {
logger.error(
- `${chargingStation.logPrefix()} ${ocppCommand} incoming request received with invalid connector Id ${connectorId}`
+ `${chargingStation.logPrefix()} ${ocppCommand} incoming request received with invalid connector id ${connectorId}`
);
return false;
}
public static buildStatusNotificationRequest(
chargingStation: ChargingStation,
connectorId: number,
- status: ConnectorStatusEnum
+ status: ConnectorStatusEnum,
+ evseId?: number
): StatusNotificationRequest {
switch (chargingStation.stationInfo.ocppVersion ?? OCPPVersion.VERSION_16) {
case OCPPVersion.VERSION_16:
timestamp: new Date(),
connectorStatus: status,
connectorId,
- evseId: connectorId,
+ evseId,
} as OCPP20StatusNotificationRequest;
default:
throw new BaseError('Cannot build status notification payload: OCPP version not supported');
public static async sendAndSetConnectorStatus(
chargingStation: ChargingStation,
connectorId: number,
- status: ConnectorStatusEnum
+ status: ConnectorStatusEnum,
+ evseId?: number
) {
OCPPServiceUtils.checkConnectorStatusTransition(chargingStation, connectorId, status);
await chargingStation.ocppRequestService.requestHandler<
>(
chargingStation,
RequestCommand.STATUS_NOTIFICATION,
- OCPPServiceUtils.buildStatusNotificationRequest(chargingStation, connectorId, status)
+ OCPPServiceUtils.buildStatusNotificationRequest(chargingStation, connectorId, status, evseId)
);
chargingStation.getConnectorStatus(connectorId).status = status;
}
logger.warn(
`${chargingStation.logPrefix()} OCPP ${
chargingStation.stationInfo.ocppVersion
- } connector ${connectorId} status transition from '${
+ } connector id ${connectorId} status transition from '${
chargingStation.getConnectorStatus(connectorId).status
}' to '${status}' is not allowed`
);
const onPhaseStr = phase ? `on phase ${phase} ` : '';
if (Constants.SUPPORTED_MEASURANDS.includes(measurand) === false) {
logger.warn(
- `${chargingStation.logPrefix()} Trying to get unsupported MeterValues measurand '${measurand}' ${onPhaseStr}in template on connectorId ${connectorId}`
+ `${chargingStation.logPrefix()} Trying to get unsupported MeterValues measurand '${measurand}' ${onPhaseStr}in template on connector id ${connectorId}`
);
return;
}
)?.value?.includes(measurand) === false
) {
logger.debug(
- `${chargingStation.logPrefix()} Trying to get MeterValues measurand '${measurand}' ${onPhaseStr}in template on connectorId ${connectorId} not found in '${
+ `${chargingStation.logPrefix()} Trying to get MeterValues measurand '${measurand}' ${onPhaseStr}in template on connector id ${connectorId} not found in '${
StandardParametersKey.MeterValuesSampledData
}' OCPP parameter`
);
) === false
) {
logger.warn(
- `${chargingStation.logPrefix()} Unsupported MeterValues measurand '${measurand}' ${onPhaseStr}in template on connectorId ${connectorId}`
+ `${chargingStation.logPrefix()} Unsupported MeterValues measurand '${measurand}' ${onPhaseStr}in template on connector id ${connectorId}`
);
} else if (
phase &&
}
}
if (measurand === MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER) {
- const errorMsg = `Missing MeterValues for default measurand '${measurand}' in template on connectorId ${connectorId}`;
+ const errorMsg = `Missing MeterValues for default measurand '${measurand}' in template on connector id ${connectorId}`;
logger.error(`${chargingStation.logPrefix()} ${errorMsg}`);
throw new BaseError(errorMsg);
}
logger.debug(
- `${chargingStation.logPrefix()} No MeterValues for measurand '${measurand}' ${onPhaseStr}in template on connectorId ${connectorId}`
+ `${chargingStation.logPrefix()} No MeterValues for measurand '${measurand}' ${onPhaseStr}in template on connector id ${connectorId}`
);
}