Skip to content

ListAcInError: show error code for all energy meters, not just Fronius/CG#2816

Open
cgoudie wants to merge 1 commit intovictronenergy:mainfrom
TechBlueprints:generic-error-code-display
Open

ListAcInError: show error code for all energy meters, not just Fronius/CG#2816
cgoudie wants to merge 1 commit intovictronenergy:mainfrom
TechBlueprints:generic-error-code-display

Conversation

@cgoudie
Copy link

@cgoudie cgoudie commented Feb 15, 2026

Summary

  • The error code row in ListAcInError.qml is currently only visible for Fronius PV inverters and Carlo Gavazzi energy meters (hard-coded ProductId check). Third-party energy meter drivers (e.g. com.victronenergy.grid services) that publish /ErrorCode cannot surface errors in the device page.
  • 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.
  • Adds support for an optional /ErrorMessage D-Bus path. When a device publishes both /ErrorCode and /ErrorMessage, the GUI displays "<message> (<code>)" (e.g. "Open Neutral (5)"). Devices that only publish /ErrorCode get 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 /ErrorCode on its com.victronenergy.grid service. However, the error code is invisible on the Cerbo GX display because ListAcInError.qml only renders the row for two specific product IDs.

As a workaround we currently set our /ProductId to 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.qml

  1. Added a generic else branch after the Fronius and Carlo Gavazzi checks — shows the raw error code for any other product
  2. Extended preferredVisible to include dataItem.valid && dataItem.value > 0 (non-zero error code present) and errorMessage.valid (device has a status message)
  3. Added a VeQuickItem binding to /ErrorMessage — an optional D-Bus path that devices can publish to provide a human-readable error description

Backward compatibility

  • Fronius: Unchanged — still shows raw error code, always visible
  • Carlo Gavazzi: Unchanged — still shows translated messages, always visible
  • All other devices: Error row appears only when /ErrorCode > 0 or /ErrorMessage is non-empty; hidden otherwise
  • No changes to any other files

Test plan

  • Verify Fronius PV inverter error display is unchanged
  • Verify Carlo Gavazzi energy meter error display is unchanged
  • Verify a third-party grid meter publishing /ErrorCode = 5 shows "5" in the error row
  • Verify a third-party grid meter publishing /ErrorCode = 5 and /ErrorMessage = "Open Neutral" shows "Open Neutral (5)"
  • Verify a third-party grid meter publishing /ErrorCode = 0 (no error) hides the error row
  • Verify a device with no /ErrorCode path does not show the error row

…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>
@cgoudie cgoudie force-pushed the generic-error-code-display branch from 974d6a6 to 6a9181a Compare February 15, 2026 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant