feat: add pvlib pv forecast provider (#1214)

Add a PV forecast provider that calculates the forecast using a PVLib system model
and weather forecast from the EOS weather forecast provider.

Additional module and inverter models can be easily added as the database
is build from PVLib and SAM databases and a bundled csv file.

The module model and inververt model names are provided by new endpoints
to be used in configuration.

The provider is based on the fantastic work of EMHASS. See
https://github.com/davidusb-geek/emhass/blob/master/src/emhass/forecast.py

A short description of the provider is added to the documentation.

Besides the new features there are the fixes and improvements:

* feat: improve EOSdash config page

* fix: kex_to_series for start_datetime

  Make key_to_series always start the series at start_datetime.

* fix: default provider for GENETIC and GENETIC0 optimization

  To make the default less dependent on internet servers (with API changes and
  availability issues) the default for PVForecast is set to PVForecastPVLib
  and for ElecPrice to ElecPriceFixed. The default weather provider is changed
  to OpenMeteo.

* fix: EOSdash display resampled prediction values

  Make EOSdash display resampled prediction values where  resampling fits to
  the prediction value type. Use bar width that fits to 15 minutes value samples.

* chore: add a UI hints system to EOSdash

  The UI hints system eases the definition of forms for configuration items.
  There are also forms for items in maps and lists. These forms allow to add and delete
  items to/ from  maps and lists. The forms ensure that all required fields of newly
  added items are filled.

* chore: Create an enum for valid optimization algorithms

* chore. Make config also provide the available energy management modes.

  Used for configuration hints.

* chore: Randomize default device id in configuration

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
This commit is contained in:
Bobby Noelte
2026-08-07 13:13:17 +02:00
committed by GitHub
parent 9189fc890e
commit 894790f577
49 changed files with 29242 additions and 667 deletions
+131 -24
View File
@@ -8,7 +8,7 @@
"name": "Apache 2.0",
"url": "https://www.apache.org/licenses/LICENSE-2.0.html"
},
"version": "v0.3.0.dev2608010961051894"
"version": "v0.3.0.dev2608071015082558"
},
"paths": {
"/v1/admin/cache/clear": {
@@ -2391,6 +2391,58 @@
}
}
},
"/v1/prediction/pvforecast/pvlib/modules": {
"get": {
"tags": [
"prediction"
],
"summary": "Fastapi Prediction Pvforecast Modules Get",
"description": "Get module names supported by PVForecast PVLib provider.",
"operationId": "fastapi_prediction_pvforecast_modules_get_v1_prediction_pvforecast_pvlib_modules_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"items": {
"type": "string"
},
"type": "array",
"title": "Response Fastapi Prediction Pvforecast Modules Get V1 Prediction Pvforecast Pvlib Modules Get"
}
}
}
}
}
}
},
"/v1/prediction/pvforecast/pvlib/inverters": {
"get": {
"tags": [
"prediction"
],
"summary": "Fastapi Prediction Pvforecast Inverters Get",
"description": "Get inverter names supported by PVForecast PVLib provider.",
"operationId": "fastapi_prediction_pvforecast_inverters_get_v1_prediction_pvforecast_pvlib_inverters_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"items": {
"type": "string"
},
"type": "array",
"title": "Response Fastapi Prediction Pvforecast Inverters Get V1 Prediction Pvforecast Pvlib Inverters Get"
}
}
}
}
}
}
},
"/v1/energy-management/optimization/solution": {
"get": {
"tags": [
@@ -2427,8 +2479,7 @@
"in": "path",
"required": true,
"schema": {
"type": "string",
"title": "Algorithm"
"$ref": "#/components/schemas/OptimizationAlgorithm"
}
}
],
@@ -2828,7 +2879,6 @@
"type": "string",
"title": "Device Id",
"description": "ID of device",
"default": "<unknown>",
"examples": [
"battery1",
"ev1",
@@ -2982,7 +3032,6 @@
"type": "string",
"title": "Device Id",
"description": "ID of device",
"default": "<unknown>",
"examples": [
"battery1",
"ev1",
@@ -3242,7 +3291,7 @@
"$ref": "#/components/schemas/DatabaseCommonSettings-Output"
},
"ems": {
"$ref": "#/components/schemas/EnergyManagementCommonSettings"
"$ref": "#/components/schemas/EnergyManagementCommonSettings-Output"
},
"logging": {
"$ref": "#/components/schemas/LoggingCommonSettings-Output"
@@ -4524,7 +4573,7 @@
"title": "EnergyChartsBiddingZones",
"description": "Energy Charts Bidding Zones."
},
"EnergyManagementCommonSettings": {
"EnergyManagementCommonSettings-Input": {
"properties": {
"startup_delay": {
"type": "number",
@@ -4545,10 +4594,9 @@
},
"mode": {
"$ref": "#/components/schemas/EnergyManagementMode",
"description": "Energy management mode [DISABLED | OPTIMIZATION | PREDICTION].",
"description": "Energy management mode [DISABLED | PREDICTION | OPTIMIZATION]. Defaults to DISABLED.",
"examples": [
"OPTIMIZATION",
"PREDICTION"
"OPTIMIZATION"
]
}
},
@@ -4556,6 +4604,49 @@
"title": "EnergyManagementCommonSettings",
"description": "Energy Management Configuration."
},
"EnergyManagementCommonSettings-Output": {
"properties": {
"startup_delay": {
"type": "number",
"minimum": 1.0,
"title": "Startup Delay",
"description": "Startup delay in seconds for EOS energy management runs.",
"default": 5
},
"interval": {
"type": "number",
"minimum": 60.0,
"title": "Interval",
"description": "Intervall between EOS energy management runs [seconds].",
"default": 300.0,
"examples": [
"300"
]
},
"mode": {
"$ref": "#/components/schemas/EnergyManagementMode",
"description": "Energy management mode [DISABLED | PREDICTION | OPTIMIZATION]. Defaults to DISABLED.",
"examples": [
"OPTIMIZATION"
]
},
"modes": {
"items": {
"type": "string"
},
"type": "array",
"title": "Modes",
"description": "Available energy management modes.",
"readOnly": true
}
},
"type": "object",
"required": [
"modes"
],
"title": "EnergyManagementCommonSettings",
"description": "Energy Management Configuration."
},
"EnergyManagementMode": {
"type": "string",
"enum": [
@@ -8181,7 +8272,6 @@
"type": "string",
"title": "Device Id",
"description": "ID of device",
"default": "<unknown>",
"examples": [
"battery1",
"ev1",
@@ -8244,7 +8334,6 @@
"type": "string",
"title": "Device Id",
"description": "ID of device",
"default": "<unknown>",
"examples": [
"battery1",
"ev1",
@@ -8782,7 +8871,6 @@
"type": "string",
"title": "Device Id",
"description": "ID of device",
"default": "<unknown>",
"examples": [
"battery1",
"ev1",
@@ -8876,7 +8964,6 @@
"type": "string",
"title": "Device Id",
"description": "ID of device",
"default": "<unknown>",
"examples": [
"battery1",
"ev1",
@@ -9781,13 +9868,20 @@
"title": "OMBCStatus",
"description": "Reports the current operational status of an Operation Mode Based Control system.\n\nThis model provides real-time status information about an OMBC-controlled device,\nincluding which operation mode is currently active, how it is configured,\nand information about recent mode transitions. It enables monitoring of the\ndevice's operational state and tracking mode transition history."
},
"OptimizationAlgorithm": {
"type": "string",
"enum": [
"GENETIC",
"GENETIC0"
],
"title": "OptimizationAlgorithm",
"description": "Optimization Algorithm."
},
"OptimizationCommonSettings-Input": {
"properties": {
"algorithm": {
"type": "string",
"title": "Algorithm",
"description": "The optimization algorithm. Defaults to GENETIC",
"default": "GENETIC",
"$ref": "#/components/schemas/OptimizationAlgorithm",
"description": "Optimization algorithm [GENETIC | GENETIC0]. Defaults to GENETIC.",
"examples": [
"GENETIC",
"GENETIC0"
@@ -9825,10 +9919,8 @@
"OptimizationCommonSettings-Output": {
"properties": {
"algorithm": {
"type": "string",
"title": "Algorithm",
"description": "The optimization algorithm. Defaults to GENETIC",
"default": "GENETIC",
"$ref": "#/components/schemas/OptimizationAlgorithm",
"description": "Optimization algorithm [GENETIC | GENETIC0]. Defaults to GENETIC.",
"examples": [
"GENETIC",
"GENETIC0"
@@ -10412,6 +10504,10 @@
"$ref": "#/components/schemas/PVForecastVrmCommonSettings",
"description": "Victron Remote Management (VRM) provider settings"
},
"pvlib": {
"$ref": "#/components/schemas/PVForecastPVLibCommonSettings",
"description": "PVLib provider settings"
},
"pvnode": {
"$ref": "#/components/schemas/PVForecastPVNodeCommonSettings",
"description": "PVNode provider settings"
@@ -10529,6 +10625,10 @@
"$ref": "#/components/schemas/PVForecastVrmCommonSettings",
"description": "Victron Remote Management (VRM) provider settings"
},
"pvlib": {
"$ref": "#/components/schemas/PVForecastPVLibCommonSettings",
"description": "PVLib provider settings"
},
"pvnode": {
"$ref": "#/components/schemas/PVForecastPVNodeCommonSettings",
"description": "PVNode provider settings"
@@ -10740,6 +10840,12 @@
"title": "PVForecastImportCommonSettings",
"description": "Common settings for pvforecast data import from file or JSON string."
},
"PVForecastPVLibCommonSettings": {
"properties": {},
"type": "object",
"title": "PVForecastPVLibCommonSettings",
"description": "Common settings for pvforecast data calculation with PVLib."
},
"PVForecastPVNodeCommonSettings": {
"properties": {
"api_key": {
@@ -10889,7 +10995,7 @@
],
"title": "Mountingplace",
"description": "Type of mounting for PV system. Options are 'free' for free-standing and 'building' for building-integrated.",
"default": "free"
"default": "building"
},
"loss": {
"anyOf": [
@@ -10969,6 +11075,7 @@
],
"title": "Albedo",
"description": "Proportion of the light hitting the ground that it reflects back.",
"default": 0.2,
"examples": [
null
]
@@ -11455,7 +11562,7 @@
"ems": {
"anyOf": [
{
"$ref": "#/components/schemas/EnergyManagementCommonSettings"
"$ref": "#/components/schemas/EnergyManagementCommonSettings-Input"
},
{
"type": "null"