Release 1.0.43
[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
326ab6fd
JB
25workerProcess | workerSet/staticPool/dynamicPool | workerSet | string | worker threads process type
26workerStartDelay | | 500 | integer | milliseconds to wait at charging station worker threads startup
2c28fc83
JB
27workerPoolMinSize | | 4 | integer | worker threads pool minimum number of threads
28workerPoolMaxSize | | 16 | integer | worker threads pool maximum number of threads
4be5abe3 29workerPoolStrategy | ROUND_ROBIN/LESS_RECENTLY_USED/... | [poolifier](https://github.com/poolifier/poolifier) default: ROUND_ROBBIN | string | worker threads pool [poolifier](https://github.com/poolifier/poolifier) worker choice strategy
2c28fc83 30chargingStationsPerWorker | | 1 | integer | number of charging stations per worker threads for the `workerSet` process type
72f041bd 31logStatisticsInterval | | 60 | integer | seconds between charging stations statistics output in the logs
2c28fc83
JB
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
72f041bd
JB
39performanceStorage | | { "enabled": false, "type": "jsonfile", "file:///performanceMeasurements.json" } | { enabled: string; type: string; URI: string; } | performance storage configuration section
40stationTemplateURLs | | {}[] | { file: string; numberOfStations: number; }[] | array of charging station templates URIs configuration section (template file name and number of stations)
2c28fc83
JB
41
42### Charging station template
2e6e52f3 43
2c28fc83
JB
44Key | Value(s) | Default Value | Value type | Description
45--- | -------| --------------| ---------- | ------------
a02da55f 46supervisionURL | | '' | string | connection URI to OCPP-J server
15042c5f
JB
47supervisionUser | | '' | string | basic HTTP authentication user to OCPP-J server
48supervisionPassword | | '' | string | basic HTTP authentication password to OCPP-J server
a02da55f
JB
49ocppVersion | 1.6 | 1.6 | string | OCPP version
50ocppProtocol | json | json | string | OCPP protocol
2c28fc83 51authorizationFile | | '' | string | RFID tags list file relative to src/assets path
a02da55f
JB
52baseName | | '' | string | base name to build charging stations name
53nameSuffix | | '' | string | name suffix to build charging stations name
54fixedName | true/false | false | boolean | use the baseName as the charging stations unique name
55chargePointModel | | '' | string | charging stations model
56chargePointVendor | | '' | string | charging stations vendor
57chargeBoxSerialNumberPrefix | | '' | string | charging stations serial number prefix
58firmwareVersion | | '' | string | charging stations firmware version
4a1857a2 59power | | | float\|float[] | charging stations maximum power value(s)
c6f76013 60powerSharedByConnectors | true/false | false | boolean | charging stations power shared by its connectors
ef16e252 61powerUnit | W/kW | W | string | charging stations power unit
7decf1b6 62currentOutType | AC/DC | AC | string | charging stations current out type
6ed92bc1 63voltageOut | | AC:230/DC:400 | integer | charging stations voltage out
c706280d 64numberOfPhases | 0/1/3 | AC:3/DC:0 | integer | charging stations number of phase(s)
7decf1b6
JB
65numberOfConnectors | | | integer\|integer[] | charging stations number of connector(s)
66useConnectorId0 | true/false | true | boolean | use connector id 0 definition from the template
11b056bb 67randomConnectors | true/false | false | boolean | randomize runtime connector id affectation from the connector id definition in template
7decf1b6 68resetTime | | 60 | integer | seconds to wait before the charging stations come back at reset
47e22477 69autoRegister | true/false | false | boolean | set the charging station as registered at boot notification for testing purpose
7decf1b6
JB
70autoReconnectMaxRetries | | -1 (unlimited) | integer | connection retries to the OCPP-J server
71reconnectExponentialDelay | true/false | false | boolean | connection delay retry to the OCPP-J server
0b13b85d 72registrationMaxRetries | | -1 (unlimited) | integer | charging stations boot notification retries
6ed92bc1 73enableStatistics | true/false | true | boolean | enable charging stations statistics
a7fc8211 74mayAuthorizeAtRemoteStart | true/false | true | boolean | always send authorize at remote start transaction when AuthorizeRemoteTxRequests is enabled
6ed92bc1
JB
75beginEndMeterValues | true/false | false | boolean | enable Transaction.{Begin,End} MeterValues
76outOfOrderEndMeterValues | true/false | false | boolean | send Transaction.End MeterValues out of order
a7fc8211 77meteringPerTransaction | true/false | true | boolean | enable metering history on a per transaction basis
fd0c36fa 78transactionDataMeterValues | true/false | false | boolean | enable transaction data MeterValues at stop transaction
9ccca265 79mainVoltageMeterValues | true/false | true | boolean | include charging station main voltage MeterValues on three phased charging stations
6b10669b 80phaseLineToLineVoltageMeterValues | true/false | true | boolean | include charging station line to line voltage MeterValues on three phased charging stations
72f041bd
JB
81Configuration | | | ChargingStationConfiguration | charging stations OCPP parameters configuration section
82AutomaticTransactionGenerator | | | AutomaticTransactionGenerator | charging stations ATG configuration section
83Connectors | | | Connectors | charging stations connectors configuration section
c94a349a
JB
84
85#### Configuration section
86
87```json
0302da79 88 "Configuration": {
c94a349a
JB
89 "configurationKey": [
90 ...
91 {
92 "key": "StandardKey",
93 "readonly": false,
94 "value": "StandardValue",
95 "visible": true,
96 "reboot": false
97 },
98 ...
99 {
100 "key": "VendorKey",
101 "readonly": false,
102 "value": "VendorValue",
103 "visible": false,
104 "reboot": true
105 },
106 ...
107 ]
108 }
109```
110
111#### AutomaticTransactionGenerator section
112
113```json
0302da79 114 "AutomaticTransactionGenerator": {
c94a349a
JB
115 "enable": false,
116 "minDuration": 60,
117 "maxDuration": 80,
118 "minDelayBetweenTwoTransactions": 15,
119 "maxDelayBetweenTwoTransactions": 30,
120 "probabilityOfStart": 1,
121 "stopAfterHours": 0.3,
122 "stopOnConnectionFailure": true,
e644918b 123 "requireAuthorize": true
c94a349a
JB
124 }
125```
126#### Connectors section
127
128```json
0302da79 129 "Connectors": {
c94a349a
JB
130 "0": {},
131 "1": {
132 "bootStatus": "Available",
133 "MeterValues": [
9bd87386
JB
134 ...
135 {
136 "unit": "W",
137 "measurand": "Power.Active.Import",
138 "phase": "L1-N",
139 "value": "5000",
140 "fluctuationPercent": "10"
141 },
c94a349a
JB
142 ...
143 {
144 "unit": "A",
145 "measurand": "Current.Import"
146 },
147 ...
148 {
149 "unit": "Wh"
150 },
151 ...
152 ]
153 }
154 },
155```
156
6f0ec20e
JB
157## Start
158
159To start the program, run: `npm start`.
160
161## Docker
162
163In the [docker](./docker) folder:
164
165```bash
166make
167```
168
169Or without the optional git submodules:
170
171```bash
172make SUBMODULES_INIT=false
173```
174
175## OCPP-J commands supported
c94a349a
JB
176
177### Version 1.6
178
c56d42f1 179#### Core Profile
6f0ec20e 180
778f7924
JB
181- :white_check_mark: Authorize
182- :white_check_mark: BootNotification
183- :white_check_mark: ChangeAvailability
184- :white_check_mark: ChangeConfiguration
185- :white_check_mark: ClearCache
9e1b12e4 186- :x: DataTransfer
778f7924
JB
187- :white_check_mark: GetConfiguration
188- :white_check_mark: Heartbeat
189- :white_check_mark: MeterValues
190- :white_check_mark: RemoteStartTransaction
191- :white_check_mark: RemoteStopTransaction
192- :white_check_mark: Reset
193- :white_check_mark: StartTransaction
194- :white_check_mark: StatusNotification
195- :white_check_mark: StopTransaction
196- :white_check_mark: UnlockConnector
6f0ec20e 197
c56d42f1 198#### Firmware Management Profile
6f0ec20e 199
9e1b12e4
JB
200- :x: GetDiagnostics
201- :x: DiagnosticsStatusNotification
202- :x: FirmwareStatusNotification
203- :x: UpdateFirmware
6f0ec20e 204
c56d42f1 205#### Local Auth List Management Profile
6f0ec20e 206
9e1b12e4
JB
207- :x: GetLocalListVersion
208- :x: SendLocalList
6f0ec20e 209
c56d42f1 210#### Reservation Profile
6f0ec20e 211
9e1b12e4
JB
212- :x: CancelReservation
213- :x: ReserveNow
6f0ec20e 214
c56d42f1 215#### Smart Charging Profile
6f0ec20e 216
778f7924
JB
217- :white_check_mark: ClearChargingProfile
218- :white_check_mark: GetCompositeSchedule
219- :white_check_mark: SetChargingProfile
6f0ec20e 220
c56d42f1 221#### Remote Trigger Profile
6f0ec20e 222
9e1b12e4 223- :x: TriggerMessage
7dde0b73 224
7e1dc878
JB
225## OCPP-J standard parameters supported
226
adf16e64 227All 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
228
229### Version 1.6
230
c56d42f1 231#### Core Profile
7e1dc878
JB
232
233- :white_check_mark: AuthorizeRemoteTxRequests (type: boolean) (units: -)
234- :x: ClockAlignedDataInterval (type: integer) (units: seconds)
291cb255 235- :white_check_mark: ConnectionTimeOut (type: integer) (units: seconds)
7e1dc878
JB
236- :x: GetConfigurationMaxKeys (type: integer) (units: -)
237- :white_check_mark: HeartbeatInterval (type: integer) (units: seconds)
238- :x: LocalAuthorizeOffline (type: boolean) (units: -)
239- :x: LocalPreAuthorize (type: boolean) (units: -)
240- :x: MeterValuesAlignedData (type: CSL) (units: -)
241- :white_check_mark: MeterValuesSampledData (type: CSL) (units: -)
242- :white_check_mark: MeterValueSampleInterval (type: integer) (units: seconds)
243- :white_check_mark: NumberOfConnectors (type: integer) (units: -)
244- :x: ResetRetries (type: integer) (units: times)
245- :white_check_mark: ConnectorPhaseRotation (type: CSL) (units: -)
246- :x: StopTransactionOnEVSideDisconnect (type: boolean) (units: -)
247- :x: StopTransactionOnInvalidId (type: boolean) (units: -)
248- :x: StopTxnAlignedData (type: CSL) (units: -)
249- :x: StopTxnSampledData (type: CSL) (units: -)
36f6a92e 250- :white_check_mark: SupportedFeatureProfiles (type: CSL) (units: -)
7e1dc878
JB
251- :x: TransactionMessageAttempts (type: integer) (units: times)
252- :x: TransactionMessageRetryInterval (type: integer) (units: seconds)
253- :x: UnlockConnectorOnEVSideDisconnect (type: boolean) (units: -)
36f6a92e 254- :white_check_mark: WebSocketPingInterval (type: integer) (units: seconds)
7e1dc878 255
c56d42f1 256#### Firmware Management Profile
7e1dc878
JB
257
258- *none*
259
c56d42f1 260#### Local Auth List Management Profile
7e1dc878 261
36f6a92e 262- :white_check_mark: LocalAuthListEnabled (type: boolean) (units: -)
7e1dc878
JB
263- :x: LocalAuthListMaxLength (type: integer) (units: -)
264- :x: SendLocalListMaxLength (type: integer) (units: -)
265
c56d42f1 266#### Reservation Profile
7e1dc878
JB
267
268- *none*
269
c56d42f1 270#### Smart Charging Profile
7e1dc878
JB
271
272- :x: ChargeProfileMaxStackLevel (type: integer) (units: -)
273- :x: ChargingScheduleAllowedChargingRateUnit (type: CSL) (units: -)
274- :x: ChargingScheduleMaxPeriods (type: integer) (units: -)
275- :x: MaxChargingProfilesInstalled (type: integer) (units: -)
276
c56d42f1 277#### Remote Trigger Profile
7e1dc878
JB
278
279- *none*
280
7dde0b73
JB
281## License
282
25c7bbb9 283This 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 or the code source file header.
7dde0b73
JB
284
285Please 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.