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

Revision history [back]

click to hide/show revision 1
initial version

Possible solution to the EnergyPlus' two shading devices on same window impossibility?

Like many of you, I'm faced with the problem of wanting to assign two shading devices to the same window - an exterior shutter (shade) and an interior blind (operating on different conditions) - and finding it is not possible on EnergyPlus, even with EMS' shading control. The simplest way would be to just drop one device. In my case, I would place exterior blinds, but that's not ideal nor what I desire for my model - I want to use the shutters as "movable insulation", and the blinds to block radiation while still providing some daylighting when the occupants are home.

So I've thought of this: while specifying a window's shading control on EMS, would it be possible to include the second device's conditions that when met change the window construction to another one including (the window and) only the second device? (The construction would be called with ConstructionIndexVariable.) Stipulating the second one like this, EnergyPlus would still assume the correct placement of the device layer (since it is defined by order in Construction) and assume it as totally deployed (on), or not? And if it was a blind, it would simply be fixed at the slat angle defined on Material.

Would this cause conflicts with the window construction associated with the first device's WindowShadingControl? Maybe if the first one is defined as a separate device, not a construction with shading, no problems would arise? I haven't tested this since my script isn't complete yet. Would this produce no E+ internal problems and work in the desired manner?

If you know, please let me know.

Thanks in advance.

Possible solution to the EnergyPlus' two shading devices on same window impossibility?

Like many of you, I'm faced with the problem of wanting to assign two shading devices to the same window - an exterior shutter (shade) and an interior blind (operating on different conditions) - and finding it is not possible on EnergyPlus, even with EMS' shading control. The simplest way would be to just drop one device. In my case, I would place exterior blinds, but that's not ideal nor what I desire for my model - I want to use the shutters as "movable insulation", and the blinds to block radiation while still providing some daylighting when the occupants are home.

So I've thought of this: while specifying a window's shading control on EMS, would it be possible to include the second device's conditions that when met change the window construction to another one including (the window and) only the second device? (The construction would be called with ConstructionIndexVariable.) Stipulating the second one like this, EnergyPlus would still assume the correct placement of the device layer (since it is defined by order in Construction) and assume it as totally deployed (on), or not? And if it was a blind, it would simply be fixed at the slat angle defined on Material.

Would this cause conflicts with the window construction associated with the first device's WindowShadingControl? Maybe if the first one is defined as a separate device, not a construction with shading, no problems would arise? I haven't tested this since my script isn't complete yet. Would this produce no E+ internal problems and work in the desired manner?

If you know, please let me know.

know. Thanks in advance.

--EDIT:

According to https://unmethours.com/question/35413/night-shutter-interior-window-energyplus/ which refers to @MJWitte's answer on https://unmethours.com/question/32800/does-e-consider-interior-shading-when-calculating-the-operative-temperature/ about shading an internal window, my construction switch theory was right. And I think E+ performs correct optical and radiative assessments to extend this to external windows as well, since assigning a Construction with Shading is an option in WindowShadingControl and this method simply emulates that with EMS, so I conclude it must be a valid method for all openings.

So, shading devices can be changed by changing the whole window construction with EMS' Surface Construction State, solving the two devices on same window problem and the shading device on internal opening impossibility (which is also useful for me).

I used: as the primary device, the external shutter declared on WindowShadingControl (inserted as a separate device, not a construction), and as the secondary device the internal blinds constructions on EMS. I did it like this simply because I have more shutter conditions and I had already started writing the EMS Window Shading Control Control Status for the shutters, but this way the blinds are fixed at the slat angle defined on Material. I may change it to make the blinds block solar beam radiation and place the shutters with the EMS construction.

Below is a part of my EMS Program for the shading control. I use the shutters at night, both while sleeping and a bit before, and to prevent overheating while the house is unoccupied, and the blinds mainly to block excessive sun when the house is occupied. I use schedules, the Shading Control constants have been initialized and given names, so was the new window construction on ConstructionIndexVariable, the blinds' slat angle was defined as 45º on Material:Blind, and 'Shade' refers to the shutter:

EnergyManagementSystem:Program,
    Bedrooms_wiShadingControl,
    SET BR1wiConstruct = Null,
    IF BR1a2Awake == 0,
    SET BR1wiShadiStatus = ExteriorShadeOn,
    ELSEIF SunIsUp == 0 && BR1AirTemp < NatVentSetpoint,
    SET BR1wiShadiStatus = ExteriorShadeOn,
    ELSEIF HOUSEOccupancy == 0 && BR1AirTemp >= NatVentSetpoint && BR1AirTemp < OutdAirTemp,
    SET BR1wiShadiStatus = ExteriorShadeOn,
    ELSEIF BR1AirTemp >= NatVentSetpoint && BR1wiSolRadIncid > 150 && BR1AirTemp < OutdAirTemp,
    SET BR1wiConstruct = ExtWindowwIntHorizBlind45,
    ELSE,
    SET BR1wiShadiStatus = ShadingOff,
    ENDIF;

