Skip to content

Commit 4050b0e

Browse files
Add messages describing microgrid entities (#127)
This change introduces messages to describe microgrid entities such as sensors, components, electrical connections, and microgrids.
2 parents 4bd67bc + 29f77ca commit 4050b0e

File tree

17 files changed

+615
-44
lines changed

17 files changed

+615
-44
lines changed

RELEASE_NOTES.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,23 @@
4040

4141
- Added a message `SensorData` to represent metrics sampled from sensors.
4242

43+
- Added a message `Lifetime` as a wrapper over the start and end timestamps of
44+
an entity.
45+
46+
- Added a message `Sensor` to represent sensors installed in a microgrid.
47+
48+
- Added a message `Component` to represent components installed in a microgrid.
49+
50+
- Added a message `ComponentCategoryMetadataVariant` to represent the different
51+
types of sub-categories that can be associated with a component category.
52+
53+
- Added a message `ComponentConnection` to represent electrical connection
54+
between two components installed in a microgrid.
55+
56+
- Added a message `DeliveryArea` to represent a market contract delivery area.
57+
58+
- Added a message `Microgrid` to represent a microgrid.
59+
4360
## New Features
4461

4562
<!-- Here goes the main new features and examples or instructions on how to use them -->
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
// Frequenz definitions of grids as entites participating in trading.
2+
//
3+
// Copyright 2023 Frequenz Energy-as-a-Service GmbH
4+
//
5+
// Licensed under the MIT License (the "License");
6+
// you may not use this file except in compliance with the License.
7+
8+
syntax = "proto3";
9+
10+
package frequenz.api.common.v1.grid;
11+
12+
// CodeType specifies the type of identification code used for uniquely
13+
// identifying various entities such as delivery areas, market participants, and
14+
// grid components within the energy market. This enumeration aims to offer
15+
// compatibility across different jurisdictional standards.
16+
//
17+
// !!! note "Understanding Code Types"
18+
// Different regions or countries may have their own standards for uniquely
19+
// identifying various entities within the energy market. For example, in
20+
// Europe, the Energy Identification Code (EIC) is commonly used for this
21+
// purpose.
22+
//
23+
// !!! info "Extensibility"
24+
// New code types can be added to this enum to accommodate additional
25+
// regional standards, enhancing the API's adaptability.
26+
//
27+
// !!! caution "Validation Required"
28+
// The chosen code type should correspond correctly with the `code` field in
29+
// the relevant message objects, such as `DeliveryArea` or `Counterparty`.
30+
// Failure to match the code type with the correct code could lead to
31+
// processing errors.
32+
//
33+
enum EnergyMarketCodeType {
34+
// Unspecified type. This value is a placeholder and should not be used.
35+
ENERGY_MARKET_CODE_TYPE_UNSPECIFIED = 0;
36+
37+
// European Energy Identification Code Standard.
38+
ENERGY_MARKET_CODE_TYPE_EUROPE_EIC = 1;
39+
40+
// North American Electric Reliability Corporation identifiers.
41+
ENERGY_MARKET_CODE_TYPE_US_NERC = 2;
42+
}
43+
44+
// DeliveryArea represents the geographical or administrative region, usually
45+
// defined and maintained by a Transmission System Operator (TSO), where
46+
// electricity deliveries for a contract occur.
47+
//
48+
// The concept is important to energy trading as it delineates the agreed-upon
49+
// delivery location. Delivery areas can have different codes based on the//
50+
// jurisdiction in which they operate.
51+
//
52+
// !!! note "Jurisdictional Differences"
53+
// This is typically represented by specific codes according to local
54+
// jurisdiction. In Europe, this is represented by an EIC
55+
// (Energy Identification Code).
56+
message DeliveryArea {
57+
// Code representing the unique identifier for the delivery area.
58+
string code = 1;
59+
60+
// Type of code used for identifying the delivery area itself.
61+
EnergyMarketCodeType code_type = 2;
62+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Frequenz definitions for batteries.
2+
//
3+
// Copyright:
4+
// Copyright 2023 Frequenz Energy-as-a-Service GmbH
5+
//
6+
// License:
7+
// MIT
8+
9+
syntax = "proto3";
10+
11+
package frequenz.api.common.v1.microgrid.components;
12+
13+
// Enumerated battery types.
14+
enum BatteryType {
15+
// Unspecified.
16+
BATTERY_TYPE_UNSPECIFIED = 0;
17+
18+
// Li-ion batteries.
19+
BATTERY_TYPE_LI_ION = 1;
20+
21+
// Sodium-ion batteries
22+
BATTERY_TYPE_NA_ION = 2;
23+
}
24+
25+
// A representation of a battery.
26+
message Battery {
27+
// The battery type.
28+
BatteryType type = 1;
29+
}

proto/frequenz/api/common/v1/components.proto renamed to proto/frequenz/api/common/v1/microgrid/components/components.proto

Lines changed: 93 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,16 @@
88

99
syntax = "proto3";
1010

11-
package frequenz.api.common.v1.components;
11+
package frequenz.api.common.v1.microgrid.components;
1212

1313
import "frequenz/api/common/v1/metrics.proto";
14+
import "frequenz/api/common/v1/microgrid/components/battery.proto";
15+
import "frequenz/api/common/v1/microgrid/components/ev_charger.proto";
16+
import "frequenz/api/common/v1/microgrid/components/fuse.proto";
17+
import "frequenz/api/common/v1/microgrid/components/grid.proto";
18+
import "frequenz/api/common/v1/microgrid/components/inverter.proto";
19+
import "frequenz/api/common/v1/microgrid/components/transformer.proto";
20+
import "frequenz/api/common/v1/microgrid/lifetime.proto";
1421

1522
import "google/protobuf/timestamp.proto";
1623

@@ -75,46 +82,102 @@ enum ComponentCategory {
7582
COMPONENT_CATEGORY_VOLTAGE_TRANSFORMER = 14;
7683
}
7784

78-
// Enumerated battery types.
79-
enum BatteryType {
80-
// Unspecified.
81-
BATTERY_TYPE_UNSPECIFIED = 0;
85+
// Metadata specific to a microgrid component.
86+
message ComponentCategoryMetadataVariant {
87+
oneof metadata {
88+
frequenz.api.common.v1.microgrid.components.Battery battery = 1;
89+
frequenz.api.common.v1.microgrid.components.EvCharger ev_charger = 2;
90+
frequenz.api.common.v1.microgrid.components.Fuse fuse = 3;
91+
frequenz.api.common.v1.microgrid.components.GridConnectionPoint grid = 4;
92+
frequenz.api.common.v1.microgrid.components.Inverter inverter = 5;
93+
frequenz.api.common.v1.microgrid.components.VoltageTransformer
94+
voltage_transformer = 6;
95+
}
96+
}
97+
98+
// ComponentStatus defines the possible statuses for a component.
99+
//
100+
// !!! note
101+
// The status indicates the status set by the user via the user interface.
102+
// The status is not yet included in the Component messages and should be
103+
// added.
104+
//
105+
enum ComponentStatus {
106+
// The status is unspecified. This should not be used.
107+
COMPONENT_STATUS_UNSPECIFIED = 0;
82108

83-
// Li-ion batteries.
84-
BATTERY_TYPE_LI_ION = 1;
109+
// The component is active.
110+
COMPONENT_STATUS_ACTIVE = 1;
85111

86-
// Sodium-ion batteries
87-
BATTERY_TYPE_NA_ION = 2;
112+
// The component is inactive.
113+
COMPONENT_STATUS_INACTIVE = 2;
88114
}
89115

90-
// Enumerated inverter types.
91-
enum InverterType {
92-
// Unspecified.
93-
INVERTER_TYPE_UNSPECIFIED = 0;
116+
// Microgrid electrical component details.
117+
message Component {
118+
// The component ID.
119+
uint64 id = 1;
94120

95-
// Battery inverter.
96-
INVERTER_TYPE_BATTERY = 1;
121+
// Unique identifier of the parent microgrid_id.
122+
uint64 microgrid_id = 2;
97123

98-
// Solar inverter.
99-
INVERTER_TYPE_SOLAR = 2;
124+
// The component name.
125+
string name = 3;
100126

101-
// Hybrid inverter.
102-
INVERTER_TYPE_HYBRID = 3;
103-
}
127+
// The component category. E.g., Inverter, Battery, etc.
128+
ComponentCategory category = 4;
129+
130+
// The metadata specific to the component category type.
131+
ComponentCategoryMetadataVariant category_type = 5;
104132

105-
// Enumerated EV charger types.
106-
enum EvChargerType {
107-
// Default type.
108-
EV_CHARGER_TYPE_UNSPECIFIED = 0;
133+
// The component manufacturer.
134+
string manufacturer = 6;
109135

110-
// The EV charging station supports AC charging only.
111-
EV_CHARGER_TYPE_AC = 1;
136+
// The model name of the component.
137+
string model_name = 7;
112138

113-
// The EV charging station supports DC charging only.
114-
EV_CHARGER_TYPE_DC = 2;
139+
// The status of the component.
140+
ComponentStatus status = 8;
115141

116-
// The EV charging station supports both AC and DC.
117-
EV_CHARGER_TYPE_HYBRID = 3;
142+
// The operational lifetime of the component.
143+
frequenz.api.common.v1.microgrid.Lifetime operational_lifetime = 9;
144+
}
145+
146+
// ComponentConnection describes a single electrical link between two components
147+
// within a microgrid, effectively representing the physical wiring as viewed
148+
// from the grid connection point, if one exists, or from the islanding point,
149+
// in case of an islanded microgrids.
150+
//
151+
// !!! note "Physical Representation"
152+
// This message is not about data flow but rather about the physical
153+
// electrical connections between components. Therefore, the IDs for the
154+
// source and destination components correspond to the actual setup within
155+
// the microgrid.
156+
//
157+
// !!! note "Direction"
158+
// The direction of the connection follows the flow of current away from the
159+
// grid connection point, or in case of islands, away from the islanding
160+
// point. This direction is aligned with positive current according to the
161+
// [Passive Sign Convention]
162+
// (https://en.wikipedia.org/wiki/Passive_sign_convention).
163+
//
164+
// !!! info "Historical Data"
165+
// The timestamps of when a connection was created and terminated allows for
166+
// tracking the changes over time to a microgrid, providing insights into
167+
// when and how the microgrid infrastructure has been modified.
168+
//
169+
message ComponentConnection {
170+
// Unique identifier of the component where the connection originates. This is
171+
// aligned with the direction of current flow away from the grid connection
172+
// point, or in case of islands, away from the islanding point.
173+
uint64 source_component_id = 1;
174+
175+
// Unique ID of the component where the connection terminates. This is the
176+
// component towards which the current flows.
177+
uint64 destination_component_id = 2;
178+
179+
// The operational lifetime of the connection.
180+
frequenz.api.common.v1.microgrid.Lifetime operational_lifetime = 3;
118181
}
119182

120183
// ComponentData message aggregates multiple metrics, operational states, and
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Frequenz definitions for EV chargers.
2+
//
3+
// Copyright:
4+
// Copyright 2023 Frequenz Energy-as-a-Service GmbH
5+
//
6+
// License:
7+
// MIT
8+
9+
syntax = "proto3";
10+
11+
package frequenz.api.common.v1.microgrid.components;
12+
13+
// Enumerated EV charger types.
14+
enum EvChargerType {
15+
// Default type.
16+
EV_CHARGER_TYPE_UNSPECIFIED = 0;
17+
18+
// The EV charging station supports AC charging only.
19+
EV_CHARGER_TYPE_AC = 1;
20+
21+
// The EV charging station supports DC charging only.
22+
EV_CHARGER_TYPE_DC = 2;
23+
24+
// The EV charging station supports both AC and DC.
25+
EV_CHARGER_TYPE_HYBRID = 3;
26+
}
27+
28+
// A representation of an EV chaging station.
29+
message EvCharger {
30+
// The EV charger type.
31+
EvChargerType type = 1;
32+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Frequenz definitions for electrical fuses.
2+
//
3+
// Copyright:
4+
// Copyright 2023 Frequenz Energy-as-a-Service GmbH
5+
//
6+
// License:
7+
// MIT
8+
9+
syntax = "proto3";
10+
11+
package frequenz.api.common.v1.microgrid.components;
12+
13+
// A representation of a fuse.
14+
// The fuse component represents a fuse in the microgrid. It is used to protect
15+
// components from overcurrents.
16+
message Fuse {
17+
// The rated current of the fuse in amperes.
18+
// This is the maximum current that the fuse can withstand for a long time.
19+
// This limit applies to currents both flowing in or out of each of the 3
20+
// phases individually.
21+
//
22+
// In other words, a current _i_ A at one of the phases of the node must
23+
// comply with the following constraint:
24+
// `-rated_fuse_current <= i <= rated_fuse_current`
25+
uint32 rated_current = 1;
26+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Frequenz definitions for grid connection points.
2+
//
3+
// Copyright:
4+
// Copyright 2023 Frequenz Energy-as-a-Service GmbH
5+
//
6+
// License:
7+
// MIT
8+
9+
syntax = "proto3";
10+
11+
package frequenz.api.common.v1.microgrid.components;
12+
13+
// A representation of a grid connection point. This is the point where a
14+
// microgrid connects to the grid.
15+
//
16+
// The terms "Grid Connection Point" and "Point of Common Coupling" (PCC) are
17+
// commonly used in the context.
18+
//
19+
// While both terms describe a connection point to the grid, the
20+
// `GridConnectionPoint` is specifically the physical connection point of the
21+
// generation facility to the grid, often concerned with the technical and
22+
// ownership aspects of the connection.
23+
//
24+
// In contrast, the PCC is is more specific in terms of electrical engineering.
25+
// It refers to the point where a customer's local electrical system (such as a
26+
// microgrid) connects to the utility distribution grid in such a way that it
27+
// can affect other customers’ systems connected to the same network. It is the
28+
// point where the grid and customer's electrical systems interface and where
29+
// issues like power quality and supply regulations are assessed.
30+
//
31+
// The term `GridConnectionPoint` is used to make it clear that what is referred
32+
// to here is the physical connection point of the local facility to the grid.
33+
// Note that this may also be the PCC in some cases.
34+
message GridConnectionPoint {
35+
// This refers to the maximum amount of electrical current, in amperes, that a
36+
// fuse at the grid connection point is designed to safely carry under normal
37+
// operating conditions.
38+
//
39+
// This limit applies to currents both flowing in or out of each of the 3
40+
// phases individually.
41+
//
42+
// In other words, a current _i_ A at one of the phases of the grid connection
43+
// point must comply with the following constraint:
44+
// `-rated_fuse_current <= i <= rated_fuse_current`
45+
uint32 rated_fuse_current = 1;
46+
}

0 commit comments

Comments
 (0)