Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question

Revision history [back]

You need to use the callback functions https://nrel.github.io/EnergyPlus/api/python/runtime.html

There are different calling point, for which you should read the EnergyManagementSystem's documentation to understand them: https://bigladdersoftware.com/epx/docs/9-5/input-output-reference/group-energy-management-system-ems.html#field-energyplus-model-calling-point

For eg callback_begin_system_timestep_before_predictor corresponds to BeginTimestepBeforePredictor.

I have one example at https://github.com/jmarrec/OpenStudio_to_EnergyPlusAPI/blob/main/OpenStudio_to_EnergyPlusAPI.ipynb

For your information, you may also use the Python:Plugin object in which case you would keep running your simulation the same way you did before (via the command line interface (CLI, energyplus.exe) or EP-Launch). This would be exactly like using EnergyManagementSystem except the EnergyManagementSystem:Program is actually defined in an external .py file. Have a look at the Example Files that start with "PythonPlugin" (eg: https://github.com/NREL/EnergyPlus/blob/develop/testfiles/PythonPluginCustomSchedule.py)