Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve EOSdash. #417

Open
wants to merge 2 commits into
base: feature/config-nested
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 29 additions & 6 deletions docs/_generated/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,10 @@ Validators:
| ---- | -------------------- | ---- | --------- | ------- | ----------- |
| data_folder_path | `EOS_GENERAL__DATA_FOLDER_PATH` | `Optional[pathlib.Path]` | `rw` | `None` | Path to EOS data directory. |
| data_output_subpath | `EOS_GENERAL__DATA_OUTPUT_SUBPATH` | `Optional[pathlib.Path]` | `rw` | `output` | Sub-path for the EOS output data directory. |
| data_cache_subpath | `EOS_GENERAL__DATA_CACHE_SUBPATH` | `Optional[pathlib.Path]` | `rw` | `cache` | Sub-path for the EOS cache data directory. |
| latitude | `EOS_GENERAL__LATITUDE` | `Optional[float]` | `rw` | `52.52` | Latitude in decimal degrees, between -90 and 90, north is positive (ISO 19115) (°) |
| longitude | `EOS_GENERAL__LONGITUDE` | `Optional[float]` | `rw` | `13.405` | Longitude in decimal degrees, within -180 to 180 (°) |
| timezone | | `Optional[str]` | `ro` | `N/A` | Compute timezone based on latitude and longitude. |
| data_output_path | | `Optional[pathlib.Path]` | `ro` | `N/A` | Compute data_output_path based on data_folder_path. |
| data_cache_path | | `Optional[pathlib.Path]` | `ro` | `N/A` | Compute data_cache_path based on data_folder_path. |
| config_folder_path | | `Optional[pathlib.Path]` | `ro` | `N/A` | Path to EOS configuration directory. |
| config_file_path | | `Optional[pathlib.Path]` | `ro` | `N/A` | Path to EOS configuration file. |
:::
Expand All @@ -46,7 +44,6 @@ Validators:
"general": {
"data_folder_path": null,
"data_output_subpath": "output",
"data_cache_subpath": "cache",
"latitude": 52.52,
"longitude": 13.405
}
Expand All @@ -62,18 +59,41 @@ Validators:
"general": {
"data_folder_path": null,
"data_output_subpath": "output",
"data_cache_subpath": "cache",
"latitude": 52.52,
"longitude": 13.405,
"timezone": "Europe/Berlin",
"data_output_path": null,
"data_cache_path": null,
"config_folder_path": "/home/user/.config/net.akkudoktoreos.net",
"config_file_path": "/home/user/.config/net.akkudoktoreos.net/EOS.config.json"
}
}
```

## Cache Configuration

:::{table} cache
:widths: 10 20 10 5 5 30
:align: left

| Name | Environment Variable | Type | Read-Only | Default | Description |
| ---- | -------------------- | ---- | --------- | ------- | ----------- |
| subpath | `EOS_CACHE__SUBPATH` | `Optional[pathlib.Path]` | `rw` | `cache` | Sub-path for the EOS cache data directory. |
| cleanup_intervall | `EOS_CACHE__CLEANUP_INTERVALL` | `float` | `rw` | `300` | Intervall in seconds for EOS file cache cleanup. |
:::

### Example Input/Output

```{eval-rst}
.. code-block:: json
{
"cache": {
"subpath": "cache",
"cleanup_intervall": 300.0
}
}
```

## Logging Configuration

:::{table} logging
Expand Down Expand Up @@ -889,10 +909,13 @@ Attributes:
"general": {
"data_folder_path": null,
"data_output_subpath": "output",
"data_cache_subpath": "cache",
"latitude": 52.52,
"longitude": 13.405
},
"cache": {
"subpath": "cache",
"cleanup_intervall": 300.0
},
"logging": {
"level": "INFO"
},
Expand Down
197 changes: 193 additions & 4 deletions docs/_generated/openapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,93 @@ Note:

---

## GET /v1/admin/cache

**Links**: [local](http://localhost:8503/docs#/default/fastapi_admin_cache_get_v1_admin_cache_get), [eos](https://petstore3.swagger.io/?url=https://raw.githubusercontent.com/Akkudoktor-EOS/EOS/refs/heads/main/openapi.json#/default/fastapi_admin_cache_get_v1_admin_cache_get)

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](http://localhost:8503/docs#/default/fastapi_admin_cache_clear_post_v1_admin_cache_clear_post), [eos](https://petstore3.swagger.io/?url=https://raw.githubusercontent.com/Akkudoktor-EOS/EOS/refs/heads/main/openapi.json#/default/fastapi_admin_cache_clear_post_v1_admin_cache_clear_post)

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](http://localhost:8503/docs#/default/fastapi_admin_cache_load_post_v1_admin_cache_load_post), [eos](https://petstore3.swagger.io/?url=https://raw.githubusercontent.com/Akkudoktor-EOS/EOS/refs/heads/main/openapi.json#/default/fastapi_admin_cache_load_post_v1_admin_cache_load_post)

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](http://localhost:8503/docs#/default/fastapi_admin_cache_save_post_v1_admin_cache_save_post), [eos](https://petstore3.swagger.io/?url=https://raw.githubusercontent.com/Akkudoktor-EOS/EOS/refs/heads/main/openapi.json#/default/fastapi_admin_cache_save_post_v1_admin_cache_save_post)

Fastapi Admin Cache Save Post

```
Save the current cache management data.

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

