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

Hi Nadish,

Let’s summarise the question. You would like to cycle your system ON and OFF in both cooling and heating mode. The operation in the heating mode should be:

  1. Keep the system running until the zone air temperature reaches the heating setpoint
  2. Switch off the system and keep it off until the zone air temperature drops below the heating setpoint by Toffset
  3. Switch on the system again.

Similarly, the operation in the cooling mode should be:

  1. Keep the system running until the zone air temperature reaches the cooling setpoint
  2. Switch off the system and keep it off until the zone air temperature rises above the cooling setpoint by Toffset.
  3. Switch on the system again.

We can identify three control zones in the attached diagram.

  • The crosshatched control zone (between heating setpoint and cooling setpoint) is a zone when the system is always OFF.
  • The grey-shaded control zones (below (heating setpoint – Toffset) line and above (cooling setpoint + Toffset) line) are zones when the system is always ON.
  • Control zones within Toffset from either heating setpoint or cooling setpoint are zones where system can be either ON or OFF depending on the previous operation. For example, if the heating setpoint is 21C and Toffset is 0.5C. When the zone air temperature reaches 21C the system should be stopped. The temperature in the zone starts dropping and in the next timestep it might be 20.7. It is still within the Toffset boundary and the system should remain OFF. If in the following timestep the zone air temperature drops below (heating setpoing – Toffset) the system will switch ON. Naturally, the zone air temperature will start rising, however it might not reash the heating setpoint within one timestep. This means that the system should remain ON. The behaviour is similar in the cooling mode.

image description

The task is to apply this control login within EnergyPlus by using EMS. The crude way of achieving this is to override the system availability schedule (AvailabilityManager:Scheduled > Packaged Rooftop Air Conditioner Availability Manager).

In your example the system availability schedule (Always On Discrete) is used by many other objects. You need to create new schedule:constant (let’s name it Cycle) and apply it to the Packaged Rooftop Air Conditioner Availability Manager.

Schedule:Constant,Cycle,OnOff,1; ! New schedule object

AvailabilityManager:Scheduled, ! Updated Availability Manager
  Packaged Rooftop Air Conditioner Availability Manager, 
  Cycle;

To be able to create desired control logic you need to have three EMS sensors: Zone Mean Air Temperature, Zone Thermostat Heating Setpoint Temperature, and Zone Thermostat Cooling Setpoint Temperature.

EnergyManagementSystem:Sensor,
  AptTemp,
  Thermal Zone 1,
  Zone Mean Air Temperature;

EnergyManagementSystem:Sensor,
  hSP,
  Thermal Zone 1,
  Zone Thermostat Heating Setpoint Temperature;

EnergyManagementSystem:Sensor,
  cSP,
  Thermal Zone 1,
  Zone Thermostat Cooling Setpoint Temperature;

In addition to EMS sensors you need an EMS Actuator which will overwrite the “Cycle” schedule (basically switches system ON and OFF)

EnergyManagementSystem:Actuator,
  AvailSCH_Overwrite,
  Cycle,
  Schedule:Constant,
  Schedule Value;

The EMS Program Calling Manager specifies when the ERL program is executed. In this case the condition of zone air temperature and system operation should be checked at the beginning of each timestep.

EnergyManagementSystem:ProgramCallingManager,
  Supervision,
  BeginTimestepBeforePredictor,
  HVAC_uncontolledloop_Supervision;

Last thing is the ERL program which actually integrates the control logic into the E+. If the zone air temperature is between setpoints, keep the system OFF (I introduces a small error of 0.01C due to system can maintain the zone temperature very close to the setpoint, for example within the range of 0.00something). If the system has been switched OFF and the zone air starts cooling (in the heating mode) or heating (in the cooling mode) but not exits the boundaries set by Toffset, than keep the system OFF. In any other case the system should be operated.