I'm confident but not absolutely certain of what's above since I'm no expert. Can the experts still confirm if this method and my code are entirely correct, please?

And on that note, a tiny question: when using EMS for windows opening and shading control, the availability shedules inserted in AFN and ShadingControl (if scheduled) are still valid and not overriden (unless dictated so), right? The documentation never mentions this, I assumed it as obvious, but would of course prefer confirmation.

Thanks in advance.

Possible solution to the EnergyPlus' two shading devices on same window impossibility?

Like many of you, I'm faced with the problem of wanting to assign two shading devices to the same window - an exterior shutter (shade) and an interior blind (operating on different conditions) - and finding it is not possible on EnergyPlus, even with EMS' shading control. The simplest way would be to just drop one device. In my case, I would place exterior blinds, but that's not ideal nor what I desire for my model - I want to use the shutters as "movable insulation", and the blinds to block radiation while still providing some daylighting when the occupants are home.

So I've thought of this: while specifying a window's shading control on EMS, would it be possible to include the second device's conditions that when met change the window construction to another one including (the window and) only the second device? (The construction would be called with ConstructionIndexVariable.) Stipulating the second one like this, EnergyPlus would still assume the correct placement of the device layer (since it is defined by order in Construction) and assume it as totally deployed (on), or not? And if it was a blind, it would simply be fixed at the slat angle defined on Material.

Would this cause conflicts with the window construction associated with the first device's WindowShadingControl? Maybe if the first one is defined as a separate device, not a construction with shading, no problems would arise? I haven't tested this since my script isn't complete yet. Would this produce no E+ internal problems and work in the desired manner?

If you know, please let me know. Thanks in advance.

--EDIT:

According to https://unmethours.com/question/35413/night-shutter-interior-window-energyplus/ which refers to @MJWitte's answer on https://unmethours.com/question/32800/does-e-consider-interior-shading-when-calculating-the-operative-temperature/ about shading an internal window, my construction switch theory was right. And I think E+ performs correct optical and radiative assessments to extend this to external windows as well, since assigning a Construction with Shading is an option in WindowShadingControl and this method simply emulates that with EMS, so I conclude it must be a valid method for all openings.

So, shading devices can be changed by changing the whole window construction with EMS' Surface Construction State, solving the two devices on same window problem and the shading device on internal opening impossibility (which is also useful for me).

I used: as the primary device, the external shutter declared on WindowShadingControl (inserted as a separate device, not a construction), and as the secondary device the internal blinds constructions on EMS. I did it like this simply because I have more shutter conditions and I had already started writing the EMS Window Shading Control Control Status for the shutters, but this way the blinds are fixed at the slat angle defined on Material. I may change it to make the blinds block solar beam radiation and place the shutters with the EMS construction.

Below is a part of my EMS Program for the shading control. I use the shutters at night, both while sleeping and a bit before, and to prevent overheating while the house is unoccupied, and the blinds mainly to block excessive sun when the house is occupied. I use schedules, the Shading Control constants have been initialized and given names, so was the new window construction on ConstructionIndexVariable, the blinds' slat angle was defined as 45º on Material:Blind, and 'Shade' refers to the shutter:

EnergyManagementSystem:Program,
    Bedrooms_wiShadingControl,
    SET BR1wiConstruct = Null,
    IF BR1a2Awake == 0,
    SET BR1wiShadiStatus = ExteriorShadeOn,
    ELSEIF SunIsUp == 0 && BR1AirTemp < NatVentSetpoint,
    SET BR1wiShadiStatus = ExteriorShadeOn,
    ELSEIF HOUSEOccupancy == 0 && BR1AirTemp >= NatVentSetpoint && BR1AirTemp < OutdAirTemp,
    SET BR1wiShadiStatus = ExteriorShadeOn,
    ELSEIF BR1AirTemp >= NatVentSetpoint && BR1wiSolRadIncid > 150 && BR1AirTemp < OutdAirTemp,
    SET BR1wiConstruct = ExtWindowwIntHorizBlind45,
    ELSE,
    SET BR1wiShadiStatus = ShadingOff,
    ENDIF;

