ListAcInError: show error code for all energy meters, not just Fronius/CG#2816
Open
cgoudie wants to merge 1 commit intovictronenergy:mainfrom
Open
ListAcInError: show error code for all energy meters, not just Fronius/CG#2816cgoudie wants to merge 1 commit intovictronenergy:mainfrom
cgoudie wants to merge 1 commit intovictronenergy:mainfrom
Conversation
…s/CG The error code row was previously only visible for Fronius PV inverters and Carlo Gavazzi energy meters (hard-coded ProductId check). Third-party energy meter drivers that publish /ErrorCode were unable to surface errors in the GUI. This change makes the error row visible for any device that publishes a non-zero /ErrorCode, while preserving existing Fronius and Carlo Gavazzi behaviour unchanged. Additionally, a new optional /ErrorMessage D-Bus path is supported. When a device publishes both /ErrorCode and /ErrorMessage, the GUI displays "<message> (<code>)" (e.g. "Open Neutral (5)"). Devices that only publish /ErrorCode still get the raw numeric code displayed. Co-authored-by: Cursor <cursoragent@cursor.com>
974d6a6 to
6a9181a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ListAcInError.qmlis currently only visible for Fronius PV inverters and Carlo Gavazzi energy meters (hard-codedProductIdcheck). Third-party energy meter drivers (e.g.com.victronenergy.gridservices) that publish/ErrorCodecannot surface errors in the device page./ErrorCode, while preserving existing Fronius and Carlo Gavazzi behaviour unchanged./ErrorMessageD-Bus path. When a device publishes both/ErrorCodeand/ErrorMessage, the GUI displays"<message> (<code>)"(e.g."Open Neutral (5)"). Devices that only publish/ErrorCodeget the raw numeric code displayed, matching the existing Fronius behaviour.Motivation
We maintain a Venus OS driver (dbus-power-watchdog) for Hughes Power Watchdog energy meters. These devices report error codes (0-9) via BLE, which the driver publishes to
/ErrorCodeon itscom.victronenergy.gridservice. However, the error code is invisible on the Cerbo GX display becauseListAcInError.qmlonly renders the row for two specific product IDs.As a workaround we currently set our
/ProductIdto the Fronius value (0xA142) to make the error visible. This PR would let us (and other third-party drivers) use our own product ID while still having errors shown in the GUI.Changes
components/listitems/ListAcInError.qmlelsebranch after the Fronius and Carlo Gavazzi checks — shows the raw error code for any other productpreferredVisibleto includedataItem.valid && dataItem.value > 0(non-zero error code present) anderrorMessage.valid(device has a status message)VeQuickItembinding to/ErrorMessage— an optional D-Bus path that devices can publish to provide a human-readable error descriptionBackward compatibility
/ErrorCode > 0or/ErrorMessageis non-empty; hidden otherwiseTest plan
/ErrorCode = 5shows "5" in the error row/ErrorCode = 5and/ErrorMessage = "Open Neutral"shows "Open Neutral (5)"/ErrorCode = 0(no error) hides the error row/ErrorCodepath does not show the error row