Skip to content

feat: Add inverter_limit_export to cap discharge rate during forced export only#3875

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/add-scale-down-export-rate
Draft

feat: Add inverter_limit_export to cap discharge rate during forced export only#3875
Copilot wants to merge 4 commits intomainfrom
copilot/add-scale-down-export-rate

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 6, 2026

inverter_limit_discharge caps discharge globally, including ECO mode. This adds inverter_limit_export to cap discharge rate exclusively during forced export windows while leaving ECO mode discharge unaffected.

New config option

inverter_limit_export:
  - 2000  # Watts; one entry per inverter

Defaults to inverter_limit_discharge (or inverter maximum) if not set.

Changes

  • config.py: New inverter_limit_export schema entry (per-inverter sensor list, integer, Watts)
  • inverter.py: Reads inverter_limit_export, stores as battery_rate_max_export (defaults to inverter_limit_discharge)
  • execute.py: Accumulates battery_rate_max_export across inverters; uses it (instead of battery_rate_max_discharge) when calling adjust_discharge_rate during forced export
  • prediction.py: Uses battery_rate_max_export as the discharge rate setting during export windows so the plan model matches actual behaviour; ECO-mode discharge continues to use battery_rate_max_discharge
  • predbat.py: Initialises battery_rate_max_export = 0 in reset()
  • Tests: Updated test_infra.py and test_execute.py to propagate the new field; added discharge_limit_export execute test asserting the rate is capped to the export limit rather than the full discharge limit
  • docs/apps-yaml.md: Documents the new option

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.octopus.energy
    • Triggering command: /home/REDACTED/work/batpred/batpred/coverage/venv/bin/python3 python3 ../apps/predbat/unit_test.py --quick (dns block)
    • Triggering command: /home/REDACTED/work/batpred/batpred/coverage/venv/bin/python3 python3 ../apps/predbat/unit_test.py --quick bin/rustc (dns block)
    • Triggering command: /home/REDACTED/work/batpred/batpred/coverage/venv/bin/python3 python3 ../apps/predbat/unit_test.py --quick git conf�� unset --global p/bin/git credential.helperustc (dns block)
  • gitlab.com
    • Triggering command: /usr/lib/git-core/git-remote-https /usr/lib/git-core/git-remote-https origin REDACTED owner --uid-owner 0 -j ACCEPT (dns block)
    • Triggering command: /usr/lib/git-core/git-remote-https /usr/lib/git-core/git-remote-https origin REDACTED conntrack --ctstate INVALID,NEW -j DROP (dns block)
    • Triggering command: /usr/lib/git-core/git-remote-https /usr/lib/git-core/git-remote-https origin REDACTED (dns block)
  • https://api.github.com/repos/springfall2008/batpred/contents/apps/predbat
    • Triggering command: /home/REDACTED/work/batpred/batpred/coverage/venv/bin/python3 python3 ../apps/predbat/unit_test.py --quick (http block)
    • Triggering command: /home/REDACTED/work/batpred/batpred/coverage/venv/bin/python3 python3 ../apps/predbat/unit_test.py --quick bin/rustc (http block)
    • Triggering command: /home/REDACTED/work/batpred/batpred/coverage/venv/bin/python3 python3 ../apps/predbat/unit_test.py --quick ps conf�� e-commit-hooks --global ndor/bin/bash HooksPath (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI and others added 3 commits May 6, 2026 08:01
… export

Agent-Logs-Url: https://github.com/springfall2008/batpred/sessions/0d18f601-6845-4146-97d7-c026fc93c39d

Co-authored-by: springfall2008 <48591903+springfall2008@users.noreply.github.com>
Agent-Logs-Url: https://github.com/springfall2008/batpred/sessions/0d18f601-6845-4146-97d7-c026fc93c39d

Co-authored-by: springfall2008 <48591903+springfall2008@users.noreply.github.com>
Copilot AI changed the title [WIP] Add ability to scale down max export rate during forced export feat: Add inverter_limit_export to cap discharge rate during forced export only May 6, 2026
Copilot AI requested a review from springfall2008 May 6, 2026 08:07
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.

feat: Add ability to scale down max export rate during forced export

2 participants