Ask in the forum

PV Forecast — 7-day site PV yield

GET /v1/plant/pv-forecast — 7-day solar yield (kWh). Loxone: PV Forecast guide. Open REST; Community 200 billable requests/day (PV counts toward the same Fair Use pool — poll hourly).

What this does

PV Forecast estimates how much solar energy your plant will produce at your site over the next days — in kWh per day (optionally hourly).

Everyday example: “Today about 18 kWh, tomorrow 22 kWh, the day after only 8 kWh under clouds.”

Same estimate engine as Plant outlook and Hours Demand — not a second calculator. After Hours Decide the server stores a PV pack with model FC (daily/hourly + pv_hash). GET and outlook prefer a fresh pack (≤6 h, same profile, weather not newer / cache not midday-stale, hours present, days[0] = today). Serve: With an optional PV yield meter, D0 (today) on GET/loxone.d0_kwh and Portal/Sparvo is actual + forecast (same calendar meter blend, keyed by calendar date); later days and pv_hash stay model FC. loxone.d0_soc_eod / txt_d0 SoC are re-rolled from the current live SoC on every GET and on SOC telemetry. PV and planned grid kWh of the open hour count only the minutes still ahead; load in that hour stays whole. When the estimate is recomputed (e.g. after an Open-Meteo refresh), the server writes the pack (FC) again — display follows the serve blend. If the live estimate fails after invalidate, an age-ok pack (fingerprint + ≤6 h) is still served — Serve aligns D0 to today (pad/strip; missing today → synthetic D0); no hard weather_missing while the pack still matches. Kill HOURS_PV_METER_REFINE=0 → no scale; actual is still painted.

When to use

  • Smart-home displays (e.g. Loxone memories “today / tomorrow …”)
  • Scripts that need expected PV yield

Not needed if you only want electricity prices → Forecast.

Endpoint


GET https://api.spotpriceapi.com/v1/plant/pv-forecast

Header:


X-API-Key: sf_live_YOUR_KEY

At least Community access. Anonymous basic key → pv_status: not_available.

Query parameters

ParameterDefaultValuesMeaning
granularitydailydaily \hourly \
days71…7Calendar days from today in the response (days/hours/totals); live estimate + pack always store 7 FC days (a short query does not zero-fill the pack)
timezoneprofile / Europe/ViennaIANADay boundaries; on pack serve the JSON timezone follows pack/serve TZ (query does not override day boundaries)
localefrom TZe.g. de, enportal_hint language

Location & kWp from the portal

Geo and plant size come from the plant profile of your API key — not from the query.

Under Location & profile set:

  • Address / coordinates (on save, coordinates are checked/filled from the address when needed)
  • PV size (kWp)

Missing data → pv_status: incomplete_input plus portal_hint and portal_url.

Situationpv_statusWhat to do
Lat/lon or kWp missingincomplete_inputFill portal
Weather cache emptyweather_missingRetry later
OKokUse days / loxone
Basic keynot_availableRegister

Minimal example


curl -s "https://api.spotpriceapi.com/v1/plant/pv-forecast?granularity=daily&days=7&timezone=Europe/Vienna" \
  -H "X-API-Key: sf_live_YOUR_KEY"

{
  "pv_status": "ok",
  "pv_engine": "pv_forecast_v1",
  "quota_class": "pv",
  "timezone": "Europe/Vienna",
  "days": [
    { "date": "2026-08-12", "label": "D0", "pv_kwh": 18.4 },
    { "date": "2026-08-13", "label": "D1", "pv_kwh": 22.1 }
  ],
  "totals": { "pv_kwh_horizon": 124.6 },
  "loxone": {
    "d0_kwh": 18.4,
    "d1_kwh": 22.1,
    "d2_kwh": 19.0,
    "d3_kwh": 8.2,
    "d4_kwh": 15.6,
    "d5_kwh": 21.3,
    "d6_kwh": 20.0,
    "week_kwh": 124.6,
    "d0_load_kwh": 21.5,
    "d1_load_kwh": 18.3,
    "d0_soc_eod": 16.5,
    "d0_tmax": 24.8,
    "d0_tmin": 12.8,
    "txt_d0": "Mon 12.08.2026 · PV 18,4 kWh · Load 21,5 kWh · SoC 16,5% · 13-25°",
    "txt_d1": "Tue 13.08.2026 · PV 22,1 kWh · Load 18,3 kWh · SoC 23,7% · 14-26°",
    "txt_status": "OK"
  },
  "missing": [],
  "portal_hint": null
}

Response fields (plain language)

FieldMeaning
pv_statusok = usable values
days[].pv_kwhExpected yield that day (kWh). D0 with PV meter: actual+forecast; later days: model FC
days[].pv_kindOptional: meter_blend or forecast (D0)
days[].pv_meter_today_kwhOptional: actual so far today (when meter_blend)
loxone.d0_kwh … d6_kwhSame day totals flat for PicoC (d0_kwh = served D0 as above)
loxone.week_kwh7-day sum
loxone.d0_load_kwh / d1_load_kwhLoad today/tomorrow, only if profile or meter exists. Today = same estimate as Hours/portal (typical + same-day overlay); tomorrow = typical only. The Hours hourly series can differ from that daily figure
loxone.d0_soc_eodEnd-of-day SoC today (%), only with battery+SoC. Starts from the current live SoC (even while the Decide PV pack is still fresh). Load shape matches plant outlook (meter/profile, D0 from the current hour; flat 1/24 only as fallback). Load in the open hour stays the full blended remainder. PV and planned grid kWh of that hour count only the minutes still ahead (LOXONE_EOD_OPEN_HOUR_FRACTION=0 restores the full hour). Later hours stay whole. Grid kWh only from a fresh Hours day_plan with energy_kwh > 0 (snapshot ≤ 6 h); otherwise PV vs load only. Pack η 0.95
loxone.d0_tmax / d0_tminHigh/low today (°C) from the plant-weather cache
loxone.txt_d0 / txt_d1Ready-made lines for Loxone Txt2/Txt3 (missing parts omitted)
hours[]Only with hourly / both: { start, pv_kwh }
plant.kwp / pv_qualityPlant size; quality often indicative
missing / portal_hint / portal_urlWhat’s missing + portal link

Flow


Portal: location + kWp
        ↓
GET /v1/plant/pv-forecast?granularity=daily
        ↓
days[] + loxone.d0…d6
        ↓
Display / EMS / Loxone memories

Quota

Quota class pv (logging): counts toward the same billable pool as Forecast/Hours/Decision (Community 200/day). Separate 48/day softcap removed (kill-switch QUOTA_UNIFIED_BILLABLE=0 restores it).

Hourly polling is enough — in Loxone auto-fetch on start and at :08, see the Loxone guide. Shared host VO and minute plan: Loxone overview.

Radiation/weather source data come from the plant-weather cache (Open-Meteo, timer 05:20 + 12:20 Vienna; freshness: morning slot from ~05:00, midday from ~11:00 — see Weather).

Common beginner mistakes

ProblemFix
incomplete_inputSave location + kWp
Basic keyCommunity account + personal key
Huge JSON in PicoCgranularity=daily instead of hourly
Double GETs in LoxoneVirtual Output: digital output on, Command OFF empty

Next steps

Start with SpotpriceAPI

Register for Community or code samples with your personal key.

Live API status