I'm confident but not absolutely certain of what's above since I'm no expert. Can the experts still confirm if this method and my code are entirely correct, please?

And on that note, a tiny question: when using EMS for windows opening and shading control, the availability shedules inserted in AFN and ShadingControl (if scheduled) are still valid and not overriden (unless dictated so), right? The documentation never mentions this, I assumed it as obvious, but would of course prefer confirmation.

Thanks in advance.

-- EDIT 2:

Switched the internal blinds and external shutters around to be able to set blinds to block beam rad. Now the blinds are defined in WindowShadingControl and the shutters are the construction. Edited EMS code:

EnergyManagementSystem:Program,
    Bedrooms_wiShadingControl,
    SET BR1wiConstruct = Null,
    IF BR1a2Awake == 0,   
    SET BR1wiConstruct = ExtWindowwExtShutter,  
    ELSEIF SunIsUp == 0 && BR1AirTemp < NatVentSetpoint, 
    SET BR1wiConstruct = ExtWindowwExtShutter, 
    ELSEIF HOUSEOccupancy == 0 && BR1AirTemp >= NatVentSetpoint && BR1AirTemp < OutdAirTemp,  
    SET BR1wiConstruct = ExtWindowwExtShutter,  
    ELSEIF BR1AirTemp >= NatVentSetpoint && BR1wiSolRadIncid > 150 && BR1AirTemp < OutdAirTemp, 
    SET BR1wiShadiStatus = InteriorBlindOn,  
    ELSE,                 
    SET BR1wiShadiStatus = ShadingOff, 
    ENDIF;

Possible solution to the EnergyPlus' two shading devices on same window impossibility?

Like many of you, I'm faced with the problem of wanting to assign two shading devices to the same window - an exterior shutter (shade) and an interior blind (operating on different conditions) - and finding it is not possible on EnergyPlus, even with EMS' shading control. The simplest way would be to just drop one device. In my case, I would place exterior blinds, but that's not ideal nor what I desire for my model - I want to use the shutters as "movable insulation", and the blinds to block radiation while still providing some daylighting when the occupants are home.

So I've thought of this: while specifying a window's shading control on EMS, would it be possible to include the second device's conditions that when met change the window construction to another one including (the window and) only the second device? (The construction would be called with ConstructionIndexVariable.) Stipulating the second one like this, EnergyPlus would still assume the correct placement of the device layer (since it is defined by order in Construction) and assume it as totally deployed (on), or not? And if it was a blind, it would simply be fixed at the slat angle defined on Material.

Would this cause conflicts with the window construction associated with the first device's WindowShadingControl? Maybe if the first one is defined as a separate device, not a construction with shading, no problems would arise? I haven't tested this since my script isn't complete yet. Would this produce no E+ internal problems and work in the desired manner?

If you know, please let me know. Thanks in advance.

--EDIT:

According to https://unmethours.com/question/35413/night-shutter-interior-window-energyplus/ which refers to @MJWitte's answer on https://unmethours.com/question/32800/does-e-consider-interior-shading-when-calculating-the-operative-temperature/ about shading an internal window, my construction switch theory was right. And I think E+ performs correct optical and radiative assessments to extend this to external windows as well, since assigning a Construction with Shading is an option in WindowShadingControl and this method simply emulates that with EMS, so I conclude it must be a valid method for all openings.

So, shading devices can be changed by changing the whole window construction with EMS' Surface Construction State, solving the two devices on same window problem and the shading device on internal opening impossibility (which is also useful for me).

I used: as the primary device, the external shutter declared on WindowShadingControl (inserted as a separate device, not a construction), and as the secondary device the internal blinds constructions on EMS. I did it like this simply because I have more shutter conditions and I had already started writing the EMS Window Shading Control Control Status for the shutters, but this way the blinds are fixed at the slat angle defined on Material. I may change it to make the blinds block solar beam radiation and place the shutters with the EMS construction.

Below is a part of my EMS Program for the shading control. I use the shutters at night, both while sleeping and a bit before, and to prevent overheating while the house is unoccupied, and the blinds mainly to block excessive sun when the house is occupied. I use schedules, the Shading Control constants have been initialized and given names, so was the new window construction on ConstructionIndexVariable, the blinds' slat angle was defined as 45º on Material:Blind, and 'Shade' refers to the shutter:

