* Fix logging configuration issues that made logging stop operation. Switch to Loguru logging (from Python logging). Enable console and file logging with different log levels. Add logging documentation. * Fix logging configuration and EOS configuration out of sync. Added tracking support for nested value updates of Pydantic models. This used to update the logging configuration when the EOS configurationm for logging is changed. Should keep logging config and EOS config in sync as long as all changes to the EOS logging configuration are done by set_nested_value(), which is the case for the REST API. * Fix energy management task looping endlessly after the second update when trying to update the last_update datetime. * Fix get_nested_value() to correctly take values from the dicts in a Pydantic model instance. * Fix usage of model classes instead of model instances in nested value access when evaluation the value type that is associated to each key. * Fix illegal json format in prediction documentation for PVForecastAkkudoktor provider. * Fix documentation qirks and add EOS Connect to integrations. * Support deprecated fields in configuration in documentation generation and EOSdash. * Enhance EOSdash demo to show BrightSky humidity data (that is often missing) * Update documentation reference to German EOS installation videos. Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
Energy System Simulation and Optimization
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.
Documentation can be found at Akkudoktor-EOS.
Getting Involved
See CONTRIBUTING.md.
System requirements
- Python >= 3.11, < 3.13
- Architecture: amd64, aarch64 (armv8)
- OS: Linux, Windows, macOS
Note: For Python 3.13 some dependencies (e.g. Pendulum) are not yet available on https://pypi.org and have to be manually compiled (a recent Rust installation is required).
Other architectures (e.g. armv6, armv7) are unsupported for now, because a multitude of dependencies are not available on https://piwheels.org and have to be built manually (a recent Rust installation and GCC are required, Python 3.11 is recommended).
Installation
The project requires Python 3.11 or newer. Docker images (amd64/aarch64) can be found at akkudoktor/eos.
Following sections describe how to locally start the EOS server on http://localhost:8503
.
Run from source
Install dependencies in virtual environment:
Linux:
python -m venv .venv
.venv/bin/pip install -r requirements.txt
.venv/bin/pip install -e .
Windows:
python -m venv .venv
.venv\Scripts\Activate
.venv\Scripts\pip install -r requirements.txt
.venv\Scripts\pip install -e .
Finally, start the EOS server to access it at http://localhost:8503
(API docs at http://localhost:8503/docs
):
Linux:
.venv/bin/python src/akkudoktoreos/server/eos.py
Windows:
.venv\Scripts\python src/akkudoktoreos/server/eos.py
Docker
Start EOS with following command to access it at http://localhost:8503
(API docs at http://localhost:8503/docs
):
docker compose up
If you are running the EOS container on a system hosting multiple services, such as a Synology NAS, and want to allow external network access to EOS, please ensure that the default exported ports (8503, 8504) are available on the host. On Synology systems, these ports might already be in use (refer to this guide). If the ports are occupied, you will need to reconfigure the exported ports accordingly.
Configuration
This project uses the EOS.config.json
file to manage configuration settings.
Default Configuration
A default configuration file default.config.json
is provided. This file contains all the necessary configuration keys with their default values.
Custom Configuration
Users can specify a custom configuration directory by setting the environment variable EOS_DIR
.
- If the directory specified by
EOS_DIR
contains an existingconfig.json
file, the application will use this configuration file. - If the
EOS.config.json
file does not exist in the specified directory, thedefault.config.json
file will be copied to the directory asEOS.config.json
.
Configuration Updates
If the configuration keys in the EOS.config.json
file are missing or different from those in default.config.json
, they will be automatically updated to match the default settings, ensuring that all required keys are present.
Classes and Functionalities
This project uses various classes to simulate and optimize the components of an energy system. Each class represents a specific aspect of the system, as described below:
-
Battery
: Simulates a battery storage system, including capacity, state of charge, and now charge and discharge losses. -
PVForecast
: Provides forecast data for photovoltaic generation, based on weather data and historical generation data. -
Load
: Models the load requirements of a household or business, enabling the prediction of future energy demand. -
Heatpump
: Simulates a heat pump, including its energy consumption and efficiency under various operating conditions. -
Strompreis
: Provides information on electricity prices, enabling optimization of energy consumption and generation based on tariff information. -
EMS
: The Energy Management System (EMS) coordinates the interaction between the various components, performs optimization, and simulates the operation of the entire energy system.
These classes work together to enable a detailed simulation and optimization of the energy system. For each class, specific parameters and settings can be adjusted to test different scenarios and strategies.
Customization and Extension
Each class is designed to be easily customized and extended to integrate additional functions or improvements. For example, new methods can be added for more accurate modeling of PV system or battery behavior. Developers are invited to modify and extend the system according to their needs.
Server API
See the Swagger API documentation for detailed information: EOS OpenAPI Spec