From f86be2d71f068575cf46bbd66e8c707f55394f42 Mon Sep 17 00:00:00 2001 From: Mark Parker Date: Wed, 4 Dec 2024 11:18:26 +0000 Subject: [PATCH 1/8] fix: error is hw climate set to off --- custom_components/wiser/climate.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/custom_components/wiser/climate.py b/custom_components/wiser/climate.py index 8e7430b..676cdff 100755 --- a/custom_components/wiser/climate.py +++ b/custom_components/wiser/climate.py @@ -1037,7 +1037,12 @@ async def run_automation(self) -> bool: updated = False should_heat = self.hotwater.is_heating - # Reasons it shoudl heat + if self.hvac_mode == HVACMode.OFF: + # HW is off. Just return here as if turned on by app or hub, will go + # into manual mode. + return False + + # Reasons it should heat if self.current_temperature <= self.target_temperature_low or ( self.current_temperature <= self.target_temperature_high and self.hotwater.is_heating @@ -1045,11 +1050,6 @@ async def run_automation(self) -> bool: should_heat = True # Now all reasons it should not heat - if self.hvac_mode == HVACMode.OFF: - # HW is off. Just return here as if turned on by app or hub, will go - # into manual mode. - return False - if not self.hotwater.is_boosted: # Boost overrides all other mode settings From 387c1e2bf1bd187b45b84a61e5a00e3090e7e3d3 Mon Sep 17 00:00:00 2001 From: Mark Parker Date: Wed, 4 Dec 2024 11:59:15 +0000 Subject: [PATCH 2/8] fix: config entry does not migrate if automation disabled --- custom_components/wiser/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/wiser/__init__.py b/custom_components/wiser/__init__.py index 0657e88..efb47ec 100755 --- a/custom_components/wiser/__init__.py +++ b/custom_components/wiser/__init__.py @@ -50,7 +50,7 @@ async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> new_options = {**config_entry.options} if config_entry.minor_version < 2: # move passive mode options into new section - if new_options.get(CONF_AUTOMATIONS_PASSIVE): + if new_options.get(CONF_AUTOMATIONS_PASSIVE) is not None: new_options[CONF_AUTOMATIONS_PASSIVE] = { CONF_AUTOMATIONS_PASSIVE: new_options[CONF_AUTOMATIONS_PASSIVE] } @@ -62,7 +62,7 @@ async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> del new_options[item] # hw climate - if new_options.get(CONF_AUTOMATIONS_HW_CLIMATE): + if new_options.get(CONF_AUTOMATIONS_HW_CLIMATE) is not None: if new_options.get(CONF_DEPRECATED_HW_TARGET_TEMP): del new_options[CONF_DEPRECATED_HW_TARGET_TEMP] From 2e67a4c0b176bd1a143ab000d643cf142eb851f6 Mon Sep 17 00:00:00 2001 From: Mark Parker Date: Wed, 4 Dec 2024 12:42:45 +0000 Subject: [PATCH 3/8] fix: correct config flow migration failure --- custom_components/wiser/__init__.py | 68 ++++++++++++++------------ custom_components/wiser/config_flow.py | 2 +- 2 files changed, 38 insertions(+), 32 deletions(-) diff --git a/custom_components/wiser/__init__.py b/custom_components/wiser/__init__.py index efb47ec..ea13310 100755 --- a/custom_components/wiser/__init__.py +++ b/custom_components/wiser/__init__.py @@ -48,44 +48,50 @@ async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> if config_entry.version == 1: new_options = {**config_entry.options} - if config_entry.minor_version < 2: + if config_entry.minor_version < 3: # move passive mode options into new section if new_options.get(CONF_AUTOMATIONS_PASSIVE) is not None: - new_options[CONF_AUTOMATIONS_PASSIVE] = { - CONF_AUTOMATIONS_PASSIVE: new_options[CONF_AUTOMATIONS_PASSIVE] - } - for item in [ - CONF_AUTOMATIONS_PASSIVE_TEMP_INCREMENT, - ]: - if new_options.get(item): - new_options[CONF_AUTOMATIONS_PASSIVE][item] = new_options[item] - del new_options[item] + # detect if failed last upgrade to minor version 2 + if isinstance(new_options.get(CONF_AUTOMATIONS_PASSIVE), bool): + new_options[CONF_AUTOMATIONS_PASSIVE] = { + CONF_AUTOMATIONS_PASSIVE: new_options[CONF_AUTOMATIONS_PASSIVE] + } + for item in [ + CONF_AUTOMATIONS_PASSIVE_TEMP_INCREMENT, + ]: + if new_options.get(item): + new_options[CONF_AUTOMATIONS_PASSIVE][item] = new_options[ + item + ] + del new_options[item] # hw climate if new_options.get(CONF_AUTOMATIONS_HW_CLIMATE) is not None: - if new_options.get(CONF_DEPRECATED_HW_TARGET_TEMP): - del new_options[CONF_DEPRECATED_HW_TARGET_TEMP] - - new_options[CONF_AUTOMATIONS_HW_CLIMATE] = { - CONF_AUTOMATIONS_HW_CLIMATE: new_options[ - CONF_AUTOMATIONS_HW_CLIMATE - ] - } - for item in [ - CONF_AUTOMATIONS_HW_AUTO_MODE, - CONF_AUTOMATIONS_HW_HEAT_MODE, - CONF_AUTOMATIONS_HW_SENSOR_ENTITY_ID, - ]: - if value := new_options.get(item): - if value == "Normal": - value = HWCycleModes.CONTINUOUS - if value == "Override": - value = HWCycleModes.ONCE - new_options[CONF_AUTOMATIONS_HW_CLIMATE][item] = value - del new_options[item] + # detect if failed last upgrade to minor version 2 + if isinstance(new_options.get(CONF_AUTOMATIONS_HW_CLIMATE), bool): + if new_options.get(CONF_DEPRECATED_HW_TARGET_TEMP): + del new_options[CONF_DEPRECATED_HW_TARGET_TEMP] + + new_options[CONF_AUTOMATIONS_HW_CLIMATE] = { + CONF_AUTOMATIONS_HW_CLIMATE: new_options[ + CONF_AUTOMATIONS_HW_CLIMATE + ] + } + for item in [ + CONF_AUTOMATIONS_HW_AUTO_MODE, + CONF_AUTOMATIONS_HW_HEAT_MODE, + CONF_AUTOMATIONS_HW_SENSOR_ENTITY_ID, + ]: + if value := new_options.get(item): + if value == "Normal": + value = HWCycleModes.CONTINUOUS + if value == "Override": + value = HWCycleModes.ONCE + new_options[CONF_AUTOMATIONS_HW_CLIMATE][item] = value + del new_options[item] hass.config_entries.async_update_entry( - config_entry, options=new_options, minor_version=2, version=1 + config_entry, options=new_options, minor_version=3, version=1 ) _LOGGER.debug( diff --git a/custom_components/wiser/config_flow.py b/custom_components/wiser/config_flow.py index 704640b..7563d40 100755 --- a/custom_components/wiser/config_flow.py +++ b/custom_components/wiser/config_flow.py @@ -104,7 +104,7 @@ class WiserFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): """ VERSION = 1 - MINOR_VERSION = 2 + MINOR_VERSION = 3 CONNECTION_CLASS = config_entries.CONN_CLASS_LOCAL_POLL def __init__(self) -> None: From 84acf933a24c0cd4184a89cacac072523a92768a Mon Sep 17 00:00:00 2001 From: Mark Parker Date: Wed, 4 Dec 2024 12:42:55 +0000 Subject: [PATCH 4/8] bump api to v1.6.4 --- custom_components/wiser/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/wiser/manifest.json b/custom_components/wiser/manifest.json index 6299a9e..00bd6d4 100755 --- a/custom_components/wiser/manifest.json +++ b/custom_components/wiser/manifest.json @@ -16,7 +16,7 @@ "iot_class": "local_polling", "issue_tracker": "https://github.com/asantaga/wiserHomeAssistantPlatform/issues", "requirements": [ - "aioWiserHeatAPI==1.6.3" + "aioWiserHeatAPI==1.6.4" ], "version": "3.4.13", "zeroconf": [ From f04543c2b4ff0a651929249174c12816e07c74b7 Mon Sep 17 00:00:00 2001 From: Mark Parker Date: Wed, 4 Dec 2024 12:45:01 +0000 Subject: [PATCH 5/8] v3.4.14 --- README.md | 5 ++++- custom_components/wiser/const.py | 2 +- custom_components/wiser/manifest.json | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2509e9e..da400e9 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Wiser Home Assistant Integration v3.4.13 +# Wiser Home Assistant Integration v3.4.14 [![hacs_badge](https://img.shields.io/badge/HACS-Default-orange.svg?style=for-the-badge)](https://github.com/hacs/integration) [![downloads](https://shields.io/github/downloads/asantaga/wiserHomeAssistantPlatform/latest/total?style=for-the-badge)](https://github.com/asantaga/wiserHomeAssistantPlatform) @@ -29,6 +29,9 @@ For more information checkout the AMAZING community thread available on ## Change log +- v3.4.14 + - Fixed issue causing integration not to load in some circumstances due to failed config entry migration - issue #539 + - v3.4.13 - Added support for PowerTag C - issue #528 - BREAKING CHANGE - refactored HW climate automation - issues #481, #490. See wiki for updated instructions diff --git a/custom_components/wiser/const.py b/custom_components/wiser/const.py index 258404d..92e4a4e 100755 --- a/custom_components/wiser/const.py +++ b/custom_components/wiser/const.py @@ -9,7 +9,7 @@ from enum import StrEnum -VERSION = "3.4.13" +VERSION = "3.4.14" DOMAIN = "wiser" DATA_WISER_CONFIG = "wiser_config" URL_BASE = "/wiser" diff --git a/custom_components/wiser/manifest.json b/custom_components/wiser/manifest.json index 00bd6d4..aeb4788 100755 --- a/custom_components/wiser/manifest.json +++ b/custom_components/wiser/manifest.json @@ -18,7 +18,7 @@ "requirements": [ "aioWiserHeatAPI==1.6.4" ], - "version": "3.4.13", + "version": "3.4.14", "zeroconf": [ { "type": "_http._tcp.local.", From 12d07e17392e6506b34329edeada2e4a14b83219 Mon Sep 17 00:00:00 2001 From: Mark Parker Date: Wed, 4 Dec 2024 12:53:55 +0000 Subject: [PATCH 6/8] feat: add binary sensor active state --- custom_components/wiser/binary_sensor.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/custom_components/wiser/binary_sensor.py b/custom_components/wiser/binary_sensor.py index b16d483..bf114ab 100644 --- a/custom_components/wiser/binary_sensor.py +++ b/custom_components/wiser/binary_sensor.py @@ -62,6 +62,10 @@ async def async_setup_entry(hass: HomeAssistant, config_entry, async_add_entitie ] ) + # Binary sensors active + for device in data.wiserhub.devices.binary_sensor.all: + binary_sensors.extend([BaseBinarySensor(data, device.id, "Active")]) + async_add_entities(binary_sensors, True) From 8bdf693f7dd1501eec0566d631f22fa0f9da69f7 Mon Sep 17 00:00:00 2001 From: Mark Parker Date: Wed, 4 Dec 2024 13:01:40 +0000 Subject: [PATCH 7/8] update readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index da400e9..ff6a4cc 100755 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ For more information checkout the AMAZING community thread available on - v3.4.14 - Fixed issue causing integration not to load in some circumstances due to failed config entry migration - issue #539 + - Added binary sensor active state sensor - v3.4.13 - Added support for PowerTag C - issue #528 From 2ddc06ab9edcab9bd72b9426738c6614f31eeb9e Mon Sep 17 00:00:00 2001 From: Mark Parker Date: Wed, 4 Dec 2024 13:11:56 +0000 Subject: [PATCH 8/8] update readme --- README.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index ff6a4cc..6964696 100755 --- a/README.md +++ b/README.md @@ -30,21 +30,21 @@ For more information checkout the AMAZING community thread available on ## Change log - v3.4.14 - - Fixed issue causing integration not to load in some circumstances due to failed config entry migration - issue #539 - - Added binary sensor active state sensor + - Fixed issue causing integration not to load in some circumstances due to failed config entry migration - issue #539 + - Added binary sensor active state sensor - v3.4.13 - - Added support for PowerTag C - issue #528 - - BREAKING CHANGE - refactored HW climate automation - issues #481, #490. See wiki for updated instructions - - Added illuminance, humidity and temp sensors to devices with threshold sensors - issue #531 - - Added support for 2 gang light switch - issue #529 - - Added interacts with room climate switch to supported devices - - Fixed support for Binary sensors with threshold sensors - issue #530 - - Fixed incompatibility with Python3.13 and HA2024.12 - issue #535 - - Fixed events not correctly firing for climate changes - issue #526 - - Fixed error when saving schedule with an off slot - issue #536 - - Changed all hot water related sensors to now belong to a hot water device - - Bumped aiowiserheatapi to v1.6.3 + - Added support for PowerTag C - issue #528 + - BREAKING CHANGE - refactored HW climate automation - issues #481, #490. See wiki for updated instructions + - Added illuminance, humidity and temp sensors to devices with threshold sensors - issue #531 + - Added support for 2 gang light switch - issue #529 + - Added interacts with room climate switch to supported devices + - Fixed support for Binary sensors with threshold sensors - issue #530 + - Fixed incompatibility with Python3.13 and HA2024.12 - issue #535 + - Fixed events not correctly firing for climate changes - issue #526 + - Fixed error when saving schedule with an off slot - issue #536 + - Changed all hot water related sensors to now belong to a hot water device + - Bumped aiowiserheatapi to v1.6.3 - v3.4.12 - Fixed issue assigning schedules with non ascii characters in name - issue #509