-
Notifications
You must be signed in to change notification settings - Fork 13
Getting Started with EnergyPlus Measures Part 2: Creating Actuators
This tutorial will lead you through the process of creating an actuator which you can control through Alfalfa.
Note: This tutorial assumes you have already completed Getting Started with EnergyPlus Measures Part 1: Creating Inputs and Outputs
As in the previous tutorial code will be inserted into the run(...)
method. The below code will create an actuator which controls the outdoor air temperature of the model.
# The actuator must be attached to the model's outdoor air node, so here we get that object
outdoor_air_node = workspace.getObjectsByType('OutdoorAir:Node'.to_IddObjectType)[0]
# We need the name of the node in order to attach to it
outdoor_air_node_name = outdoor_air_node.name.get
# Create the actuator
outdoor_air_temp_actuator = create_actuator(create_ems_str('Outdoor Air Temperature'), # EMS name of the input to create
outdoor_air_node_name, # Component to actuate
'Outdoor Air System Node', # Component type
'Drybulb Temperature', # Control Type
true) # Set up actuator for external control
# Register the actuator
register_input(outdoor_air_temp_actuator)
At this point you have an actuator which controls the outdoor air temperature of your model. However, you may notice that when you read the value of this point after you start the site it is 0
. This is because by default the value reported is from the input variable, not from the component you are actuating. The next step will go over how to fix this.
In this step we will create an OutputVariable
which listens to the temperature of the outdoor air node and tell Alfalfa that this is the value we want reported for the point we created in the previous step.
# Create the output variable for the outdoor air node's temperature
outdoor_air_temp = create_output_variable(outdoor_air_node_name, 'System Node Temperature')
# Set this variable as the echo for our point
outdoor_air_temp_actuator.echo = outdoor_air_temp
Now if we upload and start our site again we can see that the value of our point reflects the outdoor air temperature.
- Getting Started with Model Measures Part 1: Creating Inputs and Outputs
- Getting Started with Model Measures Part 2: Creating Actuators
- Getting Started with EnergyPlus Measures Part 1: Creating Inputs and Outputs
- Getting Started with EnergyPlus Measures Part 2: Creating Actuators
- How to Configure an OpenStudio Model
- How to Configure Measures for Use with Alfalfa Ruby Gem
- How to Create Inputs and Outputs With Measures
- How to Run URBANopt Output Models in Alfalfa
- How to Migrate EnergyPlus Python Plugins
- How to Integrate Python based Electric Vehicle Models with OpenStudio Workflows
- How to Locally Test OpenStudio Models
- Required Structure of OpenStudio Workflow
- List of Automatically Generated Energyplus Points
- Alfalfa EnergyPlus Mixin Methods
- Getting Started with Uploading and Running a Model Using Python
- Getting Started with Uploading and Running a Model Using the UI
- How to Install Alfalfa Client
- How to Preprocess and Upload a Model
- How to Step Through a Simulation
- How to View Historical Data in Grafana
- How to Configure an Alias
- How to Troubleshoot Models