feat(VRM forecast): add load and pv forecast by VRM API (#611)
Some checks failed
docker-build / platform-excludes (push) Has been cancelled
docker-build / build (push) Has been cancelled
docker-build / merge (push) Has been cancelled
pre-commit / pre-commit (push) Has been cancelled
Run Pytest on Pull Request / test (push) Has been cancelled

Add support for fetching forecasts from the VRM API by Victron Energy. Retrieve forecasts for PV generation and total load of a Victron system from the internet. 

Tests for the new modules have been added, and the documentation has been updated accordingly.

Signed-off-by: redmoon2711 <redmoon2711@gmx.de>
This commit is contained in:
redmoon2711
2025-07-19 08:55:16 +02:00
committed by GitHub
parent e5500b6857
commit 8e69caba73
11 changed files with 5458 additions and 4829 deletions

View File

@@ -6,6 +6,7 @@ from akkudoktoreos.prediction.elecpriceenergycharts import ElecPriceEnergyCharts
from akkudoktoreos.prediction.elecpriceimport import ElecPriceImport
from akkudoktoreos.prediction.loadakkudoktor import LoadAkkudoktor
from akkudoktoreos.prediction.loadimport import LoadImport
from akkudoktoreos.prediction.loadvrm import LoadVrm
from akkudoktoreos.prediction.prediction import (
Prediction,
PredictionCommonSettings,
@@ -13,6 +14,7 @@ from akkudoktoreos.prediction.prediction import (
)
from akkudoktoreos.prediction.pvforecastakkudoktor import PVForecastAkkudoktor
from akkudoktoreos.prediction.pvforecastimport import PVForecastImport
from akkudoktoreos.prediction.pvforecastvrm import PVForecastVrm
from akkudoktoreos.prediction.weatherbrightsky import WeatherBrightSky
from akkudoktoreos.prediction.weatherclearoutside import WeatherClearOutside
from akkudoktoreos.prediction.weatherimport import WeatherImport
@@ -32,8 +34,10 @@ def forecast_providers():
ElecPriceEnergyCharts(),
ElecPriceImport(),
LoadAkkudoktor(),
LoadVrm(),
LoadImport(),
PVForecastAkkudoktor(),
PVForecastVrm(),
PVForecastImport(),
WeatherBrightSky(),
WeatherClearOutside(),
@@ -73,12 +77,14 @@ def test_provider_sequence(prediction):
assert isinstance(prediction.providers[1], ElecPriceEnergyCharts)
assert isinstance(prediction.providers[2], ElecPriceImport)
assert isinstance(prediction.providers[3], LoadAkkudoktor)
assert isinstance(prediction.providers[4], LoadImport)
assert isinstance(prediction.providers[5], PVForecastAkkudoktor)
assert isinstance(prediction.providers[6], PVForecastImport)
assert isinstance(prediction.providers[7], WeatherBrightSky)
assert isinstance(prediction.providers[8], WeatherClearOutside)
assert isinstance(prediction.providers[9], WeatherImport)
assert isinstance(prediction.providers[4], LoadVrm)
assert isinstance(prediction.providers[5], LoadImport)
assert isinstance(prediction.providers[6], PVForecastAkkudoktor)
assert isinstance(prediction.providers[7], PVForecastVrm)
assert isinstance(prediction.providers[8], PVForecastImport)
assert isinstance(prediction.providers[9], WeatherBrightSky)
assert isinstance(prediction.providers[10], WeatherClearOutside)
assert isinstance(prediction.providers[11], WeatherImport)
def test_provider_by_id(prediction, forecast_providers):
@@ -95,8 +101,10 @@ def test_prediction_repr(prediction):
assert "ElecPriceEnergyCharts" in result
assert "ElecPriceImport" in result
assert "LoadAkkudoktor" in result
assert "LoadVrm" in result
assert "LoadImport" in result
assert "PVForecastAkkudoktor" in result
assert "PVForecastVrm" in result
assert "PVForecastImport" in result
assert "WeatherBrightSky" in result
assert "WeatherClearOutside" in result