Skip to content

Docs: HA + Predbat setup as deployed, Python 3.12, systemd service - #51

Merged
piomar123 merged 1 commit into
mainfrom
docs-ha-predbat-setup
Oct 23, 2026
Merged

piomar123 merged 1 commit into
mainfrom
docs-ha-predbat-setup

Conversation

@piomar123

@piomar123 piomar123 commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

Why

I went through the README and MQTT_TOPICS.md as a newcomer would, starting from a fresh clone, before linking the repo on the elektrowoz.pl forum. The setup wouldn't have gone through:

  • Predbat rejects the documented apps.yaml: scheduled_charge_enable/scheduled_discharge_enable pointed at input_booleans, which its validation doesn't accept for entities it writes. Since 2026-09-28 production has wrapped them in template switches, but the docs never caught up.
  • pip install fails on Python 3.9 (click==8.5.0). The pins need 3.12+ because of numpy 2.5.2. Nothing said so.
  • The README step "Replace the rest of poor-man's config in main.py" is stale: everything is in .env now.
  • Several things a newcomer can't work out from the docs:
    • the example scripts.yaml had a script: key, which doesn't belong in that file;
    • the apps.yaml example only had the inverter part (no soc_percent, power sensors, prices, PV forecast or currency);
    • the docs pointed to my private HA repo.

What

  • MQTT_TOPICS.md, "Home Assistant + Predbat example": now matches what runs on my Pi.

  • README.MD:

    • Python 3.12+ and the tested hardware (GW8KN-ET + Pylontech Force H2);
    • the stale step is removed;
    • the Solcast east/west two-site assumption is noted;
    • a "Running as a service" section (the systemd user unit used on the Pi, plus linger) replaces the TODO.
  • README.MD, Predbat thresholds: the old note said Predbat's thresholds were tuned for pence and should be cut to ~0.001 against zł prices. That's wrong: Predbat multiplies start/end/value rate lists by 100 (fetch_octopus_rates in octopus.py), so it works in grosze and its defaults fit. Production keeps them and only sets metric_min_improvement_plan to 5.

Test plan

  • Fresh clone: git clone, then pip install -r requirements.txt. Fails on Python 3.9, works on 3.14. python main.py --dry-run with the stock .env.example (only the port changed) starts, and / returns 200.
  • YAML parses: every YAML block in MQTT_TOPICS.md loads with PyYAML; the apps.yaml fragment was wrapped under pred_bat: for that.
  • Matches production: the blocks were compared with the deployed configuration.yaml, scripts.yaml and apps.yaml.
  • Not tested end to end on a fresh HA + Predbat install.

🤖 Generated with Claude Code

MQTT_TOPICS.md's Predbat example pointed scheduled_*_enable at
input_booleans, which Predbat's apps.yaml validation rejects; it now uses
the template switch wrappers that run in production. Also: scripts.yaml
without the `script:` key, the full apps.yaml mapping (sensors, prices,
PV forecast, currency, sizes), freeze_charge passing target_soc, 3600 W
rate helpers, and no references to the author's private HA repo.

README: Python 3.12+ requirement, the stale "poor-man's config in
main.py" step removed (everything is in .env), the tested hardware, the
Solcast east/west assumption, and how to run it as a systemd user
service.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@piomar123
piomar123 merged commit bf5b99d into main Oct 23, 2026
1 check passed
@piomar123
piomar123 deleted the docs-ha-predbat-setup branch October 23, 2026 12:16
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.

1 participant