akkudoktoreos.prediction.pvforecastakkudoktor

PV Power Forecasting with Akkudoktor.

This module provides classes and methods to retrieve, process, and display photovoltaic (PV) power forecast data. It includes features for working with environmental data such as temperature, wind speed, DC power, and AC power. Data retrieval is designed to work with Akkudoktor.net, and caching is implemented to reduce redundant network requests. Additionally, the module supports management of historical data for analysis over time.

Classes:

AkkudoktorForecastHorizon: Represents details about the orientation of PV system horizons. AkkudoktorForecastMeta: Metadata configuration for the forecast, including location, system settings, and timezone. AkkudoktorForecastValue: Represents a single forecast data entry with information on temperature, wind speed, and solar orientation. AkkudoktorForecast: The main container for forecast data, holding both metadata and individual forecast entries. PVForecastAkkudoktorDataRecord: A specialized data record format for PV forecast data, including forecasted and actual AC power measurements. PVForecastAkkudoktorSettings: Contains configuration settings for constructing the Akkudoktor forecast API URL. PVForecastAkkudoktor: Primary class to manage PV power forecasts, handle data retrieval, caching, and integration with Akkudoktor.net.

Example

# Set up the configuration with necessary fields for URL generation settings_data = {

“general”: {

“latitude”: 52.52, “longitude”: 13.405,

}, “prediction”: {

“hours”: 48, “historic_hours”: 24,

}, “pvforecast”: {

“provider”: “PVForecastAkkudoktor”, “planes”: [

{

“peakpower”: 5.0, “surface_azimuth”: 170, “surface_tilt”: 7, “userhorizon”: [20, 27, 22, 20], “inverter_paco”: 10000,

}, {

“peakpower”: 4.8, “surface_azimuth”: 90, “surface_tilt”: 7, “userhorizon”: [30, 30, 30, 50], “inverter_paco”: 10000,

}

]

}

}

# Create the config instance from the provided data config = PVForecastAkkudoktorSettings(**settings_data)

# Initialize the forecast object with the generated configuration forecast = PVForecastAkkudoktor(settings=config)

# Get an actual forecast forecast.update_data()

# Update the AC power measurement for a specific date and time forecast.update_value(to_datetime(None, to_maxtime=False), “pvforecastakkudoktor_ac_power_measured”, 1000.0)

# Report the DC and AC power forecast along with AC measurements print(forecast.report_ac_power_and_measurement())

akkudoktoreos.prediction.pvforecastakkudoktor.hours

Number of hours into the future to forecast. Default is 48.

Type:

int

akkudoktoreos.prediction.pvforecastakkudoktor.historic_hours

Number of past hours to retain for analysis. Default is 24.

Type:

int

akkudoktoreos.prediction.pvforecastakkudoktor.latitude

Latitude for the forecast location.

Type:

float

akkudoktoreos.prediction.pvforecastakkudoktor.longitude

Longitude for the forecast location.

Type:

float

akkudoktoreos.prediction.pvforecastakkudoktor.start_datetime

Start time for the forecast, defaulting to current datetime.

Type:

datetime

akkudoktoreos.prediction.pvforecastakkudoktor.end_datetime

Computed end datetime based on start_datetime and hours.

Type:

datetime

akkudoktoreos.prediction.pvforecastakkudoktor.keep_datetime

Computed threshold datetime for retaining historical data.

Type:

datetime

akkudoktoreos.prediction.pvforecastakkudoktor.provider_id()

Returns the unique identifier for the Akkudoktor provider.

akkudoktoreos.prediction.pvforecastakkudoktor._request_forecast()

Retrieves forecast data from the Akkudoktor API.

akkudoktoreos.prediction.pvforecastakkudoktor._update_data()

Updates forecast data within the PVForecastAkkudoktorDataRecord structure.

akkudoktoreos.prediction.pvforecastakkudoktor.report_ac_power_and_measurement()

Generates a report on AC and DC power forecasts and actual measurements.

Classes

AkkudoktorForecast(*, meta, values)

AkkudoktorForecastHorizon(*, altitude, ...)

AkkudoktorForecastMeta(*, lat, lon, power, ...)

AkkudoktorForecastValue(*, datetime, ...)

PVForecastAkkudoktor(*args, records, ...)

Fetch and process PV forecast data from akkudoktor.net.

PVForecastAkkudoktorDataRecord(*, date_time, ...)

Represents a Akkudoktor specific pvforecast data record containing various pvforecast attributes at a specific datetime.