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

Direct ON-OFF Access to Heating/Cooling System via Python API

asked 2025-11-04 14:10:43 -0600

Angothoron's avatar

updated 2025-11-05 09:11:39 -0600

Hello,

I've got the attached IDF file and I'd like to gain direct access to the heating/cooling systems via the API.

Specifically I'm trying to avoid the use of setpoints or any internal logic built into energy plus and use it solely as a solver rather than have it try and control things. My goal is to fiddle with a control system of my own devising and trying to determine what I have control of versus what energyplus is trying to do is more trouble than it is worth.

Long and short if I tell the system to turn on, I would like it to run (ideally at a specific power rating), if I want it off, I want it off. Regardless of if this hits whatever performance goals is set by Energy Plus.

ShortVersion:

If I have an HVACTEMPLATE:SYSTEM:UNITARYHEATPUMP:AIRTOAIR

How do I force

  • Heat Pump Heating Coil Gross Rated Capacity {W}
  • Supplemental Heating Coil Capacity {W}
  • Cooling Coil Gross Rated Total Capacity {W}

to be applied at my say so...presumably through the use of an actuator. However the below code seems to only allow the actuator to run, rather than forcing it to run.

coolingSch_hndl = api.exchange.get_actuator_handle(state, "Schedule:Constant", "Schedule Value", "CoolingSch")
api.exchange.set_actuator_value(state, coolingSch_hndl, 1)

Thanks

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2025-11-07 07:41:50 -0600

Angothoron's avatar

I've managed to find a very inelegant way of doing this if anyone else is following along with the same question. I'd prefer a more straightforward method, but here is what I have thus far.

1) Set your heating/cooling setpoints well out of the way of what your system will ever hit.

2) Have an if statement that runs on each timestep which checks an externally managed setpoint and conditions of activation of whichever system you want to run.

3) Directly modify the heating/cooling setpoint within that timestep via the if statment to the externally managed setpoint, if you want to do this at 100-0 then this modification should be extremely high (I'm using 50C and it seems to be working)

4) Use api.exchange.set_actuator_value(state, coolingSch_hndl, 1) to allow the specific actuator you want to allow to run to run.

This will allow the system to function much more similarly to the ON-OFF functions available in actual installations rather than the variable allowances generated by EnergyPlus, though it is limited by the resolution of the timesteps which isn't optimal. There also appears to be some control left over meaning you are never getting 100% application of the system. But this IMO is a much better representation of how a system like this would actually work in the real world (minimal throttling)

edit flag offensive delete link more

Comments

Have you seen the Temperature Difference Between Cutout And Setpoint field? It allows modeling the on/off cycling of equipment. There's some additional discussion around it here.

shorowit's avatar shorowit  ( 2025-11-07 08:42:04 -0600 )edit
0

answered 2025-11-10 03:35:07 -0600

Dutchie's avatar

"I would like it to run (ideally at a specific power rating)"

Have you also found a way to do that?

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

Training Workshops

Question Tools

1 follower

Stats

Asked: 2025-11-04 14:10:27 -0600

Seen: 112 times

Last updated: Nov 07