-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgdr.proto
192 lines (179 loc) · 5.49 KB
/
gdr.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
syntax = "proto3";
import "google/protobuf/timestamp.proto";
//GDRs is the message type wich is published to the mqtt Handler for GDR
// config_uuid - unique identification of config at time of measurement (same as associated GCR)
message GDRs {
map<string,GDR> GDRs = 1;
string config_uuid = 2;
}
//GCRs is the message type wich is published to the mqtt Handler for GCR
// config_uuid - unique identification of config in time (i.e. changes on config change)
message GCRs {
map<string,GCR> GCRs = 1;
string config_uuid = 2;
}
//GDR = Generic Data Record
// id - unique identification (Same to associated GCR)
// status - see Status declaration
// timestamp - last time Data was updated
// values - Key = Binary ObisCode, Value = Value of ObisCode
// - based on ObisCode the basic Data information
// - in groups here is the comparison of the childs data information
// flexValues - Key = string
// Value = FlexValue
message GDR {
string id = 1;
Status status = 2;
google.protobuf.Timestamp timestamp = 3;
map<uint64,uint64> values = 4;
map<string,FlexValue> flexValues = 5;
}
//GCR = Generic Config Record
// id - unique identification (Same to associated GDR)
// label - describes the Datasource
// class - see Class declaration
// sources - points to the childs of the measuring point
// - references on the GDR ids
// - structure of groupings
// codes - based on Binary ObisCodes
// - declares which ObisCodes the associated GDR has
// devicetype - see DeviceType declaration
// meta - may include app-dependent meta information
// timestamp - last time the config was updated
// flexDefinitions - definition of flexible values
message GCR {
string id = 1;
string label = 2;
Class class = 3;
repeated string sources = 4;
repeated uint64 codes = 5;
DeviceType devicetype = 6;
map<string,string> meta = 7;
google.protobuf.Timestamp timestamp = 8;
map<string,FlexDefinition> flexDefinitions = 9;
}
// FlexValue is a message type which handles flexible datapoints inside a GDR
message FlexValue {
int64 int_value = 1;
string string_value = 2;
}
// FlexDefinition describes the content of the flexible values
message FlexDefinition {
string label = 1;
FlexValueType type = 2;
Unit unit = 3;
sint32 decimalpower = 4;
}
// FlexValueType declares which field should be used parsing the flexvalue
enum FlexValueType {
FLEX_VALUE_TYPE_INTEGER = 0;
FLEX_VALUE_TYPE_STRING = 1;
}
// Unit declares the unit of the flexible value
enum Unit {
UNIT_UNKNOWN = 0;
// Electrical values
UNIT_AMPERE = 1;
UNIT_VOLT = 2;
UNIT_WATT = 3;
UNIT_HERTZ = 4;
UNIT_VOLT_AMPERE = 5;
UNIT_VOLT_AMPERE_REACTIVE = 6;
UNIT_WATT_HOUR = 7;
UNIT_KILO_WATT_HOUR = 8;
// Time Values
UNIT_SECOND = 9;
UNIT_MINUTE = 10;
UNIT_HOUR = 11;
UNIT_DAY = 12;
UNIT_WEEK = 13;
UNIT_MONTH = 14;
UNIT_YEAR = 15;
// Other values
UNIT_DEGREE_CELSIUS = 16;
UNIT_KELVIN = 17;
UNIT_DEGREE_FAHRENHEIT = 18;
}
// Devicetype - declares which Type of Device the Data Source is
// - necessary for Sankey-Diagram
enum DeviceType {
DEVICE_TYPE_UNKNOWN = 0;
DEVICE_TYPE_PHOTOVOLTAIC_SYSTEM = 1;
DEVICE_TYPE_ELECTRIC_VEHICLE = 2;
DEVICE_TYPE_BATTERY = 3;
DEVICE_TYPE_OVEN = 4;
DEVICE_TYPE_FLOW_HEATER = 5;
DEVICE_TYPE_BOILER = 6;
DEVICE_TYPE_IMMERSION_HEATER = 7;
DEVICE_TYPE_STOVE = 8;
DEVICE_TYPE_COOLER = 9;
DEVICE_TYPE_VENTILATION = 10;
DEVICE_TYPE_DISHWASHER = 11;
DEVICE_TYPE_DRYER = 12;
DEVICE_TYPE_HEAT_PUMP = 13;
DEVICE_TYPE_WASHING_MACHINE = 14;
DEVICE_TYPE_INVERTER_ONEPHASE = 15;
DEVICE_TYPE_INVERTER_THREEPHASE = 16;
DEVICE_TYPE_CHP = 17; // Combined heat and power
DEVICE_TYPE_BUILDING_OFFICE = 18;
DEVICE_TYPE_BUILDING_COMMERCIAL = 19;
DEVICE_TYPE_BUILDING_FACTORY = 20;
DEVICE_TYPE_BUILDING_SINGLE_HOME = 21;
DEVICE_TYPE_BUILDING_HOTEL = 22;
DEVICE_TYPE_BUILDING_APARTMENTS = 23;
DEVICE_TYPE_BUILDING_PARKING = 24;
DEVICE_TYPE_BUILDING_RESIDENTIAL = 25;
DEVICE_TYPE_ROOM_BATH = 26;
DEVICE_TYPE_ROOM_GARAGE = 27;
DEVICE_TYPE_ROOM_BASEMENT = 28;
DEVICE_TYPE_ROOM_CHILD = 29;
DEVICE_TYPE_ROOM_KITCHEN = 30;
DEVICE_TYPE_ROOM_SAUNA = 31;
DEVICE_TYPE_ROOM_BED = 32;
DEVICE_TYPE_ROOM_LIVING = 33;
DEVICE_TYPE_ROOM_GENERIC = 34;
DEVICE_TYPE_CONTROLLABLE_LOAD = 35;
DEVICE_TYPE_LIGHTING = 36;
DEVICE_TYPE_OFFICES = 37;
DEVICE_TYPE_DOMESTIC_APPLIANCES = 38;
DEVICE_TYPE_HEATER_OF_HEAT_PUMP = 39;
DEVICE_TYPE_INDUSTRIAL_ENGINE = 40;
DEVICE_TYPE_AIR_CONDITIONING = 41;
DEVICE_TYPE_COMPRESSOR = 42;
DEVICE_TYPE_PC_DATA_CENTER = 43;
DEVICE_TYPE_FUSES_THREE = 44;
DEVICE_TYPE_FUSES_SIX = 45;
DEVICE_TYPE_FUSES_NINE = 46;
DEVICE_TYPE_FUSES_TWELVE = 47;
DEVICE_TYPE_COMPACTOR = 48;
DEVICE_TYPE_WHITE_GOODS = 49;
DEVICE_TYPE_COLD_STORAGE_ROOM = 50;
DEVICE_TYPE_GARDEN_SHED = 51;
DEVICE_TYPE_COOLING_COMBINATION = 52;
DEVICE_TYPE_FACILITIES = 53;
DEVICE_TYPE_FREEZER = 54;
DEVICE_TYPE_FRIDGE = 55;
DEVICE_TYPE_GRID_CONNECTION_POINT = 56;
DEVICE_TYPE_INVERTER_HYBRID = 57;
DEVICE_TYPE_CIRCUIT_PROTECTION = 58;
DEVICE_TYPE_DATA_TRANSCEIVER = 59;
//To be continued
}
// Status OK = Datasource updated Data, GDR Updated
// Status WARNING = Datasource updated Data but configuration is needed
// Status Error = Datasource did not updated Data (Maybe broken)
enum Status {
STATUS_UNKNOWN = 0;
STATUS_OK = 1;
STATUS_WARNING = 2;
STATUS_ERROR = 3;
}
// Class Consumer = Consumes Energy, Power, ...
// Class Producer = Produces Energy, Power, ...
// Class Hybrid = Consumes or Produces Energy, Power, ...
enum Class {
CLASS_UNKNOWN = 0;
CLASS_CONSUMER = 1;
CLASS_PRODUCER = 2;
CLASS_HYBRID = 3;
}