@@ -461,37 +461,62 @@ 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+ message ElectricalComponentError {
485+ // A standardized error code representing the category of the issue.
486+ ElectricalComponentErrorCode error_code = 1 ;
487+
488+ // Optional vendor-provided error code for the error, for vendor-specific
489+ // insights or more granular diagnostics.
490+ optional uint32 vendor_error_code = 2 ;
491+
492+ // Optional human-readable message providing additional context.
493+ string message = 3 ;
494+ }
495+
464496// Representation of a component state and errors.
465497message ElectricalComponentState {
466498 // The time at which the state was sampled.
467499 google.protobuf.Timestamp sampled_at = 1 ;
468500
469- // List of states of the microgrid component.
501+
502+ // List of operational states currently active for the component.
470503 //
471504 // !!! note
472- // The list will contain unique members. No state will exist twice in
473- // this list.
505+ // The list must not contain duplicate state codes.
474506 repeated ElectricalComponentStateCode states = 2 ;
475507
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.
508+ // List of non-critical warnings detected for the component.
481509 //
482510 // !!! note
483- // The list will contain unique members. No warning will exist twice in
484- // this list .
485- repeated ElectricalComponentErrorCode warnings = 3 ;
511+ // Warnings may be reported even when the component is operational.
512+ // No duplicate warning codes allowed .
513+ repeated ElectricalComponentError warnings = 3 ;
486514
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.
515+ // List of critical errors currently affecting the component.
492516 //
493517 // !!! note
494- // The list will contain unique members. No error will exist twice in
495- // this list.
496- repeated ElectricalComponentErrorCode errors = 4 ;
518+ // This list is expected to be populated only when the component is in an
519+ // error state.
520+ // No duplicate error codes allowed.
521+ repeated ElectricalComponentError errors = 4 ;
497522}
0 commit comments