From 21583ab6caf5b007ce2ff330c35af7a8dd0cc100 Mon Sep 17 00:00:00 2001 From: Trefor Southwell <48591903+springfall2008@users.noreply.github.com> Date: Wed, 18 Dec 2024 19:08:38 +0000 Subject: [PATCH 1/2] Fix heat energy to be energy in not out --- apps/predbat/predheat.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/predbat/predheat.py b/apps/predbat/predheat.py index 30ba3f47..7aadc34c 100644 --- a/apps/predbat/predheat.py +++ b/apps/predbat/predheat.py @@ -88,7 +88,7 @@ def fill_table_gaps(self, table): for key in range(min_key, max_key + 1): if key not in table: next_value = last_value - for next_key in range(key + 1, max_key + 1): + for next_key in range (key + 1, max_key + 1): if next_key in table: next_value = table[next_key] break @@ -363,6 +363,7 @@ def run_simulation(self, volume_temp, heating_active, save="best", last_predict_ # self.log("Minute {} flow {} volume {} diff {} power {} kw".format(minute, flow_temp, volume_temp, flow_temp_diff, heat_power_in / 1000.0)) + if self.mode == "gas": # Gas boiler flow temperature adjustment in efficiency based on flow temp inlet_temp = int(volume_temp + 0.5) @@ -380,7 +381,7 @@ def run_simulation(self, volume_temp, heating_active, save="best", last_predict_ energy_now_out = heat_power_out * PREDICT_STEP / 60.0 / 1000.0 cost += energy_now_in * self.rate_import.get(minute_absolute, 0) - heat_energy += energy_now_out + heat_energy += energy_now_in # 1.16 watts required to raise water by 1 degree in 1 hour volume_temp += (heat_power_out / WATTS_TO_DEGREES / self.heat_volume) * PREDICT_STEP / 60.0 From 3ac4f8088523f900209887a01b9b6583184351a7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci-lite[bot]" <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 19:09:54 +0000 Subject: [PATCH 2/2] [pre-commit.ci lite] apply automatic fixes --- apps/predbat/predheat.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/predbat/predheat.py b/apps/predbat/predheat.py index 7aadc34c..c305ff7b 100644 --- a/apps/predbat/predheat.py +++ b/apps/predbat/predheat.py @@ -88,7 +88,7 @@ def fill_table_gaps(self, table): for key in range(min_key, max_key + 1): if key not in table: next_value = last_value - for next_key in range (key + 1, max_key + 1): + for next_key in range(key + 1, max_key + 1): if next_key in table: next_value = table[next_key] break @@ -363,7 +363,6 @@ def run_simulation(self, volume_temp, heating_active, save="best", last_predict_ # self.log("Minute {} flow {} volume {} diff {} power {} kw".format(minute, flow_temp, volume_temp, flow_temp_diff, heat_power_in / 1000.0)) - if self.mode == "gas": # Gas boiler flow temperature adjustment in efficiency based on flow temp inlet_temp = int(volume_temp + 0.5)