Issue loading custom OpenStudio measure with HB Load Measure (TypeErrorException)

Hi everyone,

I’m working on an energy simulation workflow using Ladybug Tools and Honeybee in Grasshopper. I want to implement a dynamic BSDF control system for two windows that switch between two optical states (state_1.xml and state_2.xml) based on solar altitude. Both windows behave identically, while a third window in the model is static and doesn’t use BSDFs.

To handle this dynamic switching, I created a custom OpenStudio measure that defines multiple Construction:ComplexFenestrationState objects and adds EMS logic (Sensor, Actuator, Program, etc.) to change states during the simulation. I placed the measure.rb and measure.xml files inside a folder named AddDynamicBSDF, along with the two BSDF files.

However, when I try to load this measure in Grasshopper using the HB Load Measure component, I immediately get the following error:

{0;0}
0. Runtime error (TypeErrorException): iteration over non-sequence of type NoneType

Traceback:
line 248, in _parse_metadata_file, “/Users/julia/ladybug_tools/python/lib/python3.10/site-packages/honeybee_energy/measure.py”
line 49, in init, “/Users/julia/ladybug_tools/python/lib/python3.10/site-packages/honeybee_energy/measure.py”
line 198, in script

The component does not update or expose inputs, and it seems to fail while parsing the XML. I’ve already made sure to include a dummy argument in the <arguments> section of measure.xml as Honeybee requires, but the issue persists. Any suggestions on what might be causing this or how to properly format a custom measure so Honeybee can recognize it?

Thanks in advance for any help!

Hey @Juliavs ,

Did you generate the XML file from the Ruby file using the OpenStudio SDK as mentioned in the Measure Writer’s Guide:

If not, then chances are that your XML file isn’t following the schema that NREL developed for it.

I usually find that opening the measure in the OpenStudio Application and using the “Apply Measures Now” interface gets the OpenStudio App to regenerate the XML file for me.

thank you very much for the help you gave me in a previous post about dynamic BSDFs — especially the suggestion to use the OpenStudio App to generate the measure.xml. That advice was extremely helpful, and I was finally able to create a custom measure.rb that seems to work well for exporting with the HB Model to OSM component. So, thank you again!

That said, I’m currently facing a new challenge. I need to create two different IDF files, each associated with a different optical state of my dynamic window system (state_1.xml and state_2.xml). These two states represent different optical behaviors of the glazing depending on the solar angle.

I’ve been trying to run and create these .idf files but the process always fails, and I get EnergyPlus parsing errors. That I think is has to be related to the IDF structure. I’ve tried several approaches but it’s been difficult to make things work cleanly.

To clarify, I’m quite new to all of this. I’m currently working on a project, and this workflow was the one I was told to follow. I’m doing my best to learn, but I also feel that this is a fairly complex area designed for more advanced users, and I’m struggling to connect all the pieces.

My goal is to simulate an annual energy model where two of the windows in a single façade change BSDF states dynamically according to solar altitude, while a third window remains static.

If anyone can suggest a better way to structure this workflow, guidance, or even alternative ideas, I would be incredibly grateful.

Thank you again for all your support!!