diff --git a/backend/Property.py b/backend/Property.py index e7341c4d..cd2f8469 100644 --- a/backend/Property.py +++ b/backend/Property.py @@ -173,7 +173,7 @@ class Property: self.windows_area = None self.solar_pv_percentage = None - self.current_adjusted_energy = None + self.current_energy_consumption = None self.expected_adjusted_energy = None self.current_energy_bill = None self.expected_energy_bill = None @@ -746,7 +746,7 @@ class Property: } # Sum up the adjusted kwh figures - self.current_adjusted_energy = sum(list(adjusted_kwh_estimates.values())) + self.current_energy_consumption = sum(list(unadjusted_kwh_estimates.values())) self.energy_cost_estimates = { "adjusted": adjusted_heating_costs, @@ -759,7 +759,7 @@ class Property: } self.energy_consumption_estimates = { - "adjusted": adjusted_kwh_estimates, + # "adjusted": adjusted_kwh_estimates, "unadjusted": unadjusted_kwh_estimates } @@ -899,7 +899,7 @@ class Property: "energy_tariff": self.data["energy-tariff"], "primary_energy_consumption": self.energy["primary_energy_consumption"], "co2_emissions": self.energy["co2_emissions"], - "adjusted_energy_consumption": self.current_adjusted_energy, + # "adjusted_energy_consumption": self.current_adjusted_energy, "estimated": self.data.get("estimated", False), } @@ -1265,29 +1265,35 @@ class Property: exclusions = [] if exclusions is None else exclusions - if (self.main_fuel["fuel_type"] == "electricity") or ( - self.main_fuel["fuel_type"] == "mains gas" and not self.is_ashp_valid(exclusions=exclusions) + if not self.is_ashp_valid(exclusions=exclusions): + return self.current_energy_consumption + + remap_fuel_sources = ["Natural Gas", "LPG", "Wood Logs"] + implemented_fuel_sources = ["Electricity"] + remap_fuel_sources + + heating_energy_source = self.heating_energy_source + hot_water_energy_source = self.hot_water_energy_source + heating_consumption = self.energy_consumption_estimates["unadjusted"]["heating"] + hotwater_consumption = self.energy_consumption_estimates["unadjusted"]["hot_water"] + + if (heating_energy_source not in implemented_fuel_sources) or ( + hot_water_energy_source not in implemented_fuel_sources ): - # if the primary fuel is already electricity, we don't need to adjust the consumpion - return self.current_adjusted_energy + raise NotImplementedError("Have not implemented estimating electrical consumption for this fuel type") - if self.main_fuel["fuel_type"] == "mains gas" and self.is_ashp_valid(exclusions=exclusions): - # if the primary fuel is gas, we need to adjust the consumption to reflect the expected - # efficiency of an ASHP. - # We should adjust the energy consumption to reflect the 200-400% efficiency of an ASHP with - # electrified heating, so that the solar panel can cover heating generation. - heating_consumption = self.energy_consumption_estimates["adjusted"]["heating"] - hot_water_consumption = self.energy_consumption_estimates["adjusted"]["hot_water"] + if heating_energy_source in ["Natural Gas", "LPG", "Wood Logs"]: + # Adjust the heating consumption to reflect the expected efficiency of an ASHP + heating_consumption = heating_consumption / (assumed_ashp_efficiency / 100) - systems_consumptions = heating_consumption + hot_water_consumption + if hot_water_energy_source in remap_fuel_sources: + # Adjust the hot water consumption to reflect the expected efficiency of an ASHP + hotwater_consumption = hotwater_consumption / (assumed_ashp_efficiency / 100) - adjusted_consumption = systems_consumptions / (assumed_ashp_efficiency / 100) - electric_consumption = ( - adjusted_consumption + - self.energy_consumption_estimates["adjusted"]["lighting"] + - self.energy_consumption_estimates["adjusted"]["appliances"] - ) + electric_consumption = ( + heating_consumption + + hotwater_consumption + + self.energy_consumption_estimates["unadjusted"]["lighting"] + + self.energy_consumption_estimates["unadjusted"]["appliances"] + ) - return electric_consumption - - raise NotImplementedError("Have not implemented estimating electrical consumption for this fuel type") + return electric_consumption diff --git a/backend/app/assumptions.py b/backend/app/assumptions.py index 13bd913f..d2b7b75a 100644 --- a/backend/app/assumptions.py +++ b/backend/app/assumptions.py @@ -1,3 +1,4 @@ -# Assumes that the average efficiency of an air source heat pump is 300%, taking the median of the 200-400% range, +# Assumes that the average efficiency of an air source heat pump is 250%, taking the median of the 200-400% range, # which is often quoted as a sensible efficiency range for air source heat pumps. +PESSIMISTIC_ASHPY_EFFICIENCY = 200 AVERAGE_ASHP_EFFICIENCY = 300 diff --git a/backend/app/plan/router.py b/backend/app/plan/router.py index 8001e6ef..a7155de0 100644 --- a/backend/app/plan/router.py +++ b/backend/app/plan/router.py @@ -506,6 +506,18 @@ async def trigger_plan(body: PlanTriggerRequest): # extensions, since it doesn't seem to do a great job # TODO: For simple properties, we should do a comparison/check between the solar API's roof area and the # basic estimate of roof area + + for p in tqdm(input_properties): + if p.uprn in [100060066017, 10033248492]: + continue + energy_consumption_client.estimate_new_consumption( + current_energy_efficiency=p.data["current-energy-efficiency"], + target_efficiency="69", + current_consumption=p.estimate_electrical_consumption( + assumed_ashp_efficiency=assumptions.PESSIMISTIC_ASHPY_EFFICIENCY, exclusions=body.exclusions + ), + ) + building_ids = [ { "building_id": p.building_id, diff --git a/etl/customers/newhaven/newhaven_study.py b/etl/customers/newhaven/newhaven_study.py index 9faf6a26..58edf578 100644 --- a/etl/customers/newhaven/newhaven_study.py +++ b/etl/customers/newhaven/newhaven_study.py @@ -142,6 +142,8 @@ def make_asset_list(): ) # Drop any entires with null floors because that means the ordnance survey data doesn't align with the epc data asset_list = asset_list[~pd.isnull(asset_list["number_of_floors"])] + # Drop any entries with null insulation wall area + asset_list = asset_list[~pd.isnull(asset_list["insulation_wall_area"])] # D 0.419929 # C 0.391459