1 import type { JsonObject
} from
'./JsonType';
3 export type ChargingStationData
= {
4 stationInfo
: ChargingStationInfo
;
7 bootNotificationResponse
: BootNotificationResponse
;
8 connectors
: ConnectorStatus
[];
11 export type ChargingStationInfo
= {
13 chargingStationId
?: string;
14 chargePointModel
: string;
15 chargePointVendor
: string;
16 firmwareVersion
?: string;
17 numberOfConnectors
?: number | number[];
20 templateHash
?: string;
21 chargeBoxSerialNumber
?: string;
22 chargePointSerialNumber
?: string;
23 meterSerialNumber
?: string;
24 maximumPower
?: number; // Always in Watt
25 maximumAmperage
?: number; // Always in Ampere
26 supervisionUrls
?: string | string[];
27 supervisionUrlOcppConfiguration
?: boolean;
28 supervisionUrlOcppKey
?: string;
29 supervisionUser
?: string;
30 supervisionPassword
?: string;
31 ocppVersion
?: OCPPVersion
;
32 ocppProtocol
?: OCPPProtocol
;
33 ocppStrictCompliance
?: boolean;
34 ocppPersistentConfiguration
?: boolean;
35 stationInfoPersistentConfiguration
?: boolean;
36 authorizationFile
?: string;
42 powerSharedByConnectors
?: boolean;
43 currentOutType
?: CurrentType
;
45 numberOfPhases
?: number;
46 useConnectorId0
?: boolean;
47 randomConnectors
?: boolean;
49 autoRegister
?: boolean;
50 autoReconnectMaxRetries
?: number;
51 reconnectExponentialDelay
?: boolean;
52 registrationMaxRetries
?: number;
53 enableStatistics
?: boolean;
54 mustAuthorizeAtRemoteStart
?: boolean;
55 amperageLimitationOcppKey
?: string;
56 amperageLimitationUnit
?: AmpereUnits
;
57 beginEndMeterValues
?: boolean;
58 outOfOrderEndMeterValues
?: boolean;
59 meteringPerTransaction
?: boolean;
60 transactionDataMeterValues
?: boolean;
61 mainVoltageMeterValues
?: boolean;
62 phaseLineToLineVoltageMeterValues
?: boolean;
63 customValueLimitationMeterValues
?: boolean;
64 commandsSupport
?: CommandsSupport
;
67 export enum OCPP16IncomingRequestCommand
{
69 CLEAR_CACHE
= 'ClearCache',
70 CHANGE_AVAILABILITY
= 'ChangeAvailability',
71 UNLOCK_CONNECTOR
= 'UnlockConnector',
72 GET_CONFIGURATION
= 'GetConfiguration',
73 CHANGE_CONFIGURATION
= 'ChangeConfiguration',
74 SET_CHARGING_PROFILE
= 'SetChargingProfile',
75 CLEAR_CHARGING_PROFILE
= 'ClearChargingProfile',
76 REMOTE_START_TRANSACTION
= 'RemoteStartTransaction',
77 REMOTE_STOP_TRANSACTION
= 'RemoteStopTransaction',
78 GET_DIAGNOSTICS
= 'GetDiagnostics',
79 TRIGGER_MESSAGE
= 'TriggerMessage',
82 export type IncomingRequestCommand
= OCPP16IncomingRequestCommand
;
84 export const IncomingRequestCommand
= {
85 ...OCPP16IncomingRequestCommand
,
88 export enum OCPP16RequestCommand
{
89 BOOT_NOTIFICATION
= 'BootNotification',
90 HEARTBEAT
= 'Heartbeat',
91 STATUS_NOTIFICATION
= 'StatusNotification',
92 AUTHORIZE
= 'Authorize',
93 START_TRANSACTION
= 'StartTransaction',
94 STOP_TRANSACTION
= 'StopTransaction',
95 METER_VALUES
= 'MeterValues',
96 DIAGNOSTICS_STATUS_NOTIFICATION
= 'DiagnosticsStatusNotification',
99 export type RequestCommand
= OCPP16RequestCommand
;
101 export const RequestCommand
= {
102 ...OCPP16RequestCommand
,
105 export type BootNotificationResponse
= OCPP16BootNotificationResponse
;
107 export enum OCPP16RegistrationStatus
{
108 ACCEPTED
= 'Accepted',
110 REJECTED
= 'Rejected',
113 export interface OCPP16BootNotificationResponse
extends JsonObject
{
114 status: OCPP16RegistrationStatus
;
119 export interface CommandsSupport
{
120 incomingCommands
: Record
<IncomingRequestCommand
, boolean>;
121 outgoingCommands
?: Record
<RequestCommand
, boolean>;
124 export enum OCPPVersion
{
129 export enum OCPPProtocol
{
134 export enum CurrentType
{
139 export enum Voltage
{
146 export enum AmpereUnits
{
153 export type ConnectorStatus
= {
154 availability
: AvailabilityType
;
155 bootStatus
?: ChargePointStatus
;
156 status?: ChargePointStatus
;
157 authorizeIdTag
?: string;
158 idTagAuthorized
?: boolean;
159 localAuthorizeIdTag
?: string;
160 idTagLocalAuthorized
?: boolean;
161 transactionRemoteStarted
?: boolean;
162 transactionStarted
?: boolean;
163 transactionId
?: number;
164 transactionIdTag
?: string;
165 energyActiveImportRegisterValue
?: number; // In Wh
166 transactionEnergyActiveImportRegisterValue
?: number; // In Wh
169 export type AvailabilityType
= OCPP16AvailabilityType
;
171 export enum OCPP16AvailabilityType
{
172 INOPERATIVE
= 'Inoperative',
173 OPERATIVE
= 'Operative',
176 export type ChargePointStatus
= OCPP16ChargePointStatus
;
178 export enum OCPP16ChargePointStatus
{
179 AVAILABLE
= 'Available',
180 PREPARING
= 'Preparing',
181 CHARGING
= 'Charging',
182 OCCUPIED
= 'Occupied',
183 SUSPENDED_EVSE
= 'SuspendedEVSE',
184 SUSPENDED_EV
= 'SuspendedEV',
185 FINISHING
= 'Finishing',
186 RESERVED
= 'Reserved',
187 UNAVAILABLE
= 'Unavailable',