## Application Guide for EMS — EnergyPlus 8.8

### Application Guide for EMS

EnergyPlus offers a wide range of control options in the WindowProperty:ShadingControl object, but it is easy to imagine custom schemes for controlling shades or blinds that are not available. We need to ask, Can we use the EMS to override the shading controls?

We will take the example file PurchAirWindowBlind.idf and use EMS to add a new control scheme. This file has an interior blind that can be either “on” or “off.” The control scheme has three parts:

• Deploy the blind whenever too much direct sun would enter the zone and cause discomfort for the occupants.

• Deploy the blind whenever there is a significant cooling load.

• Leave the blind open whenever the first two constraints have not triggered.

We assume that a model for the direct sun control is based on incidence angle, where the angle is defined as zero for normal incidence relative to the plane of the window. When the direct solar incidence angle is less than 45 degrees, we want to draw the blind. EnergyPlus has a report variable called “Surface Ext Solar Beam Cosine Of Incidence Angle,” for which we will use a sensor in our EnergyManagementSystem:Sensor input object. This sensor is a cosine value that we turn into an angle value with the built-in function @ArcCos. Then we will use the built-in function @RadToDeg to convert from radians to degrees. This new window/solar incidence angle in degree may be an interesting report variable, so we use an EnergyManagementSystem:OutputVariable input object to create custom output.

Because the transmitted solar is a problem only when there is a cooling load, we also trigger the blind based on the current data for cooling. The report variable called “Zone/Sys Sensible Cooling Rate” is used in an EMS sensor to obtain an Erl variable with the most recent data about zone cooling load required to meet setpoint. When this value is positive, we know the zone cannot make good use of passive solar heating, so we close the blind.

The EMS actuator will override the operation of a WindowProperty:ShadingControl input object. Related to this, the EDD file shows

! <EnergyManagementSystem:Actuator Available>, Component Unique Name, Component Type, Control Type

Although the user-defined name for the WindowProperty:ShadingControl is “INCIDENT SOLAR ON BLIND,” the component unique name of the actuator that is available is called “ZN001:WALL001:WIN001.” There could be multiple windows, all with shades, and each is governed by a single WindowProperty:ShadingControl input object. The EMS actuator could override each window separately. The Control Type is called “Control Status,” and requires you to set the status to one of a set of possible control flags. For this case, with only an interior shade, there are two states for the actuator to take. The first shows the shade is “off,” and corresponds to a value of 0.0. The second shows the interior shade is “on,” and corresponds to a value of 6.0.

The EMS input objects for this example follow and are contained in the example file called “EMSWindowShadeControl.idf.”

Output:EnergyManagementSystem,
Verbose,
Verbose,
Verbose;

EnergyManagementSystem:Sensor,
Solar_Beam_Incident_Cos, !Name
Zn001:Wall001:Win001,! Output:Variable or Output:Meter Index Key Name
Surface Outside Face Beam Solar Incident Angle Cosine Value; ! Var Name

Output:Variable, Zn001:Wall001:Win001,
Surface Outside Face Beam Solar Incident Angle Cosine Value, Timestep;

EnergyManagementSystem:Sensor,
Zone_Sensible_Cool_Rate, !Name
RESISTIVE ZONE,! Output:Variable or Output:Meter Index Key Name
Zone Air System Sensible Cooling Rate; ! Var Name

Output:Variable, RESISTIVE ZONE,
Zone Air System Sensible Cooling Rate, Timestep;

EnergyManagementSystem:ProgramCallingManager,
Window Shading Device EMS Controller,    ! Name
BeginTimestepBeforePredictor , ! EnergyPlus Model Calling Point
Set_Shade_Control_State ;         ! Program Name 1

EnergyManagementSystem:Actuator,
Zn001:Wall001:Win001,    ! Component Name  Surface name with shade controls
Window Shading Control, ! Component Type
Control Status;    ! Control Type

EnergyManagementSystem:Program,
!
!
IF IncidentAngle < 45 , ! Block intense direct sun
ELSEIF Zone_Sensible_Cool_Rate > 20, ! block to reduce cooling loads
Else,
ENDIF ;

EnergyManagementSystem:OutputVariable,
Erl Shading Control Status, ! Name
Averaged, ! Type of Data in Variable
ZoneTimeStep ; ! Update Frequency

EnergyManagementSystem:OutputVariable,
Erl Zn001:Wall001:Win001 Incident Angle, ! Name
IncidentAngle, ! EMS Variable Name
Averaged, ! Type of Data in Variable
ZoneTimeStep ; ! Update Frequency

EnergyManagementSystem:GlobalVariable,  IncidentAngle;

Output:Variable,
*,
Timestep;

Output:Variable,
*,
Erl Zn001:Wall001:Win001 Incident Angle,
Timestep;

EnergyManagementSystem:ProgramCallingManager,
Init Window Shading Device Control Constants,    ! Name
BeginNewEnvironment , ! EnergyPlus Model Calling Point
InitializeShadeControlFlags ;         ! Program Name 1

EnergyManagementSystem:Program,
! these are control flag values used inside EnergyPlus for window shades
! EMS control of window shading devices involves setting the control values for shading control actuators with
!  one of these values. The variable names can be used or replaced, it is the whole number values that trigger
!  changes in the modeling.
!  Shades and Blinds are either fully on or fully off, partial positions require multiple windows.
! the window shading control flag values follow
!  -1: if window has no shading device
Set Shade_Status_None = 0.0 - 1.0,  ! this is how to write a negative number Erl does not have unary "minus,"  only binary subtraction
!   0: if shading device is off
!   1: if interior shade is on
!   2: if glazing is switched to darker state
!   3: if exterior shade is on
!   6: if interior blind is on
!   7: if exterior blind is on
!   8: if between-glass shade is on
!   9: if between-glass blind is on
!  10: window has interior shade that is off but may be triggered on later
!       to control daylight glare
!  20: window has switchable glazing that is unswitched but may be switched later
!       to control daylight glare or daylight illuminance
!  30: window has exterior shade that is off but may be triggered on later
!       to control daylaight glare or daylight illuminance
!  60: window has interior blind that is off but may be triggered on later
!       to control daylaight glare or daylight illuminance
!  70: window has exterior blind that is off but may be triggered on later
!       to control daylaight glare or daylight illuminance
!  80: window has between-glass shade that is off but may be triggered on later
!       to control daylaight glare or daylight illuminance
!  90: window has between-glass blind that is off but may be triggered on later
!       to control daylaight glare or daylight illuminance
! A "shading device" may be an exterior, interior or between-glass shade or blind,
! or the lower-transmitting (dark) state of switchable glazing (e.g., electrochromic).
! In all cases, the unshaded condition is represented
! by the construction given by window's Surface()%Construction and
! the shaded condition is represented by the construction given by
! the window's Surface()%ShadedConstruction