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