power | | | integer\|integer[] | charging stations maximum power value(s)
powerSharedByConnectors | true/false | false | boolean | charging stations power shared by its connectors
powerUnit | W/kW | W | string | charging stations power unit
+currentOutType | AC/DC | AC | string | charging stations current out type
+numberOfPhases | 1/3 | AC:3/DC:0 | integer | charging stations number of phase(s)
+numberOfConnectors | | | integer\|integer[] | charging stations number of connector(s)
+useConnectorId0 | true/false | true | boolean | use connector id 0 definition from the template
+randomConnectors | true/false | false | boolean | randomize the connector id
+resetTime | | 60 | integer | seconds to wait before the charging stations come back at reset
+connectionTimeout | | 30 | integer | connection timeout to the OCPP-J server
+autoReconnectMaxRetries | | -1 (unlimited) | integer | connection retries to the OCPP-J server
+reconnectExponentialDelay | true/false | false | boolean | connection delay retry to the OCPP-J server
+registrationMaxRetries | | -1 (unlimited) | boolean | charging stations boot notification retries
+enableStatistics | true/false | true | boolean | enable charging stations statistics
+voltageOut | | AC:230/DC:400 | number | charging stations voltage out
## License
"power": 50000,
"powerSharedByConnectors": true,
"powerUnit": "W",
- "powerOutType": "DC",
+ "currentOutType": "DC",
"useConnectorId0": true,
"randomConnectors": false,
"resetTime": 60,
"power": 50000,
"powerSharedByConnectors": true,
"powerUnit": "W",
- "powerOutType": "DC",
+ "currentOutType": "DC",
"numberOfConnectors": 2,
"useConnectorId0": true,
"randomConnectors": false,
"power": 75000,
"powerUnit": "W",
"powerSharedByConnectors": true,
- "powerOutType": "DC",
+ "currentOutType": "DC",
"numberOfConnectors": 3,
"randomConnectors": false,
"Configuration": {
"power": 50000,
"powerUnit": "W",
"powerSharedByConnectors": true,
- "powerOutType": "DC",
+ "currentOutType": "DC",
"numberOfConnectors": 3,
"randomConnectors": false,
"Configuration": {
"power": 50000,
"powerUnit": "W",
"powerSharedByConnectors": true,
- "powerOutType": "DC",
+ "currentOutType": "DC",
"numberOfConnectors": 9,
"randomConnectors": false,
"Configuration": {
import { BootNotificationResponse, RegistrationStatus } from '../types/ocpp/Responses';
import ChargingStationConfiguration, { ConfigurationKey } from '../types/ChargingStationConfiguration';
-import ChargingStationTemplate, { PowerOutType, VoltageOut } from '../types/ChargingStationTemplate';
+import ChargingStationTemplate, { CurrentOutType, VoltageOut } from '../types/ChargingStationTemplate';
import Connectors, { Connector } from '../types/Connectors';
import { PerformanceObserver, performance } from 'perf_hooks';
import Requests, { AvailabilityType, BootNotificationRequest, IncomingRequest, IncomingRequestCommand } from '../types/ocpp/Requests';
}
public getNumberOfPhases(): number {
- switch (this.getPowerOutType()) {
- case PowerOutType.AC:
+ switch (this.getCurrentOutType()) {
+ case CurrentOutType.AC:
return !Utils.isUndefined(this.stationInfo.numberOfPhases) ? this.stationInfo.numberOfPhases : 3;
- case PowerOutType.DC:
+ case CurrentOutType.DC:
return 0;
}
}
return this.connectors[id];
}
- public getPowerOutType(): PowerOutType {
- return !Utils.isUndefined(this.stationInfo.powerOutType) ? this.stationInfo.powerOutType : PowerOutType.AC;
+ public getCurrentOutType(): CurrentOutType {
+ return !Utils.isUndefined(this.stationInfo.currentOutType) ? this.stationInfo.currentOutType : CurrentOutType.AC;
}
public getVoltageOut(): number {
- const errMsg = `${this.logPrefix()} Unknown ${this.getPowerOutType()} powerOutType in template file ${this.stationTemplateFile}, cannot define default voltage out`;
+ const errMsg = `${this.logPrefix()} Unknown ${this.getCurrentOutType()} currentOutType in template file ${this.stationTemplateFile}, cannot define default voltage out`;
let defaultVoltageOut: number;
- switch (this.getPowerOutType()) {
- case PowerOutType.AC:
+ switch (this.getCurrentOutType()) {
+ case CurrentOutType.AC:
defaultVoltageOut = VoltageOut.VOLTAGE_230;
break;
- case PowerOutType.DC:
+ case CurrentOutType.DC:
defaultVoltageOut = VoltageOut.VOLTAGE_400;
break;
default:
import { ACElectricUtils } from '../../../utils/ElectricUtils';
import Constants from '../../../utils/Constants';
+import { CurrentOutType } from '../../../types/ChargingStationTemplate';
import MeasurandValues from '../../../types/MeasurandValues';
import { MessageType } from '../../../types/ocpp/MessageType';
import { OCPP16BootNotificationResponse } from '../../../types/ocpp/1.6/Responses';
import { OCPP16StandardParametersKey } from '../../../types/ocpp/1.6/Configuration';
import OCPPError from '../../OcppError';
import OCPPRequestService from '../OCPPRequestService';
-import { PowerOutType } from '../../../types/ChargingStationTemplate';
import Utils from '../../../utils/Utils';
import logger from '../../../utils/Logger';
logger.error(errMsg);
throw Error(errMsg);
}
- const errMsg = `${self.chargingStation.logPrefix()} MeterValues measurand ${meterValuesTemplate[index].measurand ? meterValuesTemplate[index].measurand : OCPP16MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER}: Unknown ${self.chargingStation.getPowerOutType()} powerOutType in template file ${self.chargingStation.stationTemplateFile}, cannot calculate ${meterValuesTemplate[index].measurand ? meterValuesTemplate[index].measurand : OCPP16MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER} measurand value`;
+ const errMsg = `${self.chargingStation.logPrefix()} MeterValues measurand ${meterValuesTemplate[index].measurand ? meterValuesTemplate[index].measurand : OCPP16MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER}: Unknown ${self.chargingStation.getCurrentOutType()} currentOutType in template file ${self.chargingStation.stationTemplateFile}, cannot calculate ${meterValuesTemplate[index].measurand ? meterValuesTemplate[index].measurand : OCPP16MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER} measurand value`;
const powerMeasurandValues = {} as MeasurandValues;
const maxPower = Math.round(self.chargingStation.stationInfo.maxPower / self.chargingStation.stationInfo.powerDivider);
const maxPowerPerPhase = Math.round((self.chargingStation.stationInfo.maxPower / self.chargingStation.stationInfo.powerDivider) / self.chargingStation.getNumberOfPhases());
- switch (self.chargingStation.getPowerOutType()) {
- case PowerOutType.AC:
+ switch (self.chargingStation.getCurrentOutType()) {
+ case CurrentOutType.AC:
if (Utils.isUndefined(meterValuesTemplate[index].value)) {
powerMeasurandValues.L1 = Utils.getRandomFloatRounded(maxPowerPerPhase);
powerMeasurandValues.L2 = 0;
powerMeasurandValues.allPhases = Utils.roundTo(powerMeasurandValues.L1 + powerMeasurandValues.L2 + powerMeasurandValues.L3, 2);
}
break;
- case PowerOutType.DC:
+ case CurrentOutType.DC:
if (Utils.isUndefined(meterValuesTemplate[index].value)) {
powerMeasurandValues.allPhases = Utils.getRandomFloatRounded(maxPower);
}
logger.error(errMsg);
throw Error(errMsg);
}
- const errMsg = `${self.chargingStation.logPrefix()} MeterValues measurand ${meterValuesTemplate[index].measurand ? meterValuesTemplate[index].measurand : OCPP16MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER}: Unknown ${self.chargingStation.getPowerOutType()} powerOutType in template file ${self.chargingStation.stationTemplateFile}, cannot calculate ${meterValuesTemplate[index].measurand ? meterValuesTemplate[index].measurand : OCPP16MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER} measurand value`;
+ const errMsg = `${self.chargingStation.logPrefix()} MeterValues measurand ${meterValuesTemplate[index].measurand ? meterValuesTemplate[index].measurand : OCPP16MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER}: Unknown ${self.chargingStation.getCurrentOutType()} currentOutType in template file ${self.chargingStation.stationTemplateFile}, cannot calculate ${meterValuesTemplate[index].measurand ? meterValuesTemplate[index].measurand : OCPP16MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER} measurand value`;
const currentMeasurandValues: MeasurandValues = {} as MeasurandValues;
let maxAmperage: number;
- switch (self.chargingStation.getPowerOutType()) {
- case PowerOutType.AC:
+ switch (self.chargingStation.getCurrentOutType()) {
+ case CurrentOutType.AC:
maxAmperage = ACElectricUtils.amperagePerPhaseFromPower(self.chargingStation.getNumberOfPhases(), self.chargingStation.stationInfo.maxPower / self.chargingStation.stationInfo.powerDivider, self.chargingStation.getVoltageOut());
if (Utils.isUndefined(meterValuesTemplate[index].value)) {
currentMeasurandValues.L1 = Utils.getRandomFloatRounded(maxAmperage);
currentMeasurandValues.allPhases = Utils.roundTo((currentMeasurandValues.L1 + currentMeasurandValues.L2 + currentMeasurandValues.L3) / self.chargingStation.getNumberOfPhases(), 2);
}
break;
- case PowerOutType.DC:
+ case CurrentOutType.DC:
maxAmperage = ACElectricUtils.amperageTotalFromPower(self.chargingStation.stationInfo.maxPower / self.chargingStation.stationInfo.powerDivider, self.chargingStation.getVoltageOut());
if (Utils.isUndefined(meterValuesTemplate[index].value)) {
currentMeasurandValues.allPhases = Utils.getRandomFloatRounded(maxAmperage);
import { OCPPProtocol } from './ocpp/OCPPProtocol';
import { OCPPVersion } from './ocpp/OCPPVersion';
-export enum PowerOutType {
+export enum CurrentOutType {
AC = 'AC',
DC = 'DC',
}
power: number | number[];
powerSharedByConnectors?: boolean;
powerUnit: PowerUnits;
- powerOutType?: PowerOutType;
+ currentOutType?: CurrentOutType;
numberOfPhases?: number;
numberOfConnectors?: number | number[];
useConnectorId0?: boolean;