1 import type { JsonObject
} from
'./JsonType';
3 export type ChargingStationData
= {
4 stationInfo
: ChargingStationInfo
;
7 | typeof WebSocket
.CONNECTING
8 | typeof WebSocket
.OPEN
9 | typeof WebSocket
.CLOSING
10 | typeof WebSocket
.CLOSED
;
11 bootNotificationResponse
: BootNotificationResponse
;
12 connectors
: ConnectorStatus
[];
13 automaticTransactionGeneratorStatuses
?: Status
[];
16 export type ChargingStationInfo
= {
18 chargingStationId
?: string;
19 chargePointModel
: string;
20 chargePointVendor
: string;
21 firmwareVersion
?: string;
22 numberOfConnectors
?: number | number[];
25 templateHash
?: string;
26 chargeBoxSerialNumber
?: string;
27 chargePointSerialNumber
?: string;
28 meterSerialNumber
?: string;
29 maximumPower
?: number; // Always in Watt
30 maximumAmperage
?: number; // Always in Ampere
31 supervisionUrls
?: string | string[];
32 supervisionUrlOcppConfiguration
?: boolean;
33 supervisionUrlOcppKey
?: string;
34 supervisionUser
?: string;
35 supervisionPassword
?: string;
36 ocppVersion
?: OCPPVersion
;
37 ocppProtocol
?: OCPPProtocol
;
38 ocppStrictCompliance
?: boolean;
39 ocppPersistentConfiguration
?: boolean;
40 stationInfoPersistentConfiguration
?: boolean;
41 authorizationFile
?: string;
47 powerSharedByConnectors
?: boolean;
48 currentOutType
?: CurrentType
;
50 numberOfPhases
?: number;
51 useConnectorId0
?: boolean;
52 randomConnectors
?: boolean;
54 autoRegister
?: boolean;
55 autoReconnectMaxRetries
?: number;
56 reconnectExponentialDelay
?: boolean;
57 registrationMaxRetries
?: number;
58 enableStatistics
?: boolean;
59 mustAuthorizeAtRemoteStart
?: boolean;
60 amperageLimitationOcppKey
?: string;
61 amperageLimitationUnit
?: AmpereUnits
;
62 beginEndMeterValues
?: boolean;
63 outOfOrderEndMeterValues
?: boolean;
64 meteringPerTransaction
?: boolean;
65 transactionDataMeterValues
?: boolean;
66 mainVoltageMeterValues
?: boolean;
67 phaseLineToLineVoltageMeterValues
?: boolean;
68 customValueLimitationMeterValues
?: boolean;
69 commandsSupport
?: CommandsSupport
;
72 export enum OCPP16IncomingRequestCommand
{
74 CLEAR_CACHE
= 'ClearCache',
75 CHANGE_AVAILABILITY
= 'ChangeAvailability',
76 UNLOCK_CONNECTOR
= 'UnlockConnector',
77 GET_CONFIGURATION
= 'GetConfiguration',
78 CHANGE_CONFIGURATION
= 'ChangeConfiguration',
79 SET_CHARGING_PROFILE
= 'SetChargingProfile',
80 CLEAR_CHARGING_PROFILE
= 'ClearChargingProfile',
81 REMOTE_START_TRANSACTION
= 'RemoteStartTransaction',
82 REMOTE_STOP_TRANSACTION
= 'RemoteStopTransaction',
83 GET_DIAGNOSTICS
= 'GetDiagnostics',
84 TRIGGER_MESSAGE
= 'TriggerMessage',
87 export type IncomingRequestCommand
= OCPP16IncomingRequestCommand
;
89 export const IncomingRequestCommand
= {
90 ...OCPP16IncomingRequestCommand
,
93 export enum OCPP16RequestCommand
{
94 BOOT_NOTIFICATION
= 'BootNotification',
95 HEARTBEAT
= 'Heartbeat',
96 STATUS_NOTIFICATION
= 'StatusNotification',
97 AUTHORIZE
= 'Authorize',
98 START_TRANSACTION
= 'StartTransaction',
99 STOP_TRANSACTION
= 'StopTransaction',
100 METER_VALUES
= 'MeterValues',
101 DIAGNOSTICS_STATUS_NOTIFICATION
= 'DiagnosticsStatusNotification',
104 export type RequestCommand
= OCPP16RequestCommand
;
106 export const RequestCommand
= {
107 ...OCPP16RequestCommand
,
110 export type BootNotificationResponse
= OCPP16BootNotificationResponse
;
112 export enum OCPP16RegistrationStatus
{
113 ACCEPTED
= 'Accepted',
115 REJECTED
= 'Rejected',
118 export interface OCPP16BootNotificationResponse
extends JsonObject
{
119 status: OCPP16RegistrationStatus
;
124 type CommandsSupport
= {
125 incomingCommands
: Record
<IncomingRequestCommand
, boolean>;
126 outgoingCommands
?: Record
<RequestCommand
, boolean>;
129 export enum OCPPVersion
{
134 export enum OCPPProtocol
{
139 export enum CurrentType
{
144 export enum Voltage
{
151 export enum AmpereUnits
{
158 export type ConnectorStatus
= {
159 availability
: AvailabilityType
;
160 bootStatus
?: ChargePointStatus
;
161 status?: ChargePointStatus
;
162 authorizeIdTag
?: string;
163 idTagAuthorized
?: boolean;
164 localAuthorizeIdTag
?: string;
165 idTagLocalAuthorized
?: boolean;
166 transactionRemoteStarted
?: boolean;
167 transactionStarted
?: boolean;
168 transactionId
?: number;
169 transactionIdTag
?: string;
170 energyActiveImportRegisterValue
?: number; // In Wh
171 transactionEnergyActiveImportRegisterValue
?: number; // In Wh
174 export type AvailabilityType
= OCPP16AvailabilityType
;
176 export enum OCPP16AvailabilityType
{
177 INOPERATIVE
= 'Inoperative',
178 OPERATIVE
= 'Operative',
181 export type ChargePointStatus
= OCPP16ChargePointStatus
;
183 export enum OCPP16ChargePointStatus
{
184 AVAILABLE
= 'Available',
185 PREPARING
= 'Preparing',
186 CHARGING
= 'Charging',
187 OCCUPIED
= 'Occupied',
188 SUSPENDED_EVSE
= 'SuspendedEVSE',
189 SUSPENDED_EV
= 'SuspendedEV',
190 FINISHING
= 'Finishing',
191 RESERVED
= 'Reserved',
192 UNAVAILABLE
= 'Unavailable',
196 export type Status
= {
202 authorizeRequests
?: number;
203 acceptedAuthorizeRequests
?: number;
204 rejectedAuthorizeRequests
?: number;
205 startTransactionRequests
?: number;
206 acceptedStartTransactionRequests
?: number;
207 rejectedStartTransactionRequests
?: number;
208 stopTransactionRequests
?: number;
209 acceptedStopTransactionRequests
?: number;
210 rejectedStopTransactionRequests
?: number;
211 skippedConsecutiveTransactions
?: number;
212 skippedTransactions
?: number;