build(deps-dev): bump eslint-plugin-vue from 9.23.0 to 9.24.0
[e-mobility-charging-stations-simulator.git] / README.md
1 <!-- markdownlint-disable-file MD033 MD024 -->
2 <div align="center">
3
4 # [e-Mobility charging stations simulator](https://github.com/sap/e-mobility-charging-stations-simulator)
5
6 </div>
7
8 <div align="center">
9
10 [![GitHub Clones](https://img.shields.io/badge/dynamic/json?color=brightgreen&label=Clone&query=count&url=https://gist.githubusercontent.com/jerome-benoit/c7c669b881d5b27dc0b44a639504ff93/raw/clone.json&logo=github)](https://github.com/SAP/e-mobility-charging-stations-simulator/graphs/traffic)
11 [![GitHub commit activity (main)](https://img.shields.io/github/commit-activity/m/SAP/e-mobility-charging-stations-simulator/main?color=brightgreen&logo=github)](https://github.com/SAP/e-mobility-charging-stations-simulator/graphs/commit-activity)
12 [![CI workflow](https://github.com/SAP/e-mobility-charging-stations-simulator/actions/workflows/ci.yml/badge.svg)](https://github.com/SAP/e-mobility-charging-stations-simulator/actions/workflows/ci.yml)
13 [![REUSE status](https://api.reuse.software/badge/github.com/SAP/e-mobility-charging-stations-simulator)](https://api.reuse.software/info/github.com/SAP/e-mobility-charging-stations-simulator)
14 [![Javascript Standard Style Guide](<https://badgen.net/static/code style/standard/green>)](https://standardjs.com)
15
16 </div>
17
18 Simple [node.js](https://nodejs.org/) software to simulate and scale a set of charging stations based on the OCPP-J protocol as part of [SAP e-Mobility](https://www.sap.com/products/scm/e-mobility.html) solution.
19
20 ## Table of contents
21
22 - [Installation](#installation)
23 - [Prerequisites](#prerequisites)
24 - [Windows](#windows)
25 - [MacOSX](#macosx)
26 - [GNU/Linux](#gnulinux)
27 - [Dependencies](#dependencies)
28 - [Initial configuration](#initial-configuration)
29 - [Start simulator](#start-simulator)
30 - [Start Web UI](#start-web-ui)
31 - [Configuration files syntax](#configuration-files-syntax)
32 - [Charging stations simulator configuration](#charging-stations-simulator-configuration)
33 - [Charging station configuration template](#charging-station-configuration-template)
34 - [Charging station configuration](#charging-station-configuration)
35 - [Docker](#docker)
36 - [OCPP-J commands supported](#ocpp-j-commands-supported)
37 - [Version 1.6](#version-16)
38 - [Version 2.x.x](#version-2xx)
39 - [OCPP-J standard parameters supported](#ocpp-j-standard-parameters-supported)
40 - [Version 1.6](#version-16-1)
41 - [Version 2.x.x](#version-2xx-1)
42 - [UI Protocol](#ui-protocol)
43 - [Websocket Protocol](#websocket-protocol)
44 - [HTTP Protocol](#http-protocol)
45 - [Support, Feedback, Contributing](#support-feedback-contributing)
46 - [Code of Conduct](#code-of-conduct)
47 - [Licensing](#licensing)
48
49 ## Installation
50
51 ### Prerequisites
52
53 Install the [node.js](https://nodejs.org/) current LTS or superior version runtime environment:
54
55 #### Windows
56
57 - [Chocolatey](https://chocolatey.org/):
58
59 ```powershell
60 choco install -y nodejs
61 ```
62
63 #### MacOSX
64
65 - [Homebrew](https://brew.sh/):
66
67 ```shell
68 brew install node
69 ```
70
71 #### GNU/Linux
72
73 - [NodeSource](https://github.com/nodesource/distributions) Node.js Binary Distributions for all supported versions.
74
75 #### Dependencies
76
77 Enable corepack if not already done and install latest pnpm version:
78
79 ```shell
80 corepack enable
81 corepack prepare pnpm@latest --activate
82 ```
83
84 In the repository root, run the following command:
85
86 ```shell
87 pnpm install
88 ```
89
90 ## Initial configuration
91
92 Copy the configuration template file [src/assets/config-template.json](./src/assets/config-template.json) to [src/assets/config.json](./src/assets/config.json).
93 Copy the RFID tags template file [src/assets/idtags-template.json](./src/assets/idtags-template.json) to [src/assets/idtags.json](./src/assets/idtags.json).
94
95 Tweak them to your needs by following the section [configuration files syntax](#configuration-files-syntax): OCPP server supervision URL(s), charging station templates, etc.
96
97 ## Start simulator
98
99 ```shell
100 pnpm start
101 ```
102
103 ## Start Web UI
104
105 See Web UI [README.md](./ui/web/README.md) for more information.
106
107 ## Configuration files syntax
108
109 All configuration files are using the JSON standard syntax.
110
111 **Configuration files locations**:
112
113 - charging stations simulator configuration: [src/assets/config.json](./src/assets/config.json);
114 - charging station configuration templates: [src/assets/station-templates](./src/assets/station-templates);
115 - charging station configurations: [dist/assets/configurations](./dist/assets/configurations);
116 - charging station RFID tags lists: [src/assets](./src/assets).
117
118 The charging stations simulator's configuration parameters must be within the `src/assets/config.json` file. A charging station simulator configuration template file is available at [src/assets/config-template.json](./src/assets/config-template.json).
119
120 All charging station configuration templates are in the directory [src/assets/station-templates](./src/assets/station-templates).
121
122 A list of RFID tags must be defined for the automatic transaction generator in a file with the default location and name: `src/assets/idtags.json`. A template file is available at [src/assets/idtags-template.json](./src/assets/idtags-template.json).
123
124 **Configuration files hierarchy and priority**:
125
126 1. charging station configuration: [dist/assets/configurations](./dist/assets/configurations);
127 2. charging station configuration template: [src/assets/station-templates](./src/assets/station-templates);
128 3. charging stations simulator configuration: [src/assets/config.json](./src/assets/config.json).
129
130 The charging stations simulator has an automatic configuration files reload feature at change for:
131
132 - charging stations simulator configuration;
133 - charging station configuration templates;
134 - charging station authorization RFID tags lists.
135
136 But the modifications to test have to be done to the files in the build target directory [dist/assets](./dist/assets). Once the modifications are done, they have to be reported to the matching files in the build source directory [src/assets](./src/assets) to ensure they will be taken into account at next build.
137
138 ### Charging stations simulator configuration
139
140 **src/assets/config.json**:
141
142 | Key | Value(s) | Default Value | Value type | Description |
143 | -------------------------- | -------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
144 | supervisionUrls | | [] | string \| string[] | string or strings array containing global connection URIs to OCPP-J servers |
145 | supervisionUrlDistribution | round-robin/random/charging-station-affinity | charging-station-affinity | string | supervision urls distribution policy to simulated charging stations |
146 | log | | {<br />"enabled": true,<br />"file": "logs/combined.log",<br />"errorFile": "logs/error.log",<br />"statisticsInterval": 60,<br />"level": "info",<br />"console": false,<br />"format": "simple",<br />"rotate": true<br />} | {<br />enabled?: boolean;<br />file?: string;<br />errorFile?: string;<br />statisticsInterval?: number;<br />level?: string;<br />console?: boolean;<br />format?: string;<br />rotate?: boolean;<br />maxFiles?: string \| number;<br />maxSize?: string \| number;<br />} | Log configuration section:<br />- _enabled_: enable logging<br />- _file_: log file relative path<br />- _errorFile_: error log file relative path<br />- _statisticsInterval_: seconds between charging stations statistics output in the logs<br />- _level_: emerg/alert/crit/error/warning/notice/info/debug [winston](https://github.com/winstonjs/winston) logging level</br >- _console_: output logs on the console<br />- _format_: [winston](https://github.com/winstonjs/winston) log format<br />- _rotate_: enable daily log files rotation<br />- _maxFiles_: maximum number of log files: https://github.com/winstonjs/winston-daily-rotate-file#options<br />- _maxSize_: maximum size of log files in bytes, or units of kb, mb, and gb: https://github.com/winstonjs/winston-daily-rotate-file#options |
147 | worker | | {<br />"processType": "workerSet",<br />"startDelay": 500,<br />"elementAddDelay": 0,<br />"elementsPerWorker": 'auto',<br />"poolMinSize": 4,<br />"poolMaxSize": 16<br />} | {<br />processType?: WorkerProcessType;<br />startDelay?: number;<br />elementAddDelay?: number;<br />elementsPerWorker?: number \| 'auto' \| 'all';<br />poolMinSize?: number;<br />poolMaxSize?: number;<br />resourceLimits?: ResourceLimits;<br />} | Worker configuration section:<br />- _processType_: worker threads process type (`workerSet`/`fixedPool`/`dynamicPool`)<br />- _startDelay_: milliseconds to wait at worker threads startup (only for `workerSet` worker threads process type)<br />- _elementAddDelay_: milliseconds to wait between charging station add<br />- _elementsPerWorker_: number of charging stations per worker threads for the `workerSet` process type (`auto` means (number of stations) / (number of CPUs) \* 1.5 if (number of stations) > (number of CPUs), otherwise 1; `all` means a unique worker will run all charging stations)<br />- _poolMinSize_: worker threads pool minimum number of threads</br >- _poolMaxSize_: worker threads pool maximum number of threads<br />- _resourceLimits_: worker threads [resource limits](https://nodejs.org/api/worker_threads.html#new-workerfilename-options) object option |
148 | uiServer | | {<br />"enabled": false,<br />"type": "ws",<br />"version": "1.1",<br />"options": {<br />"host": "localhost",<br />"port": 8080<br />}<br />} | {<br />enabled?: boolean;<br />type?: ApplicationProtocol;<br />version?: ApplicationProtocolVersion;<br />options?: ServerOptions;<br />authentication?: {<br />enabled: boolean;<br />type: AuthenticationType;<br />username?: string;<br />password?: string;<br />}<br />} | UI server configuration section:<br />- _enabled_: enable UI server<br />- _type_: 'http' or 'ws'<br />- _version_: HTTP version '1.1' or '2.0'<br />- _options_: node.js net module [listen options](https://nodejs.org/api/net.html#serverlistenoptions-callback)<br />- _authentication_: authentication type configuration section |
149 | performanceStorage | | {<br />"enabled": true,<br />"type": "none",<br />} | {<br />enabled?: boolean;<br />type?: string;<br />uri?: string;<br />} | Performance storage configuration section:<br />- _enabled_: enable performance storage<br />- _type_: 'jsonfile', 'mongodb' or 'none'<br />- _uri_: storage URI |
150 | stationTemplateUrls | | {}[] | {<br />file: string;<br />numberOfStations: number;<br />}[] | array of charging station configuration templates URIs configuration section (charging station configuration template file name and number of stations) |
151
152 #### Worker process model
153
154 - **workerSet**:
155 Worker set executing each a fixed number (elementsPerWorker) of simulated charging stations from the total
156
157 - **fixedPool**:
158 Fixedly sized worker pool executing a fixed total number of simulated charging stations
159
160 - **dynamicPool** (experimental):
161 Dynamically sized worker pool executing a fixed total number of simulated charging stations
162
163 ### Charging station configuration template
164
165 **src/assets/station-templates/\<name\>.json**:
166
167 | Key | Value(s) | Default Value | Value type | Description |
168 | ---------------------------------------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
169 | supervisionUrls | | [] | string \| string[] | string or strings array containing connection URIs to OCPP-J servers |
170 | supervisionUser | | undefined | string | basic HTTP authentication user to OCPP-J server |
171 | supervisionPassword | | undefined | string | basic HTTP authentication password to OCPP-J server |
172 | supervisionUrlOcppConfiguration | true/false | false | boolean | enable supervision URL configuration via a vendor OCPP parameter key |
173 | supervisionUrlOcppKey | | 'ConnectionUrl' | string | the vendor string that will be used as a vendor OCPP parameter key to set the supervision URL |
174 | autoStart | true/false | true | boolean | enable automatic start of added charging station from template |
175 | ocppVersion | 1.6/2.0/2.0.1 | 1.6 | string | OCPP version |
176 | ocppProtocol | json | json | string | OCPP protocol |
177 | ocppStrictCompliance | true/false | true | boolean | enable strict adherence to the OCPP version and protocol specifications with OCPP commands PDU validation against [OCA](https://www.openchargealliance.org/) JSON schemas |
178 | ocppPersistentConfiguration | true/false | true | boolean | enable persistent OCPP parameters storage by charging stations 'hashId'. The persistency is ensured by the charging stations configuration files in [dist/assets/configurations](./dist/assets/configurations) |
179 | stationInfoPersistentConfiguration | true/false | true | boolean | enable persistent station information and specifications storage by charging stations 'hashId'. The persistency is ensured by the charging stations configuration files in [dist/assets/configurations](./dist/assets/configurations) |
180 | automaticTransactionGeneratorPersistentConfiguration | true/false | true | boolean | enable persistent automatic transaction generator configuration storage by charging stations 'hashId'. The persistency is ensured by the charging stations configuration files in [dist/assets/configurations](./dist/assets/configurations) |
181 | wsOptions | | {} | ClientOptions & ClientRequestArgs | [ws](https://github.com/websockets/ws) and node.js [http](https://nodejs.org/api/http.html) clients options intersection |
182 | idTagsFile | | undefined | string | RFID tags list file relative to [src/assets](./src/assets) path |
183 | baseName | | undefined | string | base name to build charging stations id |
184 | nameSuffix | | undefined | string | name suffix to build charging stations id |
185 | fixedName | true/false | false | boolean | use the 'baseName' as the charging stations unique name |
186 | chargePointModel | | undefined | string | charging stations model |
187 | chargePointVendor | | undefined | string | charging stations vendor |
188 | chargePointSerialNumberPrefix | | undefined | string | charge point serial number prefix |
189 | chargeBoxSerialNumberPrefix | | undefined | string | charge box serial number prefix (deprecated since OCPP 1.6) |
190 | firmwareVersionPattern | | Semantic versioning regular expression: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string | string | charging stations firmware version pattern |
191 | firmwareVersion | | undefined | string | charging stations firmware version |
192 | power | | | float \| float[] | charging stations maximum power value(s) |
193 | powerSharedByConnectors | true/false | false | boolean | charging stations power shared by its connectors |
194 | powerUnit | W/kW | W | string | charging stations power unit |
195 | currentOutType | AC/DC | AC | string | charging stations current out type |
196 | voltageOut | | AC:230/DC:400 | integer | charging stations voltage out |
197 | numberOfPhases | 0/1/3 | AC:3/DC:0 | integer | charging stations number of phase(s) |
198 | numberOfConnectors | | | integer \| integer[] | charging stations number of connector(s) |
199 | useConnectorId0 | true/false | true | boolean | use connector id 0 definition from the charging station configuration template |
200 | randomConnectors | true/false | false | boolean | randomize runtime connector id affectation from the connector id definition in charging station configuration template |
201 | resetTime | | 60 | integer | seconds to wait before the charging stations come back at reset |
202 | autoRegister | true/false | false | boolean | set charging stations as registered at boot notification for testing purpose |
203 | autoReconnectMaxRetries | | -1 (unlimited) | integer | connection retries to the OCPP-J server |
204 | reconnectExponentialDelay | true/false | false | boolean | connection delay retry to the OCPP-J server |
205 | registrationMaxRetries | | -1 (unlimited) | integer | charging stations boot notification retries |
206 | amperageLimitationOcppKey | | undefined | string | charging stations OCPP parameter key used to set the amperage limit, per phase for each connector on AC and global for DC |
207 | amperageLimitationUnit | A/cA/dA/mA | A | string | charging stations amperage limit unit |
208 | enableStatistics | true/false | false | boolean | enable charging stations statistics |
209 | remoteAuthorization | true/false | true | boolean | enable RFID tags remote authorization |
210 | beginEndMeterValues | true/false | false | boolean | enable Transaction.{Begin,End} MeterValues |
211 | outOfOrderEndMeterValues | true/false | false | boolean | send Transaction.End MeterValues out of order. Need to relax OCPP specifications strict compliance ('ocppStrictCompliance' parameter) |
212 | meteringPerTransaction | true/false | true | boolean | enable metering history on a per transaction basis |
213 | transactionDataMeterValues | true/false | false | boolean | enable transaction data MeterValues at stop transaction |
214 | stopTransactionsOnStopped | true/false | true | boolean | enable stop transactions on charging station stop |
215 | mainVoltageMeterValues | true/false | true | boolean | include charging stations main voltage MeterValues on three phased charging stations |
216 | phaseLineToLineVoltageMeterValues | true/false | false | boolean | include charging stations line to line voltage MeterValues on three phased charging stations |
217 | customValueLimitationMeterValues | true/false | true | boolean | enable limitation on custom fluctuated value in MeterValues |
218 | firmwareUpgrade | | {<br />"versionUpgrade": {<br />"step": 1<br />},<br />"reset": true<br />} | {<br />versionUpgrade?: {<br />patternGroup?: number;<br />step?: number;<br />};<br />reset?: boolean;<br />failureStatus?: 'DownloadFailed' \| 'InstallationFailed';<br />} | Configuration section for simulating firmware upgrade support. |
219 | commandsSupport | | {<br />"incomingCommands": {},<br />"outgoingCommands": {}<br />} | {<br /> incomingCommands: Record<IncomingRequestCommand, boolean>;<br />outgoingCommands?: Record<RequestCommand, boolean>;<br />} | Configuration section for OCPP commands support. Empty section or subsections means all implemented OCPP commands are supported |
220 | messageTriggerSupport | | {} | Record<MessageTrigger, boolean> | Configuration section for OCPP commands trigger support. Empty section means all implemented OCPP trigger commands are supported |
221 | Configuration | | | ChargingStationOcppConfiguration | charging stations OCPP parameters configuration section |
222 | AutomaticTransactionGenerator | | | AutomaticTransactionGeneratorConfiguration | charging stations ATG configuration section |
223 | Connectors | | | Record<string, ConnectorStatus> | charging stations connectors configuration section |
224 | Evses | | | Record<string, EvseTemplate> | charging stations EVSEs configuration section |
225
226 #### Configuration section syntax example
227
228 ```json
229 "Configuration": {
230 "configurationKey": [
231 ...
232 {
233 "key": "StandardKey",
234 "readonly": false,
235 "value": "StandardValue",
236 "visible": true,
237 "reboot": false
238 },
239 ...
240 {
241 "key": "VendorKey",
242 "readonly": false,
243 "value": "VendorValue",
244 "visible": false,
245 "reboot": true
246 },
247 ...
248 ]
249 }
250 ```
251
252 #### AutomaticTransactionGenerator section syntax example
253
254 ##### Type definition:
255
256 ```ts
257 type AutomaticTransactionGeneratorConfiguration = {
258 enable: boolean
259 minDuration: number
260 maxDuration: number
261 minDelayBetweenTwoTransactions: number
262 maxDelayBetweenTwoTransactions: number
263 probabilityOfStart: number
264 stopAfterHours: number
265 stopAbsoluteDuration: boolean
266 requireAuthorize?: boolean
267 idTagDistribution?: 'random' | 'round-robin' | 'connector-affinity'
268 }
269 ```
270
271 ##### Example:
272
273 ```json
274 "AutomaticTransactionGenerator": {
275 "enable": false,
276 "minDuration": 60,
277 "maxDuration": 80,
278 "minDelayBetweenTwoTransactions": 15,
279 "maxDelayBetweenTwoTransactions": 30,
280 "probabilityOfStart": 1,
281 "stopAfterHours": 0.3,
282 "requireAuthorize": true,
283 "idTagDistribution": "random"
284 }
285 ```
286
287 #### Connectors section syntax example
288
289 ```json
290 "Connectors": {
291 "0": {},
292 "1": {
293 "bootStatus": "Available",
294 "MeterValues": [
295 ...
296 {
297 "unit": "W",
298 "measurand": "Power.Active.Import",
299 "phase": "L1-N",
300 "value": "5000",
301 "fluctuationPercent": "10"
302 },
303 ...
304 {
305 "unit": "A",
306 "measurand": "Current.Import",
307 "minimum": "0.5"
308 },
309 ...
310 {
311 "unit": "Wh"
312 },
313 ...
314 ]
315 }
316 },
317 ```
318
319 #### Evses section syntax example
320
321 ```json
322 "Evses": {
323 "0": {
324 "Connectors": {
325 "0": {}
326 }
327 },
328 "1": {
329 "Connectors": {
330 "1": {
331 "bootStatus": "Available",
332 "MeterValues": [
333 ...
334 {
335 "unit": "W",
336 "measurand": "Power.Active.Import",
337 "phase": "L1-N",
338 "value": "5000",
339 "fluctuationPercent": "10"
340 },
341 ...
342 {
343 "unit": "A",
344 "measurand": "Current.Import",
345 "minimum": "0.5"
346 },
347 ...
348 {
349 "unit": "Wh"
350 },
351 ...
352 ]
353 }
354 }
355 }
356 },
357 ```
358
359 ### Charging station configuration
360
361 **dist/assets/configurations/\<hashId\>.json**:
362
363 The charging station configuration file is automatically generated at startup from the charging station configuration template file and is persistent.
364
365 The charging station configuration file content can be regenerated partially on matching charging station configuration template file changes. The charging station serial number is kept unchanged.
366
367 #### stationInfo section (optional)
368
369 The syntax is similar to charging station configuration template with some added fields like the charging station id (name) and the 'Configuration' section removed.
370
371 That section is overwritten on matching charging station configuration template file changes.
372
373 #### connectorsStatus section
374
375 The syntax is similar to charging station configuration template 'Connectors' section with some added fields.
376
377 That section is overwritten on matching charging station configuration template file changes.
378
379 #### evsesStatus section
380
381 The syntax is similar to charging station configuration template 'Evses' section with some added fields.
382
383 That section is overwritten on matching charging station configuration template file changes.
384
385 #### automaticTransactionGenerator section (optional)
386
387 The syntax is similar to the charging station configuration template 'AutomaticTransactionGenerator' section.
388
389 That section is overwritten on matching charging station configuration template file changes.
390
391 #### automaticTransactionGeneratorStatuses section
392
393 That section is not overwritten on matching charging station configuration template file changes.
394
395 #### configurationKey section (optional)
396
397 The syntax is similar to the charging station configuration template 'Configuration' section.
398
399 That section is not overwritten on matching charging station configuration template file changes.
400
401 ## Docker
402
403 In the [docker](./docker) folder:
404
405 ```shell
406 make
407 ```
408
409 <!-- Or with the optional git submodules:
410
411 ```shell
412 make SUBMODULES_INIT=true
413 ``` -->
414
415 ## OCPP-J commands supported
416
417 ### Version 1.6
418
419 #### Core Profile
420
421 - :white_check_mark: Authorize
422 - :white_check_mark: BootNotification
423 - :white_check_mark: ChangeAvailability
424 - :white_check_mark: ChangeConfiguration
425 - :white_check_mark: ClearCache
426 - :white_check_mark: DataTransfer
427 - :white_check_mark: GetConfiguration
428 - :white_check_mark: Heartbeat
429 - :white_check_mark: MeterValues
430 - :white_check_mark: RemoteStartTransaction
431 - :white_check_mark: RemoteStopTransaction
432 - :white_check_mark: Reset
433 - :white_check_mark: StartTransaction
434 - :white_check_mark: StatusNotification
435 - :white_check_mark: StopTransaction
436 - :white_check_mark: UnlockConnector
437
438 #### Firmware Management Profile
439
440 - :white_check_mark: GetDiagnostics
441 - :white_check_mark: DiagnosticsStatusNotification
442 - :white_check_mark: FirmwareStatusNotification
443 - :white_check_mark: UpdateFirmware
444
445 #### Local Auth List Management Profile
446
447 - :x: GetLocalListVersion
448 - :x: SendLocalList
449
450 #### Reservation Profile
451
452 - :white_check_mark: CancelReservation
453 - :white_check_mark: ReserveNow
454
455 #### Smart Charging Profile
456
457 - :white_check_mark: ClearChargingProfile
458 - :white_check_mark: GetCompositeSchedule
459 - :white_check_mark: SetChargingProfile
460
461 #### Remote Trigger Profile
462
463 - :white_check_mark: TriggerMessage
464
465 ### Version 2.x.x
466
467 #### Provisioning
468
469 - :white_check_mark: BootNotification
470
471 #### Authorization
472
473 - :white_check_mark: ClearCache
474
475 #### Availability
476
477 - :white_check_mark: StatusNotification
478 - :white_check_mark: Heartbeat
479
480 ## OCPP-J standard parameters supported
481
482 All kind of OCPP parameters are supported in charging station configuration or charging station configuration template file. The list here mention the standard ones also handled automatically in the simulator.
483
484 ### Version 1.6
485
486 #### Core Profile
487
488 - :white_check_mark: AuthorizeRemoteTxRequests (type: boolean) (units: -)
489 - :x: ClockAlignedDataInterval (type: integer) (units: seconds)
490 - :white_check_mark: ConnectionTimeOut (type: integer) (units: seconds)
491 - :x: GetConfigurationMaxKeys (type: integer) (units: -)
492 - :white_check_mark: HeartbeatInterval (type: integer) (units: seconds)
493 - :x: LocalAuthorizeOffline (type: boolean) (units: -)
494 - :x: LocalPreAuthorize (type: boolean) (units: -)
495 - :x: MeterValuesAlignedData (type: CSL) (units: -)
496 - :white_check_mark: MeterValuesSampledData (type: CSL) (units: -)
497 - :white_check_mark: MeterValueSampleInterval (type: integer) (units: seconds)
498 - :white_check_mark: NumberOfConnectors (type: integer) (units: -)
499 - :x: ResetRetries (type: integer) (units: times)
500 - :white_check_mark: ConnectorPhaseRotation (type: CSL) (units: -)
501 - :x: StopTransactionOnEVSideDisconnect (type: boolean) (units: -)
502 - :x: StopTransactionOnInvalidId (type: boolean) (units: -)
503 - :x: StopTxnAlignedData (type: CSL) (units: -)
504 - :x: StopTxnSampledData (type: CSL) (units: -)
505 - :white_check_mark: SupportedFeatureProfiles (type: CSL) (units: -)
506 - :x: TransactionMessageAttempts (type: integer) (units: times)
507 - :x: TransactionMessageRetryInterval (type: integer) (units: seconds)
508 - :x: UnlockConnectorOnEVSideDisconnect (type: boolean) (units: -)
509 - :white_check_mark: WebSocketPingInterval (type: integer) (units: seconds)
510
511 #### Firmware Management Profile
512
513 - _none_
514
515 #### Local Auth List Management Profile
516
517 - :white_check_mark: LocalAuthListEnabled (type: boolean) (units: -)
518 - :x: LocalAuthListMaxLength (type: integer) (units: -)
519 - :x: SendLocalListMaxLength (type: integer) (units: -)
520
521 #### Reservation Profile
522
523 - :white_check_mark: ReserveConnectorZeroSupported (type: boolean) (units: -)
524
525 #### Smart Charging Profile
526
527 - :x: ChargeProfileMaxStackLevel (type: integer) (units: -)
528 - :x: ChargingScheduleAllowedChargingRateUnit (type: CSL) (units: -)
529 - :x: ChargingScheduleMaxPeriods (type: integer) (units: -)
530 - :x: MaxChargingProfilesInstalled (type: integer) (units: -)
531
532 #### Remote Trigger Profile
533
534 - _none_
535
536 ### Version 2.x.x
537
538 ## UI Protocol
539
540 Protocol to control the simulator via a Websocket or HTTP server:
541
542 ```mermaid
543 sequenceDiagram
544 Client->>UI Server: request
545 UI Server->>Client: response
546 Note over UI Server,Client: HTTP or Websocket
547 ```
548
549 ### Websocket Protocol
550
551 SRPC protocol over Websocket. PDU stands for 'Protocol Data Unit'.
552
553 - Request:
554 [`uuid`, `ProcedureName`, `PDU`]
555 `uuid`: String uniquely representing this request
556 `ProcedureName`: The procedure to run on the simulator
557 `PDU`: The parameters for said procedure
558
559 - Response:
560 [`uuid`, `PDU`]
561 `uuid`: String uniquely linking the response to the request
562 `PDU`: Response parameters to requested procedure
563
564 To learn how to use the Websocket protocol to pilot the simulator, an [Insomnia](https://insomnia.rest/) Websocket requests collection is available in [src/assets/ui-protocol](./src/assets/ui-protocol) directory.
565
566 #### Version 0.0.1
567
568 Set the Websocket header _Sec-Websocket-Protocol_ to `ui0.0.1`.
569
570 ##### Procedures
571
572 ###### Simulator State
573
574 - Request:
575 `ProcedureName`: 'simulatorState'
576 `PDU`: {}
577
578 - Response:
579 `PDU`: {
580 `status`: 'success' | 'failure',
581 `state`: {
582 `version`: string,
583 `started`: boolean,
584 `templateStatistics`: Record<string, TemplateStatistics>
585 }
586 }
587
588 ###### Start Simulator
589
590 - Request:
591 `ProcedureName`: 'startSimulator'
592 `PDU`: {}
593
594 - Response:
595 `PDU`: {
596 `status`: 'success' | 'failure'
597 }
598
599 ###### Stop Simulator
600
601 - Request:
602 `ProcedureName`: 'stopSimulator'
603 `PDU`: {}
604
605 - Response:
606 `PDU`: {
607 `status`: 'success' | 'failure'
608 }
609
610 ###### List Charging Station Templates
611
612 - Request:
613 `ProcedureName`: 'listTemplates'
614 `PDU`: {}
615
616 - Response:
617 `PDU`: {
618 `status`: 'success' | 'failure',
619 `templates`: string[]
620 }
621
622 ###### Add Charging Stations
623
624 - Request:
625 `ProcedureName`: 'addChargingStations'
626 `PDU`: {
627 `template`: string,
628 `numberOfStations`: number,
629 `options?`: {
630 `supervisionUrls?`: string | string[],
631 `persistentConfiguration?`: boolean,
632 `autoStart?`: boolean,
633 `autoRegister?`: boolean,
634 `enableStatistics?`: boolean,
635 `ocppStrictCompliance?`: boolean,
636 `stopTransactionsOnStopped?`: boolean
637 }
638 }
639
640 - Response:
641 `PDU`: {
642 `status`: 'success' | 'failure',
643 `hashIdsSucceeded`: charging station unique identifier strings array (optional),
644 `hashIdsFailed`: charging station unique identifier strings array (optional)
645 }
646
647 ###### Delete Charging Stations
648
649 - Request:
650 `ProcedureName`: 'deleteChargingStations'
651 `PDU`: {
652 `hashIds`: charging station unique identifier strings array (optional, default: all charging stations),
653 `deleteConfiguration?`: boolean
654 }
655
656 - Response:
657 `PDU`: {
658 `status`: 'success' | 'failure',
659 `hashIdsSucceeded`: charging station unique identifier strings array,
660 `hashIdsFailed`: charging station unique identifier strings array (optional),
661 `responsesFailed`: failed responses payload array (optional)
662 }
663
664 ###### Set Charging Station Supervision Url
665
666 - Request:
667 `ProcedureName`: 'setSupervisionUrl'
668 `PDU`: {
669 `hashIds`: charging station unique identifier strings array (optional, default: all charging stations),
670 `url`: string
671 }
672
673 - Response:
674 `PDU`: {
675 `status`: 'success' | 'failure',
676 `hashIdsSucceeded`: charging station unique identifier strings array,
677 `hashIdsFailed`: charging station unique identifier strings array (optional),
678 `responsesFailed`: failed responses payload array (optional)
679 }
680
681 ###### Performance Statistics
682
683 - Request:
684 `ProcedureName`: 'performanceStatistics'
685 `PDU`: {}
686
687 - Response:
688 `PDU`: {
689 `status`: 'success' | 'failure',
690 `performanceStatistics`: Statistics[]
691 }
692
693 ###### List Charging Stations
694
695 - Request:
696 `ProcedureName`: 'listChargingStations'
697 `PDU`: {}
698
699 - Response:
700 `PDU`: {
701 `status`: 'success' | 'failure',
702 `chargingStations`: ChargingStationData[]
703 }
704
705 ###### Start Charging Station
706
707 - Request:
708 `ProcedureName`: 'startChargingStation'
709 `PDU`: {
710 `hashIds`: charging station unique identifier strings array (optional, default: all charging stations)
711 }
712
713 - Response:
714 `PDU`: {
715 `status`: 'success' | 'failure',
716 `hashIdsSucceeded`: charging station unique identifier strings array,
717 `hashIdsFailed`: charging station unique identifier strings array (optional),
718 `responsesFailed`: failed responses payload array (optional)
719 }
720
721 ###### Stop Charging Station
722
723 - Request:
724 `ProcedureName`: 'stopChargingStation'
725 `PDU`: {
726 `hashIds`: charging station unique identifier strings array (optional, default: all charging stations)
727 }
728
729 - Response:
730 `PDU`: {
731 `status`: 'success' | 'failure',
732 `hashIdsSucceeded`: charging station unique identifier strings array,
733 `hashIdsFailed`: charging station unique identifier strings array (optional),
734 `responsesFailed`: failed responses payload array (optional)
735 }
736
737 ###### Open Connection
738
739 - Request:
740 `ProcedureName`: 'openConnection'
741 `PDU`: {
742 `hashIds`: charging station unique identifier strings array (optional, default: all charging stations)
743 }
744
745 - Response:
746 `PDU`: {
747 `status`: 'success' | 'failure',
748 `hashIdsSucceeded`: charging station unique identifier strings array,
749 `hashIdsFailed`: charging station unique identifier strings array (optional),
750 `responsesFailed`: failed responses payload array (optional)
751 }
752
753 ###### Close Connection
754
755 - Request:
756 `ProcedureName`: 'closeConnection'
757 `PDU`: {
758 `hashIds`: charging station unique identifier strings array (optional, default: all charging stations)
759 }
760
761 - Response:
762 `PDU`: {
763 `status`: 'success' | 'failure',
764 `hashIdsSucceeded`: charging station unique identifier strings array,
765 `hashIdsFailed`: charging station unique identifier strings array (optional),
766 `responsesFailed`: failed responses payload array (optional)
767 }
768
769 ###### Start Automatic Transaction Generator
770
771 - Request:
772 `ProcedureName`: 'startAutomaticTransactionGenerator'
773 `PDU`: {
774 `hashIds`: charging station unique identifier strings array (optional, default: all charging stations),
775 `connectorIds`: connector id integer array (optional, default: all connectors)
776 }
777
778 - Response:
779 `PDU`: {
780 `status`: 'success' | 'failure',
781 `hashIdsSucceeded`: charging station unique identifier strings array,
782 `hashIdsFailed`: charging station unique identifier strings array (optional),
783 `responsesFailed`: failed responses payload array (optional)
784 }
785
786 ###### Stop Automatic Transaction Generator
787
788 - Request:
789 `ProcedureName`: 'stopAutomaticTransactionGenerator'
790 `PDU`: {
791 `hashIds`: charging station unique identifier strings array (optional, default: all charging stations),
792 `connectorIds`: connector id integer array (optional, default: all connectors)
793 }
794
795 - Response:
796 `PDU`: {
797 `status`: 'success' | 'failure',
798 `hashIdsSucceeded`: charging station unique identifier strings array,
799 `hashIdsFailed`: charging station unique identifier strings array (optional),
800 `responsesFailed`: failed responses payload array (optional)
801 }
802
803 ###### OCPP commands trigger
804
805 - Request:
806 `ProcedureName`: 'commandName' (the OCPP command name in camel case)
807 `PDU`: {
808 `hashIds`: charging station unique identifier strings array (optional, default: all charging stations),
809 ...`commandPayload`
810 } (the OCPP command payload with some optional fields added to target the simulated charging stations)
811
812 - Response:
813 `PDU`: {
814 `status`: 'success' | 'failure',
815 `hashIdsSucceeded`: charging station unique identifier strings array,
816 `hashIdsFailed`: charging station unique identifier strings array (optional),
817 `responsesFailed`: failed responses payload array (optional)
818 }
819
820 Examples:
821
822 - **Start Transaction**
823
824 - Request:
825 `ProcedureName`: 'startTransaction'
826 `PDU`: {
827 `hashIds`: charging station unique identifier strings array (optional, default: all charging stations),
828 `connectorId`: connector id integer,
829 `idTag`: RFID tag string
830 }
831
832 - Response:
833 `PDU`: {
834 `status`: 'success' | 'failure',
835 `hashIdsSucceeded`: charging station unique identifier strings array,
836 `hashIdsFailed`: charging station unique identifier strings array (optional),
837 `responsesFailed`: failed responses payload array (optional)
838 }
839
840 - **Stop Transaction**
841
842 - Request:
843 `ProcedureName`: 'stopTransaction'
844 `PDU`: {
845 `hashIds`: charging station unique identifier strings array (optional, default: all charging stations),
846 `transactionId`: transaction id integer
847 }
848
849 - Response:
850 `PDU`: {
851 `status`: 'success' | 'failure',
852 `hashIdsSucceeded`: charging station unique identifier strings array,
853 `hashIdsFailed`: charging station unique identifier strings array (optional),
854 `responsesFailed`: failed responses payload array (optional)
855 }
856
857 - **Status Notification**
858
859 - Request:
860 `ProcedureName`: 'statusNotification'
861 `PDU`: {
862 `hashIds`: charging station unique identifier strings array (optional, default: all charging stations),
863 `connectorId`: connector id integer,
864 `errorCode`: connector error code,
865 `status`: connector status
866 }
867
868 - Response:
869 `PDU`: {
870 `status`: 'success' | 'failure',
871 `hashIdsSucceeded`: charging station unique identifier strings array,
872 `hashIdsFailed`: charging station unique identifier strings array (optional),
873 `responsesFailed`: failed responses payload array (optional)
874 }
875
876 - **Heartbeat**
877
878 - Request:
879 `ProcedureName`: 'heartbeat'
880 `PDU`: {
881 `hashIds`: charging station unique identifier strings array (optional, default: all charging stations)
882 }
883
884 - Response:
885 `PDU`: {
886 `status`: 'success' | 'failure',
887 `hashIdsSucceeded`: charging station unique identifier strings array,
888 `hashIdsFailed`: charging station unique identifier strings array (optional),
889 `responsesFailed`: failed responses payload array (optional)
890 }
891
892 ### HTTP Protocol
893
894 To learn how to use the HTTP protocol to pilot the simulator, an [Insomnia](https://insomnia.rest/) HTTP requests collection is available in [src/assets/ui-protocol](./src/assets/ui-protocol) directory.
895
896 ## Support, Feedback, Contributing
897
898 This project is open to feature requests/suggestions, bug reports etc. via [GitHub issues](https://github.com/SAP/e-mobility-charging-stations-simulator/issues). Contribution and feedback are encouraged and always welcome. For more information about how to contribute, the project structure, as well as additional contribution information, see our [Contribution Guidelines](./CONTRIBUTING.md).
899
900 ## Code of Conduct
901
902 We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone. By participating in this project, you agree to abide by its [Code of Conduct](./CODE_OF_CONDUCT.md) at all times.
903
904 ## Licensing
905
906 Copyright 2020-2024 SAP SE or an SAP affiliate company and e-mobility-charging-stations-simulator contributors. Please see our [LICENSE](./LICENSE) for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available [via the REUSE tool](https://api.reuse.software/info/github.com/SAP/e-mobility-charging-stations-simulator).