Skip to content

Added support for Quick DHW Heating on Therma V heatpump #854

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions custom_components/smartthinq_sensors/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@ class ThinQSwitchEntityDescription(SwitchEntityDescription):
turn_on_fn=lambda x: x.device.set_mode_awhp_silent(True),
available_fn=lambda x: x.is_power_on,
),
ThinQSwitchEntityDescription(
key=AirConditionerFeatures.MODE_HOT_WATER_POWER,
name="Hot Water Power mode",
icon="mdi:water-sync",
turn_off_fn=lambda x: x.device.set_mode_hot_water_power(False),
turn_on_fn=lambda x: x.device.set_mode_hot_water_power(True),
available_fn=lambda x: x.is_power_on,
),
)
MICROWAVE_SWITCH: tuple[ThinQSwitchEntityDescription, ...] = (
ThinQSwitchEntityDescription(
Expand Down
1 change: 1 addition & 0 deletions custom_components/smartthinq_sensors/wideq/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class AirConditionerFeatures(StrEnum):
LIGHTING_DISPLAY = "lighting_display"
MODE_AIRCLEAN = "mode_airclean"
MODE_AWHP_SILENT = "mode_awhp_silent"
MODE_HOT_WATER_POWER = "mode_hot_water_power"
MODE_JET = "mode_jet"
PM1 = "pm1"
PM10 = "pm10"
Expand Down
26 changes: 26 additions & 0 deletions custom_components/smartthinq_sensors/wideq/devices/ac.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,12 @@
STATE_HOT_WATER_MAX_TEMP = ["HotWaterTempMax", "airState.tempState.hotWaterTempMax"]
STATE_HOT_WATER_MODE = ["HotWater", "airState.miscFuncState.hotWater"]
STATE_MODE_AWHP_SILENT = ["SilentMode", "airState.miscFuncState.silentAWHP"]
STATE_MODE_HOT_WATER_POWER = ["HotWaterPower", "airState.miscFuncState.powerHotWater"]

CMD_STATE_HOT_WATER_MODE = [CTRL_BASIC, "Set", STATE_HOT_WATER_MODE]
CMD_STATE_HOT_WATER_TARGET_TEMP = [CTRL_BASIC, "Set", STATE_HOT_WATER_TARGET_TEMP]
CMD_STATE_MODE_AWHP_SILENT = [CTRL_BASIC, "Set", STATE_MODE_AWHP_SILENT]
CMD_STATE_MODE_HOT_WATER_POWER = [CTRL_BASIC, "Set", STATE_MODE_HOT_WATER_POWER]

CMD_ENABLE_EVENT_V2 = ["allEventEnable", "Set", "airState.mon.timeout"]

Expand Down Expand Up @@ -792,6 +794,16 @@ async def set_mode_awhp_silent(self, value: bool):
raise ValueError(f"Invalid AWHP silent mode: {mode}")
await self.set(keys[0], keys[1], key=keys[2], value=silent_mode)

async def set_mode_hot_water_power(self, value: bool):
"""Set the awhp Power mode on or off."""
if not self.is_air_to_water:
raise ValueError("AWHP Power mode not supported")
mode = MODE_ON if value else MODE_OFF
keys = self._get_cmd_keys(CMD_STATE_MODE_HOT_WATER_POWER)
if (power_mode := self.model_info.enum_value(keys[2], mode)) is None:
raise ValueError(f"Invalid AWHP Power mode: {mode}")
await self.set(keys[0], keys[1], key=keys[2], value=power_mode)

async def hot_water_mode(self, value: bool):
"""Set the device hot water mode on or off."""
if not self.is_water_heater_supported:
Expand Down Expand Up @@ -1344,6 +1356,19 @@ def mode_awhp_silent(self):
AirConditionerFeatures.MODE_AWHP_SILENT, status, False
)

@property
def mode_hot_water_power(self):
"""Return AWHP Power mode status."""
if not (self._device.is_air_to_water and self.is_info_v2):
return None
key = self._get_state_key(STATE_MODE_HOT_WATER_POWER)
if (value := self.lookup_enum(key, True)) is None:
return None
status = value == MODE_ON
return self._update_feature(
AirConditionerFeatures.MODE_HOT_WATER_POWER, status, False
)

@property
def hot_water_current_temp(self):
"""Return AWHP hot water current temperature."""
Expand Down Expand Up @@ -1402,6 +1427,7 @@ def _update_features(self):
self.water_in_current_temp,
self.water_out_current_temp,
self.mode_awhp_silent,
self.mode_hot_water_power,
self.hot_water_current_temp,
self.reservation_sleep_time,
]