Skip to main content

EnCoDaPy – Energy Control and Data Preparation in Python.

Project description

"EnCoDaPy" – Energy Control and Data Preparation in Python.

Overview

  • The Basic Controller provides a system for

    • read a configuration
    • receive data
    • start a calculation
    • return the results
  • This interaction is possible with several interfaces, see examples/03_interfaces:

    • FIWARE-API
    • MQTT
    • File
  • The controller has the functionality to read a configuration from JSON and ENV, validate it and return it as a model.

  • The framework provides components that can be used within a service.
    For more information and code, see: encodapy/components/README.md

  • Examples and documentation for each part of the project are available under: examples

Configuration

  • The configuration of the service must be provided via config.json and has several sections (see the examples):

    • name: Controller name - for documentation purposes only
    • interfaces: Indicates which interfaces are active
    • inputs: Configuration of the inputs to the controller
    • outputs: Configuration of the outputs
    • staticdata: Static data point configuration (Data that is not continuously updated)
    • controller_components: Configuration of the controller components, see encodapy/components/readme.md
    • controller_settings: General settings about the controller
  • ENVs are required to configure the interfaces / get the config with the default value [default]:

    CONFIG_PATH =  ["./config.json"]
    LOG_LEVEL =
    RELOAD_STATICDATA = False
    
    # FIWARE - Interface
    CB_URL = ["http://localhost:1026"]
    FIWARE_SERVICE = ["service"]
    FIWARE_SERVICE_PATH = [/]
    FIWARE_AUTH = [False]
    # only used if FIWARE_AUTH = true / Option 1 for authentication
    FIWARE_CLIENT_ID = 
    FIWARE_CLIENT_PW = 
    FIWARE_TOKEN_URL = 
    # only used if FIWARE_AUTH = true and the three previously not set / Option 2 for authentication
    FIWARE_BAERER_TOKEN = []
    
    CRATE_DB_URL = ["http://localhost:4200"]
    CRATE_DB_USER = ["crate"]
    CRATE_DB_PW = [""]
    CRATE_DB_SSL = [False]
    
    # FILE - Interface
    PATH_OF_INPUT_FILE = "path_to_the_file_\\validation_data.csv"
    START_TIME_FILE = "01.01.2023 06:00"
    TIME_FORMAT_FILE = "%d.%m.%Y %H:%M" - format of time in file
    

Usage

You could install the Package via PyPI:

pip install encodapy

To create your own custom service, you have to overwrite two functions of the ControllerBasicService:

  • prepare_start: This is a synchronous function that prepares the start of the algorithm and specifies aspects of the service. This should not take long due to health issues in Docker containers. It only needs to be overwritten if other tasks are required after initialisation of the service.
  • calculation(): Asynchronous function to perform the main calculation in the service
  • calibration(): Asynchronous function to calibrate the service or coefficients in the service if only required

To start the service, you need to call

  • start_calibration(): To start the calibration if required
  • start_service(): To start the service

A easy posibility to start the service is to run the base main.py. For more details, see the examples

Examples

For different examples and documentation, how to use the tool - see examples.

The examples are intended to help you use the tool and understand how it works:

  • the configuration
  • the use
  • the components

Units

  • Inputs and outputs get information about the unit. The class DataUnits is used for this.
  • More units must be added manually.
  • Timeranges:
    • Timeranges for data queries are different for calculation and calibration.
    • The following timeranges are possible
      • '"minute"'
      • '"hour"'
      • '"day"'
      • '"month"' (30 days for simple use)
  • Today, there ist no adjustment for different units. Its a TODO for the future

Deployment

The recommended way to run the service is:

  • Create a Python environment using Poetry (see pyproject.toml).
  • Use a Docker container for production deployments (create a custom image using the dockerfile).

License

This project is licensed under the BSD License - see the LICENSE file for details.

Copyright

EBC

2024-2025, TUD Dresden University of Technology, Chair of Building Energy Systems and Heat Supply

Related projects

  • EnOB: N5GEH-Serv - National 5G Energy Hub
    National 5G Energy Hub

  • EnOB: TWE-Flex - Optimisation and flexibilisation of domestic hot water heating systems
    Project Website

  • EnEff: E³ - Low-emission and energy-efficient energy supply in urban areas using the latest intelligent ICT structures
    Project Website

Acknowledgments

We gratefully acknowledge the financial support of the Federal Ministry for Economic Affairs and Climate Action (BMWK).

BMWK

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

encodapy-0.5.0.tar.gz (40.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

encodapy-0.5.0-py3-none-any.whl (49.3 kB view details)

Uploaded Python 3

File details

Details for the file encodapy-0.5.0.tar.gz.

File metadata

  • Download URL: encodapy-0.5.0.tar.gz
  • Upload date:
  • Size: 40.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.12.11 Linux/6.11.0-1018-azure

File hashes

Hashes for encodapy-0.5.0.tar.gz
Algorithm Hash digest
SHA256 1acf18ee9004259119a948d6020eb4f50391292a09e1a7f2e394d91f5542ab3f
MD5 4e0c82ea2e9cca2a160755294efb0c8c
BLAKE2b-256 2178eac434a222cae70cdd053f9d3abe2018928cfc63d27988dfef450f927e79

See more details on using hashes here.

File details

Details for the file encodapy-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: encodapy-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 49.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.12.11 Linux/6.11.0-1018-azure

File hashes

Hashes for encodapy-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0ef1fa71e0ee7e598a4860b2b75c5535c2d6619a40df797afa3a3fddcc057f53
MD5 6219615f915e285f74c0a8ac228b1444
BLAKE2b-256 a9b93c5cee829be02c992ebce3b9ca431f3be0c207a4b2a4c8ba47707bf8fccc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page