From a43c9e82d34e952983ff62f12ed919a53dcc0951 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Wed, 10 Jul 2024 01:29:11 +0100 Subject: [PATCH] reverting electric boiler recs, adding cylinder thermostat rec --- recommendations/Costs.py | 19 +++++++ recommendations/HotwaterRecommendations.py | 60 ++++++++++++++++++++-- 2 files changed, 75 insertions(+), 4 deletions(-) diff --git a/recommendations/Costs.py b/recommendations/Costs.py index 2dbce327..2159c0b0 100644 --- a/recommendations/Costs.py +++ b/recommendations/Costs.py @@ -1151,6 +1151,25 @@ class Costs: "labour_days": 1, } + def cylinder_thermostat(self): + """ + Calculate the cost of installing a cylinder thermostat + """ + + # The £200 cost is a rough estimate based on internet research + total_cost = 200 + subtotal_before_vat = total_cost / (1 + self.VAT_RATE) + vat = total_cost - subtotal_before_vat + + # We estimate the labour hours to be 2 + return { + "total": total_cost, + "subtotal": subtotal_before_vat, + "vat": vat, + "labour_hours": 2, + "labour_days": 1, + } + def hot_water_tank_insulation(self): """ Calculate the cost of installing hot water tank insulation diff --git a/recommendations/HotwaterRecommendations.py b/recommendations/HotwaterRecommendations.py index 95488d3f..86a031d6 100644 --- a/recommendations/HotwaterRecommendations.py +++ b/recommendations/HotwaterRecommendations.py @@ -1,6 +1,7 @@ from backend.Property import Property from recommendations.Costs import Costs -from recommendations.recommendation_utils import override_costs +from recommendations.recommendation_utils import override_costs, check_simulation_difference +from etl.epc_clean.epc_attributes.HotWaterAttributes import HotWaterAttributes class HotwaterRecommendations: @@ -34,10 +35,15 @@ class HotwaterRecommendations: self.recommend_tank_insulation(phase=phase) return + if self.property.hotwater["clean_description"] == "From main system, no cylinder thermostat": + self.recommend_cylinder_thermostat(phase=phase) + return + def recommend_tank_insulation(self, phase): """ If the home has a very poor hot water system, this is often indicative of a lack of insulation on the hot water - tank. This is a very simple and cost effective improvement that can be made to the home. + tank. This is a very simple and cost effective improvement that can be made to the home. It will likely + take the efficiency from very poor to poor. """ recommendation_cost = self.costs.hot_water_tank_insulation() @@ -62,9 +68,55 @@ class HotwaterRecommendations: "sap_points": None, "already_installed": already_installed, **recommendation_cost, - "simulation_config": {"hot_water_energy_eff_ending": "Average"}, + "simulation_config": {"hot_water_energy_eff_ending": "Poor"}, "description_simulation": { - "hot-water-energy-eff": "Average" + "hot-water-energy-eff": "Poor" + } + } + ) + return + + def recommend_cylinder_thermostat(self, phase): + """ + If the home has a very poor hot water system, this is often indicative of a lack of insulation on the hot water + tank. This is a very simple and cost effective improvement that can be made to the home. + """ + + recommendation_cost = self.costs.cylinder_thermostat() + + already_installed = "cylinder_thermostat" in self.property.already_installed + if already_installed: + recommendation_cost = override_costs(recommendation_cost) + description = "Cylinder thermostat has already been installed, no further action required" + else: + description = "Install cylinder thermostat" + + new_epc_description = "From main system" + hotwater_ending_config = HotWaterAttributes(new_epc_description).process() + hotwater_simulation_config = check_simulation_difference( + new_config=hotwater_ending_config, old_config=self.property.hotwater + ) + + simulation_config = { + "hot_water_energy_eff_ending": self.property.data["hot-water-energy-eff"], + **hotwater_simulation_config + } + + self.recommendations.append( + { + "phase": phase, + "parts": [], + "type": "cylinder_thermostat", + "description": description, + "starting_u_value": None, + "new_u_value": None, + "sap_points": None, + "already_installed": already_installed, + **recommendation_cost, + "simulation_config": simulation_config, + "description_simulation": { + "hot-water-energy-eff": self.property.data["hot-water-energy-eff"], + "hotwater-description": new_epc_description, } } )