EnergyManagementSystem:Program,
    Bedrooms_wiShadingControl,
    SET BR1wiConstruct = Null,
    SET BR1wiShadiStatus = ShadingOff,
    IF BR1a2Awake == 0,
    SET BR1wiShadiStatus = ExteriorShadeOn,
    ELSEIF SunIsUp == 0 && BR1AirTemp < NatVentSetpoint,
    SET BR1wiShadiStatus = ExteriorShadeOn,
    ELSEIF HOUSEOccupancy == 0 && BR1AirTemp >= NatVentSetpoint && BR1AirTemp < OutdAirTemp,
    SET BR1wiShadiStatus = ExteriorShadeOn,
    ELSEIF BR1AirTemp >= NatVentSetpoint && BR1wiSolRadIncid > 150 && BR1AirTemp < OutdAirTemp,
    SET BR1wiConstruct = ExtWindowwIntHorizBlind45,
    ELSE,
    SET BR1wiShadiStatus = ShadingOff,
    ENDIF;

I'm confident but not absolutely certain of what's above since I'm no expert. Can the experts still confirm if this method and my code are entirely correct, please?

And on that note, a tiny question: when using EMS for windows opening and shading control, the availability shedules inserted in AFN and ShadingControl (if scheduled) are still valid and not overriden (unless dictated so), right? The documentation never mentions this, I assumed it as obvious, but would of course prefer confirmation.

Thanks in advance.

-- EDIT 2:

Switched the internal blinds and external shutters around to be able to set blinds to block beam rad. Now the blinds are defined in WindowShadingControl and the shutters are the construction. Edited EMS code:

EnergyManagementSystem:Program,
    Bedrooms_wiShadingControl,
    SET BR1wiConstruct = Null,
    SET BR1wiShadiStatus = ShadingOff,
    IF BR1a2Awake == 0,   
    SET BR1wiConstruct = ExtWindowwExtShutter,  
    ELSEIF SunIsUp == 0 && BR1AirTemp < NatVentSetpoint, 
    SET BR1wiConstruct = ExtWindowwExtShutter, 
    ELSEIF HOUSEOccupancy == 0 && BR1AirTemp >= NatVentSetpoint && BR1AirTemp < OutdAirTemp,  
    SET BR1wiConstruct = ExtWindowwExtShutter,  
    ELSEIF BR1AirTemp >= NatVentSetpoint && BR1wiSolRadIncid > 150 && BR1AirTemp < OutdAirTemp, 
    SET BR1wiShadiStatus = InteriorBlindOn,  
    ELSE,                 
    SET BR1wiShadiStatus = ShadingOff, 
InteriorBlindOn,
    ENDIF;

Possible solution to the EnergyPlus' two shading devices on same window impossibility?

Like many of you, I'm faced with the problem of wanting to assign two shading devices to the same window - an exterior shutter (shade) and an interior blind (operating on different conditions) - and finding it is not possible on EnergyPlus, even with EMS' shading control. The simplest way would be to just drop one device. In my case, I would place exterior blinds, but that's not ideal nor what I desire for my model - I want to use the shutters as "movable insulation", and the blinds to block radiation while still providing some daylighting when the occupants are home.

So I've thought of this: while specifying a window's shading control on EMS, would it be possible to include the second device's conditions that when met change the window construction to another one including (the window and) only the second device? (The construction would be called with ConstructionIndexVariable.) Stipulating the second one like this, EnergyPlus would still assume the correct placement of the device layer (since it is defined by order in Construction) and assume it as totally deployed (on), or not? And if it was a blind, it would simply be fixed at the slat angle defined on Material.

Would this cause conflicts with the window construction associated with the first device's WindowShadingControl? Maybe if the first one is defined as a separate device, not a construction with shading, no problems would arise? I haven't tested this since my script isn't complete yet. Would this produce no E+ internal problems and work in the desired manner?

If you know, please let me know. Thanks in advance.

--EDIT:

According to https://unmethours.com/question/35413/night-shutter-interior-window-energyplus/ which refers to @MJWitte's answer on https://unmethours.com/question/32800/does-e-consider-interior-shading-when-calculating-the-operative-temperature/ about shading an internal window, my construction switch theory was right. And I think E+ performs correct optical and radiative assessments to extend this to external windows as well, since assigning a Construction with Shading is an option in WindowShadingControl and this method simply emulates that with EMS, so I conclude it must be a valid method for all openings.

So, shading devices can be changed by changing the whole window construction with EMS' Surface Construction State, solving the two devices on same window problem and the shading device on internal opening impossibility (which is also useful for me).

I used: as the primary device, the external shutter declared on WindowShadingControl (inserted as a separate device, not a construction), and as the secondary device the internal blinds constructions on EMS. I did it like this simply because I have more shutter conditions and I had already started writing the EMS Window Shading Control Control Status for the shutters, but this way the blinds are fixed at the slat angle defined on Material. I may change it to make the blinds block solar beam radiation and place the shutters with the EMS construction.

