109 Commits

Author SHA1 Message Date
Dominique Lasserre
1658b491d2 Update manual documentation for nested config.
* Add config_file_path, config_folder_path back to general
   (ConfigCommonSettings). Overwrite in docs generation.
2025-01-24 20:08:52 +01:00
Dominique Lasserre
af5e4a753a PVForecast: planes as nested config (list) 2025-01-24 20:08:52 +01:00
Dominique Lasserre
e0b1ece524 PR review 2025-01-24 20:08:50 +01:00
Dominique Lasserre
437d38f508 Fix EOSdash startup (docker)
* Docker: Copy the same directory structure (src/) to support the
   lifespan startup of EOSdash.
   Use EOS_SERVER_EOSDASH_SESSKEY environment variable to provide
   EOSdash with session key.
2025-01-24 20:08:48 +01:00
Dominique Lasserre
95be7b914f Fix API endpoint 2025-01-24 20:07:23 +01:00
Dominique Lasserre
3257dac92b Rename settings variables (remove prefixes) 2025-01-24 20:07:21 +01:00
Dominique Lasserre
1e1bac9fdb EOSdash: Support nested types 2025-01-24 20:06:38 +01:00
Dominique Lasserre
d74a56b75a Documentation: Support nested config
* Add examples to pydantic models.
2025-01-24 20:05:48 +01:00
Dominique Lasserre
be26457563 Nested config, devices registry
* All config now nested.
    - Use default config from model field default values. If providers
      should be enabled by default, non-empty default config file could
      be provided again.
    - Environment variable support with EOS_ prefix and __ between levels,
      e.g. EOS_SERVER__EOS_SERVER_PORT=8503 where all values are case
      insensitive.
      For more information see:
      https://docs.pydantic.dev/latest/concepts/pydantic_settings/#parsing-environment-variable-values
    - Use devices as registry for configured devices. DeviceBase as base
      class with for now just initializion support (in the future expand
      to operations during optimization).
    - Strip down ConfigEOS to the only configuration instance. Reload
      from file or reset to defaults is possible.

 * Fix multi-initialization of derived SingletonMixin classes.
2025-01-24 20:05:48 +01:00
Dominique Lasserre
f09658578a Fix docker access. Closes #278
Some checks failed
docker-build / platform-excludes (push) Has been cancelled
pre-commit / pre-commit (push) Has been cancelled
Run Pytest on Pull Request / test (push) Has been cancelled
docker-build / build (push) Has been cancelled
docker-build / merge (push) Has been cancelled
* Need to start within container with host 0.0.0.0 to access it later
   on host.