**Responses**:

- **200**: Successful Response

---

## GET /v1/config

**Links**: [local](http://localhost:8503/docs#/default/fastapi_config_get_v1_config_get), [eos](https://petstore3.swagger.io/?url=https://raw.githubusercontent.com/Akkudoktor-EOS/EOS/refs/heads/main/openapi.json#/default/fastapi_config_get_v1_config_get)
Expand Down Expand Up @@ -238,11 +325,11 @@ Returns:

---

## PUT /v1/config/reset
## POST /v1/config/reset

**Links**: [local](http://localhost:8503/docs#/default/fastapi_config_update_post_v1_config_reset_put), [eos](https://petstore3.swagger.io/?url=https://raw.githubusercontent.com/Akkudoktor-EOS/EOS/refs/heads/main/openapi.json#/default/fastapi_config_update_post_v1_config_reset_put)
**Links**: [local](http://localhost:8503/docs#/default/fastapi_config_reset_post_v1_config_reset_post), [eos](https://petstore3.swagger.io/?url=https://raw.githubusercontent.com/Akkudoktor-EOS/EOS/refs/heads/main/openapi.json#/default/fastapi_config_reset_post_v1_config_reset_post)

Fastapi Config Update Post
Fastapi Config Reset Post

```
Reset the configuration to the EOS configuration file.
Expand Down Expand Up @@ -321,6 +408,22 @@ Returns:

---

## GET /v1/health

**Links**: [local](http://localhost:8503/docs#/default/fastapi_health_get_v1_health_get), [eos](https://petstore3.swagger.io/?url=https://raw.githubusercontent.com/Akkudoktor-EOS/EOS/refs/heads/main/openapi.json#/default/fastapi_health_get_v1_health_get)

Fastapi Health Get

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

**Responses**:

- **200**: Successful Response

---

## PUT /v1/measurement/data

**Links**: [local](http://localhost:8503/docs#/default/fastapi_measurement_data_put_v1_measurement_data_put), [eos](https://petstore3.swagger.io/?url=https://raw.githubusercontent.com/Akkudoktor-EOS/EOS/refs/heads/main/openapi.json#/default/fastapi_measurement_data_put_v1_measurement_data_put)
Expand Down Expand Up @@ -537,6 +640,92 @@ Merge the measurement of given key and value into EOS measurements at given date

---

## GET /v1/prediction/dataframe

**Links**: [local](http://localhost:8503/docs#/default/fastapi_prediction_dataframe_get_v1_prediction_dataframe_get), [eos](https://petstore3.swagger.io/?url=https://raw.githubusercontent.com/Akkudoktor-EOS/EOS/refs/heads/main/openapi.json#/default/fastapi_prediction_dataframe_get_v1_prediction_dataframe_get)

Fastapi Prediction Dataframe 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**:

- `keys` (query, required): Prediction keys.

- `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

---

## PUT /v1/prediction/import/{provider_id}

**Links**: [local](http://localhost:8503/docs#/default/fastapi_prediction_import_provider_v1_prediction_import__provider_id__put), [eos](https://petstore3.swagger.io/?url=https://raw.githubusercontent.com/Akkudoktor-EOS/EOS/refs/heads/main/openapi.json#/default/fastapi_prediction_import_provider_v1_prediction_import__provider_id__put)

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](http://localhost:8503/docs#/default/fastapi_prediction_keys_get_v1_prediction_keys_get), [eos](https://petstore3.swagger.io/?url=https://raw.githubusercontent.com/Akkudoktor-EOS/EOS/refs/heads/main/openapi.json#/default/fastapi_prediction_keys_get_v1_prediction_keys_get)
Expand Down Expand Up @@ -580,7 +769,7 @@ Args:

- `end_datetime` (query, optional): Ending datetime (exclusive).

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

**Responses**:

Expand Down
22 changes: 17 additions & 5 deletions docs/akkudoktoreos/prediction.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,12 @@ The prediction key for the electricity price forecast data is:
- `elecprice_marketprice_wh`: Electricity market price per Wh (€/Wh).

The electricity proce forecast data must be provided in one of the formats described in
<project:#prediction-import-providers>. The data source must be given in the
<project:#prediction-import-providers>. The data source can be given in the
`import_file_path` or `import_json` configuration option.

The data may additionally or solely be provided by the
**PUT** `/v1/prediction/import/ElecPriceImport` endpoint.

## Load Prediction

Prediction keys:
Expand Down Expand Up @@ -184,9 +187,12 @@ The prediction keys for the load forecast data are:
- `load_mean_adjusted`: Predicted load mean value adjusted by load measurement (W).

The load forecast data must be provided in one of the formats described in
<project:#prediction-import-providers>. The data source must be given in the `loadimport_file_path`
<project:#prediction-import-providers>. The data source can be given in the `loadimport_file_path`
or `loadimport_json` configuration option.

The data may additionally or solely be provided by the
**PUT** `/v1/prediction/import/LoadImport` endpoint.

## PV Power Prediction

Prediction keys:
Expand Down Expand Up @@ -362,9 +368,12 @@ The prediction keys for the PV forecast data are:
- `pvforecast_dc_power`: Total AC power (W).

The PV forecast data must be provided in one of the formats described in
<project:#prediction-import-providers>. The data source must be given in the
<project:#prediction-import-providers>. The data source can be given in the
`import_file_path` or `import_json` configuration option.

The data may additionally or solely be provided by the
**PUT** `/v1/prediction/import/PVForecastImport` endpoint.

## Weather Prediction

Prediction keys:
Expand Down Expand Up @@ -460,7 +469,7 @@ The `WeatherImport` provider is designed to import weather forecast data from a
string. An external entity should update the file or JSON string whenever new prediction data
becomes available.

The prediction keys for the PV forecast data are:
The prediction keys for the weather forecast data are:

- `weather_dew_point`: Dew Point (°C)
- `weather_dhi`: Diffuse Horizontal Irradiance (W/m2)
Expand All @@ -486,5 +495,8 @@ The prediction keys for the PV forecast data are:
- `weather_wind_speed`: Wind Speed (kmph)

The PV forecast data must be provided in one of the formats described in
<project:#prediction-import-providers>. The data source must be given in the
<project:#prediction-import-providers>. The data source can be given in the
`import_file_path` or `import_json` configuration option.

The data may additionally or solely be provided by the
**PUT** `/v1/prediction/import/WeatherImport` endpoint.
Loading
Loading