Skip to content

Conversation

@joseph-robertson
Copy link
Collaborator

@joseph-robertson joseph-robertson commented Dec 29, 2025

Pull Request Description

Addresses #1499. Change the battery operation scheme to TrackMeterDemandStoreExcessOnSite, and track unit electricity meters.

Checklist

Not all may apply:

  • Schematron validator (EPvalidator.sch) has been updated
  • Sample files have been added/updated (openstudio tasks.rb update_hpxmls)
  • Tests have been added/updated (e.g., HPXMLtoOpenStudio/tests/test*.rb and/or workflow/tests/test*.rb)
  • Documentation has been updated
  • Changelog has been updated
  • openstudio tasks.rb update_measures has been run
  • No unexpected changes to simulation results of sample files

elsif hpxml_bldg.vehicles.size > 0
# Same as battery issue above
return
# return
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we missed removing this in #2113?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shorowit
Copy link
Contributor

@joseph-robertson I don't think this is going to work correctly. Because the battery operation scheme is TrackFacilityElectricDemandStoreExcessOnSite, each battery is going to be looking at the total building energy use, rather than the individual dwelling unit it serves. In order to implement this, we would need to create a custom meter for each dwelling unit (non-trivial) and then change the operation scheme to TrackMeterDemandStoreExcessOnSite.

@joseph-robertson
Copy link
Collaborator Author

@joseph-robertson I don't think this is going to work correctly. Because the battery operation scheme is TrackFacilityElectricDemandStoreExcessOnSite, each battery is going to be looking at the total building energy use, rather than the individual dwelling unit it serves. In order to implement this, we would need to create a custom meter for each dwelling unit (non-trivial) and then change the operation scheme to TrackMeterDemandStoreExcessOnSite.

Right. That's what I'm doing in this PR.

@shorowit
Copy link
Contributor

Right. That's what I'm doing in this PR.

Oh, wow. Sorry I guess I should have looked at the implementation before commenting. Glad to see you're aware of what it would take!

Comment on lines 1147 to 1148
abs_delta_tol = 10
abs_frac_tol = nil
Copy link
Collaborator Author

@joseph-robertson joseph-robertson Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that previously we weren't ever checking batteries with unit multipliers. This is because in our tests we only use unit multipliers along with whole SFA/MF building simulations. But whole SFA/MF building simulations with batteries were returning (based on the limitation) before checking unit multiplier results.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact, I'm pretty sure that unit multipliers aren't working correctly for homes with a battery. At least for base-battery-scheduled-power-outage.xml. When NumberofUnits=1, resilience hours are 1.254. When NumberofUnits=2, resilience hours are 31.691.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shorowit had the idea to test unit multipliers, for technologies that aren't supported in whole SFA/MF buildings, by using a single building with multiplier of 10 instead of 2 buildings with multipliers of 5. Although, maybe the need for this approach may no longer be needed once this PR is merged?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

next if object.to_AdditionalProperties.is_initialized
next if object.to_EnergyManagementSystemOutputVariable.is_initialized

vars_by_key = get_object_outputs_by_key(model, object, EUT)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's nice to (re)use the get_object_outputs_by_key method, but not so nice that there's some extra special stuff below.

@shorowit shorowit moved this from Triage to In progress in OpenStudio-HPXML Jan 6, 2026
@joseph-robertson joseph-robertson changed the base branch from master to unit-fuel-meters January 7, 2026 17:17
@joseph-robertson
Copy link
Collaborator Author

joseph-robertson commented Jan 14, 2026

I'm seeing that changing from TrackFacilityElectricDemandStoreExcessOnSite to TrackMeterDemandStoreExcessOnSite leads to discrepancy in End Use: Battery when there is also a generator in the building (e.g., base-pv-generators-battery.xml). I create a custom meter that exactly mirrors Electricity:Facility, and set that custom meter along with TrackMeterDemandStoreExcessOnSite. The results are different than just using TrackFacilityElectricDemandStoreExcessOnSite.

I'm not totally sure what to make of this. Perhaps in the TrackFacilityElectricDemandStoreExcessOnSite case the ELCD accounts for on-site generation produced by the generator, but in the TrackMeterDemandStoreExcessOnSite case the ELCD ignores it?

What should the path forward be here? To continue with using TrackFacilityElectricDemandStoreExcessOnSite, or switch to TrackMeterDemandStoreExcessOnSite, for single unit simulations?

Edit: I took the TrackMeterDemandStoreExcessOnSite path. c888e49

Comment on lines +1515 to 1517
# Since custom meter cannot reference other custom meters, copy
# all custom meter key/variable groups to this custom meter.
key_vars = custom_unit_meter.keyVarGroups
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

3 participants