Commit graph

4 commits

Author SHA1 Message Date
Michiel Berger
1878b0a383 Speed up /api/calculate from 75s to 17s on h4a's small VM
- ProcessPoolExecutor with fork context: 4 workers each inherit the
  scenario df via copy-on-write. linprog/HiGHS doesn't release the GIL
  so threads were useless; processes get clean ~3.5× speedup.
- Cross-scenario LP cache keyed on everything the LP depends on
  (demand, retail, PV size, saldering, η_rt) but NOT inflation or cost.
  Result: tweaking just inflation re-uses every LP — sub-100ms.

Cold cold scenario went 75s → 17s; inflation tweak went 17s → 10ms.
2026-04-30 15:15:20 +02:00
Michiel Berger
fa7a205eb7 deploy.sh: auto-refresh SSH host key when h4a recreates the VM 2026-04-30 15:02:47 +02:00
Michiel Berger
1d7574e0b2 Add plug-in-only filter to web app + deploy script
- Checkbox 'plug-in only (≤ 0.8 kW, no electrician)' filters the leaderboard
  client-side and re-picks the top recommendation from visible rows.
  Filter state is persisted in localStorage.
- scripts/deploy.sh: idempotent rsync + systemd setup against the
  'thuisbatterij' SSH alias. Run after provisioning the h4a workload.
2026-04-30 14:58:52 +02:00
Michiel Berger
60e0706736 Initial import: home-battery ROI simulator + cracked thuisbatterijgids calc
- Hourly data exporter (InfluxDB → CSV) for prices, P1, irradiance.
- LP-based 24h-foresight oracle dispatch with SoC-consistent state engine.
- Reverse-engineered thuisbatterijgids.nl formula (matches their quotes
  to within €0.50 across three battery configs).
- Catalog scraper for the 52 batteries on thuisbatterijgids.net via their
  /wp-json REST endpoint.
- Web app (Flask) that ranks every catalog battery by honest payback and
  contrasts with the store's quote, deployable via the included Procfile.
2026-04-30 13:46:27 +02:00