Skip to content

Commit ef96b30

Browse files
Clear release notes and add v1alpha8 package (#396)
2 parents 7953a91 + 7ff922c commit ef96b30

File tree

31 files changed

+2272
-112
lines changed

31 files changed

+2272
-112
lines changed

RELEASE_NOTES.md

Lines changed: 5 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -2,123 +2,16 @@
22

33
## Summary
44

5-
This release introduces several breaking changes, new features, and improvements to the existing API. The most significant changes include renaming and restructuring of the `components` package to `electrical_components`, the introduction of new diagnostic codes, and the addition of new messages for communication components and streaming events.
5+
<!-- Here goes a general summary of what this release is about -->
66

77
## Upgrading
88

9-
- Removed:
10-
11-
+ `microgrid.components.ComponentStatus`, use `microgrid.electrical_components.ElectricalComponentControlMode` instead
12-
+ `ComponentErrorCode.UNDERVOLTAGE_SHUTDOWN`, use `ElectricalComponentDiagnosticCode.UNDERVOLTAGE` instead
13-
+ `microgrid.sensors.SensorMetric`, use `metrics.Metric` instead
14-
+ `microgrid.sensors.SensorMetricSample`, use `metrics.MetricSample` instead
15-
+ `microgrid.sensors.SensorCategory`, since it was not useful and potentially confusing
16-
17-
Sensors can report different sensor metrics, and they could belong to several of these categories simultaneously. This defeats the purpose of having singular categories for sensors. Some more useful categorization may be introduced again in the future.
18-
19-
- Renamed several symbols to increase consistency and clarity:
20-
21-
+ `microgrid.components`:
22-
23-
* The whole package and all proto files, messages, field, enums were renamed to `electrical_components`
24-
* `ComponentCategoryMetadataVariant` to `ElectricalComponentCategorySpecificInfo`
25-
* `ComponentCategory` to `ElectricalComponentCategory`
26-
* `Component.category_type` to `ElectricalComponent.category_specific_info`
27-
* `ComponentCategoryMetadataVariant.metadata` to `ElectricalComponentCategorySpecificInfo.kind`
28-
* `ComponentErrorCode` to `ElectricalComponentDiagnosticCode`
29-
* `ComponentState` to `ElectricalComponentStateSnapshot`
30-
* `ComponentState.sampled_at` to `ElectricalComponentStateSnapshot.origin_time`
31-
* `ComponentData` to `ElectricalComponentTelemetry` (to better specify its purpose of encapsulating general telemetry data from electrical components)
32-
* `ComponentData.states` to `ElectricalComponentTelemetry.state_snapshots`
33-
* Grid-related terms to clarify their meaning and purpose:
34-
35-
+ `COMPONENT_CATEGORY_GRID` to `ELECTRICAL_COMPONENT_CATEGORY_GRID_CONNECTION_POINT`
36-
+ `ComponentCategoryMetadataVariant.metadata.grid` to `ElectricalComponentCategorySpecificInfo.kind.grid_connection_point`
37-
* `InverterType.INVERTER_TYPE_SOLAR` to `InverterType.INVERTER_TYPE_PV` (to align with the more colloquial term "PV inverter")
38-
* `ComponentCategory.COMPONENT_CATEGORY_RELAY` to `ElectricalComponentCategory.ELECTRICAL_COMPONENT_CATEGORY_BREAKER` (to better align with the common terminology used in electrical engineering).
39-
* All contents of all the files in the `electrical_components` directory (previously `components`) are now moved into the `electrical_components.proto` file.
40-
41-
+ `microgrid.sensors`:
42-
43-
* `SensorErrorCode` to `SensorDiagnosticCode`
44-
* `SensorData` to `SensorTelemetry` (to better specify its purpose of encapsulating general telemetry data from sensors)
45-
* `SensorState` to `SensorStateSnapshot`
46-
* `SensorData.states` to `SensorTelemetry.state_snapshots`
47-
* `SensorState.sampled_at` to `SensorStateSnapshot.origin_time`
48-
* `SensorStateCode.SENSOR_STATE_CODE_ON` to `SensorStateCode.SENSOR_STATE_CODE_OK` (to better indicate that we do not control on/off state of sensors)
49-
50-
+ `metrics`:
51-
52-
* The file `metric_sample.proto` to `metrics.proto`
53-
* `MetricSample.source` to `MetricSample.connection`
54-
* `MetricSample.sampled_at` to `sample_time`
55-
56-
+ `metrics.Metric`:
57-
58-
* The enum variants to follow a more consistent naming scheme of core-concept to modifier.
59-
* `METRIC_AC_APPARENT_POWER*` to `METRIC_AC_POWER_APPARENT*`
60-
* `METRIC_AC_ACTIVE_POWER*` to `METRIC_AC_POWER_ACTIVE*`
61-
* `METRIC_AC_REACTIVE_POWER*` to `METRIC_AC_POWER_REACTIVE*`
62-
* `METRIC_AC_APPARENT_ENERGY*` to `METRIC_AC_ENERGY_APPARENT*`
63-
* `METRIC_AC_ACTIVE_ENERGY*` to `METRIC_AC_ENERGY_ACTIVE*`
64-
* `METRIC_AC_REACTIVE_ENERGY*` to `METRIC_AC_ENERGY_REACTIVE*`
65-
66-
+ `types`:
67-
68-
* The whole package has been renamed to `type`.
69-
70-
- Renumbered some enum values to remove unnecessary gaps:
71-
72-
+ `microgrid.components.ComponentCategory` (`microgrid.electrical_components.ElectricalComponentCategory`)
73-
+ `microgrid.components.ComponentErrorCode` (`microgrid.electrical_components.ElectricalComponentDiagnosticCode`)
74-
+ `metrics.Metric`
75-
76-
- The minimum allowed version of `protobuf` and `grpcio` has been updated to 6.31.1 and 1.72.1 respectively, you might also need to bump your dependencies accordingly.
77-
78-
- The file `location.proto` has been moved to the `types` package, moving the message `Location` to `types.Location`.
79-
80-
- The type of the field `metrics.MetricSample.connection` has been changed from `string` to `metrics.MetricConnection`. The latter is a newly added message that provides a better categorization of the connection type.
81-
82-
- The `v1` package has been renamed to `v1alpha7`. The current `v1` package now consists of the contents the same directory from the v0.6.x branch, which is the latest stable version of the API.
83-
84-
- The enum `ComponentCategory` (now `ElectricalComponentCategory`) has been extended with new variants.
9+
<!-- Here goes notes on how to upgrade from previous versions, including deprecations and what they should be replaced with -->
8510

8611
## New Features
8712

88-
Added many new messages and enum values:
89-
90-
- `microgrid.communication_components`: Package with message definitions for communication components
91-
92-
+ `CommunicationComponentDiagnostic`: Message to represent warnings and errors in microgrid communication components
93-
+ `CommunicationComponentStateSnapshot`: Message to represent the state of communication components
94-
95-
- `microgrid.electrical_components` (previously `microgrid.components`)
96-
97-
+ `ElectricalComponentDiagnostic`: Message to represent warnings and errors in microgrid electrical components
98-
+ `ElectricalComponentDiagnosticCode` (previously `ComponentErrorCode`): New diagnostic codes to cover more cases, especially for inverters
99-
+ `InverterType.INVERTER_TYPE_WIND_TURBINE`: Enum value to represent wind turbine inverters
100-
101-
- `microgrid.ElectricalComponentCategory` (previously `microgrid.ComponentCategory`) has been extended with new enum values:
102-
+ `ELECTRICAL_COMPONENT_CATEGORY_PLC`
103-
+ `ELECTRICAL_COMPONENT_CATEGORY_STATIC_TRANSFER_SWITCH`
104-
+ `ELECTRICAL_COMPONENT_CATEGORY_UNINTERRUPTIBLE_POWER_SUPPLY`
105-
+ `ELECTRICAL_COMPONENT_CATEGORY_CAPACITOR_BANK`
106-
+ `ELECTRICAL_COMPONENT_CATEGORY_SMART_LOAD`
107-
+ `ELECTRICAL_COMPONENT_CATEGORY_WIND_TURBINE`
108-
109-
- `microgrid.sensors`
110-
111-
+ Message linking microgrid and sensor IDs
112-
+ `SensorDiagnostic`: Message to represent warnings and errors in microgrid sensors
113-
+ Added warnings to sensor `SensorState`
114-
115-
- `streaming`: Package with message definitions for streaming events
116-
117-
+ `Event`: Enum to represent different types of streaming events (Created, Deleted, Updated)
118-
119-
- `types`
120-
121-
+ `Interval`: Message to standardize time interval filtering across APIs
13+
- A new package `frequenz.api.common.v1alpha8` has been added.
12214

123-
This uses `start_time` (inclusive) and `end_time` (exclusive) fields, aligning with ISO 8601 and common programming conventions.
15+
## Bug Fixes
12416

17+
<!-- Here goes notable bug fixes that are worth a special mention or explanation -->
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
// Frequenz definitions of grids as entities participating in trading.
2+
//
3+
// Copyright 2025 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.v1alpha8.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: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
// Frequenz definitions of the time increment used for electricity
2+
// deliveries and trading.
3+
//
4+
// Copyright 2025 Frequenz Energy-as-a-Service GmbH
5+
//
6+
// Licensed under the MIT License (the "License");
7+
// you may not use this file except in compliance with the License.
8+
9+
syntax = "proto3";
10+
11+
package frequenz.api.common.v1alpha8.grid;
12+
13+
import "google/protobuf/timestamp.proto";
14+
15+
// DeliveryDuration represents the time increment, in minutes,
16+
// used for electricity deliveries and trading. These durations
17+
// serve as the basis for defining the delivery period in contracts,
18+
// and they dictate how energy is scheduled and delivered to meet
19+
// contractual obligations.
20+
//
21+
// !!! note "Compatibility Constraints"
22+
// Not all delivery durations are universally
23+
// compatible with all delivery areas or markets.
24+
//
25+
enum DeliveryDuration {
26+
// Default value, indicates that the duration is unspecified.
27+
DELIVERY_DURATION_UNSPECIFIED = 0;
28+
29+
// 5-minute duration
30+
DELIVERY_DURATION_5 = 1;
31+
32+
// 15-minute contract duration.
33+
DELIVERY_DURATION_15 = 2;
34+
35+
// 30-minute contract duration.
36+
DELIVERY_DURATION_30 = 3;
37+
38+
// 1-hour contract duration.
39+
DELIVERY_DURATION_60 = 4;
40+
}
41+
42+
// DeliveryPeriod represents the time period during which the contract
43+
// is delivered. It is defined by a start timestamp and a duration.
44+
message DeliveryPeriod {
45+
// Start UTC timestamp represents the beginning of the delivery period.
46+
// This timestamp is inclusive, meaning that the delivery period starts
47+
// from this point in time.
48+
//
49+
// !!! note
50+
// Delivery period start time constraints:
51+
// - 5-minute durations must start at times that are multiples of
52+
// 5 minutes past the hour.
53+
// - 15-minute durations must start at :00, :15, :30, or
54+
// :45 past the hour.
55+
// - 30-minute durations must start at :00 or :30 past the hour.
56+
// - 60-minute durations must start at :00 past the hour.
57+
google.protobuf.Timestamp start = 1;
58+
59+
// The length of the delivery period.
60+
DeliveryDuration duration = 2;
61+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Frequenz definitions of energy.
2+
//
3+
// Copyright 2025 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.v1alpha8.market;
11+
12+
import "frequenz/api/common/v1alpha8/type/decimal.proto";
13+
14+
// Represents a single unit of electricity.
15+
//
16+
// !!! note
17+
// The unit of energy is denominated in MWh, which is a unit of energy
18+
// representing total output over a period.(Megawatt-hours). This differs
19+
// from MW (Megawatts), a unit of power representing the rate of energy
20+
// production or consumption.
21+
message Energy {
22+
// Energy unit in Megawatthours (MWh).
23+
frequenz.api.common.v1alpha8.type.Decimal mwh = 1;
24+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Frequenz definitions of power.
2+
//
3+
// Copyright 2024 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.v1alpha8.market;
11+
12+
import "frequenz/api/common/v1alpha8/type/decimal.proto";
13+
14+
// Represents a single unit of power.
15+
//
16+
// !!! note
17+
// The power unit is denominated in MW (Megawatts), which is a unit of
18+
// power representing the rate of energy production or consumption at any
19+
// given moment. This differs from MWh (Megawatt-hours), which measures
20+
// the total amount of energy delivered or consumed over a period.
21+
//
22+
// Example:
23+
// A power plant running at 10 MW for 1 hour generates 10 MWh of energy.
24+
//
25+
// This message standardizes the representation of power in MW across all
26+
// market applications.
27+
message Power {
28+
// Power amount in Megawatts (MW).
29+
frequenz.api.common.v1alpha8.type.Decimal mw = 1;
30+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// Frequenz definitions of price for electricity trading.
2+
//
3+
// Copyright 2025 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.v1alpha8.market;
11+
12+
import "frequenz/api/common/v1alpha8/type/decimal.proto";
13+
14+
// Represents a monetary price for electricity trading, including
15+
// the amount and currency. The currency used should align with the
16+
// delivery area's standard currency.
17+
//
18+
// !!! caution "Validation Required"
19+
// It's essential to ensure that the currency aligns with the
20+
// standard currency of the associated delivery area. Failure to
21+
// do so may result in the API service rejecting the request due to currency
22+
// mismatches.
23+
//
24+
// !!! info "Relation to Delivery Area"
25+
// The currency specified is intrinsically related to the delivery area
26+
// for the contract. Make sure the chosen currency is compatible with
27+
// the delivery area's currency standards.
28+
//
29+
message Price {
30+
// List of supported currencies.
31+
//
32+
// !!! info "Extensibility"
33+
// New currencies can be added to this enum to support additional markets.
34+
enum Currency {
35+
CURRENCY_UNSPECIFIED = 0;
36+
CURRENCY_USD = 1;
37+
CURRENCY_CAD = 2;
38+
CURRENCY_EUR = 3;
39+
CURRENCY_GBP = 4;
40+
CURRENCY_CHF = 5;
41+
CURRENCY_CNY = 6;
42+
CURRENCY_JPY = 7;
43+
CURRENCY_AUD = 8;
44+
CURRENCY_NZD = 9;
45+
CURRENCY_SGD = 10;
46+
}
47+
48+
// The amount of the price.
49+
frequenz.api.common.v1alpha8.type.Decimal amount = 1;
50+
51+
// The currency in which the price is denominated.
52+
Currency currency = 2;
53+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Definitions for bounds.
2+
//
3+
// Copyright:
4+
// Copyright 2025 Frequenz Energy-as-a-Service GmbH
5+
//
6+
// License:
7+
// MIT
8+
9+
syntax = "proto3";
10+
11+
package frequenz.api.common.v1alpha8.metrics;
12+
13+
// A set of lower and upper bounds for any metric.
14+
// The units of the bounds are always the same as the related metric.
15+
message Bounds {
16+
// The lower bound.
17+
// If absent, there is no lower bound.
18+
optional float lower = 1;
19+
20+
// The upper bound.
21+
// If absent, there is no upper bound.
22+
optional float upper = 2;
23+
}

0 commit comments

Comments
 (0)