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

E+: Pause the simulation, get data for a full day, change schedules, continue simulation?

asked 2026-06-17 04:24:54 -0500

PmP's avatar

updated 2026-07-09 10:23:45 -0500

I want to know if it's possible to do the following:

Pause an ongoing simulation Make it execute another program and give it a simulation result on that timestep Get data as input from that external program Use that data and continue the simulation.

Basically, I want to run a year-long simulation stopping at the end of each day to execute external software. Giving that external software the value of a temperature at the time of stopping the simulation. Then, the external software does some calculations that result in schedule values for the next 24h of simulation. These calculations cannot be run inside an EMS directly. Has anyone worked with something similar to this?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2026-07-09 09:40:30 -0500

updated 2026-07-09 10:23:23 -0500

You just have to creative a bit.

Use a PythonPlugin file or the EnergyPlus Python API directly, hooking up a callback, say callback_begin_system_timestep_before_predictor for example.

The callback will fire each time, but just check whether you're actually at the first timestep of a day. There are a number of ways you can achieve this, see https://energyplus.readthedocs.io/en/... One way would be to check something like hour() == 0, zone_time_step_number() = 1 (test it yourself)

When that precondition arrives, you call your executable (subprocess.check_call for eg) and retrieve your values for the next 24 hours and store them on your class instance.

Every other callback firing event, you just retrieve what you already computed and assign that to your schedule actuator

It know this may look vague-ish (your question wasn't very specific either) but it's really not that hard to implement.


Edit: I got nerdsnipped and added a fully functional demonstration at https://github.com/jmarrec/OpenStudio...

edit flag offensive delete link more

Comments

1

Actually I asked the question while delving into using a PythonPlugin, just in case I was overengineering a solution.

I have a working PythonPlugin file that does what I needed and indeed the "check the timestep you want is the one you want" was a bit of an issue.

I stand comforted by this answer as it reinforces my choice of the approach to a solution. Thank you!

Edit: I will check my plugin against your demonstration, (My solution is barebones and ad-hoc) Thoughtful answers like this are very appreciated!

PmP's avatar PmP  ( 2026-07-09 10:23:42 -0500 )edit

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

Stats

Asked: 2026-06-17 04:24:54 -0500

Seen: 96 times

Last updated: yesterday