) {
chargingStation.restartWebSocketPing()
}
+ if (
+ (keyToChange.key as OCPP16StandardParametersKey) ===
+ OCPP16StandardParametersKey.MeterValueSampleInterval &&
+ chargingStation.getNumberOfRunningTransactions() > 0 &&
+ valueChanged
+ ) {
+ for (
+ let connectorId = 1;
+ connectorId <= chargingStation.getNumberOfConnectors();
+ connectorId++
+ ) {
+ if (chargingStation.getConnectorStatus(connectorId)?.transactionStarted === true) {
+ chargingStation.restartMeterValues(
+ connectorId,
+ secondsToMilliseconds(convertToInt(value))
+ )
+ }
+ }
+ }
if (keyToChange.reboot === true) {
return OCPP16Constants.OCPP_CONFIGURATION_RESPONSE_REBOOT_REQUIRED
}
csChargingProfiles.chargingProfilePurpose === OCPP16ChargingProfilePurposeType.TX_PROFILE &&
connectorId > 0 &&
connectorStatus?.transactionStarted === true &&
+ csChargingProfiles.transactionId != null &&
csChargingProfiles.transactionId !== connectorStatus.transactionId
) {
logger.error(
start: currentDate,
end: addSeconds(currentDate, duration)
}
- // Get charging profiles sorted by connector id then stack level
+ // FIXME: add and handle charging station charging profiles
const chargingProfiles: OCPP16ChargingProfile[] = getConnectorChargingProfiles(
chargingStation,
connectorId
connectorId: number,
chargingProfile: OCPP16ChargingProfile
): boolean {
- if (chargingProfile.chargingProfilePurpose === OCPP16ChargingProfilePurposeType.TX_PROFILE) {
+ if (
+ chargingProfile.chargingProfilePurpose === OCPP16ChargingProfilePurposeType.TX_PROFILE &&
+ chargingProfile.transactionId == null
+ ) {
OCPP16ServiceUtils.setChargingProfile(chargingStation, connectorId, chargingProfile)
logger.debug(
`${chargingStation.logPrefix()} Charging profile(s) set at remote start transaction on ${
logger.debug(
`${chargingStation.logPrefix()} Not allowed to set ${
chargingProfile.chargingProfilePurpose
- } charging profile(s) at remote start transaction`
+ } charging profile(s)${chargingProfile.transactionId != null ? ' with transactionId set' : ''} at remote start transaction`
)
return false
}