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

Revision history [back]

As of version 9.3.0, EnergyPlus has two ways to interact with a running simulation using Python.

  • A new C API has been added to EnergyPlus, along with Python bindings, that allow you to very simply write a python script that registers callback functions in the simulation, then executes the simulation. At each callback, your python can call into EnergyPlus and read and actuate variables.
  • An alternative to the EMS system allows a user to write Python code that is essentially a plugin to a running simulation. Much like the new runtime API, this method allows your Python functions to read and write data during a simulation, but in this case, the workflow is slightly similar in that you don't need to write a function to call EnergyPlus to run. Instead you just specify your Python class in the original IDF file and run EnergyPlus.

This is a brand new implementation, and the base 9.3.0 version has some issues, but those have already been resolved and we are planning on a bug-fix release version of 9.3.0 that addresses those. It should be out very soon.