EnergyManagementSystem:Program,
  HVAC_uncontolledloop_Supervision,
  SET Toffset = 0.556,
  IF AptTemp > (hSP - 0.01) && AptTemp < (cSP + 0.01),
  SET AvailSCH_Overwrite = 0,
  ELSEIF AvailSCH_Overwrite == 0 && AptTemp >= (hSP - Toffset) && AptTemp <= (cSP + Toffset),
  SET AvailSCH_Overwrite = 0,
  ELSE,
  SET AvailSCH_Overwrite = 1,
  ENDIF;

This operation will cycle your system in minimum timestep intervals (5 minutes in your case). The impact of this is that the zone air temperature can drop/rise by significantly more than Toffset during one timestep. The improved operation should be to change the Calling point from BeginTimestepBeforePredictor to InsideHVACSystemIterationLoop. In this case the AptTemp sensor should use Zone Air Temperature Output:Variable instead of Zone Mean Air Temperature Output:Variable. This will improve control accuracy within Toffset boundaries; however, the system cycling ON/OFF will be much often.

The more sophisticated control would be to switch off the fan, cooling coil and heating coil (as well as to adjust the system availability) depending on the system requirements. However, I do not expect large difference in outputs.

First there is a need for more schedules

Schedule:Constant,FanAvail,OnOff,1; ! Assign to AvailabilityManager:Scheduled and to Fan:ConstantVolume objects
Schedule:Constant,HCAvail,OnOff,1; ! Assign to Coil:Cooling:DX:SingleSpeed and to CoilSystem:Cooling:DX objects
Schedule:Constant,CCAvail,OnOff,1; ! Assign to Coil:Heating:Electric object

EMS Sensors are the same

EnergyManagementSystem:Sensor,
  AptTemp,  Thermal Zone 1,
  Zone Mean Air Temperature;

EnergyManagementSystem:Sensor,
  hSP,
  Thermal Zone 1,
  Zone Thermostat Heating Setpoint Temperature;

EnergyManagementSystem:Sensor,
  cSP,        
  Thermal Zone 1,  
  Zone Thermostat Cooling Setpoint Temperature;

EMS Actuators follow the new assigned schedules

EnergyManagementSystem:Actuator,
  FanAvail_Overwrite,      
  FanAvail,                   
  Schedule:Constant,       
  Schedule Value;

EnergyManagementSystem:Actuator,
  HCAvail_Overwrite,
  HCAvail,                   
  Schedule:Constant,       
  Schedule Value;          

EnergyManagementSystem:Actuator,
  CCAvail_Overwrite,      
  CCAvail,                   
  Schedule:Constant,       
  Schedule Value;

EMS program calling point is the same

EnergyManagementSystem:ProgramCallingManager,
  Supervision,
  BeginTimestepBeforePredictor,  
  HVAC_uncontolledloop_Supervision;

while the program differs a bit

EnergyManagementSystem:Program,
  HVAC_uncontolledloop_Supervision,  
  SET Toffset = 0.556,     
  IF AptTemp > (hSP - 0.01) && AptTemp < (cSP + 0.01),  
  SET FanAvail_Overwrite = 0,  
  SET HCAvail_Overwrite = 0,
  SET CCAvail_Overwrite = 0,
  ELSEIF FanAvail_Overwrite == 0 && AptTemp >= (hSP - Toffset) && AptTemp <= (cSP + Toffset),  
  SET FanAvail_Overwrite = 0,  
  SET HCAvail_Overwrite = 0,
  SET CCAvail_Overwrite = 0,
  ELSEIF AptTemp < (hSP - Toffset),                   
  SET FanAvail_Overwrite = 1,
  SET HCAvail_Overwrite = 1,
  ELSEIF AptTemp > (cSP + Toffset),  
  SET FanAvail_Overwrite = 1,  
  SET CCAvail_Overwrite = 1,
  ENDIF;

You can also check the operation when the EMS calling point is changed from BeginTimestepBeforePredictor to InsideHVACSystemIterationLoop (Don’t forget to change the Output:Variable in the AptTemp sensor from Zone Mean Air Temperature to Zone Air Temperature).

Hi Nadish,

