Skip to content

Commit c447367

Browse files
Add an ElectricalComponentError message
This commit adds the `ElectricalComponentError` message to the `electrical_components.proto` file. This message is designed to represent error or warning conditions reported by microgrid electrical components. It extends a standardized error code with contextual information useful for diagnostics or vendor-specific insights. Signed-off-by: Tiyash Basu <[email protected]>
1 parent dfce8fa commit c447367

File tree

2 files changed

+51
-19
lines changed

2 files changed

+51
-19
lines changed

RELEASE_NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
- Renamed `components` to `electrical_components` and related messages, fields, enums.
1414
- Added message linking microgrid and sensor IDs.
1515
- Added new message definitions for communication components.
16+
- Added new message `ElectricalComponentError` to represent errors in microgrid electrical components.
1617

1718
## Bug Fixes
1819

proto/frequenz/api/common/v1/microgrid/electrical_components/electrical_components.proto

Lines changed: 50 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -461,37 +461,68 @@ enum ElectricalComponentErrorCode {
461461
ELECTRICAL_COMPONENT_ERROR_CODE_RELAY_CYCLE_LIMIT_REACHED = 60;
462462
}
463463

464+
// Represents an error or warning condition reported by a microgrid electrical
465+
// component.
466+
//
467+
// This message extends a standardized error code with contextual information
468+
// useful for diagnostics, such as subsystem names, measured values, or
469+
// vendor-specific insights.
470+
//
471+
// !!! example "Typical Component Error"
472+
// ```json
473+
// {
474+
// "errorCode": "ELECTRICAL_COMPONENT_ERROR_CODE_OVERTEMPERATURE",
475+
// "vendorErrorCode": 2003,
476+
// "message": "Temperature sensor 3 reported 61.5°C (limit: 60°C)"
477+
// }
478+
// ```
479+
//
480+
// !!! note "Component-Originated Diagnostics"
481+
// This message is intended to reflect diagnostics originating from
482+
// electrical components (e.g., inverters, batteries), either from internal
483+
// firmware or via gateway logic.
484+
//
485+
// !!! note "Vendor-Specific Codes"
486+
// When available, `vendor_error_code` will reflect manufacturer-defined
487+
// error identifiers, typically exposed via Modbus or similar interfaces.
488+
// These codes are vendor- and firmware-specific and must be interpreted
489+
// using the vendor's official documentation.
490+
message ElectricalComponentError {
491+
// A standardized error code representing the category of the issue.
492+
ElectricalComponentErrorCode error_code = 1;
493+
494+
// Optional vendor-provided error code for the error, for vendor-specific
495+
// insights or more granular diagnostics.
496+
optional uint32 vendor_error_code = 2;
497+
498+
// Optional human-readable message providing additional context.
499+
string message = 3;
500+
}
501+
464502
// Representation of a component state and errors.
465503
message ElectricalComponentState {
466504
// The time at which the state was sampled.
467505
google.protobuf.Timestamp sampled_at = 1;
468506

469-
// List of states of the microgrid component.
507+
508+
// List of operational states currently active for the component.
470509
//
471510
// !!! note
472-
// The list will contain unique members. No state will exist twice in
473-
// this list.
511+
// The list must not contain duplicate state codes.
474512
repeated ElectricalComponentStateCode states = 2;
475513

476-
// List of warnings for the microgrid component.
477-
//
478-
// !!! note
479-
// This list may have warnings even if the component state is not in an
480-
// error state.
514+
// List of non-critical warnings detected for the component.
481515
//
482516
// !!! note
483-
// The list will contain unique members. No warning will exist twice in
484-
// this list.
485-
repeated ElectricalComponentErrorCode warnings = 3;
517+
// Warnings may be reported even when the component is operational.
518+
// No duplicate warning codes allowed.
519+
repeated ElectricalComponentError warnings = 3;
486520

487-
// List of errors for the microgrid component.
488-
//
489-
// !!! note
490-
// This list is expected to have errors if and only if the component is in
491-
// an error state.
521+
// List of critical errors currently affecting the component.
492522
//
493523
// !!! note
494-
// The list will contain unique members. No error will exist twice in
495-
// this list.
496-
repeated ElectricalComponentErrorCode errors = 4;
524+
// This list is expected to be populated only when the component is in an
525+
// error state.
526+
// No duplicate error codes allowed.
527+
repeated ElectricalComponentError errors = 4;
497528
}

0 commit comments

Comments
 (0)