Skip to content

Conversation

@tiyash-basu-frequenz
Copy link
Contributor

The following changes have been made to the ElectricalComponentDiagnosticCode enum (previously ComponentErrorCode):

  • The code UNDERVOLTAGE_SHUTDOWN has been removed in favour of UNDERVOLTAGE.
  • New diagnostic codes have been added to cover more cases, especially for inverters.
  • The codes have been renumbered.

closes #231

This commit:
- Removes the diagnostic codes for `UNDERVOLTAGE_SHUTDOWN`, since it can
  be inferred from the `UNDERVOLTAGE` code.
- Moves the `EV_UNEXPECTED_PILOT_FAILURE` code to the EV section, since
  it is more relevant there.
- Renumbers the diagnostic codes for electrical components to ensure
  that they are in a logical order and do not overlap with the EV codes.

Signed-off-by: Tiyash Basu <[email protected]>
@tiyash-basu-frequenz tiyash-basu-frequenz added this to the 231 milestone May 23, 2025
@tiyash-basu-frequenz tiyash-basu-frequenz self-assigned this May 23, 2025
Copilot AI review requested due to automatic review settings May 23, 2025 15:01
@tiyash-basu-frequenz tiyash-basu-frequenz requested a review from a team as a code owner May 23, 2025 15:01
@github-actions github-actions bot added part:docs Affects the documentation part:protobuf Affects the protocol buffer definition files labels May 23, 2025
@tiyash-basu-frequenz tiyash-basu-frequenz removed this from the 231 milestone May 23, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the ElectricalComponentDiagnosticCode enum by renaming, renumbering, and adding new diagnostic codes to cover more electrical component scenarios, especially for inverter issues.

  • Removed the UNDERVOLTAGE_SHUTDOWN code in favor of UNDERVOLTAGE.
  • Renumbered existing codes and added new ones for leakage current, insulation resistance, grid voltage/frequency issues, and PV/inverter faults.
  • Updated the release notes to reflect these changes.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
proto/frequenz/api/common/v1/microgrid/electrical_components/electrical_components.proto Updated diagnostic code renumbering, removal of an outdated code, and addition of new fault codes.
RELEASE_NOTES.md Expanded release notes to document changes made to the ElectricalComponentDiagnosticCode enum.

The new codes help cover more cases for inverters.

Signed-off-by: Tiyash Basu <[email protected]>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refines the ElectricalComponentDiagnosticCode enum by removing an old undervoltage code, renumbering existing values, and adding a broad set of new diagnostic codes covering inverters, PV panels, EV components, grid faults, and more.

  • Remove UNDERVOLTAGE_SHUTDOWN and replace it with a more general undervoltage code
  • Renumber existing enum values to collapse gaps
  • Add new codes for leakage, grid conditions, PV faults, inverter DC limits, and EV scenarios

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
proto/frequenz/api/common/v1/microgrid/electrical_components/electrical_components.proto Removed old undervoltage shutdown code, renumbered entries, and added many new diagnostic codes
RELEASE_NOTES.md Updated release notes to describe the enum changes
Comments suppressed due to low confidence (3)

RELEASE_NOTES.md:45

  • Release notes mention replacing with UNDERVOLTAGE, but the code isn’t present. Please update the notes or add the new enum entry accordingly.
-    - The code `UNDERVOLTAGE_SHUTDOWN` has been removed in favour of `UNDERVOLTAGE`.

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

  • Many new diagnostic codes have been added; consider adding or updating unit tests to cover serialization, parsing, and handling of each new enum value.
// There is excessive leakage current in the component.

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

  • The PR removes UNDERVOLTAGE_SHUTDOWN in favor of a new UNDERVOLTAGE code, but I don’t see UNDERVOLTAGE defined. Please add the general UNDERVOLTAGE enum entry or clarify its replacement.
ELECTRICAL_COMPONENT_DIAGNOSTIC_CODE_FAULT_CURRENT = 14;

…lectrical_components.proto

Co-authored-by: Copilot <[email protected]>
Signed-off-by: thomas-nicolai-frequenz <[email protected]>
Copy link
Contributor

@thomas-nicolai-frequenz thomas-nicolai-frequenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@llucax llucax changed the title [Add new codes to ElectricalComponentDiagnosticCode enum Add new codes to ElectricalComponentDiagnosticCode enum May 26, 2025
@tiyash-basu-frequenz tiyash-basu-frequenz added this pull request to the merge queue May 28, 2025
Merged via the queue into frequenz-floss:v0.x.x with commit de9ac32 May 28, 2025
6 checks passed
@tiyash-basu-frequenz tiyash-basu-frequenz deleted the 231_inv_err_code branch May 28, 2025 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

part:docs Affects the documentation part:protobuf Affects the protocol buffer definition files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add inverter-specific error codes to ComponentErrorCode enum

3 participants