Skip to content

Feature: Native Solar Clipping Buffer (Resolves #1206)#4036

Open
rholligan wants to merge 1 commit into
springfall2008:mainfrom
rholligan:clipping-buffer
Open

Feature: Native Solar Clipping Buffer (Resolves #1206)#4036
rholligan wants to merge 1 commit into
springfall2008:mainfrom
rholligan:clipping-buffer

Conversation

@rholligan

Copy link
Copy Markdown

Resolves #1206. This PR introduces a native clipping buffer to Predbat. It prevents solar energy loss on high-generation days by reserving a dynamic buffer in the battery SoC, specifically targeting periods where PV generation is forecast to exceed inverter AC capacity or DNO export limits.

image

Key Features:

  • Dynamic Buffer Calculation: Computes the required buffer (sensor.predbat_clipping_buffer_kwh) based on the solar forecast area exceeding the "Effective
    Clipping Limit" (choosing the most restrictive hardware or DNO constraint).
  • Grid-Charge Capping: Restricts overnight grid charging to ensure headroom for the calculated buffer.
  • Proactive Risk Management: Includes a two-stage safety system. It uses a risk_threshold (trigger) and a configurable clipping_buffer_safety_margin
    (default 5% of window solar) to protect against un-forecasted cloud-edge spikes.
  • Dynamic Buffer Decay: Reserved space shrinks as the solar peak passes, releasing capacity for evening use.
  • Web UI Integration: Adds a "Clipping Analysis" chart to the Predbat Web UI, displaying PV curves, clipping ceilings, and the decaying buffer.
  • Improved Peak Reporting: Refined the clipping status text to report the actual high-risk generation period (minutes exceeding the limit) rather than the broad protection window, providing clearer information for the user.

Configuration Parameters:

  • clipping_buffer_enable: Master toggle.
  • clipping_buffer_forecast: Selection of forecast model (recommends pv_clearsky).
  • clipping_buffer_safety_margin: Percentage of window solar to reserve as a safety factor (default 0.05).
  • clipping_buffer_risk_threshold: Sensitivity factor to trigger the safety margin logic (default 0.80).
  • clipping_buffer_can_discharge: Discharge behavior (None, Cost Optimal, or Always).
  • clipping_buffer_min_kwh / max_kwh: Manual size constraints.
  • clipping_buffer_limit_override: Manual power threshold override (Watts).

Testing & Documentation:

  • Verified on live 5kW hardware; effectively mitigated 6.28kW solar spikes by holding battery headroom.
  • Includes unit tests in apps/predbat/tests/test_clipping.py.
  • Full feature documentation available in docs/clipping.md.

Developed with Gemini ✦

This PR introduces a native clipping buffer to Predbat. It prevents solar energy loss on high-generation days by reserving a dynamic buffer in the battery SoC, specifically targeting periods where PV generation is forecast to exceed inverter AC capacity or DNO export limits. Resolves springfall2008#1206.
@tieskuh

tieskuh commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Cross-referencing #4023 (Model curtailment on a negative export price) — our PRs look complementary and touch some of the same files, so flagging for coordination.

#4023 This PR (#4036)
Trigger export price is negative (rate-conditional) PV exceeds a power limit (inverter AC / DNO export)
Goal avoid a phantom export cost + keep PV calibration clean avoid solar lost to clipping
Approach modelling-only (models the curtailment) active control (reserves battery SoC headroom)
Related issue #3986 #1206 (+ #3442 / #3481 / #3828)

Yours handles clipping against a power limit with active SoC buffering; mine models price-driven curtailment and keeps PV calibration clean (modelling-only). We overlap in prediction.py / solcast.py / output.py / config.py and the tests, so whichever merges second will need a rebase. Happy to rebase mine on top if yours lands first.

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.

Clipping Buffer (hybrid inverter)

2 participants