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

How can I control node and fan actuators in EnergyPlus via Python API without being overwritten by SetpointManagers or system logic?

asked 2025-05-08 08:41:59 -0500

Donna's avatar

updated 2025-05-08 09:11:58 -0500

Hello all,

I am working on a project where I need to control certain actuators in EnergyPlus using the Python API, specifically:

  • System Node Temperature Setpoints (e.g., for supply air nodes and zone equipment inlet nodes)
  • Fan Air Mass Flow Rate (for supply fans)

I have set up my Python script to obtain actuator handles and set values at each timestep. However, when I check the simulation results (e.g., in the .eso file), the actual node temperatures and flow rates often do not match the values I set via the actuators. I suspect that my actuator values are being overwritten, possibly by SetpointManagers or other internal system logic.

Here's what I've tried and checked:

  1. I removed SetpointManagers for the nodes I want to control via Python, but left them in place for other nodes that require setpoints.
  2. I confirmed that my Python script is obtaining valid actuator handles (handle > 0) and is setting values at each timestep.
  3. I log the setpoints I apply, and compare them to the actual node values in the output files.
  4. Despite this, the actual node values often do not match the setpoints I set, especially when the system is not calling for flow or when other controls may be active.

My questions:

  1. What is the best practice for ensuring that actuator values set via the Python API are not overwritten by SetpointManagers or other EnergyPlus controls?

  2. Are there specific object types or node types where EnergyPlus will always override Python/EMS actuator values, regardless of input?

  3. Is there a recommended workflow for disabling or bypassing SetpointManagers for nodes I want to control via Python, while still satisfying EnergyPlus's requirement that all necessary nodes have setpoints?

  4. Are there any tips for debugging or confirming that my actuator values are being applied as intended, especially for cases where the node may be inactive (e.g., no flow) or the system logic imposes limits?

Example of what I'm doing in Python: python temp_handle = api.exchange.get_actuator_handle( state, "System Node Setpoint", "Temperature Setpoint", "MY NODE NAME" ) if temp_handle > 0: api.exchange.set_actuator_value(state, temp_handle, 14.0) Example of what I see in the .eso file: 2191,1,MY NODE NAME,System Node Temperature [C] !TimeStep ... 2191,17.0 But I set 14.0°C in Python.

Any advice or references to documentation on how to ensure my Python actuator values are honored would be greatly appreciated!

Thank you!

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
2

answered 2025-05-20 06:13:40 -0500

updated 2025-05-20 08:10:50 -0500

  1. My go-to when I'm working on a new implementation in EnergyPlus is to reference the example files. ASHRAE901_OfficeLarge_STD2019_Denver_Chiller205.idf uses EMS to override the setpoint temperatures at various nodes. One important thing to note is that the program is being run inside the HVAC system iteration loop (EnergyPlus Model Calling Point is InsideHVACSystemIterationLoop). If your System Node Setpoint Temperature Output:Variable for your controlled node is reflecting your calculated values, then you are setting the node setpoint correctly.
    1. If your implementation is not controlling to your node setpoints, it suggests that your components may be controlled by something other than a setpoint. Coils inside a ZoneHVAC or AirLoopHVAC:Unitary object are usually controlled by loads, not setpoints. Coil:Heating:Water and Coil:Cooling:Water that are listed on an AirLoopHVAC supply branch will each have a Controller:WaterCoil that specifies both a sensor and actuator node. Similarly, CoilSystem:Cooling:DX and CoilSystem:Heating:DX have sensor nodes. SetpointManagers are only effective if there is equipment that can respond to them. There are similar options on the plant side. If you share exactly what equipment you're trying to control, I can give you more specific suggestions.
    2. If you follow the advice in #1, you should be all set.
    3. When nodes have no flow, they may continue to show the temperature at the last timestep when there was flow. This is a common occurance in EnergyPlus. No flow = no energy transfer = it doesn't matter what the temparature is.

As an aside - lots of applications that use Python / EMS can also be achieved by pre-calculating schedule values and then storing them in a Schedule:File object. This approach is much easier to troubleshoot and achieves faster runtimes.

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-05-08 08:41:59 -0500

Seen: 179 times

Last updated: May 20