EOS/docs/_generated/openapi.md
Bobby Noelte 80bfe4d0f0
Improve caching. (#431)
* Move the caching module to core.

Add an in memory cache that for caching function and method results
during an energy management run (optimization run). Two decorators
are provided for methods and functions.

* Improve the file cache store by load and save functions.

Make EOS load the cache file store on startup and save it on shutdown.
Add a cyclic task that cleans the cache file store from outdated cache files.

* Improve startup of EOSdash by EOS

Make EOS starting EOSdash adhere to path configuration given in EOS.
The whole environment from EOS is now passed to EOSdash.
Should also prevent test errors due to unwanted/ wrong config file creation.

Both servers now provide a health endpoint that can be used to detect whether
the server is running. This is also used for testing now.

* Improve startup of EOS

EOS now has got an energy management task that runs shortly after startup.
It tries to execute energy management runs with predictions newly fetched
or initialized from cached data on first run.

* Improve shutdown of EOS

EOS has now a shutdown task that shuts EOS down gracefully with some
time delay to allow REST API requests for shutdwon or restart to be fully serviced.

* Improve EMS

Add energy management task for repeated energy management controlled by
startup delay and interval configuration parameters.
Translate EnergieManagementSystem to english EnergyManagement.

* Add administration endpoints

  - endpoints to control caching from REST API.
  - endpoints to control server restart (will not work on Windows) and shutdown from REST API

* Improve doc generation

Use "\n" linenend convention also on Windows when generating doc files.
Replace Windows specific 127.0.0.1 address by standard 0.0.0.0.

* Improve test support (to be able to test caching)

  - Add system test option to pytest for running tests with "real" resources
  - Add new test fixture to start server for test class and test function
  - Make kill signal adapt to Windows/ Linux
  - Use consistently "\n" for lineends when writing text files in  doc test
  - Fix test_logging under Windows
  - Fix conftest config_default_dirs test fixture under Windows

From @Lasall

* Improve Windows support

 - Use 127.0.0.1 as default config host (model defaults) and
   addionally redirect 0.0.0.0 to localhost on Windows (because default
   config file still has 0.0.0.0).
 - Update install/startup instructions as package installation is
   required atm.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
2025-02-12 21:35:51 +01:00

25 KiB

Akkudoktor-EOS

Version: 0.0.1

Description: This project provides a comprehensive solution for simulating and optimizing an energy system based on renewable energy sources. With a focus on photovoltaic (PV) systems, battery storage (batteries), load management (consumer requirements), heat pumps, electric vehicles, and consideration of electricity price data, this system enables forecasting and optimization of energy flow and costs over a specified period.

Base URL: No base URL provided.

Endpoints:

POST /gesamtlast

Links: local, eos

Fastapi Gesamtlast

Deprecated: Total Load Prediction with adjustment.

Endpoint to handle total load prediction adjusted by latest measured data.

Total load prediction starts at 00.00.00 today and is provided for 48 hours.
If no prediction values are available the missing ones at the start of the series are
filled with the first available prediction value.

Note:
    Use '/v1/prediction/list?key=load_mean_adjusted' instead.
    Load energy meter readings to be added to EOS measurement by:
    '/v1/measurement/load-mr/value/by-name' or
    '/v1/measurement/value'

Request Body:

  • application/json: { "$ref": "#/components/schemas/GesamtlastRequest" }

Responses:

  • 200: Successful Response

  • 422: Validation Error


GET /gesamtlast_simple

Links: local, eos

Fastapi Gesamtlast Simple

Deprecated: Total Load Prediction.

Endpoint to handle total load prediction.

Total load prediction starts at 00.00.00 today and is provided for 48 hours.
If no prediction values are available the missing ones at the start of the series are
filled with the first available prediction value.

Args:
    year_energy (float): Yearly energy consumption in Wh.

Note:
    Set LoadAkkudoktor as provider, then update data with
    '/v1/prediction/update'
    and then request data with
    '/v1/prediction/list?key=load_mean' instead.

Parameters:

  • year_energy (query, required): No description provided.

Responses:

  • 200: Successful Response

  • 422: Validation Error


POST /optimize

Links: local, eos

Fastapi Optimize

Parameters:

  • start_hour (query, optional): Defaults to current hour of the day.

  • ngen (query, optional): No description provided.

Request Body:

  • application/json: { "$ref": "#/components/schemas/OptimizationParameters" }

Responses:

  • 200: Successful Response

  • 422: Validation Error


GET /pvforecast

Links: local, eos

Fastapi Pvforecast

Deprecated: PV Forecast Prediction.

Endpoint to handle PV forecast prediction.

PVForecast starts at 00.00.00 today and is provided for 48 hours.
If no forecast values are available the missing ones at the start of the series are
filled with the first available forecast value.

Note:
    Set PVForecastAkkudoktor as provider, then update data with
    '/v1/prediction/update'
    and then request data with
    '/v1/prediction/list?key=pvforecast_ac_power' and
    '/v1/prediction/list?key=pvforecastakkudoktor_temp_air' instead.

Responses:

  • 200: Successful Response

GET /strompreis

Links: local, eos

Fastapi Strompreis

Deprecated: Electricity Market Price Prediction per Wh (€/Wh).

Electricity prices start at 00.00.00 today and are provided for 48 hours.
If no prices are available the missing ones at the start of the series are
filled with the first available price.

Note:
    Electricity price charges are added.

Note:
    Set ElecPriceAkkudoktor as provider, then update data with
    '/v1/prediction/update'
    and then request data with
    '/v1/prediction/list?key=elecprice_marketprice_wh' or
    '/v1/prediction/list?key=elecprice_marketprice_kwh' instead.

Responses:

  • 200: Successful Response

GET /v1/admin/cache

Links: local, eos

Fastapi Admin Cache Get

Current cache management data.

Returns:
    data (dict): The management data.

Responses:

  • 200: Successful Response

POST /v1/admin/cache/clear

Links: local, eos

Fastapi Admin Cache Clear Post

Clear the cache from expired data.

Deletes expired cache files.

Args:
    clear_all (Optional[bool]): Delete all cached files. Default is False.

Returns:
    data (dict): The management data after cleanup.

Parameters:

  • clear_all (query, optional): No description provided.

Responses:

  • 200: Successful Response

  • 422: Validation Error


POST /v1/admin/cache/load

Links: local, eos

Fastapi Admin Cache Load Post

Load cache management data.

Returns:
    data (dict): The management data that was loaded.

Responses:

  • 200: Successful Response

POST /v1/admin/cache/save

Links: local, eos

Fastapi Admin Cache Save Post

Save the current cache management data.

Returns:
    data (dict): The management data that was saved.

Responses:

  • 200: Successful Response

POST /v1/admin/server/restart

Links: local, eos

Fastapi Admin Server Restart Post

Restart the server.

Restart EOS properly by starting a new instance before exiting the old one.

Responses:

  • 200: Successful Response

POST /v1/admin/server/shutdown

Links: local, eos

Fastapi Admin Server Shutdown Post

Shutdown the server.

Responses:

  • 200: Successful Response

GET /v1/config

Links: local, eos

Fastapi Config Get

Get the current configuration.

Returns:
    configuration (ConfigEOS): The current configuration.

Responses:

  • 200: Successful Response

PUT /v1/config

Links: local, eos

Fastapi Config Put

Update the current config with the provided settings.

Note that for any setting value that is None or unset, the configuration will fall back to
values from other sources such as environment variables, the EOS configuration file, or default
values.

Args:
    settings (SettingsEOS): The settings to write into the current settings.

Returns:
    configuration (ConfigEOS): The current configuration after the write.

Request Body:

  • application/json: { "$ref": "#/components/schemas/SettingsEOS" }

Responses:

  • 200: Successful Response

  • 422: Validation Error


PUT /v1/config/file

Links: local, eos

Fastapi Config File Put

Save the current configuration to the EOS configuration file.

Returns:
    configuration (ConfigEOS): The current configuration that was saved.

Responses:

  • 200: Successful Response

POST /v1/config/reset

Links: local, eos

Fastapi Config Reset Post

Reset the configuration.

Returns:
    configuration (ConfigEOS): The current configuration after update.

Responses:

  • 200: Successful Response

GET /v1/config/{path}

Links: local, eos

Fastapi Config Get Key

Get the value of a nested key or index in the config model.

Args:
    path (str): The nested path to the key (e.g., "general/latitude" or "optimize/nested_list/0").

Returns:
    value (Any): The value of the selected nested key.

Parameters:

  • path (path, required): The nested path to the configuration key (e.g., general/latitude).

Responses:

  • 200: Successful Response

  • 422: Validation Error


PUT /v1/config/{path}

Links: local, eos

Fastapi Config Put Key

Update a nested key or index in the config model.

Args:
    path (str): The nested path to the key (e.g., "general/latitude" or "optimize/nested_list/0").
    value (Any): The new value to assign to the key or index at path.

Returns:
    configuration (ConfigEOS): The current configuration after the update.

Parameters:

  • path (path, required): The nested path to the configuration key (e.g., general/latitude).

Request Body:

  • application/json: { "description": "The value to assign to the specified configuration path.", "title": "Value" }

Responses:

  • 200: Successful Response

  • 422: Validation Error


GET /v1/health

Links: local, eos

Fastapi Health Get

Health check endpoint to verify that the EOS server is alive.

Responses:

  • 200: Successful Response

PUT /v1/measurement/data

Links: local, eos

Fastapi Measurement Data Put

Merge the measurement data given as datetime data into EOS measurements.

Request Body:

  • application/json: { "$ref": "#/components/schemas/PydanticDateTimeData" }

Responses:

  • 200: Successful Response

  • 422: Validation Error


PUT /v1/measurement/dataframe

Links: local, eos

Fastapi Measurement Dataframe Put

Merge the measurement data given as dataframe into EOS measurements.

Request Body:

  • application/json: { "$ref": "#/components/schemas/PydanticDateTimeDataFrame" }

Responses:

  • 200: Successful Response

  • 422: Validation Error


GET /v1/measurement/keys

Links: local, eos

Fastapi Measurement Keys Get

Get a list of available measurement keys.

Responses:

  • 200: Successful Response

GET /v1/measurement/load-mr/series/by-name

Links: local, eos

Fastapi Measurement Load Mr Series By Name Get

Get the meter reading of given load name as series.

Parameters:

  • name (query, required): Load name.

Responses:

  • 200: Successful Response

  • 422: Validation Error


PUT /v1/measurement/load-mr/series/by-name

Links: local, eos

Fastapi Measurement Load Mr Series By Name Put

Merge the meter readings series of given load name into EOS measurements at given datetime.

Parameters:

  • name (query, required): Load name.

Request Body:

  • application/json: { "$ref": "#/components/schemas/PydanticDateTimeSeries" }

Responses:

  • 200: Successful Response

  • 422: Validation Error


PUT /v1/measurement/load-mr/value/by-name

Links: local, eos

Fastapi Measurement Load Mr Value By Name Put

Merge the meter reading of given load name and value into EOS measurements at given datetime.

Parameters:

  • datetime (query, required): Datetime.

  • name (query, required): Load name.

  • value (query, required): No description provided.

Responses:

  • 200: Successful Response

  • 422: Validation Error


GET /v1/measurement/series

Links: local, eos

Fastapi Measurement Series Get

Get the measurements of given key as series.

Parameters:

  • key (query, required): Prediction key.

Responses:

  • 200: Successful Response

  • 422: Validation Error


PUT /v1/measurement/series

Links: local, eos

Fastapi Measurement Series Put

Merge measurement given as series into given key.

Parameters:

  • key (query, required): Prediction key.

Request Body:

  • application/json: { "$ref": "#/components/schemas/PydanticDateTimeSeries" }

Responses:

  • 200: Successful Response

  • 422: Validation Error


PUT /v1/measurement/value

Links: local, eos

Fastapi Measurement Value Put

Merge the measurement of given key and value into EOS measurements at given datetime.

Parameters:

  • datetime (query, required): Datetime.

  • key (query, required): Prediction key.

  • value (query, required): No description provided.

Responses:

  • 200: Successful Response

  • 422: Validation Error


PUT /v1/prediction/import/{provider_id}

Links: local, eos

Fastapi Prediction Import Provider

Import prediction for given provider ID.

Args:
    provider_id: ID of provider to update.
    data: Prediction data.
    force_enable: Update data even if provider is disabled.
        Defaults to False.

Parameters:

  • provider_id (path, required): Provider ID.

  • force_enable (query, optional): No description provided.

Request Body:

  • application/json: { "anyOf": [ { "$ref": "#/components/schemas/PydanticDateTimeDataFrame" }, { "$ref": "#/components/schemas/PydanticDateTimeData" }, { "type": "object" }, { "type": "null" } ], "title": "Data" }

Responses:

  • 200: Successful Response

  • 422: Validation Error


GET /v1/prediction/keys

Links: local, eos

Fastapi Prediction Keys Get

Get a list of available prediction keys.

Responses:

  • 200: Successful Response

GET /v1/prediction/list

Links: local, eos

Fastapi Prediction List Get

Get prediction for given key within given date range as value list.

Args:
    key (str): Prediction key
    start_datetime (Optional[str]): Starting datetime (inclusive).
        Defaults to start datetime of latest prediction.
    end_datetime (Optional[str]: Ending datetime (exclusive).
        Defaults to end datetime of latest prediction.
    interval (Optional[str]): Time duration for each interval.
        Defaults to 1 hour.

Parameters:

  • key (query, required): Prediction key.

  • start_datetime (query, optional): Starting datetime (inclusive).

  • end_datetime (query, optional): Ending datetime (exclusive).

  • interval (query, optional): Time duration for each interval. Defaults to 1 hour.

Responses:

  • 200: Successful Response

  • 422: Validation Error


GET /v1/prediction/providers

Links: local, eos

Fastapi Prediction Providers Get

Get a list of available prediction providers.

Args:
    enabled (bool): Return enabled/disabled providers. If unset, return all providers.

Parameters:

  • enabled (query, optional): No description provided.

Responses:

  • 200: Successful Response

  • 422: Validation Error


GET /v1/prediction/series

Links: local, eos

Fastapi Prediction Series Get

Get prediction for given key within given date range as series.

Args:
    key (str): Prediction key
    start_datetime (Optional[str]): Starting datetime (inclusive).
        Defaults to start datetime of latest prediction.
    end_datetime (Optional[str]: Ending datetime (exclusive).
        Defaults to end datetime of latest prediction.

Parameters:

  • key (query, required): Prediction key.

  • start_datetime (query, optional): Starting datetime (inclusive).

  • end_datetime (query, optional): Ending datetime (exclusive).

Responses:

  • 200: Successful Response

  • 422: Validation Error


POST /v1/prediction/update

Links: local, eos

Fastapi Prediction Update

Update predictions for all providers.

Args:
    force_update: Update data even if it is already cached.
        Defaults to False.
    force_enable: Update data even if provider is disabled.
        Defaults to False.

Parameters:

  • force_update (query, optional): No description provided.

  • force_enable (query, optional): No description provided.

Responses:

  • 200: Successful Response

  • 422: Validation Error


POST /v1/prediction/update/{provider_id}

Links: local, eos

Fastapi Prediction Update Provider

Update predictions for given provider ID.

Args:
    provider_id: ID of provider to update.
    force_update: Update data even if it is already cached.
        Defaults to False.
    force_enable: Update data even if provider is disabled.
        Defaults to False.

Parameters:

  • provider_id (path, required): No description provided.

  • force_update (query, optional): No description provided.

  • force_enable (query, optional): No description provided.

Responses:

  • 200: Successful Response

  • 422: Validation Error


GET /visualization_results.pdf

Links: local, eos

Get Pdf

Responses:

  • 200: Successful Response