Below is a part of my EMS Program for the shading control. I use the shutters at night, both while sleeping and a bit before, and to prevent overheating while the house is unoccupied, and the blinds mainly to block excessive sun when the house is occupied. I use schedules, the Shading Control constants have been initialized and given names, so was the new window construction on ConstructionIndexVariable, the blinds' slat angle was defined as 45º on Material:Blind, and 'Shade' refers to the shutter:

EnergyManagementSystem:Program,
    Bedrooms_wiShadingControl,
    SET BR1wiConstruct = Null,
    SET BR1wiShadiStatus = ShadingOff,
    IF BR1a2Awake == 0,
    SET BR1wiShadiStatus = ExteriorShadeOn,
    ELSEIF SunIsUp == 0 && BR1AirTemp < NatVentSetpoint,
    SET BR1wiShadiStatus = ExteriorShadeOn,
    ELSEIF HOUSEOccupancy == 0 && BR1AirTemp >= NatVentSetpoint && BR1AirTemp < OutdAirTemp,
    SET BR1wiShadiStatus = ExteriorShadeOn,
    ELSEIF BR1AirTemp >= NatVentSetpoint && BR1wiSolRadIncid > 150 && BR1AirTemp < OutdAirTemp,
    SET BR1wiConstruct = ExtWindowwIntHorizBlind45,
    ENDIF;

I'm confident but not absolutely certain of what's above since I'm no expert. Can the experts still confirm if this method and my code are entirely correct, please?

And on that note, a tiny question: when using EMS for windows opening and shading control, the availability shedules inserted in AFN and ShadingControl (if scheduled) are still valid and not overriden (unless dictated so), right? The documentation never mentions this, I assumed it as obvious, but would of course prefer confirmation.

Thanks in advance.

-- EDIT 2:

Switched the internal blinds and external shutters around to be able to set blinds to block beam rad. Now the blinds are defined in WindowShadingControl and the shutters are the construction. Edited EMS code:

EnergyManagementSystem:Program,
    Bedrooms_wiShadingControl,
    SET BR1wiConstruct = Null,
    SET BR1wiShadiStatus = ShadingOff,
    IF BR1a2Awake == 0,   
    SET BR1wiConstruct = ExtWindowwExtShutter,  
    ELSEIF SunIsUp == 0 && BR1AirTemp < NatVentSetpoint, 
    SET BR1wiConstruct = ExtWindowwExtShutter, 
    ELSEIF HOUSEOccupancy == 0 && BR1AirTemp >= NatVentSetpoint && BR1AirTemp < OutdAirTemp,  
    SET BR1wiConstruct = ExtWindowwExtShutter,  
    ELSEIF BR1AirTemp >= NatVentSetpoint && BR1wiSolRadIncid > 150 && BR1AirTemp < OutdAirTemp, 
    SET BR1wiShadiStatus = InteriorBlindOn,
    ENDIF;