Let’s summarise the question. You would like to cycle your system ON and OFF in both cooling and heating mode. The operation in the heating mode should be:

  1. Keep the system running until the zone air temperature reaches the heating setpoint
  2. Switch off the system and keep it off until the zone air temperature drops below the heating setpoint by Toffset
  3. Switch on the system again.

Similarly, the operation in the cooling mode should be:

  1. Keep the system running until the zone air temperature reaches the cooling setpoint
  2. Switch off the system and keep it off until the zone air temperature rises above the cooling setpoint by Toffset.
  3. Switch on the system again.

We can identify three control zones in the attached diagram.

  • The crosshatched control zone (between heating setpoint and cooling setpoint) is a zone when the system is always OFF.
  • The grey-shaded control zones (below (heating setpoint – Toffset) line and above (cooling setpoint + Toffset) line) are zones when the system is always ON.
  • Control zones within Toffset from either heating setpoint or cooling setpoint are zones where system can be either ON or OFF depending on the previous operation. For example, if the heating setpoint is 21C and Toffset is 0.5C. When the zone air temperature reaches 21C the system should be stopped. The temperature in the zone starts dropping and in the next timestep it might be 20.7. It is still within the Toffset boundary and the system should remain OFF. If in the following timestep the zone air temperature drops below (heating setpoing – Toffset) the system will switch ON. Naturally, the zone air temperature will start rising, however it might not reash the heating setpoint within one timestep. This means that the system should remain ON. The behaviour is similar in the cooling mode.

image description

The task is to apply this control login within EnergyPlus by using EMS. The crude way of achieving this is to override the system availability schedule (AvailabilityManager:Scheduled > Packaged Rooftop Air Conditioner Availability Manager).

In your example the system availability schedule (Always On Discrete) is used by many other objects. You need to create new schedule:constant (let’s name it Cycle) and apply it to the Packaged Rooftop Air Conditioner Availability Manager.

Schedule:Constant,Cycle,OnOff,1; ! New schedule object

AvailabilityManager:Scheduled, ! Updated Availability Manager
  Packaged Rooftop Air Conditioner Availability Manager, 
  Cycle;

To be able to create desired control logic you need to have three EMS sensors: Zone Mean Air Temperature, Zone Thermostat Heating Setpoint Temperature, and Zone Thermostat Cooling Setpoint Temperature.

EnergyManagementSystem:Sensor,
  AptTemp,
  Thermal Zone 1,
  Zone Mean Air Temperature;

EnergyManagementSystem:Sensor,
  hSP,
  Thermal Zone 1,
  Zone Thermostat Heating Setpoint Temperature;

EnergyManagementSystem:Sensor,
  cSP,
  Thermal Zone 1,
  Zone Thermostat Cooling Setpoint Temperature;

In addition to EMS sensors you need an EMS Actuator which will overwrite the “Cycle” schedule (basically switches system ON and OFF)

EnergyManagementSystem:Actuator,
  AvailSCH_Overwrite,
  Cycle,
  Schedule:Constant,
  Schedule Value;

The EMS Program Calling Manager specifies when the ERL program is executed. In this case the condition of zone air temperature and system operation should be checked at the beginning of each timestep.

EnergyManagementSystem:ProgramCallingManager,
  Supervision,
  BeginTimestepBeforePredictor,
  HVAC_uncontolledloop_Supervision;

Last thing is the ERL program which actually integrates the control logic into the E+. If the zone air temperature is between setpoints, keep the system OFF (I introduces a small error of 0.01C due to system can maintain the zone temperature very close to the setpoint, for example within the range of 0.00something). If the system has been switched OFF and the zone air starts cooling (in the heating mode) or heating (in the cooling mode) but not exits the boundaries set by Toffset, than keep the system OFF. In any other case the system should be operated.

