Schedule Value handle does not work in Python EMS
Good day!
I'm need to create a user defined object managed by a python plug-in, all works perfect but the handle of schedule value, I've already added the output variable in the IDF file and I've checked the name of the schedule too. I tried a simple box plug-in using the example of E+ (https://wetransfer.com/downloads/6891...) and it happens exactly the same when I change the simulation settings. Can someone explain me what am I missing? Hi Julien, thank your for your celerity to answer. The file I linked is just the example file of EnergyPlus (PythonPluginUserDefinedWindACAuto.py) I just simplified the code to just let the basic concept of the problem, if you keep all the running conditions of the file, the plugin run with the python code:
self.handles["COOLINGCOILAVAILSCHED"] = self.api.exchange.get_variable_handle(
state,
"Schedule Value",
"COOLINGCOILAVAILSCHED"
)
So the python code is fine. However if you changed the running conditions in the IDF file:
SimulationControl,
No, !- Do Zone Sizing Calculation
No, !- Do System Sizing Calculation
No, !- Do Plant Sizing Calculation
No, !- Run Simulation for Sizing Periods
Yes, !- Run Simulation for Weather File Run Periods
No, !- Do HVAC Sizing Simulation for Sizing Periods
1; !- Maximum Number of HVAC Sizing Simulation Passes
Suddenly the file launch the error of "handle not found", i just wanted to change a ZoneHVAC object I'm using to a ZoneHVAC UserDefined object, with the EnergyPlus ZoneHVAC object the IDF file works fine, but when I substituted for the ZoneHVAC:UserDefined, suddenly launched that error. In my opinion, there is a bug in the program, you need to keep "Do Zone Sizing Calculation" in "Yes" and add the Zone Sizing objects even if you don't need them to make the code work correctly. My objective with the schedule is not modified it but to read the availability to turn on or off my User Defined Object.
(You should try to give out more information about what's not working, that'd be helpful. Going to download a zip file from wetransfer is an extra step that most people won't do)