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