EnergyManagementSystem:Program,
  HVAC_uncontolledloop_Supervision,
  SET Toffset = 0.556,
  IF AptTemp > (hSP - 0.01) && AptTemp < (cSP + 0.01),
  SET AvailSCH_Overwrite = 0,
  ELSEIF AvailSCH_Overwrite == 0 && AptTemp >= (hSP - Toffset) && AptTemp <= (cSP + Toffset),
  SET AvailSCH_Overwrite = 0,
  ELSE,
  SET AvailSCH_Overwrite = 1,
  ENDIF;

This operation will cycle your system in minimum timestep intervals (5 minutes in your case). The impact of this is that the zone air temperature can drop/rise by significantly more than Toffset during one timestep. The improved operation should be to change the Calling point from BeginTimestepBeforePredictor to InsideHVACSystemIterationLoop. In this case the AptTemp sensor should use Zone Air Temperature Output:Variable instead of Zone Mean Air Temperature Output:Variable. This will improve control accuracy within Toffset boundaries; however, the system cycling ON/OFF will be much often.

The more sophisticated control would be to switch off the fan, cooling coil and heating coil (as well as to adjust the system availability) depending on the system requirements. However, I do not expect large difference in outputs.

First there is a need for more schedules

Schedule:Constant,FanAvail,OnOff,1; ! Assign to AvailabilityManager:Scheduled and to Fan:ConstantVolume objects
Schedule:Constant,HCAvail,OnOff,1; ! Assign to Coil:Cooling:DX:SingleSpeed and to CoilSystem:Cooling:DX objects
Schedule:Constant,CCAvail,OnOff,1; ! Assign to Coil:Heating:Electric object

EMS Sensors are the same

EnergyManagementSystem:Sensor,
  AptTemp,  Thermal Zone 1,
  Zone Mean Air Temperature;

EnergyManagementSystem:Sensor,
  hSP,
  Thermal Zone 1,
  Zone Thermostat Heating Setpoint Temperature;

EnergyManagementSystem:Sensor,
  cSP,        
  Thermal Zone 1,  
  Zone Thermostat Cooling Setpoint Temperature;

EMS Actuators follow the new assigned schedules

EnergyManagementSystem:Actuator,
  FanAvail_Overwrite,      
  FanAvail,                   
  Schedule:Constant,       
  Schedule Value;

EnergyManagementSystem:Actuator,
  HCAvail_Overwrite,
  HCAvail,                   
  Schedule:Constant,       
  Schedule Value;          

EnergyManagementSystem:Actuator,
  CCAvail_Overwrite,      
  CCAvail,                   
  Schedule:Constant,       
  Schedule Value;

EMS program calling point is the same

EnergyManagementSystem:ProgramCallingManager,
  Supervision,
  BeginTimestepBeforePredictor,  
  HVAC_uncontolledloop_Supervision;

while the program differs a bit

EnergyManagementSystem:Program,
  HVAC_uncontolledloop_Supervision,  
  SET Toffset = 0.556,     
  IF AptTemp > (hSP - 0.01) && AptTemp < (cSP + 0.01),  
  SET FanAvail_Overwrite = 0,  
  SET HCAvail_Overwrite = 0,
  SET CCAvail_Overwrite = 0,
  ELSEIF FanAvail_Overwrite == 0 && AptTemp >= (hSP - Toffset) && AptTemp <= (cSP + Toffset),  
  SET FanAvail_Overwrite = 0,  
  SET HCAvail_Overwrite = 0,
  SET CCAvail_Overwrite = 0,
  ELSEIF AptTemp < (hSP - Toffset),                   
  SET FanAvail_Overwrite = 1,
  SET HCAvail_Overwrite = 1,
  ELSEIF AptTemp > (cSP + Toffset),  
  SET FanAvail_Overwrite = 1,  
  SET CCAvail_Overwrite = 1,
  ENDIF;

You can also check the operation when the EMS calling point is changed from BeginTimestepBeforePredictor to InsideHVACSystemIterationLoop (Don’t forget to change the Output:Variable in the AptTemp sensor from Zone Mean Air Temperature to Zone Air Temperature).

Hi Nadish,

