Revision history [back]
To build upon @mdahlhausen's answer in more specific terms, here's what I've been doing to automate this stuff:
- Create a spreadsheet with columns ["model_space_name", "watt", "hours"].
- You can have several lines that have the same "model_space_name", the space will then get multiple Lights objects.
- You could also include your multiplier here if you wanted to... In my spreadsheet I actually have more columns, for eg Fixture (eg 'Fluorescent Linear T8 590mm, 2-18 Watt, electronic ballast'), Count, W/fixture and I calculate "watt" by doing Count times W/fixture
- Use Roo to parse the Excel spreadsheet
- I find this convenient exactly because I have multiple columns and formulas and I don't need to export a CSV each time I change it.
- You could also just export your spreadsheet to CSV and use the built-in CSV module if you find this easier.
- Define a ScheduleRuset in my model to use as a default profile. That would be
SecondarySchool Bldg Light
in your example, let's call itlight_sch
going forward - Loop on parsed rows (from Excel),
- use
model.getSpaceByName(row["model_space_name"]).get
to get the corresponding space, and create a new lighting object (you need to create aOpenStudio::Model::LightsDefinition
and aOpenStudio::Model::Lights
that references it). - The real key point here is to scale to the
SecondarySchool Bldg Light
to get the correct number of hours while maintaining the same profile. For this, I leverage openstudio-standards' ScheduleRuleset.annual_equivalent_full_load_hrs. I store the initialeflh = light_sch.annual_equivalent_full_load_hrs
. For the lighting objects, I clone this schedule, get the ScheduleDay attached to it (it helps if there's only one...) and scale each value entered accordingly by looping onday_sch.times.with_index
(new_value = old_value * daily_h * 365 / eflh.to_f
). - Neat trick: I rename the cloned schedule like
#{light_sch.name} - #{daily_h} hrs/day
, so that in the loop I can test whether I already created it or not to avoid duplicating it many times unnecessarily.
- use
To build upon @mdahlhausen's answer in more specific terms, answer, here's what I've been doing to automate this stuff:doing:
- Create a spreadsheet with columns ["model_space_name", "watt",
"hours"]."hours"]. You can have several lines that have the same "model_space_name", the space will then get multiple Lightsobjects. - You could also include your multiplier here if you wanted to... In my spreadsheet I actually have more columns, for eg Fixture (eg 'Fluorescent Linear T8 590mm, 2-18 Watt, electronic ballast'), Count, W/fixture and I calculate "watt" by doing Count times W/fixture
- I find this convenient exactly because I have multiple columns and formulas and I don't need to export a CSV each time I change it.
SecondarySchool Bldg Light
in your example, let's call it light_sch
going forwardmodel.getSpaceByName(row["model_space_name"]).get
to get the corresponding space, and create a new lighting object (you need to create a OpenStudio::Model::LightsDefinition
and a OpenStudio::Model::Lights
that references it).SecondarySchool Bldg Light
to get the correct number of hours while maintaining the same profile. For this, I leverage openstudio-standards' ScheduleRuleset.annual_equivalent_full_load_hrs. I store the initial eflh = light_sch.annual_equivalent_full_load_hrs
. For the lighting objects, I clone this schedule, get the ScheduleDay attached to it (it helps if there's only one...) and scale each value entered accordingly by looping on day_sch.times.with_index
(new_value = old_value * daily_h * 365 / eflh.to_f
). #{light_sch.name} - #{daily_h} hrs/day
, so that in the loop I can test whether I already created it or not to avoid duplicating it many times unnecessarily.To build upon @mdahlhausen's answer, here's what I've been doing:
- Create a spreadsheet with columns ["model_space_name", "watt", "hours"]. You can have several lines that have the same "model_space_name", the space will then get multiple Lights objects.
- Use Roo to parse the Excel spreadsheet. You could also just export your spreadsheet to CSV and use the built-in CSV module.
- Define a ScheduleRuset in my model to use as a default profile. That would be
SecondarySchool Bldg Light
in your example, let's call itlight_sch
going forward - Loop on parsed rows (from Excel), use
model.getSpaceByName(row["model_space_name"]).get
to get the corresponding space, and create a new lighting object (you need to create aOpenStudio::Model::LightsDefinition
and aOpenStudio::Model::Lights
that references it). - The real key point here is to scale to the
SecondarySchool Bldg Light
to get the correct number of hours while maintaining the same profile. For this, I leverage openstudio-standards' ScheduleRuleset.annual_equivalent_full_load_hrs. I store the initialeflh = light_sch.annual_equivalent_full_load_hrs
. For the lighting objects, I clone this schedule, get the ScheduleDay attached to it (it helps if there's only one...) and scale each value entered accordingly by looping onday_sch.times (day_sch.times.with_index
new_value = old_value * daily_h * 365 / eflh.to_f
). Neat trick: I renameI renamed the cloned schedule like#{light_sch.name} - #{daily_h} hrs/day
, so that in the loop I can test whether I already created it or not to avoid duplicating it many times unnecessarily.
To build upon @mdahlhausen's @mdahlausen's answer, here's what I've been doing:
- Create a spreadsheet with columns ["model_space_name", "watt", "hours"]. You can have several lines that have the same "model_space_name", the space will then get multiple Lights objects.
- Use Roo to parse the Excel spreadsheet. You could also just export your spreadsheet to CSV and use the built-in CSV module.
- Define a ScheduleRuset in my model to use as a default profile. That would be
SecondarySchool Bldg Light
in your example, let's call itlight_sch
going forward - Loop on parsed rows (from Excel), use
model.getSpaceByName(row["model_space_name"]).get
to get the corresponding space, and create a new lighting object (you need to create aOpenStudio::Model::LightsDefinition
and aOpenStudio::Model::Lights
that references it). - The real key point here is to scale to the
SecondarySchool Bldg Light
to get the correct number of hours while maintaining the same profile. For this, I leverage openstudio-standards' ScheduleRuleset.annual_equivalent_full_load_hrs. I store the initialeflh = light_sch.annual_equivalent_full_load_hrs
. For the lighting objects, I clone this schedule, get the ScheduleDay attached to it (it helps if there's only one...) and scale each value entered accordingly by looping on day_sch.times (new_value = old_value * daily_h * 365 / eflh.to_f
). - I renamed the cloned schedule like
#{light_sch.name} - #{daily_h} hrs/day
, so that in the loop I can test whether I already created it or not to avoid duplicating it many times unnecessarily.
To build upon @mdahlausen's answer, here's what I've been doing:
- Create a spreadsheet with columns ["model_space_name", "watt", "hours"]. You can have several lines that have the same "model_space_name", the space will then get multiple Lights objects.
- Use Roo to parse the Excel spreadsheet. You could also just export your spreadsheet to CSV and use the built-in CSV module.
- Define a ScheduleRuset in my model to use as a default profile. That would be
SecondarySchool Bldg Light
in your example, let's call itlight_sch
going forward - Loop on parsed rows (from Excel), use
model.getSpaceByName(row["model_space_name"]).get
to get the corresponding space, and create a new lighting object (you need to create aOpenStudio::Model::LightsDefinition
and aOpenStudio::Model::Lights
that references it). - The real key point here is to scale to the
SecondarySchool Bldg Light
to get the correct number of hours while maintaining the same profile. For this, I leverage openstudio-standards' ScheduleRuleset.annual_equivalent_full_load_hrs. I store the initialeflh = light_sch.annual_equivalent_full_load_hrs
. For the lighting objects, I clone this schedule, get the ScheduleDay attached to it (it helps if there's only one...) and scale each value entered accordingly by looping on day_sch.times (new_value = old_value * daily_h * 365 / eflh.to_f
). - I renamed the cloned schedule like
#{light_sch.name} -
, so that in the loop I can test whether I already created it or not to avoid duplicating it many times#{daily_h} hrs/day#{hours}unnecessarily.unecessarily.
To build upon @mdahlausen's answer, here's what I've been doing:
- Create a spreadsheet with columns ["model_space_name", "watt", "hours"]. You
canhave several lines that have the same"model_space_name", the space will then get multiple Lights objects."model_space_name" - Use Roo to parse the Excel spreadsheet. You could also just export your spreadsheet to CSV and use the built-in CSV module.
- Define a ScheduleRuset in my model to use as a default profile. That would be
SecondarySchool Bldg Light
in your example, let's call itlight_sch
going forward - Loop on parsed
rows (from Excel),rows, usemodel.getSpaceByName(row["model_space_name"]).get
to get the corresponding space, and create a new lighting object (you need to create aOpenStudio::Model::LightsDefinition
and aOpenStudio::Model::Lights
that references it). - The real key point here is to scale to the
SecondarySchool Bldg Light
to get the correct number of hours while maintaining the same profile. For this, I leverage openstudio-standards' ScheduleRuleset.annual_equivalent_full_load_hrs. I store the initialeflh = light_sch.annual_equivalent_full_load_hrs
. For the lighting objects, I clone this schedule, get the ScheduleDay attached to it (it helps if there's only one...) and scale each value entered accordingly by looping on day_sch.times (new_value = old_value * daily_h * 365 / eflh.to_f
). - I renamed the cloned schedule like
#{light_sch.name} - #{hours}
, so that in the loop I can test whether I already created it or not to avoid duplicating it many times unecessarily.)