457 Commits

Author SHA1 Message Date
Dominique Lasserre
05ed5ab836 Update README.md (#303)
- Development on feature/config-overhaul
2024-12-30 23:46:20 +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
Normann
45079ca29c python version 3.10 for feature branch (#298)
* switch to python version 3.10 from 3.9 because of Numpy requirements
2024-12-30 14:26:12 +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
Dominique Lasserre
e8a47af04e simulate: more verbose validation 2024-12-30 13:07:08 +01:00
Andreas
86d2173a4d Awattar Price changed to more precise value; if SoC=0 discharge =1 forced. Exp Avg for siple Price Forecast
* Discharge Mask Bug, Tests updated, simple Price Forecast with linear weighting
 * Price Forecast with linear weighting, last value = highest weighting Discharge enforce when soc = 0 -> mask bug
2024-12-30 13:07:08 +01:00
dependabot[bot]
9881fe6da1 Bump matplotlib from 3.9.2 to 3.10.0 (#251)
Bumps [matplotlib](https://github.com/matplotlib/matplotlib) from 3.9.2 to 3.10.0.
- [Release notes](https://github.com/matplotlib/matplotlib/releases)
- [Commits](https://github.com/matplotlib/matplotlib/compare/v3.9.2...v3.10.0)

---
updated-dependencies:
- dependency-name: matplotlib
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-30 13:07:08 +01:00
dependabot[bot]
0a2d1cd8c2 Bump fastapi[standard] from 0.115.5 to 0.115.6 (#254)
Bumps [fastapi[standard]](https://github.com/fastapi/fastapi) from 0.115.5 to 0.115.6.
- [Release notes](https://github.com/fastapi/fastapi/releases)
- [Commits](https://github.com/fastapi/fastapi/compare/0.115.5...0.115.6)

---
updated-dependencies:
- dependency-name: fastapi[standard]
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-30 13:07:08 +01:00
dependabot[bot]
04ccc90479 Bump uvicorn from 0.32.1 to 0.34.0 (#252)
Bumps [uvicorn](https://github.com/encode/uvicorn) from 0.32.1 to 0.34.0.
- [Release notes](https://github.com/encode/uvicorn/releases)
- [Changelog](https://github.com/encode/uvicorn/blob/master/CHANGELOG.md)
- [Commits](https://github.com/encode/uvicorn/compare/0.32.1...0.34.0)

---
updated-dependencies:
- dependency-name: uvicorn
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-30 13:07:08 +01:00
dependabot[bot]
0a70b0e57d Bump pytest from 8.3.3 to 8.3.4 (#253)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.3.3 to 8.3.4.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.3.3...8.3.4)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-30 13:07:08 +01:00
dependabot[bot]
b750ac6969 Bump pydantic from 2.10.3 to 2.10.4 (#280)
Bumps [pydantic](https://github.com/pydantic/pydantic) from 2.10.3 to 2.10.4.
- [Release notes](https://github.com/pydantic/pydantic/releases)
- [Changelog](https://github.com/pydantic/pydantic/blob/main/HISTORY.md)
- [Commits](https://github.com/pydantic/pydantic/compare/v2.10.3...v2.10.4)

---
updated-dependencies:
- dependency-name: pydantic
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-30 13:07:08 +01:00
Andreas
54eae5a871 Soc 1 hour shift fixed + some german -> english translations in ems 2024-12-30 13:07:08 +01:00
Dominique Lasserre
053e60aca4 Pythonic: Rename self_consumption_probability.py -> interpolator.py
* Rename class self_consumption_probability_interpolator to PascalCase
   SelfConsumptionProbabilityInterpolator.
2024-12-30 13:07:08 +01:00
Andreas
410a23e375 Self consumption predictor
* Inverter: Self consumption interpolator for better discharge_hour results
 * Small penalty when EV 100% and charge >0
 * Price Forceast (use mean of last 7 days instead of repeat)
 * Price Prediction as JSON simulation output, config fixed electricty fees configurable + MyPy & Ruff
2024-12-30 13:07:08 +01:00
Bobby Noelte
1c75060d8a Fix electricity price prediction. (#295)
The electricity price prediction provided prices in Eurocent/ kWh despite claiming
the price to be in €/ kWh. Also the addition of charges was not possible.

Now prices are provided in €/kWh. Charges can be configured by the `elecprice_charges`
configuration option.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
2024-12-30 00:50:54 +01:00
Bobby Noelte
830af85fca Fix2 config and predictions revamp. (#281)
measurement:

- Add new measurement class to hold real world measurements.
- Handles load meter readings, grid import and export meter readings.
- Aggregates load meter readings aka. measurements to total load.
- Can import measurements from files, pandas datetime series,
    pandas datetime dataframes, simple daetime arrays and
    programmatically.
- Maybe expanded to other measurement values.
- Should be used for load prediction adaptions by real world
    measurements.

core/coreabc:

- Add mixin class to access measurements

core/pydantic:

- Add pydantic models for pandas datetime series and dataframes.
- Add pydantic models for simple datetime array

core/dataabc:

- Provide DataImport mixin class for generic import handling.
    Imports from JSON string and files. Imports from pandas datetime dataframes
    and simple datetime arrays. Signature of import method changed to
    allow import datetimes to be given programmatically and by data content.
- Use pydantic models for datetime series, dataframes, arrays
- Validate generic imports by pydantic models
- Provide new attributes min_datetime and max_datetime for DataSequence.
- Add parameter dropna to drop NAN/ None values when creating lists, pandas series
    or numpy array from DataSequence.

config/config:

- Add common settings for the measurement module.

predictions/elecpriceakkudoktor:

- Use mean values of last 7 days to fill prediction values not provided by
    akkudoktor.net (only provides 24 values).

prediction/loadabc:

- Extend the generic prediction keys by 'load_total_adjusted' for load predictions
    that adjust the predicted total load by measured load values.

prediction/loadakkudoktor:

- Extend the Akkudoktor load prediction by load adjustment using measured load
    values.

prediction/load_aggregator:

- Module removed. Load aggregation is now handled by the measurement module.

prediction/load_corrector:

- Module removed. Load correction (aka. adjustment of load prediction by
    measured load energy) is handled by the LoadAkkudoktor prediction and
    the generic 'load_mean_adjusted' prediction key.

prediction/load_forecast:

- Module removed. Functionality now completely handled by the LoadAkkudoktor
    prediction.

utils/cacheutil:

- Use pydantic.
- Fix potential bug in ttl (time to live) duration handling.

utils/datetimeutil:

- Added missing handling of pendulum.DateTime and pendulum.Duration instances
    as input. Handled before as datetime.datetime and datetime.timedelta.

utils/visualize:

- Move main to generate_example_report() for better testing support.

server/server:

- Added new configuration option server_fastapi_startup_server_fasthtml
  to make startup of FastHTML server by FastAPI server conditional.

server/fastapi_server:

- Add APIs for measurements
- Improve APIs to provide or take pandas datetime series and
    datetime dataframes controlled by pydantic model.
- Improve APIs to provide or take simple datetime data arrays
    controlled by pydantic model.
- Move fastAPI server API to v1 for new APIs.
- Update pre v1 endpoints to use new prediction and measurement capabilities.
- Only start FastHTML server if 'server_fastapi_startup_server_fasthtml'
    config option is set.

tests:

- Adapt import tests to changed import method signature
- Adapt server test to use the v1 API
- Extend the dataabc test to test for array generation from data
    with several data interval scenarios.
- Extend the datetimeutil test to also test for correct handling
    of to_datetime() providing now().
- Adapt LoadAkkudoktor test for new adjustment calculation.
- Adapt visualization test to use example report function instead of visualize.py
    run as process.
- Removed test_load_aggregator. Functionality is now tested in test_measurement.
- Added tests for measurement module

docs:

- Remove sphinxcontrib-openapi as it prevents build of documentation.
    "site-packages/sphinxcontrib/openapi/openapi31.py", line 305, in _get_type_from_schema
    for t in schema["anyOf"]: KeyError: 'anyOf'"

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
2024-12-29 18:42:49 +01:00
Dominique Lasserre
f195edb07d 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-29 16:43:37 +01:00
Normann
4f51c891d3 duplicate line removed (#290) 2024-12-27 21:42:50 +01:00
Normann
2a8e11d7dc default filename changed back (#289) 2024-12-27 10:46:36 +01:00
Normann
043f9e74e5 default filename changed back (#288) 2024-12-27 10:46:13 +01:00
Normann
c3aa567b4d heatpump translated (#282) 2024-12-26 19:34:16 +01:00
Andreas
c791ecb683 Merge 2024-12-26 08:12:56 +01:00
Andreas
ef4b07610f Merge branch 'soc_zero_price_precision' of https://github.com/Akkudoktor-EOS/EOS into soc_zero_price_precision 2024-12-26 08:11:06 +01:00
Andreas
072413f1a4 Ruff 2024-12-26 08:10:02 +01:00
Andreas
f89889410d Awattar Price changed to more precise value; if SoC=0 discharge =1 forced. Exp Avg for siple Price Forecast 2024-12-26 08:10:02 +01:00
Andreas
d348be8025 Merge branch 'soc_zero_price_precision' of https://github.com/Akkudoktor-EOS/EOS into soc_zero_price_precision 2024-12-26 08:01:11 +01:00
Andreas
546400aea6 Ruff 2024-12-26 08:00:52 +01:00
Andreas
83a048fb83 Ruff 2024-12-26 07:55:29 +01:00
Andreas
ebc41bca14 Merge branch 'main' into soc_zero_price_precision 2024-12-26 07:53:07 +01:00
Andreas
a126d89362 Price Forecast with linear weighting, last value = highest weighting
Discharge enforce when soc = 0 -> mask bug
2024-12-26 07:50:30 +01:00
Andreas
8b9ad60759 Discharge Mask Bug, Tests updated, simple Price Forecast with linear weighting 2024-12-26 07:50:25 +01:00
Andreas
af49072a2e Awattar Price changed to more precise value; if SoC=0 discharge =1 forced. Exp Avg for siple Price Forecast 2024-12-25 19:17:08 +01:00
Andreas
56aa0ac2f5 Awattar Price changed to more precise value; if SoC=0 discharge =1 forced. Exp Avg for siple Price Forecast 2024-12-25 19:12:38 +01:00
dependabot[bot]
cc24904703 Bump matplotlib from 3.9.2 to 3.10.0 (#251)
Bumps [matplotlib](https://github.com/matplotlib/matplotlib) from 3.9.2 to 3.10.0.
- [Release notes](https://github.com/matplotlib/matplotlib/releases)
- [Commits](https://github.com/matplotlib/matplotlib/compare/v3.9.2...v3.10.0)

---
updated-dependencies:
- dependency-name: matplotlib
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-24 13:32:04 +01:00
dependabot[bot]
815aaa78e2 Bump fastapi[standard] from 0.115.5 to 0.115.6 (#254)
Bumps [fastapi[standard]](https://github.com/fastapi/fastapi) from 0.115.5 to 0.115.6.
- [Release notes](https://github.com/fastapi/fastapi/releases)
- [Commits](https://github.com/fastapi/fastapi/compare/0.115.5...0.115.6)

---
updated-dependencies:
- dependency-name: fastapi[standard]
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-24 13:26:47 +01:00
dependabot[bot]
62acf8f1f0 Bump uvicorn from 0.32.1 to 0.34.0 (#252)
Bumps [uvicorn](https://github.com/encode/uvicorn) from 0.32.1 to 0.34.0.
- [Release notes](https://github.com/encode/uvicorn/releases)
- [Changelog](https://github.com/encode/uvicorn/blob/master/CHANGELOG.md)
- [Commits](https://github.com/encode/uvicorn/compare/0.32.1...0.34.0)

---
updated-dependencies:
- dependency-name: uvicorn
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-24 13:21:01 +01:00
dependabot[bot]
da9b211013 Bump pytest from 8.3.3 to 8.3.4 (#253)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.3.3 to 8.3.4.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.3.3...8.3.4)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-24 13:16:19 +01:00
dependabot[bot]
d596ed3cc3 Bump pydantic from 2.10.3 to 2.10.4 (#280)
Bumps [pydantic](https://github.com/pydantic/pydantic) from 2.10.3 to 2.10.4.
- [Release notes](https://github.com/pydantic/pydantic/releases)
- [Changelog](https://github.com/pydantic/pydantic/blob/main/HISTORY.md)
- [Commits](https://github.com/pydantic/pydantic/compare/v2.10.3...v2.10.4)

---
updated-dependencies:
- dependency-name: pydantic
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-24 13:15:08 +01:00
Normann
343cb0e138 backport visualize v3 (#279)
* backport visualize v3

* test backport

* compare file

* old test files removed
2024-12-24 13:11:15 +01:00
Normann
bec24588e1 Visualize reworked v2 (#267)
* initial commit

* Delete duplicate openapi.json

* revert temp cahnges

* test fixed

* mypy fixes

* mypy fixed

* Financial Overview included

* test data save path

* almost done

* mypy fix

* Update visualize.py

* ruff fix

* config, label

* improved start_hour vis

* fix

* fix2
2024-12-24 13:10:31 +01:00
Andreas
2a526aa228 English translation EMS 2024-12-22 12:22:27 +01:00
Andreas
82b9216be5 Soc 1 hour shift fixed + some german -> english translations in ems 2024-12-22 12:22:27 +01:00
Dominique Lasserre
6aa2112da1 workflow: Pytest also upload artifacts on test failure 2024-12-22 10:36:36 +01:00
Dominique Lasserre
11b925f9bd input data: Fix indentation
* Comment full_run (use pytest --full-run to activate)
2024-12-22 10:36:36 +01:00
Andreas
75ee2408c4 Standard Optimization time 48h -> Tests updated 2024-12-22 10:36:36 +01:00
Andreas
9dcb88881b Test Update with new algorithm 2024-12-21 14:57:11 +01:00
Andreas
117a8852ee Tests fixed 2024-12-21 14:57:11 +01:00
Andreas
471788f11d Path 2024-12-21 14:57:11 +01:00