Skip to content

Commit 58c09c4

Browse files
Add SensorDiagnostic message to represent sensor errors
This commit introduces the `SensorDiagnostic` message to represent errors and warnings reported by microgrid sensors. This message extends a standardized error code with contextual information useful for diagnostics, such as subsystem names, measured values, or vendor-specific insights. Signed-off-by: Tiyash Basu <[email protected]>
1 parent 2e89add commit 58c09c4

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

RELEASE_NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
- Added new message definitions for communication components.
1616
- Added new message `ElectricalComponentDiagnostic` to represent warnings and errors in microgrid electrical components.
1717
- The enum `ComponentErrorCode` has now been renamed to `ElectricalComponentDiagnosticCode` to better reflect its shared usage with warnings and errors.
18+
- Added new message `SensorDiagnostic` to represent warnings and errors in microgrid sensors.
1819

1920
## Bug Fixes
2021

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

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,38 @@ message SensorData {
149149
repeated SensorState states = 3;
150150
}
151151

152+
// Represents an error or warning condition reported by a microgrid sensor.
153+
//
154+
// This message extends a standardized error code with contextual information
155+
// useful for diagnostics, such as subsystem names, measured values, or
156+
// vendor-specific insights.
157+
//
158+
// !!! example "Typical Sensor Error"
159+
// ```json
160+
// {
161+
// "errorCode":
162+
// "SENSOR_ERROR_CODE_INTERNAL",
163+
// "vendorErrorCode": 2003,
164+
// "message": "Temperature sensor 3 reported 61.5°C (limit: 60°C)"
165+
// }
166+
// ```
167+
// !!! note "Vendor-Specific Codes"
168+
// When available, `vendor_error_code` will reflect manufacturer-defined
169+
// error identifiers, typically exposed via Modbus or similar interfaces.
170+
// These codes are vendor- and firmware-specific and must be interpreted
171+
// using the vendor's official documentation.
172+
message SensorDiagnostic {
173+
// A standardized error code representing the category of the issue.
174+
SensorErrorCode error_code = 1;
175+
176+
// Optional vendor-provided error code for the error, for vendor-specific
177+
// insights or more granular diagnostics.
178+
optional uint32 vendor_error_code = 2;
179+
180+
// Optional human-readable message providing additional context.
181+
string message = 3;
182+
}
183+
152184
// Representation of a sensor state and errors.
153185
message SensorState {
154186
// The time at which the state was sampled.
@@ -170,7 +202,7 @@ message SensorState {
170202
// !!! note
171203
// The list will contain unique members. No error will exist twice in
172204
// this list.
173-
repeated SensorErrorCode errors = 4;
205+
repeated SensorDiagnostic errors = 4;
174206
}
175207

176208
// Enum to represent the various states that a sensor can be in.

0 commit comments

Comments
 (0)