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

Basic example with pyfmi

asked 2019-08-06 09:19:08 -0600

clcs gravatar image


I am trying to run a dummy test to call EnergyPlus in Python as a FMU. The IDF file is a very slightly modified version of the EP example file "1ZoneUncontrolled". I added an ExternalInterface and a FMUExport:From:Variable to get the "Zone Mean Air Temperature" in ZONE ONE as an output of the FMU. I exported the IDF file as a FMU using the LBL tool. And I try to run it from Python using pyfmi.


model = load_fmu(fmu_path)
start_time = 60.0*60*24*1
final_time = 60.0*60*24*2
ncp = (final_time-start_time)/(3600./idf_steps_per_hour)
opts = model.simulate_options()
opts['ncp'] = ncp
res = model.simulate(


model = load_fmu(fmu_path)
start_time = 60.0*60*24*1
final_time = 60.0*60*24*2
model.initialize(start_time, final_time)

just run forever. What am I doing wrong ? The log file displays

FMIL: module = b'FMI1XML', log level = 2: b'Detected on line:29 of modelDescription.xml'
FMIL: module = b'FMI1XML', log level = 2: b'Found capability flag canSignalEvents which have been deprecated as it fills no function'

Also, when I simulate the IDF file from EP launch, I get the severe error ExternalInterface: Did not find file "socket.cfg"

Thank you for your help !

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-08-07 09:42:53 -0600

clcs gravatar image

OK, after running the same script from the command line, I got additional info on why nothing was happening. Turns out, energyplus was not in my PATH. Adding the energyplus installation directory solved the issue.

Both options above run fine.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer


Question Tools

1 follower


Asked: 2019-08-06 09:19:08 -0600

Seen: 117 times

Last updated: Aug 07