Add per phase support to MeterValues in template.
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / 1.6 / MeterValues.ts
1 export enum MeterValueUnit {
2 WATT_HOUR = 'Wh',
3 KILO_WATT_HOUR = 'kWh',
4 VAR_HOUR = 'varh',
5 KILO_VAR_HOUR = 'kvarh',
6 WATT = 'W',
7 KILO_WATT = 'kW',
8 VOLT_AMP = 'VA',
9 KILO_VOLT_AMP = 'kVA',
10 VAR = 'var',
11 KILO_VAR = 'kvar',
12 AMP = 'A',
13 VOLT = 'V',
14 TEMP_CELSIUS = 'Celsius',
15 TEMP_FAHRENHEIT = 'Fahrenheit',
16 TEMP_KELVIN = 'K',
17 PERCENT = 'Percent'
18 }
19
20 export enum MeterValueContext {
21 INTERRUPTION_BEGIN = 'Interruption.Begin',
22 INTERRUPTION_END = 'Interruption.End',
23 OTHER = 'Other',
24 SAMPLE_CLOCK = 'Sample.Clock',
25 SAMPLE_PERIODIC = 'Sample.Periodic',
26 TRANSACTION_BEGIN = 'Transaction.Begin',
27 TRANSACTION_END = 'Transaction.End',
28 TRIGGER = 'Trigger'
29 }
30
31 export enum OCPP16MeterValueMeasurand {
32 CURRENT_EXPORT = 'Current.Export',
33 CURRENT_IMPORT = 'Current.Import',
34 CURRENT_OFFERED = 'Current.Offered',
35 ENERGY_ACTIVE_EXPORT_REGISTER = 'Energy.Active.Export.Register',
36 ENERGY_ACTIVE_IMPORT_REGISTER = 'Energy.Active.Import.Register',
37 ENERGY_REACTIVE_EXPORT_REGISTER = 'Energy.Reactive.Export.Register',
38 ENERGY_REACTIVE_IMPORT_REGISTER = 'Energy.Reactive.Import.Register',
39 ENERGY_ACTIVE_EXPORT_INTERVAL = 'Energy.Active.Export.Interval',
40 ENERGY_ACTIVE_IMPORT_INTERVAL = 'Energy.Active.Import.Interval',
41 ENERGY_REACTIVE_EXPORT_INTERVAL = 'Energy.Reactive.Export.Interval',
42 ENERGY_REACTIVE_IMPORT_INTERVAL = 'Energy.Reactive.Import.Interval',
43 FREQUENCY = 'Frequency',
44 POWER_ACTIVE_EXPORT = 'Power.Active.Export',
45 POWER_ACTIVE_IMPORT = 'Power.Active.Import',
46 POWER_FACTOR = 'Power.Factor',
47 POWER_OFFERED = 'Power.Offered',
48 POWER_REACTIVE_EXPORT = 'Power.Reactive.Export',
49 POWER_REACTIVE_IMPORT = 'Power.Reactive.Import',
50 FAN_RPM = 'RPM',
51 STATE_OF_CHARGE = 'SoC',
52 TEMPERATURE = 'Temperature',
53 VOLTAGE = 'Voltage'
54 }
55
56 export enum MeterValueLocation {
57 BODY = 'Body',
58 CABLE = 'Cable',
59 EV = 'EV',
60 INLET = 'Inlet',
61 OUTLET = 'Outlet'
62 }
63
64 export enum OCPP16MeterValuePhase {
65 L1 = 'L1',
66 L2 = 'L2',
67 L3 = 'L3',
68 N = 'N',
69 L1_N = 'L1-N',
70 L2_N = 'L2-N',
71 L3_N = 'L3-N',
72 L1_L2 = 'L1-L2',
73 L2_L3 = 'L2-L3',
74 L3_L1 = 'L3-L1'
75 }
76
77 export enum MeterValueFormat {
78 RAW = 'Raw',
79 SIGNED_DATA = 'SignedData',
80 }
81
82 export interface OCPP16SampledValue {
83 value?: string;
84 unit?: MeterValueUnit;
85 context?: MeterValueContext;
86 measurand?: OCPP16MeterValueMeasurand;
87 phase?: OCPP16MeterValuePhase;
88 location?: MeterValueLocation;
89 format?: MeterValueFormat;
90 }
91
92 export interface OCPP16MeterValue {
93 timestamp: string;
94 sampledValue: OCPP16SampledValue[];
95 }
96
97 export interface MeterValuesRequest {
98 connectorId: number;
99 transactionId?: number;
100 meterValue: OCPP16MeterValue | OCPP16MeterValue[];
101 }
102
103 // eslint-disable-next-line @typescript-eslint/no-empty-interface
104 export interface MeterValuesResponse {}
105