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