Skip to content

SolaX Growatt wizard discovers off-grid EMS Discharging Stop SOC instead of on-grid sensor #270

Description

@johanzander

Description

Reported by a beta user (Markus Eriksson): the setup wizard's auto-discovery for SolaX/Growatt GEN4 modbus selects the off-grid "EMS Discharging Stop SOC" sensor instead of the on-grid one, requiring manual correction after the wizard runs.

Root cause

The upstream solax_modbus integration (wills106/homeassistant-solax-modbus, Growatt plugin) exposes two separate registers:

  • ems_discharging_stop_soc — off-grid, register 3037
  • ems_discharging_stop_soc_on_grid — on-grid, register 3067 (newer firmware)

Our discovery suffix map SOLAX_GROWATT_MIN_SUFFIX_MAP in core/bess/ha_api_controller.py:548 only contains an entry for the off-grid key:

"ems_discharging_stop_soc": "battery_discharge_stop_soc",

There is no entry for ems_discharging_stop_soc_on_grid. Matching is done via unique_id.endswith(f"_{suffix}") (ha_api_controller.py:2892), which is intentionally suffix-based rather than full-unique_id-based because the SolaX device name prefix is user-configurable — the register key is the only invariant part of the unique_id. Since the on-grid suffix isn't in the map at all, the on-grid sensor can never be matched; the wizard always resolves to the off-grid one.

Fix

Add "ems_discharging_stop_soc_on_grid": "battery_discharge_stop_soc" to SOLAX_GROWATT_MIN_SUFFIX_MAP, and remove or otherwise deprioritize the off-grid mapping so it isn't silently chosen on on-grid installs (needs a decision on how to prefer on-grid vs off-grid when both entities exist — likely prefer on-grid if present, fall back to off-grid otherwise).

Evidence

  • core/bess/ha_api_controller.py:548 (missing suffix map entry)
  • core/bess/ha_api_controller.py:2892 (suffix matching logic)
  • Design-doc comment at core/bess/ha_api_controller.py:346 documents the intended target as solax_ems_discharging_stop_soc, confirming the on-grid variant was an original oversight, not a matcher bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions