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