Let’s summarise the question. You would like to cycle your system ON and OFF in both cooling and heating mode. The operation in the heating mode should be:

  1. Keep the system running until the zone air temperature reaches the heating setpoint
  2. Switch off the system and keep it off until the zone air temperature drops below the heating setpoint by Toffset
  3. Switch on the system again.

Similarly, the operation in the cooling mode should be:

  1. Keep the system running until the zone air temperature reaches the cooling setpoint
  2. Switch off the system and keep it off until the zone air temperature rises above the cooling setpoint by Toffset.
  3. Switch on the system again.

We can identify three control zones in the attached diagram.

  • The crosshatched control zone (between heating setpoint and cooling setpoint) is a zone when the system is always OFF.
  • The grey-shaded control zones (below (heating setpoint – Toffset) line and above (cooling setpoint + Toffset) line) are zones when the system is always ON.
  • Control zones within Toffset from either heating setpoint or cooling setpoint are zones where system can be either ON or OFF depending on the previous operation. For example, if the heating setpoint is 21C and Toffset is 0.5C. When the zone air temperature reaches 21C the system should be stopped. The temperature in the zone starts dropping and in the next timestep it might be 20.7. It is still within the Toffset boundary and the system should remain OFF. If in the following timestep the zone air temperature drops below (heating setpoing – Toffset) the system will switch ON. Naturally, the zone air temperature will start rising, however it might not reash the heating setpoint within one timestep. This means that the system should remain ON. The behaviour is similar in the cooling mode.

image description

The task is to apply this control login within EnergyPlus by using EMS. The crude way of achieving this is to override the system availability schedule (AvailabilityManager:Scheduled > Packaged Rooftop Air Conditioner Availability Manager).

In your example the system availability schedule (Always On Discrete) is used by many other objects. You need to create new schedule:constant (let’s name it Cycle) and apply it to the Packaged Rooftop Air Conditioner Availability Manager.

Schedule:Constant,Cycle,OnOff,1; ! New schedule object

AvailabilityManager:Scheduled, ! Updated Availability Manager
  Packaged Rooftop Air Conditioner Availability Manager, 
  Cycle;

To be able to create desired control logic you need to have three EMS sensors: Zone Mean Air Temperature, Zone Thermostat Heating Setpoint Temperature, and Zone Thermostat Cooling Setpoint Temperature.

EnergyManagementSystem:Sensor,
  AptTemp,
  Thermal Zone 1,
  Zone Mean Air Temperature;

EnergyManagementSystem:Sensor,
  hSP,
  Thermal Zone 1,
  Zone Thermostat Heating Setpoint Temperature;

EnergyManagementSystem:Sensor,
  cSP,
  Thermal Zone 1,
  Zone Thermostat Cooling Setpoint Temperature;

In addition to EMS sensors you need an EMS Actuator which will overwrite the “Cycle” schedule (basically switches system ON and OFF)

EnergyManagementSystem:Actuator,
  AvailSCH_Overwrite,
  Cycle,
  Schedule:Constant,
  Schedule Value;

The EMS Program Calling Manager specifies when the ERL program is executed. In this case the condition of zone air temperature and system operation should be checked at the beginning of each timestep.

EnergyManagementSystem:ProgramCallingManager,
  Supervision,
  BeginTimestepBeforePredictor,
  HVAC_uncontolledloop_Supervision;

Last thing is the ERL program which actually integrates the control logic into the E+. If the zone air temperature is between setpoints, keep the system OFF (I introduces a small error of 0.01C due to system can maintain the zone temperature very close to the setpoint, for example within the range of 0.00something). If the system has been switched OFF and the zone air starts cooling (in the heating mode) or heating (in the cooling mode) but not exits the boundaries set by Toffset, than keep the system OFF. In any other case the system should be operated.

EnergyManagementSystem:Program,
  HVAC_uncontolledloop_Supervision,
  SET Toffset = 0.556,
  IF AptTemp > (hSP - 0.01) && AptTemp < (cSP + 0.01),
  SET AvailSCH_Overwrite = 0,
  ELSEIF AvailSCH_Overwrite == 0 && AptTemp >= (hSP - Toffset) && AptTemp <= (cSP + Toffset),
  SET AvailSCH_Overwrite = 0,
  ELSE,
  SET AvailSCH_Overwrite = 1,
  ENDIF;

This operation will cycle your system in minimum timestep intervals (5 minutes in your case). The impact of this is that the zone air temperature can drop/rise by significantly more than Toffset during one timestep. The improved operation should be to change the Calling point from BeginTimestepBeforePredictor to InsideHVACSystemIterationLoop. In this case the AptTemp sensor should use Zone Air Temperature Output:Variable instead of Zone Mean Air Temperature Output:Variable. This will improve control accuracy within Toffset boundaries; however, the system cycling ON/OFF will be much often.

The more sophisticated control would be to switch off the fan, cooling coil and heating coil (as well as to adjust the system availability) depending on the system requirements. However, I do not expect large difference in outputs.

First there is a need for more schedules

Schedule:Constant,FanAvail,OnOff,1; ! Assign to AvailabilityManager:Scheduled and to Fan:ConstantVolume objects
Schedule:Constant,HCAvail,OnOff,1; ! Assign to Coil:Cooling:DX:SingleSpeed and to CoilSystem:Cooling:DX objects
Schedule:Constant,CCAvail,OnOff,1; ! Assign to Coil:Heating:Electric object

EMS Sensors are the same

EnergyManagementSystem:Sensor,
  AptTemp,  Thermal Zone 1,
  Zone Mean Air Temperature;

EnergyManagementSystem:Sensor,
  hSP,
  Thermal Zone 1,
  Zone Thermostat Heating Setpoint Temperature;

EnergyManagementSystem:Sensor,
  cSP,        
  Thermal Zone 1,  
  Zone Thermostat Cooling Setpoint Temperature;

EMS Actuators follow the new assigned schedules

EnergyManagementSystem:Actuator,
  FanAvail_Overwrite,      
  FanAvail,                   
  Schedule:Constant,       
  Schedule Value;

EnergyManagementSystem:Actuator,
  HCAvail_Overwrite,
  HCAvail,                   
  Schedule:Constant,       
  Schedule Value;          

EnergyManagementSystem:Actuator,
  CCAvail_Overwrite,      
  CCAvail,                   
  Schedule:Constant,       
  Schedule Value;

EMS program calling point is the same

EnergyManagementSystem:ProgramCallingManager,
  Supervision,
  BeginTimestepBeforePredictor,  
  HVAC_uncontolledloop_Supervision;

while the program differs a bit

EnergyManagementSystem:Program,
  HVAC_uncontolledloop_Supervision,  
  SET Toffset = 0.556,     
  IF AptTemp > (hSP - 0.01) && AptTemp < (cSP + 0.01),  
  SET FanAvail_Overwrite = 0,  
  SET HCAvail_Overwrite = 0,
  SET CCAvail_Overwrite = 0,
  ELSEIF FanAvail_Overwrite == 0 && AptTemp >= (hSP - Toffset) && AptTemp <= (cSP + Toffset),  
  SET FanAvail_Overwrite = 0,  
  SET HCAvail_Overwrite = 0,
  SET CCAvail_Overwrite = 0,
  ELSEIF AptTemp < (hSP - Toffset),                   
  SET FanAvail_Overwrite = 1,
  SET HCAvail_Overwrite = 1,
  ELSEIF AptTemp > (cSP + Toffset),  
  SET FanAvail_Overwrite = 1,  
  SET CCAvail_Overwrite = 1,
  ENDIF;

You can also check the operation when the EMS calling point is changed from BeginTimestepBeforePredictor to InsideHVACSystemIterationLoop (Don’t forget to change the Output:Variable in the AptTemp sensor from Zone Mean Air Temperature to Zone Air Temperature).

Hi Nadish,

Let’s summarise the question. You would like to cycle your system ON and OFF in both cooling and heating mode. The operation in the heating mode should be:

  1. Keep the system running until the zone air temperature reaches the heating setpoint
  2. Switch off the system and keep it off until the zone air temperature drops below the heating setpoint by Toffset
  3. Switch on the system again.

Similarly, the operation in the cooling mode should be:

  1. Keep the system running until the zone air temperature reaches the cooling setpoint
  2. Switch off the system and keep it off until the zone air temperature rises above the cooling setpoint by Toffset.
  3. Switch on the system again.

We can identify three control zones in the attached diagram.

  • The crosshatched control zone (between heating setpoint and cooling setpoint) is a zone when the system is always OFF.
  • The grey-shaded control zones (below (heating setpoint – Toffset) line and above (cooling setpoint + Toffset) line) are zones when the system is always ON.
  • Control zones within Toffset from either heating setpoint or cooling setpoint are zones where system can be either ON or OFF depending on the previous operation. For example, if the heating setpoint is 21C and Toffset is 0.5C. When the zone air temperature reaches 21C the system should be stopped. The temperature in the zone starts dropping and in the next timestep it might be 20.7. It is still within the Toffset boundary and the system should remain OFF. If in the following timestep the zone air temperature drops below (heating setpoing – Toffset) the system will switch ON. Naturally, the zone air temperature will start rising, however it might not reash the heating setpoint within one timestep. This means that the system should remain ON. The behaviour is similar in the cooling mode.

image description

The task is to apply this control login within EnergyPlus by using EMS. The crude way of achieving this is to override the system availability schedule (AvailabilityManager:Scheduled > Packaged Rooftop Air Conditioner Availability Manager).

In your example the system availability schedule (Always On Discrete) is used by many other objects. You need to create new schedule:constant (let’s name it Cycle) and apply it to the Packaged Rooftop Air Conditioner Availability Manager.

Schedule:Constant,Cycle,OnOff,1; ! New schedule object

AvailabilityManager:Scheduled, ! Updated Availability Manager
  Packaged Rooftop Air Conditioner Availability Manager, 
  Cycle;

To be able to create desired control logic you need to have three EMS sensors: Zone Mean Air Temperature, Zone Thermostat Heating Setpoint Temperature, and Zone Thermostat Cooling Setpoint Temperature.

EnergyManagementSystem:Sensor,
  AptTemp,
  Thermal Zone 1,
  Zone Mean Air Temperature;

EnergyManagementSystem:Sensor,
  hSP,
  Thermal Zone 1,
  Zone Thermostat Heating Setpoint Temperature;

EnergyManagementSystem:Sensor,
  cSP,
  Thermal Zone 1,
  Zone Thermostat Cooling Setpoint Temperature;

In addition to EMS sensors you need an EMS Actuator which will overwrite the “Cycle” schedule (basically switches system ON and OFF)

EnergyManagementSystem:Actuator,
  AvailSCH_Overwrite,
  Cycle,
  Schedule:Constant,
  Schedule Value;

The EMS Program Calling Manager specifies when the ERL program is executed. In this case the condition of zone air temperature and system operation should be checked at the beginning of each timestep.

EnergyManagementSystem:ProgramCallingManager,
  Supervision,
  BeginTimestepBeforePredictor,
  HVAC_uncontolledloop_Supervision;

Last thing is the ERL program which actually integrates the control logic into the E+. If the zone air temperature is between setpoints, keep the system OFF (I introduces a small error of 0.01C due to system can maintain the zone temperature very close to the setpoint, for example within the range of 0.00something). If the system has been switched OFF and the zone air starts cooling (in the heating mode) or heating (in the cooling mode) but not exits the boundaries set by Toffset, than keep the system OFF. In any other case the system should be operated.

EnergyManagementSystem:Program,
  HVAC_uncontolledloop_Supervision,
  SET Toffset = 0.556,
  IF AptTemp > (hSP - 0.01) && AptTemp < (cSP + 0.01),
  SET AvailSCH_Overwrite = 0,
  ELSEIF AvailSCH_Overwrite == 0 && AptTemp >= (hSP - Toffset) && AptTemp <= (cSP + Toffset),
  SET AvailSCH_Overwrite = 0,
  ELSE,
  SET AvailSCH_Overwrite = 1,
  ENDIF;

This operation will cycle your system in minimum timestep intervals (5 minutes in your case). The impact of this is that the zone air temperature can drop/rise by significantly more than Toffset during one timestep. The improved operation should be to change the Calling point from BeginTimestepBeforePredictor to InsideHVACSystemIterationLoop. In this case the AptTemp sensor should use Zone Air Temperature Output:Variable instead of Zone Mean Air Temperature Output:Variable. This will improve control accuracy within Toffset boundaries; however, the system cycling ON/OFF will be much often.

The more sophisticated control would be to switch off the fan, cooling coil and heating coil (as well as to adjust the system availability) depending on the system requirements. However, I do not expect large difference in outputs.

First there is a need for more schedules

Schedule:Constant,FanAvail,OnOff,1; ! Assign to AvailabilityManager:Scheduled and to Fan:ConstantVolume objects
Schedule:Constant,HCAvail,OnOff,1; ! Assign to Coil:Cooling:DX:SingleSpeed and to CoilSystem:Cooling:DX objects
Schedule:Constant,CCAvail,OnOff,1; ! Assign to Coil:Heating:Electric object

EMS Sensors are the same

EnergyManagementSystem:Sensor,
  AptTemp,  Thermal Zone 1,
  Zone Mean Air Temperature;

EnergyManagementSystem:Sensor,
  hSP,
  Thermal Zone 1,
  Zone Thermostat Heating Setpoint Temperature;

EnergyManagementSystem:Sensor,
  cSP,        
  Thermal Zone 1,  
  Zone Thermostat Cooling Setpoint Temperature;

EMS Actuators follow the new assigned schedules

EnergyManagementSystem:Actuator,
  FanAvail_Overwrite,      
  FanAvail,                   
  Schedule:Constant,       
  Schedule Value;

EnergyManagementSystem:Actuator,
  HCAvail_Overwrite,
  HCAvail,                   
  Schedule:Constant,       
  Schedule Value;          

EnergyManagementSystem:Actuator,
  CCAvail_Overwrite,      
  CCAvail,                   
  Schedule:Constant,       
  Schedule Value;

EMS program calling point is the same

EnergyManagementSystem:ProgramCallingManager,
  Supervision,
  BeginTimestepBeforePredictor,  
  HVAC_uncontolledloop_Supervision;

while the program differs a bit

EnergyManagementSystem:Program,
  HVAC_uncontolledloop_Supervision,  
  SET Toffset = 0.556,     
  IF AptTemp > (hSP - 0.01) && AptTemp < (cSP + 0.01),  
  SET FanAvail_Overwrite = 0,  
  SET HCAvail_Overwrite = 0,
  SET CCAvail_Overwrite = 0,
  ELSEIF FanAvail_Overwrite == 0 && AptTemp >= (hSP - Toffset) && AptTemp <= (cSP + Toffset),  
  SET FanAvail_Overwrite = 0,  
  SET HCAvail_Overwrite = 0,
  SET CCAvail_Overwrite = 0,
  ELSEIF AptTemp < (hSP - Toffset),                   
  SET FanAvail_Overwrite = 1,
  SET HCAvail_Overwrite = 1,
  SET CCAvail_Overwrite = 0,
  ELSEIF AptTemp > (cSP + Toffset),  
  SET FanAvail_Overwrite = 1,  
  SET CCAvail_Overwrite = 1,
  SET HCAvail_Overwrite = 0,
  ENDIF;

You can also check the operation when the EMS calling point is changed from BeginTimestepBeforePredictor to InsideHVACSystemIterationLoop (Don’t forget to change the Output:Variable in the AptTemp sensor from Zone Mean Air Temperature to Zone Air Temperature).