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

Revision history [back]

The OpenStudio application doesn't expose it, but there are API methods for lights and equipment (instances) to set and get the end use subcategory. Here is a link to the lights API documentation. Below is an example usage as it would apppear in a measure.

# change enduse sub category of lights
model.getLightss.each do |light|
  if light.name.to_s.include?("Desk")
    light.setEndUseSubcategory("Task")
    runner.registerInfo("The new enduse sub-category for #{light.name} is #{light.endUseSubcategory}")
  end
end

Here is what the resulting OSM object would look like

OS:Lights, {ab047e2e-298a-4311-a213-44111fe90ed3}, !- Handle
Desk Lamp, !- Name
{1a33b605-f1b5-40b1-a8fa-57781ad953af}, !- Lights Definition Name
{f120bd53-be8c-4b30-8e87-e13a20cffeb8}, !- Space or SpaceType Name
, !- Schedule Name
, !- Fraction Replaceable
, !- Multiplier
Task; !- End-Use Subcategory