Commit | Line | Data |
---|---|---|
66a7748d | 1 | import type { JsonObject } from './JsonType' |
ce7a4fc3 | 2 | |
9dc8b66f JB |
3 | export enum IdTagDistribution { |
4 | RANDOM = 'random', | |
5 | ROUND_ROBIN = 'round-robin', | |
6 | CONNECTOR_AFFINITY = 'connector-affinity' | |
7 | } | |
8 | ||
f4b3f35d | 9 | export interface AutomaticTransactionGeneratorConfiguration extends JsonObject { |
9dc8b66f JB |
10 | enable: boolean |
11 | minDuration: number | |
12 | maxDuration: number | |
13 | minDelayBetweenTwoTransactions: number | |
14 | maxDelayBetweenTwoTransactions: number | |
15 | probabilityOfStart: number | |
16 | stopAfterHours: number | |
17 | stopAbsoluteDuration: boolean | |
18 | requireAuthorize?: boolean | |
19 | idTagDistribution?: IdTagDistribution | |
20 | } | |
21 | ||
f4b3f35d | 22 | export interface ChargingStationAutomaticTransactionGeneratorConfiguration extends JsonObject { |
9dc8b66f JB |
23 | automaticTransactionGenerator?: AutomaticTransactionGeneratorConfiguration |
24 | automaticTransactionGeneratorStatuses?: Status[] | |
25 | } | |
26 | ||
f4b3f35d | 27 | export interface ChargingStationData extends JsonObject { |
66a7748d JB |
28 | started: boolean |
29 | stationInfo: ChargingStationInfo | |
30 | connectors: ConnectorStatus[] | |
31 | evses: EvseStatus[] | |
ba70f0e6 | 32 | ocppConfiguration: ChargingStationOcppConfiguration |
1d41bc6b | 33 | supervisionUrl: string |
36999e77 JB |
34 | wsState?: |
35 | | typeof WebSocket.CONNECTING | |
36 | | typeof WebSocket.OPEN | |
37 | | typeof WebSocket.CLOSING | |
66a7748d JB |
38 | | typeof WebSocket.CLOSED |
39 | bootNotificationResponse?: BootNotificationResponse | |
9dc8b66f | 40 | automaticTransactionGenerator?: ChargingStationAutomaticTransactionGeneratorConfiguration |
66a7748d | 41 | } |
32de5a57 | 42 | |
2a526157 JB |
43 | export enum OCPP16FirmwareStatus { |
44 | Downloaded = 'Downloaded', | |
45 | DownloadFailed = 'DownloadFailed', | |
46 | Downloading = 'Downloading', | |
47 | Idle = 'Idle', | |
48 | InstallationFailed = 'InstallationFailed', | |
49 | Installing = 'Installing', | |
a974c8e4 | 50 | Installed = 'Installed' |
2a526157 JB |
51 | } |
52 | ||
f4b3f35d | 53 | export interface FirmwareUpgrade extends JsonObject { |
b0eea378 JB |
54 | versionUpgrade?: { |
55 | patternGroup?: number | |
56 | step?: number | |
57 | } | |
58 | reset?: boolean | |
59 | failureStatus?: FirmwareStatus | |
60 | } | |
61 | ||
2a526157 | 62 | export const FirmwareStatus = { |
a974c8e4 | 63 | ...OCPP16FirmwareStatus |
66a7748d JB |
64 | } as const |
65 | export type FirmwareStatus = OCPP16FirmwareStatus | |
2a526157 | 66 | |
093ca832 JB |
67 | export interface ChargingStationOptions extends JsonObject { |
68 | supervisionUrls?: string | string[] | |
69 | persistentConfiguration?: boolean | |
70 | autoStart?: boolean | |
71 | autoRegister?: boolean | |
72 | enableStatistics?: boolean | |
73 | ocppStrictCompliance?: boolean | |
74 | stopTransactionsOnStopped?: boolean | |
75 | } | |
76 | ||
f4b3f35d | 77 | export interface ChargingStationInfo extends JsonObject { |
66a7748d | 78 | hashId: string |
afbb8202 | 79 | templateIndex: number |
ba70f0e6 | 80 | templateName: string |
c317ae3e | 81 | chargingStationId: string |
66a7748d JB |
82 | chargeBoxSerialNumber?: string |
83 | chargePointSerialNumber?: string | |
84 | meterSerialNumber?: string | |
85 | maximumPower?: number // Always in Watt | |
86 | maximumAmperage?: number // Always in Ampere | |
b0eea378 JB |
87 | firmwareStatus?: FirmwareStatus |
88 | templateHash?: string | |
66a7748d JB |
89 | supervisionUrls?: string | string[] |
90 | supervisionUrlOcppConfiguration?: boolean | |
91 | supervisionUrlOcppKey?: string | |
92 | supervisionUser?: string | |
93 | supervisionPassword?: string | |
b0eea378 | 94 | autoStart?: boolean |
66a7748d JB |
95 | ocppVersion?: OCPPVersion |
96 | ocppProtocol?: OCPPProtocol | |
97 | ocppStrictCompliance?: boolean | |
98 | ocppPersistentConfiguration?: boolean | |
99 | stationInfoPersistentConfiguration?: boolean | |
b0eea378 | 100 | automaticTransactionGeneratorPersistentConfiguration?: boolean |
66a7748d | 101 | idTagsFile?: string |
b0eea378 | 102 | baseName: string |
66a7748d JB |
103 | nameSuffix?: string |
104 | fixedName?: boolean | |
b0eea378 JB |
105 | chargePointModel: string |
106 | chargePointVendor: string | |
107 | firmwareVersionPattern?: string | |
108 | firmwareVersion?: string | |
109 | firmwareUpgrade?: FirmwareUpgrade | |
66a7748d JB |
110 | iccid?: string |
111 | imsi?: string | |
112 | meterType?: string | |
113 | powerSharedByConnectors?: boolean | |
114 | currentOutType?: CurrentType | |
115 | voltageOut?: Voltage | |
116 | numberOfPhases?: number | |
117 | useConnectorId0?: boolean | |
118 | randomConnectors?: boolean | |
119 | resetTime?: number | |
120 | autoRegister?: boolean | |
121 | autoReconnectMaxRetries?: number | |
122 | reconnectExponentialDelay?: boolean | |
123 | registrationMaxRetries?: number | |
124 | enableStatistics?: boolean | |
125 | remoteAuthorization?: boolean | |
126 | amperageLimitationOcppKey?: string | |
127 | amperageLimitationUnit?: AmpereUnits | |
128 | beginEndMeterValues?: boolean | |
129 | outOfOrderEndMeterValues?: boolean | |
130 | meteringPerTransaction?: boolean | |
131 | transactionDataMeterValues?: boolean | |
b0eea378 | 132 | stopTransactionsOnStopped?: boolean |
66a7748d JB |
133 | mainVoltageMeterValues?: boolean |
134 | phaseLineToLineVoltageMeterValues?: boolean | |
135 | customValueLimitationMeterValues?: boolean | |
136 | commandsSupport?: CommandsSupport | |
137 | messageTriggerSupport?: Record<MessageTrigger, boolean> | |
138 | } | |
32de5a57 | 139 | |
f4b3f35d | 140 | export interface ChargingStationOcppConfiguration extends JsonObject { |
ba70f0e6 JB |
141 | configurationKey?: ConfigurationKey[] |
142 | } | |
143 | ||
f4b3f35d | 144 | export interface ConfigurationKey extends OCPPConfigurationKey { |
ba70f0e6 JB |
145 | visible?: boolean |
146 | reboot?: boolean | |
147 | } | |
148 | ||
f4b3f35d | 149 | export interface OCPPConfigurationKey extends JsonObject { |
ba70f0e6 JB |
150 | key: string |
151 | readonly: boolean | |
152 | value?: string | |
f4b3f35d | 153 | } |
ba70f0e6 | 154 | |
32de5a57 LM |
155 | export enum OCPP16IncomingRequestCommand { |
156 | RESET = 'Reset', | |
157 | CLEAR_CACHE = 'ClearCache', | |
158 | CHANGE_AVAILABILITY = 'ChangeAvailability', | |
159 | UNLOCK_CONNECTOR = 'UnlockConnector', | |
160 | GET_CONFIGURATION = 'GetConfiguration', | |
161 | CHANGE_CONFIGURATION = 'ChangeConfiguration', | |
162 | SET_CHARGING_PROFILE = 'SetChargingProfile', | |
163 | CLEAR_CHARGING_PROFILE = 'ClearChargingProfile', | |
164 | REMOTE_START_TRANSACTION = 'RemoteStartTransaction', | |
165 | REMOTE_STOP_TRANSACTION = 'RemoteStopTransaction', | |
166 | GET_DIAGNOSTICS = 'GetDiagnostics', | |
a974c8e4 | 167 | TRIGGER_MESSAGE = 'TriggerMessage' |
32de5a57 LM |
168 | } |
169 | ||
32de5a57 | 170 | export const IncomingRequestCommand = { |
a974c8e4 | 171 | ...OCPP16IncomingRequestCommand |
66a7748d JB |
172 | } as const |
173 | export type IncomingRequestCommand = OCPP16IncomingRequestCommand | |
32de5a57 LM |
174 | |
175 | export enum OCPP16RequestCommand { | |
176 | BOOT_NOTIFICATION = 'BootNotification', | |
177 | HEARTBEAT = 'Heartbeat', | |
178 | STATUS_NOTIFICATION = 'StatusNotification', | |
179 | AUTHORIZE = 'Authorize', | |
180 | START_TRANSACTION = 'StartTransaction', | |
181 | STOP_TRANSACTION = 'StopTransaction', | |
182 | METER_VALUES = 'MeterValues', | |
a974c8e4 | 183 | DIAGNOSTICS_STATUS_NOTIFICATION = 'DiagnosticsStatusNotification' |
32de5a57 LM |
184 | } |
185 | ||
32de5a57 | 186 | export const RequestCommand = { |
a974c8e4 | 187 | ...OCPP16RequestCommand |
66a7748d JB |
188 | } as const |
189 | export type RequestCommand = OCPP16RequestCommand | |
32de5a57 | 190 | |
66a7748d | 191 | export type BootNotificationResponse = OCPP16BootNotificationResponse |
ce7a4fc3 JB |
192 | |
193 | export enum OCPP16RegistrationStatus { | |
194 | ACCEPTED = 'Accepted', | |
195 | PENDING = 'Pending', | |
a974c8e4 | 196 | REJECTED = 'Rejected' |
ce7a4fc3 JB |
197 | } |
198 | ||
199 | export interface OCPP16BootNotificationResponse extends JsonObject { | |
66a7748d JB |
200 | status: OCPP16RegistrationStatus |
201 | currentTime: Date | |
202 | interval: number | |
ce7a4fc3 JB |
203 | } |
204 | ||
c60ed4b8 JB |
205 | export enum OCPP16MessageTrigger { |
206 | BootNotification = 'BootNotification', | |
207 | DiagnosticsStatusNotification = 'DiagnosticsStatusNotification', | |
208 | FirmwareStatusNotification = 'FirmwareStatusNotification', | |
209 | Heartbeat = 'Heartbeat', | |
210 | MeterValues = 'MeterValues', | |
a974c8e4 | 211 | StatusNotification = 'StatusNotification' |
c60ed4b8 JB |
212 | } |
213 | ||
c60ed4b8 | 214 | export const MessageTrigger = { |
a974c8e4 | 215 | ...OCPP16MessageTrigger |
66a7748d JB |
216 | } as const |
217 | export type MessageTrigger = OCPP16MessageTrigger | |
c60ed4b8 | 218 | |
f4b3f35d | 219 | interface CommandsSupport extends JsonObject { |
66a7748d JB |
220 | incomingCommands: Record<IncomingRequestCommand, boolean> |
221 | outgoingCommands?: Record<RequestCommand, boolean> | |
222 | } | |
32de5a57 LM |
223 | |
224 | export enum OCPPVersion { | |
225 | VERSION_16 = '1.6', | |
5c512453 JB |
226 | VERSION_20 = '2.0', |
227 | VERSION_201 = '2.0.1' | |
32de5a57 LM |
228 | } |
229 | ||
230 | export enum OCPPProtocol { | |
a974c8e4 | 231 | JSON = 'json' |
32de5a57 LM |
232 | } |
233 | ||
234 | export enum CurrentType { | |
235 | AC = 'AC', | |
a974c8e4 | 236 | DC = 'DC' |
32de5a57 LM |
237 | } |
238 | ||
239 | export enum Voltage { | |
240 | VOLTAGE_110 = 110, | |
241 | VOLTAGE_230 = 230, | |
242 | VOLTAGE_400 = 400, | |
a974c8e4 | 243 | VOLTAGE_800 = 800 |
32de5a57 LM |
244 | } |
245 | ||
246 | export enum AmpereUnits { | |
247 | MILLI_AMPERE = 'mA', | |
248 | CENTI_AMPERE = 'cA', | |
249 | DECI_AMPERE = 'dA', | |
a974c8e4 | 250 | AMPERE = 'A' |
32de5a57 LM |
251 | } |
252 | ||
f4b3f35d | 253 | export interface ConnectorStatus extends JsonObject { |
66a7748d JB |
254 | availability: AvailabilityType |
255 | bootStatus?: ChargePointStatus | |
256 | status?: ChargePointStatus | |
257 | authorizeIdTag?: string | |
258 | idTagAuthorized?: boolean | |
259 | localAuthorizeIdTag?: string | |
260 | idTagLocalAuthorized?: boolean | |
261 | transactionRemoteStarted?: boolean | |
262 | transactionStarted?: boolean | |
263 | transactionId?: number | |
264 | transactionIdTag?: string | |
265 | energyActiveImportRegisterValue?: number // In Wh | |
266 | transactionEnergyActiveImportRegisterValue?: number // In Wh | |
267 | } | |
32de5a57 | 268 | |
f4b3f35d | 269 | export interface EvseStatus extends JsonObject { |
66a7748d JB |
270 | availability: AvailabilityType |
271 | connectors?: ConnectorStatus[] | |
272 | } | |
52952bf8 | 273 | |
32de5a57 LM |
274 | export enum OCPP16AvailabilityType { |
275 | INOPERATIVE = 'Inoperative', | |
a974c8e4 | 276 | OPERATIVE = 'Operative' |
32de5a57 | 277 | } |
66a7748d | 278 | export type AvailabilityType = OCPP16AvailabilityType |
32de5a57 LM |
279 | |
280 | export enum OCPP16ChargePointStatus { | |
281 | AVAILABLE = 'Available', | |
282 | PREPARING = 'Preparing', | |
283 | CHARGING = 'Charging', | |
284 | OCCUPIED = 'Occupied', | |
285 | SUSPENDED_EVSE = 'SuspendedEVSE', | |
286 | SUSPENDED_EV = 'SuspendedEV', | |
287 | FINISHING = 'Finishing', | |
288 | RESERVED = 'Reserved', | |
289 | UNAVAILABLE = 'Unavailable', | |
a974c8e4 | 290 | FAULTED = 'Faulted' |
32de5a57 | 291 | } |
66a7748d | 292 | export type ChargePointStatus = OCPP16ChargePointStatus |
02cde3b7 | 293 | |
f4b3f35d | 294 | export interface Status extends JsonObject { |
66a7748d JB |
295 | start?: boolean |
296 | startDate?: Date | |
297 | lastRunDate?: Date | |
298 | stopDate?: Date | |
299 | stoppedDate?: Date | |
300 | authorizeRequests?: number | |
301 | acceptedAuthorizeRequests?: number | |
302 | rejectedAuthorizeRequests?: number | |
303 | startTransactionRequests?: number | |
304 | acceptedStartTransactionRequests?: number | |
305 | rejectedStartTransactionRequests?: number | |
306 | stopTransactionRequests?: number | |
307 | acceptedStopTransactionRequests?: number | |
308 | rejectedStopTransactionRequests?: number | |
309 | skippedConsecutiveTransactions?: number | |
310 | skippedTransactions?: number | |
311 | } |