Skip to content

feat(pumps): expose VSP power and pump diagnostics#147

Open
tonyfruzza wants to merge 3 commits into
cryptk:mainfrom
tonyfruzza:feat/pump-power-diagnostics
Open

feat(pumps): expose VSP power and pump diagnostics#147
tonyfruzza wants to merge 3 commits into
cryptk:mainfrom
tonyfruzza:feat/pump-power-diagnostics

Conversation

@tonyfruzza
Copy link
Copy Markdown

Summary

Implements issue #99 by adding pump-focused diagnostics support and exposing power usage for VSP feature pumps.

Closes #99

What changed

  • Added power parsing to TelemetryPump (@power) with default 0
  • Added Pump.power property so power is available when using the library directly
  • Added OmniLogicAPI.async_get_pump_diagnostics() as a discoverable alias for pump diagnostics
  • Added CLI command: omnilogic debug get-pump-diagnostics <bow_id> <equip_id>
  • Improved parsed diagnostics output for both:
    • debug get-filter-diagnostics
    • debug get-pump-diagnostics

When not using --raw, diagnostics now prints:

  • Power: <watts> W
  • Drive Rev: <revision>
  • Display Rev: <revision>
  • Error: No errors detected (or status code)

Why this solves #99

Feature pumps that are VSPs can now be read similarly to filters:

  • power usage is exposed through Pump.power
  • diagnostics are available via pump-specific API + CLI paths

This enables flows like Node-RED / dashboards to show values similar to the OmniLogic app (e.g. 541 W).

Testing

Added tests in tests/test_api.py for:

  • pump diagnostics request XML generation
  • diagnostics decoding (541 W, Display Rev 10.1.7, Drive Rev 1.0A, no-error summary)
  • telemetry pump power parsing

I could not run pytest in this environment because pytest is not installed on this host.

- Parse pump power from telemetry (@power) and expose Pump.power
- Add async_get_pump_diagnostics API alias for VSP feature pumps
- Add debug get-pump-diagnostics CLI command
- Decode diagnostics power/revision/error into human-readable fields
- Add tests for pump diagnostics request and power parsing

Closes cryptk#99
@tonyfruzza
Copy link
Copy Markdown
Author

tonyfruzza commented May 19, 2026

Real-world validation note from a live OmniLogic system (firmware 5.1.85):

  • Pool filter pump (BOW=1, system_id=3) running at 70% reports
  • App diagnostics shows matching-style values: Drive Rev , Display Rev , Error

Additional observation: the current diagnostics request () returned a different computed power from on this system (1345W), while telemetry power was 541W. So telemetry appears to align better with the UI power number for this equipment.

@tonyfruzza
Copy link
Copy Markdown
Author

Follow-up with clean real-world validation data from a live OmniLogic system (firmware 5.1.85):

  • Pool filter pump: BOW=1, system_id=3
  • Pump speed: 70%
  • Telemetry reading from get filters: power = 541 W
  • App diagnostics style values observed: Drive Rev 1.0A, Display Rev 10.1.7, Error No Errors detected

Additional observation: On this system, power derived from diagnostics bytes (PowerMSB/PowerLSB from GetUIFilterDiagnosticInfo) did not match telemetry power (diagnostics computed to 1345 W while telemetry showed 541 W).

So telemetry power appears to align better with the UI power value for this equipment.

@tonyfruzza
Copy link
Copy Markdown
Author

Added follow-up refactor commit 8bc1e91 to reduce duplication while preserving the pump-power feature:\n\n- Consolidated repeated diagnostics CLI output into a shared helper\n- Removed duplicated overload boilerplate on pump diagnostics wrapper\n- Parameterized near-identical diagnostics XML tests\n\nThis was done specifically to address Sonar duplication on new code. If Sonar does not auto-run, please re-run analysis on the updated head.

@sonarqubecloud
Copy link
Copy Markdown

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.

Pumps can be VSPs as well as features

1 participant