-- EDIT 3: (I'm leaving all the codes because they can be helpful to someone)

Remembered I should be able to use the values of the OpenFactor actuators I created for the windows opening, instead of unnecessary controls:

EnergyManagementSystem:Program,
    Bedrooms_wiShadingControl, 
    SET BR1wiConstruct = Null, 
    SET BR1wiShadiStatus = ShadingOff,  
    IF BR1wiOpenFactor > 0,  
    SET BR1wiConstruct = Null,  
    ELSEIF SunIsUp == 0 || BR1a2Awake == 0, 
    SET BR1wiConstruct = ExtWindowwExtShutter,  
    ELSEIF HOUSEOccupancy == 0 && BR1AirTemp >= NatVentSetpoint && BR1AirTemp < OutdAirTemp,  
    SET BR1wiConstruct = ExtWindowwExtShutter,  
    ELSEIF BR1AirTemp >= NatVentSetpoint && BR1wiSolRadIncid > 150 && BR1AirTemp < OutdAirTemp,  
    SET BR1wiShadiStatus = InteriorBlindOn,  
    ENDIF,

Which brings me to another question: the values of already determined actuators can be used to set conditions on other EMS programs, yes? (The OpeningFactor program comes first in my ProgramCallingManager.)

--

Is all of this correct or not? Thank you!

Possible solution to the EnergyPlus' two shading devices on same window impossibility?

Like many of you, I'm faced with the problem of wanting to assign two shading devices to the same window - an exterior shutter (shade) and an interior blind (operating on different conditions) - and finding it is not possible on EnergyPlus, even with EMS' shading control. The simplest way would be to just drop one device. In my case, I would place exterior blinds, but that's not ideal nor what I desire for my model - I want to use the shutters as "movable insulation", and the blinds to block radiation while still providing some daylighting when the occupants are home.

So I've thought of this: while specifying a window's shading control on EMS, would it be possible to include the second device's conditions that when met change the window construction to another one including (the window and) only the second device? (The construction would be called with ConstructionIndexVariable.) Stipulating the second one like this, EnergyPlus would still assume the correct placement of the device layer (since it is defined by order in Construction) and assume it as totally deployed (on), or not? And if it was a blind, it would simply be fixed at the slat angle defined on Material.

Would this cause conflicts with the window construction associated with the first device's WindowShadingControl? Maybe if the first one is defined as a separate device, not a construction with shading, no problems would arise? I haven't tested this since my script isn't complete yet. Would this produce no E+ internal problems and work in the desired manner?

If you know, please let me know. Thanks in advance.

--EDIT:

According to https://unmethours.com/question/35413/night-shutter-interior-window-energyplus/ which refers to @MJWitte's answer on https://unmethours.com/question/32800/does-e-consider-interior-shading-when-calculating-the-operative-temperature/ about shading an internal window, my construction switch theory was right. And I think E+ performs correct optical and radiative assessments to extend this to external windows as well, since assigning a Construction with Shading is an option in WindowShadingControl and this method simply emulates that with EMS, so I conclude it must be a valid method for all openings.

So, shading devices can be changed by changing the whole window construction with EMS' Surface Construction State, solving the two devices on same window problem and the shading device on internal opening impossibility (which is also useful for me).

I used: as the primary device, the external shutter declared on WindowShadingControl (inserted as a separate device, not a construction), and as the secondary device the internal blinds constructions on EMS. I did it like this simply because I have more shutter conditions and I had already started writing the EMS Window Shading Control Control Status for the shutters, but this way the blinds are fixed at the slat angle defined on Material. I may change it to make the blinds block solar beam radiation and place the shutters with the EMS construction.

Below is a part of my EMS Program for the shading control. I use the shutters at night, both while sleeping and a bit before, and to prevent overheating while the house is unoccupied, and the blinds mainly to block excessive sun when the house is occupied. I use schedules, the Shading Control constants have been initialized and given names, so was the new window construction on ConstructionIndexVariable, the blinds' slat angle was defined as 45º on Material:Blind, and 'Shade' refers to the shutter:

EnergyManagementSystem:Program,
    Bedrooms_wiShadingControl,
    SET BR1wiConstruct = Null,
    SET BR1wiShadiStatus = ShadingOff,
    IF BR1a2Awake == 0,
    SET BR1wiShadiStatus = ExteriorShadeOn,
    ELSEIF SunIsUp == 0 && BR1AirTemp < NatVentSetpoint,
    SET BR1wiShadiStatus = ExteriorShadeOn,
    ELSEIF HOUSEOccupancy == 0 && BR1AirTemp >= NatVentSetpoint && BR1AirTemp < OutdAirTemp,
    SET BR1wiShadiStatus = ExteriorShadeOn,
    ELSEIF BR1AirTemp >= NatVentSetpoint && BR1wiSolRadIncid > 150 && BR1AirTemp < OutdAirTemp,
    SET BR1wiConstruct = ExtWindowwIntHorizBlind45,
    ENDIF;

I'm confident but not absolutely certain of what's everything above since I'm no expert. Can the experts still confirm if this method and my code are entirely correct, please?

And on that note, a tiny question: when using EMS for windows opening and shading control, the availability shedules inserted in AFN and ShadingControl (if scheduled) are still valid and not overriden (unless dictated so), right? The documentation never mentions this, I assumed it as obvious, but would of course prefer confirmation.

Thanks in advance.

-- EDIT 2:

Switched the internal blinds and external shutters around to be able to set blinds to block beam rad. Now the blinds are defined in WindowShadingControl and the shutters are the construction. Edited EMS code:

EnergyManagementSystem:Program,
    Bedrooms_wiShadingControl,
    SET BR1wiConstruct = Null,
    SET BR1wiShadiStatus = ShadingOff,
    IF BR1a2Awake == 0,   
    SET BR1wiConstruct = ExtWindowwExtShutter,  
    ELSEIF SunIsUp == 0 && BR1AirTemp < NatVentSetpoint, 
    SET BR1wiConstruct = ExtWindowwExtShutter, 
    ELSEIF HOUSEOccupancy == 0 && BR1AirTemp >= NatVentSetpoint && BR1AirTemp < OutdAirTemp,  
    SET BR1wiConstruct = ExtWindowwExtShutter,  
    ELSEIF BR1AirTemp >= NatVentSetpoint && BR1wiSolRadIncid > 150 && BR1AirTemp < OutdAirTemp, 
    SET BR1wiShadiStatus = InteriorBlindOn,
    ENDIF;

-- EDIT 3: (I'm leaving all the codes because they can be helpful to someone)

Remembered I should be able to use the values of the OpenFactor actuators I created for the windows opening, instead of unnecessary controls:

EnergyManagementSystem:Program,
    Bedrooms_wiShadingControl, 
    SET BR1wiConstruct = Null, 
    SET BR1wiShadiStatus = ShadingOff,  
    IF BR1wiOpenFactor > 0,  
    SET BR1wiConstruct = Null,  
    ELSEIF SunIsUp == 0 || BR1a2Awake == 0, 
    SET BR1wiConstruct = ExtWindowwExtShutter,  
    ELSEIF HOUSEOccupancy == 0 && BR1AirTemp >= NatVentSetpoint && BR1AirTemp < OutdAirTemp,  
    SET BR1wiConstruct = ExtWindowwExtShutter,  
    ELSEIF BR1AirTemp >= NatVentSetpoint && BR1wiSolRadIncid > 150 && BR1AirTemp < OutdAirTemp,  
    SET BR1wiShadiStatus = InteriorBlindOn,  
    ENDIF,

Which brings me to another question: the values of already determined actuators can be used to set conditions on other EMS programs, yes? (The OpeningFactor program comes first in my ProgramCallingManager.)

And IMPORTANT: has that OpenFactor - after being determined by my EMS conditions - been "corrected" according to the Availability Schedule declared on AFN (as done in normal AFN operations), storing the right OpenFactor value when its EMS program is over? I need to know that to use it on shading conditions. (Some AFN questions yeah, but still on the EMS topic.)

--

Is all I know this post looks like a bundled mess, but if you know the aswer to any of this correct or not? my Shading and AFN on EMS questions, please let me know. Thank you!

Possible solution to the EnergyPlus' two shading devices on same window impossibility?

Like many of you, I'm faced with the problem of wanting to assign two shading devices to the same window - an exterior shutter (shade) and an interior blind (operating on different conditions) - and finding it is not possible on EnergyPlus, even with EMS' shading control. The simplest way would be to just drop one device. In my case, I would place exterior blinds, but that's not ideal nor what I desire for my model - I want to use the shutters as "movable insulation", and the blinds to block radiation while still providing some daylighting when the occupants are home.

So I've thought of this: while specifying a window's shading control on EMS, would it be possible to include the second device's conditions that when met change the window construction to another one including (the window and) only the second device? (The construction would be called with ConstructionIndexVariable.) Stipulating the second one like this, EnergyPlus would still assume the correct placement of the device layer (since it is defined by order in Construction) and assume it as totally deployed (on), or not? And if it was a blind, it would simply be fixed at the slat angle defined on Material.

Would this cause conflicts with the window construction associated with the first device's WindowShadingControl? Maybe if the first one is defined as a separate device, not a construction with shading, no problems would arise? I haven't tested this since my script isn't complete yet. Would this produce no E+ internal problems and work in the desired manner?

If you know, please let me know. Thanks in advance.

--EDIT:

According to https://unmethours.com/question/35413/night-shutter-interior-window-energyplus/ which refers to @MJWitte's answer on https://unmethours.com/question/32800/does-e-consider-interior-shading-when-calculating-the-operative-temperature/ about shading an internal window, my construction switch theory was right. And I think E+ performs correct optical and radiative assessments to extend this to external windows as well, since assigning a Construction with Shading is an option in WindowShadingControl and this method simply emulates that with EMS, so I conclude it must be a valid method for all openings.

So, shading devices can be changed by changing the whole window construction with EMS' Surface Construction State, solving the two devices on same window problem and the shading device on internal opening impossibility (which is also useful for me).

I used: as the primary device, the external shutter declared on WindowShadingControl (inserted as a separate device, not a construction), and as the secondary device the internal blinds constructions on EMS. I did it like this simply because I have more shutter conditions and I had already started writing the EMS Window Shading Control Control Status for the shutters, but this way the blinds are fixed at the slat angle defined on Material. I may change it to make the blinds block solar beam radiation and place the shutters with the EMS construction.

Below is a part of my EMS Program for the shading control. I use the shutters at night, both while sleeping and a bit before, and to prevent overheating while the house is unoccupied, and the blinds mainly to block excessive sun when the house is occupied. I use schedules, the Shading Control constants have been initialized and given names, so was the new window construction on ConstructionIndexVariable, the blinds' slat angle was defined as 45º on Material:Blind, and 'Shade' refers to the shutter:

EnergyManagementSystem:Program,
    Bedrooms_wiShadingControl,
    SET BR1wiConstruct = Null,
    SET BR1wiShadiStatus = ShadingOff,
    IF BR1a2Awake == 0,
    SET BR1wiShadiStatus = ExteriorShadeOn,
    ELSEIF SunIsUp == 0 && BR1AirTemp < NatVentSetpoint,
    SET BR1wiShadiStatus = ExteriorShadeOn,
    ELSEIF HOUSEOccupancy == 0 && BR1AirTemp >= NatVentSetpoint && BR1AirTemp < OutdAirTemp,
    SET BR1wiShadiStatus = ExteriorShadeOn,
    ELSEIF BR1AirTemp >= NatVentSetpoint && BR1wiSolRadIncid > 150 && BR1AirTemp < OutdAirTemp,
    SET BR1wiConstruct = ExtWindowwIntHorizBlind45,
    ENDIF;

I'm confident but not absolutely certain of everything above since I'm no expert. Can the experts confirm if this method and my code are entirely correct, please?

And on that note, a tiny question: when using EMS for windows opening and shading control, the availability shedules inserted in AFN and ShadingControl (if scheduled) are still valid and not overriden overridden (unless dictated so), right? The documentation never mentions this, I assumed it as obvious, but would of course prefer confirmation.

Thanks in advance.

-- EDIT 2:

Switched the internal blinds and external shutters around to be able to set blinds to block beam rad. Now the blinds are defined in WindowShadingControl and the shutters are the construction. Edited EMS code:

EnergyManagementSystem:Program,
    Bedrooms_wiShadingControl,
    SET BR1wiConstruct = Null,
    SET BR1wiShadiStatus = ShadingOff,
    IF BR1a2Awake == 0,   
    SET BR1wiConstruct = ExtWindowwExtShutter,  
    ELSEIF SunIsUp == 0 && BR1AirTemp < NatVentSetpoint, 
    SET BR1wiConstruct = ExtWindowwExtShutter, 
    ELSEIF HOUSEOccupancy == 0 && BR1AirTemp >= NatVentSetpoint && BR1AirTemp < OutdAirTemp,  
    SET BR1wiConstruct = ExtWindowwExtShutter,  
    ELSEIF BR1AirTemp >= NatVentSetpoint && BR1wiSolRadIncid > 150 && BR1AirTemp < OutdAirTemp, 
    SET BR1wiShadiStatus = InteriorBlindOn,
    ENDIF;

-- EDIT 3: (I'm leaving all the codes because they can be helpful to someone)

Remembered I should be able to use the values of the OpenFactor actuators I created for the windows opening, instead of unnecessary controls:

EnergyManagementSystem:Program,
    Bedrooms_wiShadingControl, 
    SET BR1wiConstruct = Null, 
    SET BR1wiShadiStatus = ShadingOff,  
    IF BR1wiOpenFactor > 0,  
    SET BR1wiConstruct = Null,  
    ELSEIF SunIsUp == 0 || BR1a2Awake == 0, 
    SET BR1wiConstruct = ExtWindowwExtShutter,  
    ELSEIF HOUSEOccupancy == 0 && BR1AirTemp >= NatVentSetpoint && BR1AirTemp < OutdAirTemp,  
    SET BR1wiConstruct = ExtWindowwExtShutter,  
    ELSEIF BR1AirTemp >= NatVentSetpoint && BR1wiSolRadIncid > 150 && BR1AirTemp < OutdAirTemp,  
    SET BR1wiShadiStatus = InteriorBlindOn,  
    ENDIF,

Which brings me to another question: the values of already determined actuators can be used to set conditions on other EMS programs, yes? (The OpeningFactor program comes first in my ProgramCallingManager.)

And IMPORTANT: has that OpenFactor - after being determined by my EMS conditions - been "corrected" according to the Availability Schedule declared on AFN (as done in normal AFN operations), storing the right OpenFactor value when its EMS program is over? I need to know that to use it on shading conditions. (Some AFN questions yeah, but still on the EMS topic.)

--

I know this post looks like a bundled mess, but if you know the aswer to any of my Shading and AFN on EMS questions, please let me know. Thank you!