Skip to content

Commit

Permalink
Merge branch 'develop' into feat/water-heater-heat-pump
Browse files Browse the repository at this point in the history
  • Loading branch information
BottlecapDave committed Jan 18, 2025
2 parents 6e32a44 + 8c2d006 commit aa9c45a
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 9 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [13.5.3](https://github.com/BottlecapDave/HomeAssistant-OctopusEnergy/compare/v13.5.2...v13.5.3) (2025-01-04)


### Bug Fixes

* Fixed issue with changing intelligent target time always throwing an error (30 minutes dev time) ([7ce15bd](https://github.com/BottlecapDave/HomeAssistant-OctopusEnergy/commit/7ce15bd907e544bd7b24a76fc3140ab82517fdee))

## [13.5.2](https://github.com/BottlecapDave/HomeAssistant-OctopusEnergy/compare/v13.5.1...v13.5.2) (2025-01-03)


Expand Down
4 changes: 4 additions & 0 deletions _docs/entities/heat_pump.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ The following operation modes are available

When `boost` is selected, this activates boost mode for the zone for 1 hour. If a target temperature is not set, then this will default to 50 degrees c. If you require boost to be on for a different amount of time or with a different target temperature, then you can use the [available service](../services.md#octopus_energyboost_heat_pump_zone).

!!! note

If you boost and a target temperature is not defined, then a default value will be set. This will be 50 degrees C for `water` zones and 30 degrees C for all other zones.

## Lifetime Seasonal Coefficient of Performance

`sensor.octopus_energy_heat_pump_{{HEAT_PUMP_ID}}_lifetime_scop`
Expand Down
3 changes: 3 additions & 0 deletions _docs/services.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,9 @@ Allows you to boost a given heat pump zone for a set amount of time.
| `data.minutes` | `no` | The number of minutes to turn boost mode on for. This can be 0, 15, or 45. |
| `data.target_temperature` | `yes` | The optional target temperature to boost to. If not supplied, then the current target temperature will be used. |

!!! note

If you boost and a target temperature is both not provided and not defined on the sensor itself, then a default value will be set. This will be 50 degrees C for `water` zones and 30 degrees C for all other zones.

## octopus_energy.set_heat_pump_flow_temp_config

Expand Down
6 changes: 3 additions & 3 deletions custom_components/octopus_energy/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import homeassistant.helpers.config_validation as cv

DOMAIN = "octopus_energy"
INTEGRATION_VERSION = "13.5.2"
INTEGRATION_VERSION = "13.5.3"

REFRESH_RATE_IN_MINUTES_ACCOUNT = 60
REFRESH_RATE_IN_MINUTES_INTELLIGENT = 3
Expand Down Expand Up @@ -174,8 +174,8 @@
REGEX_WEIGHTING = f"^({REGEX_WEIGHTING_NUMBERS}|{REGEX_WEIGHTING_START}|{REGEX_WEIGHTING_MIDDLE}|{REGEX_WEIGHTING_END})$"

DEFAULT_CALORIFIC_VALUE = 40.0
DEFAULT_BOOST_WATER_TEMPERATURE = 50
DEFAULT_BOOST_HEAT_TEMPERATURE = 30
DEFAULT_BOOST_TEMPERATURE_WATER = 50
DEFAULT_BOOST_TEMPERATURE_HEAT = 30

DATA_SCHEMA_ACCOUNT = vol.Schema({
vol.Required(CONFIG_ACCOUNT_ID): str,
Expand Down
4 changes: 2 additions & 2 deletions custom_components/octopus_energy/heat_pump/water_heater.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from ..api_client.heat_pump import ConfigurationZone, HeatPump, Sensor, Zone
from ..coordinators.heat_pump_configuration_and_status import HeatPumpCoordinatorResult
from ..api_client import OctopusEnergyApiClient
from ..const import DEFAULT_BOOST_WATER_TEMPERATURE, DOMAIN
from ..const import DEFAULT_BOOST_TEMPERATURE_WATER, DOMAIN

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -147,7 +147,7 @@ async def async_set_operation_mode(self, operation_mode: str):
self._heat_pump_id,
self._zone.configuration.code,
self._end_timestamp,
self._attr_target_temperature if self._attr_target_temperature is not None else DEFAULT_BOOST_WATER_TEMPERATURE
self._attr_target_temperature if self._attr_target_temperature is not None else DEFAULT_BOOST_TEMPERATURE_WATER
)
else:
zone_mode = self.get_zone_mode()
Expand Down
28 changes: 25 additions & 3 deletions custom_components/octopus_energy/heat_pump/zone.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import logging
from typing import List

from custom_components.octopus_energy.const import DOMAIN
from homeassistant.util.dt import (utcnow)
from homeassistant.exceptions import ServiceValidationError

Expand Down Expand Up @@ -31,6 +30,7 @@
from ..api_client.heat_pump import ConfigurationZone, HeatPump, Sensor, Zone
from ..coordinators.heat_pump_configuration_and_status import HeatPumpCoordinatorResult
from ..api_client import OctopusEnergyApiClient
from ..const import DEFAULT_BOOST_TEMPERATURE_HEAT, DEFAULT_BOOST_TEMPERATURE_WATER, DOMAIN

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -192,7 +192,18 @@ async def async_set_preset_mode(self, preset_mode):
if self._attr_preset_mode == PRESET_BOOST:
self._end_timestamp = utcnow()
self._end_timestamp += timedelta(hours=1)
await self._client.async_boost_heat_pump_zone(self._account_id, self._heat_pump_id, self._zone.configuration.code, self._end_timestamp, self._attr_target_temperature)

boost_temperature = self._attr_target_temperature
if boost_temperature is None:
boost_temperature = DEFAULT_BOOST_TEMPERATURE_WATER if self._zone.configuration.zoneType == "WATER" else DEFAULT_BOOST_TEMPERATURE_HEAT

await self._client.async_boost_heat_pump_zone(
self._account_id,
self._heat_pump_id,
self._zone.configuration.code,
self._end_timestamp,
boost_temperature
)
else:
zone_mode = self.get_zone_mode()
await self._client.async_set_heat_pump_zone_mode(self._account_id, self._heat_pump_id, self._zone.configuration.code, zone_mode, self._attr_target_temperature)
Expand Down Expand Up @@ -240,7 +251,18 @@ async def async_boost_heat_pump_zone(self, hours: int, minutes: int, target_temp
self._end_timestamp = utcnow()
self._end_timestamp += timedelta(hours=hours, minutes=minutes)
self._attr_preset_mode = PRESET_BOOST
await self._client.async_boost_heat_pump_zone(self._account_id, self._heat_pump_id, self._zone.configuration.code, self._end_timestamp, target_temperature if target_temperature is not None else self._attr_target_temperature)

boost_temperature = target_temperature if target_temperature is not None else self._attr_target_temperature
if boost_temperature is None:
boost_temperature = DEFAULT_BOOST_TEMPERATURE_WATER if self._zone.configuration.zoneType == "WATER" else DEFAULT_BOOST_TEMPERATURE_HEAT

await self._client.async_boost_heat_pump_zone(
self._account_id,
self._heat_pump_id,
self._zone.configuration.code,
self._end_timestamp,
boost_temperature
)

self.async_write_ha_state()

Expand Down
2 changes: 1 addition & 1 deletion custom_components/octopus_energy/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
"pydantic"
],
"ssdp": [],
"version": "13.5.2",
"version": "13.5.3",
"zeroconf": []
}

0 comments on commit aa9c45a

Please sign in to comment.