First time here? Check out the Help page!
1 | initial version |
Hi, thanks for using these new features and the question.
Re 1): my guess is that you are attempting to set the relhum value via the relhum sensor, not the actuator. Take a look at the following which is starting from the 1ZoneUncontrolled.idf file.
self.outdoor_air_relhum_actuator_handle = self.api.exchange.get_actuator_handle(state,
"Weather Data",
"Outdoor Relative Humidity",
"Environment")
self.api.exchange.set_actuator_value(state, self.outdoor_air_relhum_actuator_handle, new_relhum)
A full example is posted here: https://gist.github.com/mitchute/5a9f107aba213f1b683f4052027fc162
Re 2): the example posted at the link demonstrates this, but you will need to use a global variable, then set up a new output variable based on that.
Re 3): what's wrong with class member variables? In the examples shipped with EnergyPlus and linked above, you'll see that we use the "self" class member variables all over the place to persist these data and pass them between calling points. If you want to pass data between class instances, you might need to use global variables (gasp) or be clever with how you set up your classes and calling points.