This repository contains the predictive_control Python package, which implements a robust and flexible hybrid control strategy combining Model Predictive Control (MPC) and Real-Time Control (RTC). Designed for intelligent energy management in highly electrified residential homes, this package optimizes energy consumption while ensuring strict adherence to grid limits and user preferences.
This package is a key component within a larger Building Intelligence ecosystem, as illustrated in the architecture diagram below. It is designed to run as a service that consumes data from the central Core API of the Building Intelligence platform.
The diagram shows three primary layers:
- Smart Devices: The source of data from various building assets (e.g., HVAC, EV chargers) using protocols like Modbus and Bacnet.
- Building Intelligence Platform: The core infrastructure (a separate software repository) that gathers, stores, and processes data, making it available via a
Core API. - Grid Services: A set of applications that consume the API data to provide value-added services.
The predictive_control package provides the implementation for the grid services highlighted in red: CLPU - Predictive (MPC+RTC) and Dynamic Tariffs (MPC). If you want more information about the main platform, you can visit its Documentation or GitHub Repository.
- Hybrid Control Strategy (MPC + RTC): Proactively plans energy usage with MPC and provides immediate, reactive adjustments with RTC to handle unforeseen consumption spikes.
- Flexible Device Integration: Offers a standardized
DeviceMPCinterface for seamless integration of various controllable devices (e.g., HVAC, water heaters, electric vehicles, batteries). - User-Centric Optimization: Balances energy cost minimization with occupant comfort by incorporating dynamic pricing and thermal models.
- Python 3.11+
- Poetry for dependency management.
- Docker for containerized execution.
-
Clone the repository:
git clone https://github.com/hq-opensource/predictive-control.git cd predictive-control -
Install dependencies using Poetry: This command will create a virtual environment and install all the necessary packages defined in
pyproject.toml.poetry install
The easiest way to run the application is by using the provided Docker container.
-
Build the Docker image:
docker build -t predictive-control . -
Run the Docker container:
docker run predictive-control
You can also run the application directly using the virtual environment managed by Poetry.
-
Activate the virtual environment:
poetry shell
-
Run the application:
python -m src.cold_pickup_mpc.app
See how to contribute to this project here.
See the license for this project here.
