Enhance documentation
[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
aa8cbc5c 56power | | | integer\|integer[] | 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
c706280d 60numberOfPhases | 0/1/3 | AC:3/DC:0 | integer | charging stations number of phase(s)
7decf1b6
JB
61numberOfConnectors | | | integer\|integer[] | charging stations number of connector(s)
62useConnectorId0 | true/false | true | boolean | use connector id 0 definition from the template
11b056bb 63randomConnectors | true/false | false | boolean | randomize runtime connector id affectation from the connector id definition in template
7decf1b6
JB
64resetTime | | 60 | integer | seconds to wait before the charging stations come back at reset
65connectionTimeout | | 30 | integer | connection timeout to the OCPP-J server
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
7decf1b6 69enableStatistics | true/false | true | boolean | enable charging stations statistics
0b13b85d 70voltageOut | | AC:230/DC:400 | integer | charging stations voltage out
c94a349a
JB
71Configuration | | | ChargingStationConfiguration | charging stations OCPP configuration parameters
72AutomaticTransactionGenerator | | | AutomaticTransactionGenerator | charging stations ATG configuration
73Connectors | | | Connectors | charging stations connectors configuration
74
75#### Configuration section
76
77```json
0302da79 78 "Configuration": {
c94a349a
JB
79 "configurationKey": [
80 ...
81 {
82 "key": "StandardKey",
83 "readonly": false,
84 "value": "StandardValue",
85 "visible": true,
86 "reboot": false
87 },
88 ...
89 {
90 "key": "VendorKey",
91 "readonly": false,
92 "value": "VendorValue",
93 "visible": false,
94 "reboot": true
95 },
96 ...
97 ]
98 }
99```
100
101#### AutomaticTransactionGenerator section
102
103```json
0302da79 104 "AutomaticTransactionGenerator": {
c94a349a
JB
105 "enable": false,
106 "minDuration": 60,
107 "maxDuration": 80,
108 "minDelayBetweenTwoTransactions": 15,
109 "maxDelayBetweenTwoTransactions": 30,
110 "probabilityOfStart": 1,
111 "stopAfterHours": 0.3,
112 "stopOnConnectionFailure": true,
113 "requireAuthorize": false
114 }
115```
116#### Connectors section
117
118```json
0302da79 119 "Connectors": {
c94a349a
JB
120 "0": {},
121 "1": {
122 "bootStatus": "Available",
123 "MeterValues": [
124 ...
125 {
126 "unit": "A",
127 "measurand": "Current.Import"
128 },
129 ...
130 {
131 "unit": "Wh"
132 },
133 ...
134 ]
135 }
136 },
137```
138
6f0ec20e
JB
139## Start
140
141To start the program, run: `npm start`.
142
143## Docker
144
145In the [docker](./docker) folder:
146
147```bash
148make
149```
150
151Or without the optional git submodules:
152
153```bash
154make SUBMODULES_INIT=false
155```
156
157## OCPP-J commands supported
c94a349a
JB
158
159### Version 1.6
160
6f0ec20e
JB
161### Core Profile
162
163- :heavy_check_mark: Authorize
164- :heavy_check_mark: BootNotification
165- :heavy_check_mark: ChangeAvailability
166- :heavy_check_mark: ChangeConfiguration
167- :heavy_check_mark: ClearCache
168- :x: DataTransfer
169- :heavy_check_mark: GetConfiguration
170- :heavy_check_mark: Heartbeat
171- :heavy_check_mark: MeterValues
172- :heavy_check_mark: RemoteStartTransaction
173- :heavy_check_mark: RemoteStopTransaction
174- :heavy_check_mark: Reset
175- :heavy_check_mark: StartTransaction
176- :heavy_check_mark: StatusNotification
177- :heavy_check_mark: StopTransaction
178- :heavy_check_mark: UnlockConnector
179
180### Firmware Management Profile
181
182- :x: GetDiagnostics
183- :x: DiagnosticsStatusNotification
184- :x: FirmwareStatusNotification
185- :x: UpdateFirmware
186
187### Local Auth List Management Profile
188
189- :x: GetLocalListVersion
190- :x: SendLocalList
191
192### Reservation Profile
193
194- :x: CancelReservation
195- :x: ReserveNow
196
197### Smart Charging Profile
198
199- :heavy_check_mark: ClearChargingProfile
200- :heavy_check_mark: GetCompositeSchedule
201- :heavy_check_mark: SetChargingProfile
202
203### Remote Trigger Profile
204
205- :x: TriggerMessage
7dde0b73
JB
206
207## License
208
9f5030ff 209This 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
210
211Please 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.