Use ConnectionTineOut OCPP parameter as WS timeout
[e-mobility-charging-stations-simulator.git] / README.md
CommitLineData
7dde0b73
JB
1# ev-simulator
2
3## Summary
4
1eabf6a9 5Simple [node.js](https://nodejs.org/) program to simulate a set of charging stations based on the OCPP-J 1.6 protocol.
7dde0b73 6
2c28fc83
JB
7## Configuration syntax
8
9All configuration files are in the JSON standard format.
10
11The program's global configuration parameters must be within the src/assets/config.json file. A configuration template file is available at [src/assets/config-template.json](src/assets/config-template.json).
12
13All charging station templates are in the directory [src/assets/station-templates](src/assets/station-templates).
14
15A list of RFID tags must be defined for the automatic transaction generator with the default location and name src/assets/authorization-tags.json. A template file is available at [src/assets/authorization-tags-template.json](src/assets/authorization-tags-template.json).
16
17### Global configuration
18
b1d6e944 19**src/assets/config.json**:
2c28fc83
JB
20
21Key | Value(s) | Default Value | Value type | Description
22--- | -------| --------------| ---------- | ------------
23supervisionURLs | | [] | string[] | array of connection URIs to OCPP-J servers
24distributeStationsToTenantsEqually | true/false | true | boolean | distribute charging stations uniformly to the OCPP-J servers
25statisticsDisplayInterval | | 60 | integer | seconds between charging stations statistics output in the logs
326ab6fd
JB
26workerProcess | workerSet/staticPool/dynamicPool | workerSet | string | worker threads process type
27workerStartDelay | | 500 | integer | milliseconds to wait at charging station worker threads startup
2c28fc83
JB
28workerPoolMinSize | | 4 | integer | worker threads pool minimum number of threads
29workerPoolMaxSize | | 16 | integer | worker threads pool maximum number of threads
9efbac5b 30workerPoolStrategy | ROUND_ROBIN/LESS_RECENTLY_USED/... | [poolifier](https://github.com/pioardi/poolifier) default: ROUND_ROBBIN | string | worker threads pool [poolifier](https://github.com/pioardi/poolifier) worker choice strategy
2c28fc83
JB
31chargingStationsPerWorker | | 1 | integer | number of charging stations per worker threads for the `workerSet` process type
32logConsole | true/false | false | boolean | output logs on the console
33logFormat | | simple | string | winston log format
34logRotate | true/false | true | boolean | enable daily log files rotation
0302da79 35logMaxFiles | | 7 | integer | maximum number of log files to keep
2c28fc83
JB
36logLevel | emerg/alert/crit/error/warning/notice/info/debug | info | string | winston logging level
37logFile | | combined.log | string | log file relative path
38logErrorFile | | error.log | string | error log file relative path
a02da55f 39stationTemplateURLs | | {}[] | { file: string; numberOfStations: number; }[] | array of charging template file URIs
2c28fc83
JB
40
41### Charging station template
2e6e52f3 42
2c28fc83
JB
43Key | Value(s) | Default Value | Value type | Description
44--- | -------| --------------| ---------- | ------------
a02da55f
JB
45supervisionURL | | '' | string | connection URI to OCPP-J server
46ocppVersion | 1.6 | 1.6 | string | OCPP version
47ocppProtocol | json | json | string | OCPP protocol
2c28fc83 48authorizationFile | | '' | string | RFID tags list file relative to src/assets path
a02da55f
JB
49baseName | | '' | string | base name to build charging stations name
50nameSuffix | | '' | string | name suffix to build charging stations name
51fixedName | true/false | false | boolean | use the baseName as the charging stations unique name
52chargePointModel | | '' | string | charging stations model
53chargePointVendor | | '' | string | charging stations vendor
54chargeBoxSerialNumberPrefix | | '' | string | charging stations serial number prefix
55firmwareVersion | | '' | string | charging stations firmware version
4a1857a2 56power | | | float\|float[] | charging stations maximum power value(s)
c6f76013 57powerSharedByConnectors | true/false | false | boolean | charging stations power shared by its connectors
ef16e252 58powerUnit | W/kW | W | string | charging stations power unit
7decf1b6 59currentOutType | AC/DC | AC | string | charging stations current out type
6ed92bc1 60voltageOut | | AC:230/DC:400 | integer | charging stations voltage out
c706280d 61numberOfPhases | 0/1/3 | AC:3/DC:0 | integer | charging stations number of phase(s)
7decf1b6
JB
62numberOfConnectors | | | integer\|integer[] | charging stations number of connector(s)
63useConnectorId0 | true/false | true | boolean | use connector id 0 definition from the template
11b056bb 64randomConnectors | true/false | false | boolean | randomize runtime connector id affectation from the connector id definition in template
7decf1b6 65resetTime | | 60 | integer | seconds to wait before the charging stations come back at reset
7decf1b6
JB
66autoReconnectMaxRetries | | -1 (unlimited) | integer | connection retries to the OCPP-J server
67reconnectExponentialDelay | true/false | false | boolean | connection delay retry to the OCPP-J server
0b13b85d 68registrationMaxRetries | | -1 (unlimited) | integer | charging stations boot notification retries
6ed92bc1
JB
69enableStatistics | true/false | true | boolean | enable charging stations statistics
70beginEndMeterValues | true/false | false | boolean | enable Transaction.{Begin,End} MeterValues
71outOfOrderEndMeterValues | true/false | false | boolean | send Transaction.End MeterValues out of order
72meteringPerTransaction | true/false | true | boolean | disable metering on a per transaction basis
fd0c36fa 73transactionDataMeterValues | true/false | false | boolean | enable transaction data MeterValues at stop transaction
c94a349a
JB
74Configuration | | | ChargingStationConfiguration | charging stations OCPP configuration parameters
75AutomaticTransactionGenerator | | | AutomaticTransactionGenerator | charging stations ATG configuration
76Connectors | | | Connectors | charging stations connectors configuration
77
78#### Configuration section
79
80```json
0302da79 81 "Configuration": {
c94a349a
JB
82 "configurationKey": [
83 ...
84 {
85 "key": "StandardKey",
86 "readonly": false,
87 "value": "StandardValue",
88 "visible": true,
89 "reboot": false
90 },
91 ...
92 {
93 "key": "VendorKey",
94 "readonly": false,
95 "value": "VendorValue",
96 "visible": false,
97 "reboot": true
98 },
99 ...
100 ]
101 }
102```
103
104#### AutomaticTransactionGenerator section
105
106```json
0302da79 107 "AutomaticTransactionGenerator": {
c94a349a
JB
108 "enable": false,
109 "minDuration": 60,
110 "maxDuration": 80,
111 "minDelayBetweenTwoTransactions": 15,
112 "maxDelayBetweenTwoTransactions": 30,
113 "probabilityOfStart": 1,
114 "stopAfterHours": 0.3,
115 "stopOnConnectionFailure": true,
e644918b 116 "requireAuthorize": true
c94a349a
JB
117 }
118```
119#### Connectors section
120
121```json
0302da79 122 "Connectors": {
c94a349a
JB
123 "0": {},
124 "1": {
125 "bootStatus": "Available",
126 "MeterValues": [
127 ...
128 {
129 "unit": "A",
130 "measurand": "Current.Import"
131 },
132 ...
133 {
134 "unit": "Wh"
135 },
136 ...
137 ]
138 }
139 },
140```
141
6f0ec20e
JB
142## Start
143
144To start the program, run: `npm start`.
145
146## Docker
147
148In the [docker](./docker) folder:
149
150```bash
151make
152```
153
154Or without the optional git submodules:
155
156```bash
157make SUBMODULES_INIT=false
158```
159
160## OCPP-J commands supported
c94a349a
JB
161
162### Version 1.6
163
c56d42f1 164#### Core Profile
6f0ec20e 165
778f7924
JB
166- :white_check_mark: Authorize
167- :white_check_mark: BootNotification
168- :white_check_mark: ChangeAvailability
169- :white_check_mark: ChangeConfiguration
170- :white_check_mark: ClearCache
9e1b12e4 171- :x: DataTransfer
778f7924
JB
172- :white_check_mark: GetConfiguration
173- :white_check_mark: Heartbeat
174- :white_check_mark: MeterValues
175- :white_check_mark: RemoteStartTransaction
176- :white_check_mark: RemoteStopTransaction
177- :white_check_mark: Reset
178- :white_check_mark: StartTransaction
179- :white_check_mark: StatusNotification
180- :white_check_mark: StopTransaction
181- :white_check_mark: UnlockConnector
6f0ec20e 182
c56d42f1 183#### Firmware Management Profile
6f0ec20e 184
9e1b12e4
JB
185- :x: GetDiagnostics
186- :x: DiagnosticsStatusNotification
187- :x: FirmwareStatusNotification
188- :x: UpdateFirmware
6f0ec20e 189
c56d42f1 190#### Local Auth List Management Profile
6f0ec20e 191
9e1b12e4
JB
192- :x: GetLocalListVersion
193- :x: SendLocalList
6f0ec20e 194
c56d42f1 195#### Reservation Profile
6f0ec20e 196
9e1b12e4
JB
197- :x: CancelReservation
198- :x: ReserveNow
6f0ec20e 199
c56d42f1 200#### Smart Charging Profile
6f0ec20e 201
778f7924
JB
202- :white_check_mark: ClearChargingProfile
203- :white_check_mark: GetCompositeSchedule
204- :white_check_mark: SetChargingProfile
6f0ec20e 205
c56d42f1 206#### Remote Trigger Profile
6f0ec20e 207
9e1b12e4 208- :x: TriggerMessage
7dde0b73 209
7e1dc878
JB
210## OCPP-J standard parameters supported
211
adf16e64 212All kind of OCPP parameters are supported in a charging station template. The list here mention the standard ones also handled automatically in the simulator.
7e1dc878
JB
213
214### Version 1.6
215
c56d42f1 216#### Core Profile
7e1dc878
JB
217
218- :white_check_mark: AuthorizeRemoteTxRequests (type: boolean) (units: -)
219- :x: ClockAlignedDataInterval (type: integer) (units: seconds)
291cb255 220- :white_check_mark: ConnectionTimeOut (type: integer) (units: seconds)
7e1dc878
JB
221- :x: GetConfigurationMaxKeys (type: integer) (units: -)
222- :white_check_mark: HeartbeatInterval (type: integer) (units: seconds)
223- :x: LocalAuthorizeOffline (type: boolean) (units: -)
224- :x: LocalPreAuthorize (type: boolean) (units: -)
225- :x: MeterValuesAlignedData (type: CSL) (units: -)
226- :white_check_mark: MeterValuesSampledData (type: CSL) (units: -)
227- :white_check_mark: MeterValueSampleInterval (type: integer) (units: seconds)
228- :white_check_mark: NumberOfConnectors (type: integer) (units: -)
229- :x: ResetRetries (type: integer) (units: times)
230- :white_check_mark: ConnectorPhaseRotation (type: CSL) (units: -)
231- :x: StopTransactionOnEVSideDisconnect (type: boolean) (units: -)
232- :x: StopTransactionOnInvalidId (type: boolean) (units: -)
233- :x: StopTxnAlignedData (type: CSL) (units: -)
234- :x: StopTxnSampledData (type: CSL) (units: -)
36f6a92e 235- :white_check_mark: SupportedFeatureProfiles (type: CSL) (units: -)
7e1dc878
JB
236- :x: TransactionMessageAttempts (type: integer) (units: times)
237- :x: TransactionMessageRetryInterval (type: integer) (units: seconds)
238- :x: UnlockConnectorOnEVSideDisconnect (type: boolean) (units: -)
36f6a92e 239- :white_check_mark: WebSocketPingInterval (type: integer) (units: seconds)
7e1dc878 240
c56d42f1 241#### Firmware Management Profile
7e1dc878
JB
242
243- *none*
244
c56d42f1 245#### Local Auth List Management Profile
7e1dc878 246
36f6a92e 247- :white_check_mark: LocalAuthListEnabled (type: boolean) (units: -)
7e1dc878
JB
248- :x: LocalAuthListMaxLength (type: integer) (units: -)
249- :x: SendLocalListMaxLength (type: integer) (units: -)
250
c56d42f1 251#### Reservation Profile
7e1dc878
JB
252
253- *none*
254
c56d42f1 255#### Smart Charging Profile
7e1dc878
JB
256
257- :x: ChargeProfileMaxStackLevel (type: integer) (units: -)
258- :x: ChargingScheduleAllowedChargingRateUnit (type: CSL) (units: -)
259- :x: ChargingScheduleMaxPeriods (type: integer) (units: -)
260- :x: MaxChargingProfilesInstalled (type: integer) (units: -)
261
c56d42f1 262#### Remote Trigger Profile
7e1dc878
JB
263
264- *none*
265
7dde0b73
JB
266## License
267
9f5030ff 268This 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.
7dde0b73
JB
269
270Please note that Docker images can contain other software which may be licensed under different licenses. This LICENSE and NOTICE files are also included in the Docker image. For any usage of built Docker images please make sure to check the licenses of the artifacts contained in the images.