Move custom batteries from web.py into data/raw/extra_batteries.json

This commit is contained in:
Michiel Berger 2026-04-30 15:52:16 +02:00
parent d6a3d53a04
commit ae994a7ded
3 changed files with 25 additions and 22 deletions

1
.gitignore vendored
View file

@ -22,5 +22,6 @@ data/processed/*
!data/raw/solar_hourly.csv
!data/raw/thuisbatterijgids_catalog.csv
!data/raw/thuisbatterijgids_catalog.json
!data/raw/extra_batteries.json
.DS_Store

View file

@ -0,0 +1,17 @@
[
{
"id": -1,
"title": "Tesla Powerwall 3 (installed)",
"url": "https://www.tesla.com/powerwall",
"brand": "Tesla",
"brand_slug": "tesla",
"capacity": 13.5,
"power_continuous": 11500,
"price": 9500,
"price_per_kwh": 704,
"review_score": null,
"recommended": false,
"installation": "hybrid",
"image_url": ""
}
]

View file

@ -49,28 +49,13 @@ _AVG_CONSUMER_BASE = float(_BASE_DF["eur_per_kwh"].mean())
with open(DATA_DIR / "thuisbatterijgids_catalog.json") as _f:
_CATALOG = json.load(_f)
# Hybrid / DC-coupled units — not on thuisbatterijgids.net (they only list
# plug-in), but useful as a reference point. Prices are NL street price incl.
# a typical install (since these can't be self-installed). Mark with
# installation == "hybrid" so the LP runs with allows_export=True.
HYBRID_EXTRAS = [
{
"id": -1,
"title": "Tesla Powerwall 3 (installed)",
"url": "https://www.tesla.com/powerwall",
"brand": "Tesla",
"brand_slug": "tesla",
"capacity": 13.5,
"power_continuous": 11500,
"price": 9500,
"price_per_kwh": 704,
"review_score": None,
"recommended": False,
"installation": "hybrid",
"image_url": "",
},
]
_CATALOG = _CATALOG + HYBRID_EXTRAS
# Edit data/raw/extra_batteries.json to add anything not on thuisbatterijgids.net
# (hybrids, PV-DC-coupled units, alternative SKUs). Same schema as the scraped
# catalog; set "installation" to "hybrid" for batteries that can export to grid.
_EXTRAS_PATH = DATA_DIR / "extra_batteries.json"
if _EXTRAS_PATH.exists():
with open(_EXTRAS_PATH) as _f:
_CATALOG = _CATALOG + json.load(_f)
def _category(power_kw: float, allows_export: bool) -> str: