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

Revision history [back]

The python example files are a good place to learn the python API syntax. See example files PythonPluginMultiSpeedHeatPumpOverrideControl.idf and PythonPluginMultiSpeedHeatPumpOverrideControl.py.

PythonPluginMultiSpeedHeatPumpOverrideControl.idf:

ZoneControl:Thermostat,
  Zone Thermostat,         !- Name
  LIVING ZONE,             !- Zone or ZoneList Name
  Dual Zone Control Type Sched,  !- Control Type Schedule Name
  ThermostatSetpoint:DualSetpoint,  !- Control 1 Object Type
  Setpoints,               !- Control 1 Name
  ,                        !- Control 2 Object Type
  ,                        !- Control 2 Name
  ,                        !- Control 3 Object Type
  ,                        !- Control 3 Name
  ,                        !- Control 4 Object Type
  ,                        !- Control 4 Name
  2.0;                     !- Temperature Difference Between Cutout And Setpoint {deltaC}

ThermostatSetpoint:DualSetpoint,
  Setpoints,               !- Name
  Dual Heating Setpoints,  !- Heating Setpoint Temperature Schedule Name
  Dual Cooling Setpoints;  !- Cooling Setpoint Temperature Schedule Name

Schedule:Compact,
  Dual Heating Setpoints,  !- Name
  Temperature,             !- Schedule Type Limits Name
  Through: 12/31,          !- Field 1
  For: AllDays,            !- Field 2
  Until: 24:00,22.0;       !- Field 3

Schedule:Compact,
  Dual Cooling Setpoints,  !- Name
  Temperature,             !- Schedule Type Limits Name
  Through: 12/31,          !- Field 1
  For: AllDays,            !- Field 2
  Until: 24:00,26.6;       !- Field 3

PythonPluginMultiSpeedHeatPumpOverrideControl.py:

self.heating_setpoint_handle = self.api.exchange.get_variable_handle(state,
                                                                     "Zone Thermostat Heating Setpoint Temperature",
                                                                     "LIVING ZONE")

self.cooling_setpoint_handle = self.api.exchange.get_variable_handle(state,
                                                                     "Zone Thermostat Cooling Setpoint Temperature",
                                                                     "LIVING ZONE")