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

Zone Operative Temperature PythonPlugIn

Hi, I'm having troubles with the PythonPlugIn when I'm trying to get the handle for Zone Operative Temperature or Zone Mean Temperature. self.api.exchange.get_variable_handle works fine for Zone People Occupant Count but could not get the handle for Zone Operative or Zone Mean Temperature. I have this included in my Output: Variable of EnergyPlus: IDF,Output:Variable,SmallOffice,Zone Operative Temperature,Timestep,; And this is the script for PythonPlugIn:

from pyenergyplus.plugin import EnergyPlusPlugin

class Shades(EnergyPlusPlugin):

def __init__(self):
    super().__init__()
    self.handles_set = False

def actuate(self, state, x):
            self.api.exchange.set_actuator_value(state, self.data['schedule_handle'], x)

def on_begin_zone_timestep_after_init_heat_balance(self, state) -> int:
    if not self.handles_set:

        # Get the handle for the occupant count
        self.data['small_office_handle'] = self.api.exchange.get_variable_handle(
            state, "Zone People Occupant Count", "SmallOffice"
        )
        print("Small Error: Small Office Handle:", self.data['small_office_handle'])
        if self.data['small_office_handle'] == -1:
            self.api.runtime.issue_severe(state, "could not get handle of Zone People Occupant Count")
            return 1

        # Get the handle for the Operative temperature 
        self.data['temperature'] = self.api.exchange.get_variable_handle(
            state, "Zone Operative Temperature","SmallOffice"
        )
        print("Small Error: Glare Index Handle:", self.data['temperature'])
        if self.data['temperature'] == -1:
            self.api.runtime.issue_warning(state, "Temperature handle is -1. ")
            return 1


        self.handles_set = True

    return 0

Zone Operative Temperature PythonPlugIn

Hi, I'm having troubles with the PythonPlugIn when I'm trying to get the handle for Zone Operative Temperature or Zone Mean Temperature. self.api.exchange.get_variable_handle works fine for Zone People Occupant Count but could not get the handle for Zone Operative or Zone Mean Temperature. I have this included in my Output: Variable of EnergyPlus: IDF,Output:Variable,SmallOffice,Zone Operative Temperature,Timestep,; And this is the script for PythonPlugIn:

from pyenergyplus.plugin import EnergyPlusPlugin

class Shades(EnergyPlusPlugin):

def __init__(self):
    super().__init__()
    self.handles_set = False

def actuate(self, state, x):
            self.api.exchange.set_actuator_value(state, self.data['schedule_handle'], x)

def on_begin_zone_timestep_after_init_heat_balance(self, state) -> int:
    if not self.handles_set:

        # Get the handle for the occupant count
        self.data['small_office_handle'] = self.api.exchange.get_variable_handle(
            state, "Zone People Occupant Count", "SmallOffice"
        )
        print("Small Error: Small Office Handle:", self.data['small_office_handle'])
        if self.data['small_office_handle'] == -1:
            self.api.runtime.issue_severe(state, "could not get handle of Zone People Occupant Count")
            return 1

        # Get the handle for the Operative temperature 
        self.data['temperature'] = self.api.exchange.get_variable_handle(
            state, "Zone Operative Temperature","SmallOffice"
        )
        print("Small Error: Glare Index Handle:", self.data['temperature'])
        if self.data['temperature'] == -1:
            self.api.runtime.issue_warning(state, "Temperature handle is -1. ")
            return 1


        self.handles_set = True

    return 0

Zone Operative Temperature PythonPlugInPythonPlugIn Variable Handle

Hi, I'm having troubles with the PythonPlugIn when I'm trying to get the handle for Zone Operative Temperature or Zone Mean Temperature. self.api.exchange.get_variable_handle works fine for Zone People Occupant Count but could not get the handle for Zone Operative or Zone Mean Temperature. I have this included in my Output: Variable of EnergyPlus: IDF,Output:Variable,SmallOffice,Zone Operative Temperature,Timestep,; And this is the script for PythonPlugIn:

from pyenergyplus.plugin import EnergyPlusPlugin

EnergyPlusPlugin class Shades(EnergyPlusPlugin):

Shades(EnergyPlusPlugin):

  def __init__(self):
    super().__init__()
    self.handles_set = False

 def actuate(self, state, x):
            self.api.exchange.set_actuator_value(state, self.data['schedule_handle'], x)

 def on_begin_zone_timestep_after_init_heat_balance(self, state) -> int:
    if not self.handles_set:

        # Get the handle for the occupant count
        self.data['small_office_handle'] = self.api.exchange.get_variable_handle(
            state, "Zone People Occupant Count", "SmallOffice"
        )
        print("Small Error: Small Office Handle:", self.data['small_office_handle'])
        if self.data['small_office_handle'] == -1:
            self.api.runtime.issue_severe(state, "could not get handle of Zone People Occupant Count")
            return 1

        # Get the handle for the Operative temperature 
        self.data['temperature'] = self.api.exchange.get_variable_handle(
            state, "Zone Operative Temperature","SmallOffice"
        )
        print("Small Error: Glare Index Handle:", self.data['temperature'])
        if self.data['temperature'] == -1:
            self.api.runtime.issue_warning(state, "Temperature handle is -1. ")
            return 1


        self.handles_set = True

    return 0

Thanks

PythonPlugIn Variable Handle

Hi, I'm having troubles with the PythonPlugIn when I'm trying to get the handle for Zone Operative Temperature or Zone Mean Temperature. self.api.exchange.get_variable_handle works fine for Zone People Occupant Count but could not get the handle for Zone Operative or Zone Mean Temperature. I have this included in my Output: Variable of EnergyPlus: IDF,Output:Variable,SmallOffice,Zone Operative Temperature,Timestep,; And this is the script for PythonPlugIn:

from pyenergyplus.plugin import EnergyPlusPlugin

class Shades(EnergyPlusPlugin):

  def __init__(self):
    super().__init__()
    self.handles_set = False

  def actuate(self, state, x):
            self.api.exchange.set_actuator_value(state, self.data['schedule_handle'], x)

  def on_begin_zone_timestep_after_init_heat_balance(self, state) -> int:
    if not self.handles_set:

        # Get the handle for the occupant count
        self.data['small_office_handle'] = self.api.exchange.get_variable_handle(
            state, "Zone People Occupant Count", "SmallOffice"
        )
        print("Small Error: Small Office Handle:", self.data['small_office_handle'])
        if self.data['small_office_handle'] == -1:
            self.api.runtime.issue_severe(state, "could not get handle of Zone People Occupant Count")
            return 1

        # Get the handle for the Operative temperature 
        self.data['temperature'] = self.api.exchange.get_variable_handle(
            state, "Zone Operative Temperature","SmallOffice"
        )
        print("Small Error: Glare Index Handle:", self.data['temperature'])
        if self.data['temperature'] == -1:
            self.api.runtime.issue_warning(state, "Temperature handle is -1. ")
            return 1


        self.handles_set = True

    return 0

Thanks