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