Skip to content

Fix unmet hours calculation when using on/off thermostat deadband model#2191

Merged
shorowit merged 2 commits intomasterfrom
unmet_hours_ddb
Apr 13, 2026
Merged

Fix unmet hours calculation when using on/off thermostat deadband model#2191
shorowit merged 2 commits intomasterfrom
unmet_hours_ddb

Conversation

@shorowit
Copy link
Copy Markdown
Contributor

@shorowit shorowit commented Apr 9, 2026

Pull Request Description

Noticed while working on #2189. Also adds the reporting tolerance for consistency with non-deadband simulations.

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

Comment on lines -154 to +157
program.addLine(" If #{zone_air_temp_sensors[unit].name} < (#{htg_spt_sensors[unit].name} - #{UnitConversions.convert(onoff_deadbands, 'deltaF', 'deltaC')})")
program.addLine(" If #{zone_air_temp_sensors[unit].name} < (#{htg_spt_sensors[unit].name} - #{htg_tol})")
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

While inspecting the results for base-hvac-air-to-air-heat-pump-1-speed-research-features.xml, I found that the indoor temperature was being compared to 61F. The heating setpoint is 64F and the deadband is 2F, so it should be compared to 63F. (Or, really, 63F minus the reporting tolerance of 0.2 deg-C.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Here's an example from another EMS program that shows the lower end of the heating setpoint is the schedule value:

supp_coil_avail_program.addLine(" Set htg_sp_l = #{htg_sp_ss.name}")
supp_coil_avail_program.addLine(" Set htg_sp_h = #{htg_sp_ss.name} + #{ddb}")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Interesting, good catch, the previous approach is wrong because we already shifted the schedule by 1/2 deadband so that the htg_spt_sensors will give 63F (cut-in) instead of cut-out, so applying full deadband here is causing issues.

@shorowit shorowit marked this pull request as ready for review April 12, 2026 23:58
@shorowit shorowit requested a review from yzhou601 April 13, 2026 00:00
Copy link
Copy Markdown
Collaborator

@yzhou601 yzhou601 left a comment

Choose a reason for hiding this comment

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

Great bugfix, thanks @shorowit

@shorowit shorowit merged commit 14f7adc into master Apr 13, 2026
@shorowit shorowit deleted the unmet_hours_ddb branch April 13, 2026 21:40
@github-project-automation github-project-automation bot moved this from Triage to Done in OpenStudio-HPXML Apr 13, 2026
@shorowit shorowit changed the title Fix unmet hours calculation when using on-off thermostat deadband model Fix unmet hours calculation when using on/off thermostat deadband model Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants