Skip to content

Commit 8908df4

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 8908df4

File tree

1 file changed

+40
-19
lines changed

1 file changed

+40
-19
lines changed

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

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -461,37 +461,58 @@ 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 component.
465+
//
466+
// This message extends a standardized error code with contextual information
467+
// useful for diagnostics, such as subsystem names, measured values, or vendor-specific insights.
468+
//
469+
// !!! example "Typical Component Error"
470+
// ```json
471+
// {
472+
// "errorCode": "ELECTRICAL_COMPONENT_ERROR_CODE_OVERTEMPERATURE",
473+
// "vendorErrorCode": 2003,
474+
// "message": "Temperature sensor 3 reported 61.5°C (limit: 60°C)"
475+
// }
476+
// ```
477+
//
478+
// !!! note "Component-Originated Diagnostics"
479+
// This message is intended to reflect diagnostics originating from electrical components
480+
// (e.g., inverters, batteries), either from internal firmware or via gateway logic.
481+
message ElectricalComponentError {
482+
// A standardized error code representing the category of the issue.
483+
ElectricalComponentErrorCode error_code = 1;
484+
485+
// Optional vendor-provided error code for the error, for vendor-specific insights or more
486+
// granular diagnostics.
487+
optional uint32 vendor_error_code = 2;
488+
489+
// Optional human-readable message providing additional context.
490+
string message = 3;
491+
}
492+
464493
// Representation of a component state and errors.
465494
message ElectricalComponentState {
466495
// The time at which the state was sampled.
467496
google.protobuf.Timestamp sampled_at = 1;
468497

469-
// List of states of the microgrid component.
498+
499+
// List of operational states currently active for the component.
470500
//
471501
// !!! note
472-
// The list will contain unique members. No state will exist twice in
473-
// this list.
502+
// The list must not contain duplicate state codes.
474503
repeated ElectricalComponentStateCode states = 2;
475504

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.
505+
// List of non-critical warnings detected for the component.
481506
//
482507
// !!! note
483-
// The list will contain unique members. No warning will exist twice in
484-
// this list.
485-
repeated ElectricalComponentErrorCode warnings = 3;
508+
// Warnings may be reported even when the component is operational.
509+
// No duplicate warning codes allowed.
510+
repeated ElectricalComponentError warnings = 3;
486511

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.
512+
// List of critical errors currently affecting the component.
492513
//
493514
// !!! note
494-
// The list will contain unique members. No error will exist twice in
495-
// this list.
496-
repeated ElectricalComponentErrorCode errors = 4;
515+
// This list is expected to be populated only when the component is in an error state.
516+
// No duplicate error codes allowed.
517+
repeated ElectricalComponentError errors = 4;
497518
}

0 commit comments

Comments
 (0)