Skip to content

Solis: keep a PV-only inverter in pv_today/pv_power (#4922) - #4923

Merged
springfall2008 merged 1 commit into
mainfrom
fix/solis-pv-only-inverter-pv-totals-4922
Sep 4, 2026
Merged

Solis: keep a PV-only inverter in pv_today/pv_power (#4922)#4923
springfall2008 merged 1 commit into
mainfrom
fix/solis-pv-only-inverter-pv-totals-4922

Conversation

@springfall2008

Copy link
Copy Markdown
Owner

This is an automated draft PR generated from issue #4922 — a maintainer should review it before merging.

Fixes #4922

Summary

SolisAPI.automatic_config() built one devices list from the battery-filtered inverters and used it for every arg, so an inverter Solis Cloud reports as having no battery was dropped from the PV totals as well as from battery control. pv_today/pv_power now use a separate pv_devices list covering every discovered inverter — Predbat sums those arg lists, so a PV-only inverter's generation is simply added to the array total. Nothing else changes: num_inverters, inverter_type and all control/battery args stay battery-only, so a PV-only inverter is still never written to.

Per the maintainer's note on the issue, this is the PV half only. load_today/load_power/import_today/export_today/grid_power deliberately stay on the battery inverters, since on a shared-CT installation those registers can overlap between inverters and summing them would risk double-counting. A one-line log names any battery-less inverters folded into the PV totals, and docs/components.md records the split (including the solis_cloud_pv_load_ignore escape hatch for sites that need something different).

Testing

  • cd coverage && ./run_pre_commit — all hooks Passed, and the quick suite it runs reported All tests passed (4 slow tests skipped, total time: 107.37s).
  • tools/triage_test.sh solis — exit 0, All tests passed.

Two new tests in apps/predbat/tests/test_solis.py (both registered in run_solis_tests()):

  • test_automatic_config_keeps_no_battery_inverter_in_pv_totals — a two-inverter site with one "No Battery" unit gets both inverters in pv_today/pv_power, while soc_percent, charge_limit, reserve, grid_power, load_today, load_power, import_today and export_today stay on the battery inverter alone.
  • test_automatic_config_pv_totals_unchanged_when_all_have_batteries — with no PV-only inverter present the PV args are unchanged and the new log line is not emitted.

@springfall2008 springfall2008 self-assigned this Sep 3, 2026
@springfall2008 springfall2008 added the BOT_REVIEW Trigger an autotriage label Sep 3, 2026
Comment thread apps/predbat/solis.py
Comment thread apps/predbat/solis.py
Comment thread apps/predbat/solis.py
Comment thread apps/predbat/solis.py
Comment thread apps/predbat/solis.py
Comment thread docs/components.md
Comment thread apps/predbat/tests/test_solis.py
Comment thread apps/predbat/solis.py
@springfall2008 springfall2008 removed the BOT_REVIEW Trigger an autotriage label Sep 3, 2026
@springfall2008
springfall2008 marked this pull request as ready for review September 3, 2026 18:57
Copilot AI lite review requested due to automatic review settings September 3, 2026 18:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The updated Solis documentation guidance omits load_power from the manual-override instructions for solis_cloud_pv_load_ignore, which can mislead users into an incomplete configuration.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR fixes Solis Cloud auto-configuration so PV-only inverters (reported by Solis Cloud as having no battery) are still included in pv_today / pv_power totals, while remaining excluded from battery/control and load/grid-related arguments to avoid double-counting on shared-CT installations.

Changes:

  • Split Solis device selection so pv_today/pv_power use all discovered inverters while control/battery args stay battery-only, and emit a log line when PV-only devices are included in PV totals.
  • Add Solis unit tests covering both the mixed battery + PV-only scenario and the all-battery scenario.
  • Document the PV-only inverter behavior in the Solis component docs.
File summaries
File Description
docs/components.md Documents the PV-only inverter split between PV totals vs battery/control/load/grid behavior.
apps/predbat/solis.py Adjusts automatic_config() to include PV-only inverters in PV totals without enrolling them as battery inverters.
apps/predbat/tests/test_solis.py Adds regression tests for the new PV totals behavior and logging.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/components.md
- Leave `soc_max` unset and allow Predbat to automatically detect battery size from historical charging data (requires several days of data)
- Supports both V1 (older firmware) and V2 (newer firmware) time window formats
- Automatic configuration available - sets up all required Predbat sensors automatically
- **PV-only inverters**: an inverter Solis Cloud reports as having no battery is never managed as a battery inverter and is never written to, but its generation is still included in `pv_today` and `pv_power` so the array total covers the whole roof. Its load and grid readings are left out, as those registers can overlap with the battery inverter's on a shared-CT installation - set `pv_today`/`pv_power`/`load_today` manually with `solis_cloud_pv_load_ignore: true` if you need something different
@springfall2008
springfall2008 merged commit b4bab6b into main Sep 4, 2026
3 checks passed
@springfall2008
springfall2008 deleted the fix/solis-pv-only-inverter-pv-totals-4922 branch September 4, 2026 08:09
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.

[Solis Cloud] A PV-only inverter is dropped from pv_today/pv_power as well as from battery control

2 participants