2025-01-24 07:45:40 +01:00
Bobby Noelte
9c91a64c1b
Fix EOSdash startup. (#394)
Some checks are pending
docker-build / platform-excludes (push) Waiting to run
docker-build / build (push) Blocked by required conditions
docker-build / merge (push) Blocked by required conditions
pre-commit / pre-commit (push) Waiting to run
Run Pytest on Pull Request / test (push) Waiting to run
Revert to EOSdash startup as a sub-process.
Add arguments to control the complete startup of both servers.
Also development reload can now be given as an argument.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
2025-01-21 19:20:50 +01:00
Bobby Noelte
e255e97141
Fix Gesamtlast (#398)
Some checks are pending
docker-build / platform-excludes (push) Waiting to run
docker-build / build (push) Blocked by required conditions
docker-build / merge (push) Blocked by required conditions
pre-commit / pre-commit (push) Waiting to run
Run Pytest on Pull Request / test (push) Waiting to run
Make Gesamtlast endpoint understand the legacy load mesaurement data format.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
2025-01-21 17:02:48 +01:00
Bobby Noelte
43ebbc2e55
Fix gesamtlast_simple (#399)
Legacy endpoint gesamtlast_simple expected yearly energy consumption to be given in Wh SI units.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
2025-01-21 16:56:42 +01:00
Bobby Noelte
df2e3f7864
Fix BrightSky date format. (#393)
BrightSky needs date format with 4 digits year and 2 digits month and day.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
2025-01-20 19:14:35 +01:00
Normann
98f1105c38
Probability typo fix (#383)
* Propability->Probability
2025-01-16 18:20:39 +01:00
Normann
85bbe0b094
fix for #375 (#377)
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
* fix for #375

* comment
2025-01-14 13:27:51 +01:00
Normann
c024bd51bd
tz added (#379) 2025-01-14 13:16:18 +01:00
Andreas
10703bbc1b
Battery SoC = 0 > set Discharge randomply to 0/1. For longer periods of storage (#366)
Some checks are pending
docker-build / platform-excludes (push) Waiting to run
docker-build / build (push) Blocked by required conditions
docker-build / merge (push) Blocked by required conditions
* Battery SoC = 0 > hard Discharge Setting Off
2025-01-13 21:47:58 +01:00
Dominique Lasserre
9ad61f66b2
Cleanup: parameters: extra=forbid, optimize: battery, inverter optional (#361)
* Cleanup: parameters: extra=forbid, optimize: battery, inverter optional

 * Don't allow extra fields for parameters/REST-API (at least for now while
   changing API).
 * Allow both battery and inverter to be set optionally (atm optional
   battery not implemented, no API constraints).
 * inverter: Remove default max_power_wh
 * single_test_optimization: Add more cli-parameters

* Workflow docker-build: Don't try to authenticate for PRs

 * Secrets are not available anyway for forks.
2025-01-13 21:44:17 +01:00
Normann
745086c2eb
Visualisation footer with current date and time (#364)
* footer with date and version

* ruff

* replace toml module with build in

* using re to extract the string

* optimize re usage

* use of use pendulum in Akkudoktor-EOS

* create_line_chart_date function added

* replace datetime with pendulum

* align ax2 with ax1 and 0 first point

* dynamic ticks

* all charts with dates

* style changes

* mypy fixes

* fix test

* fixed current time
2025-01-13 21:42:52 +01:00
Normann
d317aa9937
Feature Branch: Generation Fitness plot (#362)
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
* Generation Fitness plot

* comment change

* -

* print on debug, add_json_page, add_text_page

* set debug for example

* known seed if debug

* removed unused code

* -

* bugfix empty page
2025-01-12 14:33:02 +01:00
Normann
1bf49c8c52
feature: Pv forecast refactoring (#354)
* refactoring
2025-01-12 00:00:14 +01:00
Normann
b43bf105aa
test_elecpriceakkudoktor bugfix (#360)
* test_elecpriceakkudoktor bugfix

* remove print

* warning
2025-01-10 23:20:55 +01:00
Bobby Noelte
34d8e88771
Rename FastAPI server to EOS. (#355)
Rename FastAPI server to `eos` and FastHTML server to `eosdash`.

Make an user easily identify what server is meant. FastAPI and FastHTML are
implementation details that may confuse the non-technical user.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
2025-01-09 16:54:49 +01:00
Normann
05a1ade3a3 needed_prediction_hours fixed 2025-01-09 12:15:00 +01:00
Normann
bfb8db6d56 remove print 2025-01-09 12:15:00 +01:00
Normann
8c41d291bd review improvements 2025-01-09 12:15:00 +01:00
Normann
ed8c6580ee restrict data for history array 2025-01-09 12:15:00 +01:00
Normann
df54303284 comments, cleanup 2025-01-09 12:15:00 +01:00
Normann
b16a545379 test output 2025-01-09 12:15:00 +01:00
Normann
c334cf4b33 amount_datasets cases added 2025-01-09 12:15:00 +01:00
Normann
f3d3eac500 initially working 2025-01-09 12:15:00 +01:00
Normann
4d29261914 day end 2025-01-09 12:15:00 +01:00
Normann
aec2171570 median 2025-01-09 12:15:00 +01:00
Normann
3121490a23 mypy, req 2025-01-09 12:15:00 +01:00
Normann
e0bdbdcb81 base functions 2025-01-09 12:15:00 +01:00
Normann
6bcae41213 comment 2025-01-09 12:15:00 +01:00
Normann
4c0afb6a2a initial commit 2025-01-09 12:15:00 +01:00
Bobby Noelte
0ac31348f0
Add minimum historic prediction hours for prediction providers. (#346)
Prediction providers can now individually set the minimum historic prediction hours
to be kept in the data records. This setting supersedes any lower setting given by the
configuration `prediction_historic_hours`.

As a help for the future change of ElecPriceAkkudoktor, the minimum historic hours for
this provider is set to 5 * 7 * 24 hours.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
2025-01-06 23:05:08 +01:00
Dominique Lasserre
10acc705ec
Initial readthedocs config (#339)
* Add links to documentation.
 * Drop unused file class_soc_calc.
2025-01-06 19:34:15 +01:00
Bobby Noelte
d4e31d556a
Add Documentation 2 (#334)
Add documentation that covers:

- configuration
- prediction

Add Python scripts that support automatic documentation generation for
configuration data defined with pydantic.

Adapt EOS configuration to provide more methods for REST API and
automatic documentation generation.

Adapt REST API to allow for EOS configuration file load and save.
Sort REST API on generation of openapi markdown for docs.

Move logutil to core/logging to allow configuration of logging by standard config.

Make Akkudoktor predictions always start extraction of prediction data at start of day.
Previously extraction started at actual hour. This is to support the code that assumes
prediction data to start at start of day.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
2025-01-05 14:41:07 +01:00
Dominique Lasserre
03ec729e50
Update regular_grid_interpolator.pkl to scipy 1.15 Closes #335 (#336) (#337) 2025-01-04 00:52:20 +01:00
Bobby Noelte
1866055478
Add documentation. (#321)
Add documentation that covers:

- Prediction
- Measuremnt
- REST API

Add Python scripts that support automatic documentation generation using the Sphinx
sphinxcontrib.eval extension.

Add automatic update/ test for REST API documentation.

Filter proxy endpoints from REST API documentation.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
2025-01-03 00:31:20 +01:00
Andreas
1ccedea984 Fix URL in elecprice 2025-01-02 15:29:01 +01:00
Bobby Noelte
ed79cacf63 Fix PVForecast settings active plane detection. (#320)
Detect active PV planes by pvforecast_surface_tilt and pvforecast_surface_azimuth to be non None. Assure by default these configuration values are None.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
2025-01-02 12:40:12 +01:00
Dominique Lasserre
69eac26885 Prediction: Support manual update (#319)
* Provide /v1/prediction/update and
   /v1/prediction/update/{provider_id} as POST endpoints to update
   provider data.
 * Update description for deprecated endpoints how to use new API.
2025-01-01 16:10:34 +01:00
Bobby Noelte
c0ea13d0f4 Fix2 electricity price prediction. (#296)
Normalize electricity price prediction to €/Wh.
Provide electricity price prediction by €/kWh for convenience.

Allow to configure electricity price charges by €/kWh.

Also added error page to fastapi rest server to get rid of annoying
unrelated fault messages during testing.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
2024-12-30 21:29:50 +01:00
Dominique Lasserre
75987db9e1 Reasonable defaults, isolate tests, EOS_LOGGING_LEVEL, EOS_CONFIG_DIR
* Add EOS_CONFIG_DIR to set config dir (relative path to EOS_DIR or
   absolute path).
    - config_folder_path read-only
    - config_file_path read-only
 * Default values to support app start with empty config:
    - latitude/longitude (Berlin)
    - optimization_ev_available_charge_rates_percent (null, so model
      default value is used)
    - Enable Akkudoktor electricity price forecast (docker-compose).
 * Fix some endpoints (empty data, remove unused params, fix types).
 * cacheutil: Use cache dir. Closes #240
 * Support EOS_LOGGING_LEVEL environment variable to set log level.
 * tests: All tests use separate temporary config
    - Add pytest switch --check-config-side-effect to check user
      config file existence after each test. Will also fail if user config
      existed before test execution (but will only check after the test has
      run).
      Enable flag in github workflow.
    - Globally mock platformdirs in config module. Now no longer required
      to patch individually.
      Function calls to config instance (e.g. merge_settings_from_dict)
      were unaffected previously.
 * Set Berlin as default location (default config/docker-compose).
2024-12-30 13:41:39 +01:00
Dominique Lasserre
267a9bf427 pvforecast: Some values optional. Closes #292 (#293)
* temperature, relativehumidity_2m, windspeed_10m can be null
 * prettify pv_forecast_input_1.json (and add null value)
2024-12-30 13:07:08 +01:00
Dominique Lasserre
b386c4be70 inverter test: Mock SelfConsumptionProbabilityInterpolator 2024-12-30 13:07:08 +01:00