Schedule
This module provides utilities for posting control schedules generated by the MPC to the Core API.
It includes functions to convert Pandas DataFrames, which represent the optimal control signals for various devices over time, into a dictionary format compatible with the Core API's scheduling endpoint. This module is crucial for translating the MPC's calculated dispatch decisions into actionable commands for the connected devices.
Functions
post_controls_schedule(controls: pd.DataFrame)
Posts the generated control schedule to the Core API.
This function takes a Pandas DataFrame containing the optimal control signals for various devices, converts it into a dictionary format expected by the Core API, and then sends it using the write_schedule
API call.
Args:
controls
: A Pandas DataFrame where the index represents timestamps and columns represent device/entity IDs, with values being the control signals (e.g., power setpoints).