EPAENERGYSTAR / epathermostat

Methods for measuring and reporting connected thermostat savings
17 stars 9 forks source link

Total runtime for RHU2 filtering calculated incorrectly #19

Open lirainer opened 4 years ago

lirainer commented 4 years ago

At Line 609 of core.py the total_runtime is calculated incorrectly:

        runtime_rhu['total_runtime'] = runtime_rhu.heat_runtime + runtime_rhu.aux_runtime + runtime_rhu.emg_runtime

This double counts aux_runtime, which is already in heat_runtime. Calculation should be:

        runtime_rhu['total_runtime'] = runtime_rhu.heat_runtime + runtime_rhu.emg_runtime

Note that there is also a comment at line 1562 with the same issue that should be removed. Not sure why it is there at all.

craigmaloney commented 4 years ago

HI @lirainer ,

I'm reviewing the code and while I'm not disputing that heat_runtime has aux_runtime in there, I'm also not finding where it's incorporated into heat_runtime in the code. Is that something that is specific to how heat_runtime is reported in the data?

Reason I ask is I'd like to add a comment so I or others don't feel the temptation to re-add that calculation.

(Also the total_runtime comment was because it wasn't needed in that current block of code and I wasn't sure if it was needed. I've removed the comment to avoid confusion.)

Thanks!

lirainer commented 4 years ago

@craigmaloney Thanks for looking at this. I looked at the documentation on heat_runtime and noticed this footnote which is different than what I thought. I will need to check with EPA and see if I got this wrong.

lirainer commented 2 years ago

Hi @craigmaloney. I ran across this same line of code today while I was reviewing the RHU calculation method. It looks like the equation is okay for version 1 where the heat_runtime is daily and does not include the aux_runtime, but in version 2 heat_runtime is hourly and could include aux_runtime so we will need to add some guidance as to what we expect.

craigmaloney commented 2 years ago

@lirainer Do you happen to have the line number of the code in question?

lirainer commented 2 years ago

https://github.com/EPAENERGYSTAR/epathermostat/blob/b79702ba86633678d06ade052ce4a6491d175d19/thermostat/core.py#L614