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