Skip to content

Investigate: Constant Flow setpoint readback via get_mode() may be unreliable/mis-scaled #28

Description

@eman

Origin

Companion issue to eman/esphome-alpha-hwr#44, filed against this repo because the code path involved is shared with the ESPHome port (which cites this file's line numbers directly in its own comments).

Problem

Note: the "pump runs at a fixed RPM regardless of the Constant Flow setpoint" symptom reported in esphome-alpha-hwr#23/#44 is the same root cause as #27 (start()/set_mode() hardcoding a default 3671.0 suffix) and doesn't need a separate fix here — set_constant_flow() already passes its value_m3h argument through explicitly (services/control.py:646-649), so it does not hit the default-suffix bug.

This issue is narrower: whether get_mode()'s setpoint readback is reliable for Constant Flow mode specifically. The ESPHome-side report observed, after switching to Constant Flow, a setpoint readout roughly three orders of magnitude off from a plausible value (0.003056 gal/min displayed setpoint vs 3.940 gal/min measured flow rate). Since the ESPHome port's get_mode_async() is a direct port of this client's get_mode(), the same potential issue may exist here.

Research findings

  • get_mode() (services/control.py:370-556) reads the setpoint for every control mode from the same shared Class 10 register, Object 86 / Sub 6 (the "overall operation local request" object), and applies a Pa→m conversion only for pressure-family modes (services/control.py:441-450). Speed (RPM) and flow (m³/h) setpoints are passed through with no conversion, which is consistent with how they're written by set_constant_speed()/set_constant_flow() (also no conversion) — so no unit-mismatch bug is evident from static review.
  • However, the pump's measured flow rate is read from a different register: Class 93 (0x5D) / SubID 290, TelemetryObject.FLOW_PRESSURE = (0x005D, 0x0122) (src/alpha_hwr/constants.py:72), documented in resources/GRUNDFOS_APP_BLE_DATA_MAPPING.md:198-199, 467-470 as "Verified: Extended Flow (Flow, Head, Pressure)" from the decompiled Grundfos GO app. This raises the open question of whether Object 86/Sub 6 reliably reflects a valid absolute flow setpoint in Constant Flow mode the way it clearly does for pressure/speed, or whether it can return a stale/differently-scaled value in this mode specifically.
  • This has not been confirmed against a real pump from this repo's side — it's a plausible, code-supported hypothesis surfaced by the esphome-side bug report, not an independently reproduced bug here.

Suggested next step

Bench-verify with a real pump: call set_constant_flow(x) for a known x, then dump the raw bytes from get_mode()'s Object 86/Sub 6 read (services/control.py:407-419, already logged at debug level via logger.debug(f"Raw setpoint data: {data.hex()} ...")) and compare the decoded setpoint against both the commanded value and the Class 93/290 measured flow reading, to confirm whether the register is trustworthy for flow setpoints.

References

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