From: Jérôme Benoit Date: Sun, 13 Jun 2021 12:30:30 +0000 (+0200) Subject: Documentation on OCPP parameters X-Git-Tag: v1.0.17~3 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=7e1dc8784bef178de6438ae9af2bece427809cde;p=e-mobility-charging-stations-simulator.git Documentation on OCPP parameters Signed-off-by: Jérôme Benoit --- diff --git a/README.md b/README.md index 9ceca281..c895beb1 100644 --- a/README.md +++ b/README.md @@ -208,6 +208,61 @@ make SUBMODULES_INIT=false - :x: TriggerMessage +## OCPP-J standard parameters supported + +All kind of OCPP parameters is supported in a charging station template. The list here mention the standard ones also handled automatically in the simulator. + +### Version 1.6 + +### Core Profile + +- :white_check_mark: AuthorizeRemoteTxRequests (type: boolean) (units: -) +- :x: ClockAlignedDataInterval (type: integer) (units: seconds) +- :x: ConnectionTimeOut (type: integer) (units: seconds) +- :x: GetConfigurationMaxKeys (type: integer) (units: -) +- :white_check_mark: HeartbeatInterval (type: integer) (units: seconds) +- :x: LocalAuthorizeOffline (type: boolean) (units: -) +- :x: LocalPreAuthorize (type: boolean) (units: -) +- :x: MeterValuesAlignedData (type: CSL) (units: -) +- :white_check_mark: MeterValuesSampledData (type: CSL) (units: -) +- :white_check_mark: MeterValueSampleInterval (type: integer) (units: seconds) +- :white_check_mark: NumberOfConnectors (type: integer) (units: -) +- :x: ResetRetries (type: integer) (units: times) +- :white_check_mark: ConnectorPhaseRotation (type: CSL) (units: -) +- :x: StopTransactionOnEVSideDisconnect (type: boolean) (units: -) +- :x: StopTransactionOnInvalidId (type: boolean) (units: -) +- :x: StopTxnAlignedData (type: CSL) (units: -) +- :x: StopTxnSampledData (type: CSL) (units: -) +- :x: SupportedFeatureProfiles (type: CSL) (units: -) +- :x: TransactionMessageAttempts (type: integer) (units: times) +- :x: TransactionMessageRetryInterval (type: integer) (units: seconds) +- :x: UnlockConnectorOnEVSideDisconnect (type: boolean) (units: -) + +### Firmware Management Profile + +- *none* + +### Local Auth List Management Profile + +- :x: LocalAuthListEnabled (type: boolean) (units: -) +- :x: LocalAuthListMaxLength (type: integer) (units: -) +- :x: SendLocalListMaxLength (type: integer) (units: -) + +### Reservation Profile + +- *none* + +### Smart Charging Profile + +- :x: ChargeProfileMaxStackLevel (type: integer) (units: -) +- :x: ChargingScheduleAllowedChargingRateUnit (type: CSL) (units: -) +- :x: ChargingScheduleMaxPeriods (type: integer) (units: -) +- :x: MaxChargingProfilesInstalled (type: integer) (units: -) + +### Remote Trigger Profile + +- *none* + ## License This file and all other files in this repository are licensed under the Apache Software License, v.2 and copyrighted under the copyright in [NOTICE](NOTICE) file, except as noted otherwise in the [LICENSE](LICENSE) file. diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 02cb9094..feffa05d 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -1,6 +1,7 @@ import { BootNotificationResponse, RegistrationStatus } from '../types/ocpp/Responses'; import ChargingStationConfiguration, { ConfigurationKey } from '../types/ChargingStationConfiguration'; import ChargingStationTemplate, { CurrentOutType, PowerUnits, VoltageOut } from '../types/ChargingStationTemplate'; +import { ConnectorPhaseRotation, StandardParametersKey, SupportedFeatureProfiles } from '../types/ocpp/Configuration'; import Connectors, { Connector } from '../types/Connectors'; import { PerformanceObserver, performance } from 'perf_hooks'; import Requests, { AvailabilityType, BootNotificationRequest, IncomingRequest, IncomingRequestCommand } from '../types/ocpp/Requests'; @@ -23,7 +24,6 @@ import OCPPIncomingRequestService from './ocpp/OCPPIncomingRequestService'; import OCPPRequestService from './ocpp/OCPPRequestService'; import { OCPPVersion } from '../types/ocpp/OCPPVersion'; import PerformanceStatistics from '../utils/PerformanceStatistics'; -import { StandardParametersKey } from '../types/ocpp/Configuration'; import { StopTransactionReason } from '../types/ocpp/Transaction'; import Utils from '../utils/Utils'; import { WebSocketCloseEventStatusCode } from '../types/WebSocket'; @@ -507,6 +507,26 @@ export default class ChargingStation { if (!this.getConfigurationKey(StandardParametersKey.MeterValuesSampledData)) { this.addConfigurationKey(StandardParametersKey.MeterValuesSampledData, MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER); } + if (!this.getConfigurationKey(StandardParametersKey.SupportedFeatureProfiles)) { + this.addConfigurationKey(StandardParametersKey.SupportedFeatureProfiles, SupportedFeatureProfiles.Core); + } + if (!this.getConfigurationKey(StandardParametersKey.ConnectorPhaseRotation)) { + const connectorPhaseRotation = []; + for (const connector in this.connectors) { + // AC/DC + if (Utils.convertToInt(connector) === 0 && this.getNumberOfPhases() === 0) { + connectorPhaseRotation.push(`${connector}.${ConnectorPhaseRotation.RST}`); + } else if (Utils.convertToInt(connector) > 0 && this.getNumberOfPhases() === 0) { + connectorPhaseRotation.push(`${connector}.${ConnectorPhaseRotation.NotApplicable}`); + // AC + } else if (Utils.convertToInt(connector) > 0 && this.getNumberOfPhases() === 1) { + connectorPhaseRotation.push(`${connector}.${ConnectorPhaseRotation.NotApplicable}`); + } else if (Utils.convertToInt(connector) > 0 && this.getNumberOfPhases() === 3) { + connectorPhaseRotation.push(`${connector}.${ConnectorPhaseRotation.RST}`); + } + } + this.addConfigurationKey(StandardParametersKey.ConnectorPhaseRotation, connectorPhaseRotation.toString()); + } this.stationInfo.powerDivider = this.getPowerDivider(); if (this.getEnableStatistics()) { this.performanceStatistics = new PerformanceStatistics(this.stationInfo.chargingStationId); diff --git a/src/types/ocpp/1.6/Configuration.ts b/src/types/ocpp/1.6/Configuration.ts index ae0c352d..315c9646 100644 --- a/src/types/ocpp/1.6/Configuration.ts +++ b/src/types/ocpp/1.6/Configuration.ts @@ -1,3 +1,12 @@ +export enum OCPP16SupportedFeatureProfiles { + Core = 'Core', + Firmware_Management = 'FirmwareManagement', + Local_Auth_List_Management = 'LocalAuthListManagement', + Reservation = 'Reservation', + Smart_Charging = 'SmartCharging', + Remote_Trigger = 'RemoteTrigger' +} + export enum OCPP16StandardParametersKey { AllowOfflineTxForUnknownId = 'AllowOfflineTxForUnknownId', AuthorizationCacheEnabled = 'AuthorizationCacheEnabled', diff --git a/src/types/ocpp/Configuration.ts b/src/types/ocpp/Configuration.ts index f4865325..6559f815 100644 --- a/src/types/ocpp/Configuration.ts +++ b/src/types/ocpp/Configuration.ts @@ -1,4 +1,4 @@ -import { OCPP16StandardParametersKey } from './1.6/Configuration'; +import { OCPP16StandardParametersKey, OCPP16SupportedFeatureProfiles } from './1.6/Configuration'; export type StandardParametersKey = OCPP16StandardParametersKey; @@ -6,6 +6,23 @@ export const StandardParametersKey = { ...OCPP16StandardParametersKey }; +export type SupportedFeatureProfiles = OCPP16SupportedFeatureProfiles; + +export const SupportedFeatureProfiles = { + ...OCPP16SupportedFeatureProfiles +}; + +export enum ConnectorPhaseRotation { + NotApplicable = 'NotApplicable', + Unknown = 'Unknown', + RST = 'RST', + RTS = 'RTS', + SRT = 'SRT', + STR = 'STR', + TRS = 'TRS', + TSR = 'TSR' +} + export interface OCPPConfigurationKey { key: string | StandardParametersKey; readonly: boolean;