From e56afcfb8a069dd16266a1cdd5633a7947cfb709 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 21 Jun 2026 18:32:59 +0200 Subject: [PATCH 01/42] Link to updated backend library --- custom_components/plugwise/manifest.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/custom_components/plugwise/manifest.json b/custom_components/plugwise/manifest.json index 09f91d310..3c0b27bcc 100644 --- a/custom_components/plugwise/manifest.json +++ b/custom_components/plugwise/manifest.json @@ -7,7 +7,9 @@ "integration_type": "hub", "iot_class": "local_polling", "loggers": ["plugwise"], - "requirements": ["plugwise==1.12.0"], + "requirements": [ + "plugwise@git+https://github.com/plugwise/python-plugwise.git/@water_heater_2" + ], "version": "0.65.0", "zeroconf": ["_plugwise._tcp.local."] } From cd86886a807592fe75b5edfdbfee638e1c090dde Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 21 Jun 2026 18:37:19 +0200 Subject: [PATCH 02/42] Refresh test-fixtures --- .../fixtures/adam_plus_anna_new/data.json | 16 +++++++------- .../fixtures/anna_heatpump_heating/data.json | 22 +++++++++---------- .../plugwise/fixtures/anna_v4/data.json | 21 +++++++++--------- .../plugwise/fixtures/anna_v4_dhw/data.json | 21 +++++++++--------- .../fixtures/m_adam_cooling/data.json | 16 +++++++------- .../fixtures/m_adam_heating/data.json | 21 +++++++++--------- .../m_adam_heating_off_schedule/data.json | 21 +++++++++--------- .../plugwise/fixtures/m_adam_jip/data.json | 21 +++++++++--------- .../m_anna_heatpump_cooling/data.json | 22 +++++++++---------- 9 files changed, 93 insertions(+), 88 deletions(-) diff --git a/tests/components/plugwise/fixtures/adam_plus_anna_new/data.json b/tests/components/plugwise/fixtures/adam_plus_anna_new/data.json index 56c7ffbb0..5a199f12a 100644 --- a/tests/components/plugwise/fixtures/adam_plus_anna_new/data.json +++ b/tests/components/plugwise/fixtures/adam_plus_anna_new/data.json @@ -6,24 +6,24 @@ "flame_state": true, "heating_state": true }, + "boiler_temperature": { + "current": 43.0, + "lower_bound": 25.0, + "resolution": 0.01, + "setpoint": 50.0, + "upper_bound": 95.0 + }, "dev_class": "heater_central", "dhw_modes": [ "comfort", "off" ], "location": "bc93488efab249e5bc54fd7e175a6f91", - "maximum_boiler_temperature": { - "lower_bound": 25.0, - "resolution": 0.01, - "setpoint": 50.0, - "upper_bound": 95.0 - }, "model": "Generic heater", "name": "OpenTherm", "select_dhw_mode": "off", "sensors": { - "intended_boiler_temperature": 22.5, - "water_temperature": 43.0 + "intended_boiler_temperature": 22.5 } }, "10016900610d4c7481df78c89606ef22": { diff --git a/tests/components/plugwise/fixtures/anna_heatpump_heating/data.json b/tests/components/plugwise/fixtures/anna_heatpump_heating/data.json index 54a045273..69ea20098 100644 --- a/tests/components/plugwise/fixtures/anna_heatpump_heating/data.json +++ b/tests/components/plugwise/fixtures/anna_heatpump_heating/data.json @@ -28,35 +28,35 @@ "heating_state": true, "secondary_boiler_state": false }, + "boiler_temperature": { + "current": 29.1, + "lower_bound": 0.0, + "resolution": 1.0, + "setpoint": 60.0, + "upper_bound": 100.0 + }, "dev_class": "heater_central", "dhw_mode": "off", "dhw_modes": [ "comfort", "off" ], - "location": "a57efe5f145f498c9be62a9b63626fbf", - "max_dhw_temperature": { + "dhw_temperature": { + "current": 46.3, "lower_bound": 35.0, "resolution": 0.01, "setpoint": 53.0, "upper_bound": 60.0 }, - "maximum_boiler_temperature": { - "lower_bound": 0.0, - "resolution": 1.0, - "setpoint": 60.0, - "upper_bound": 100.0 - }, + "location": "a57efe5f145f498c9be62a9b63626fbf", "model": "Generic heater/cooler", "name": "OpenTherm", "sensors": { - "dhw_temperature": 46.3, "intended_boiler_temperature": 35.0, "modulation_level": 52, "outdoor_air_temperature": 3.0, "return_temperature": 25.1, - "water_pressure": 1.57, - "water_temperature": 29.1 + "water_pressure": 1.57 }, "vendor": "Techneco" }, diff --git a/tests/components/plugwise/fixtures/anna_v4/data.json b/tests/components/plugwise/fixtures/anna_v4/data.json index 563560b49..fbf163590 100644 --- a/tests/components/plugwise/fixtures/anna_v4/data.json +++ b/tests/components/plugwise/fixtures/anna_v4/data.json @@ -66,25 +66,27 @@ "flame_state": false, "heating_state": true }, + "boiler_temperature": { + "current": 45.0, + "lower_bound": 0.0, + "resolution": 1.0, + "setpoint": 70.0, + "upper_bound": 100.0 + }, "dev_class": "heater_central", "dhw_mode": "off", "dhw_modes": [ "comfort", "off" ], - "location": "94c107dc6ac84ed98e9f68c0dd06bf71", - "max_dhw_temperature": { + "dhw_temperature": { + "current": 45.0, "lower_bound": 30.0, "resolution": 0.01, "setpoint": 60.0, "upper_bound": 60.0 }, - "maximum_boiler_temperature": { - "lower_bound": 0.0, - "resolution": 1.0, - "setpoint": 70.0, - "upper_bound": 100.0 - }, + "location": "94c107dc6ac84ed98e9f68c0dd06bf71", "model": "Generic heater", "model_id": "2.32", "name": "OpenTherm", @@ -92,8 +94,7 @@ "intended_boiler_temperature": 39.9, "modulation_level": 0.0, "return_temperature": 32.0, - "water_pressure": 2.2, - "water_temperature": 45.0 + "water_pressure": 2.2 }, "vendor": "Bosch Thermotechniek B.V." } diff --git a/tests/components/plugwise/fixtures/anna_v4_dhw/data.json b/tests/components/plugwise/fixtures/anna_v4_dhw/data.json index 9c1f13360..6ec073250 100644 --- a/tests/components/plugwise/fixtures/anna_v4_dhw/data.json +++ b/tests/components/plugwise/fixtures/anna_v4_dhw/data.json @@ -66,25 +66,27 @@ "flame_state": true, "heating_state": false }, + "boiler_temperature": { + "current": 45.0, + "lower_bound": 0.0, + "resolution": 1.0, + "setpoint": 70.0, + "upper_bound": 100.0 + }, "dev_class": "heater_central", "dhw_mode": "off", "dhw_modes": [ "comfort", "off" ], - "location": "94c107dc6ac84ed98e9f68c0dd06bf71", - "max_dhw_temperature": { + "dhw_temperature": { + "current": 45.0, "lower_bound": 30.0, "resolution": 0.01, "setpoint": 60.0, "upper_bound": 60.0 }, - "maximum_boiler_temperature": { - "lower_bound": 0.0, - "resolution": 1.0, - "setpoint": 70.0, - "upper_bound": 100.0 - }, + "location": "94c107dc6ac84ed98e9f68c0dd06bf71", "model": "Generic heater", "model_id": "2.32", "name": "OpenTherm", @@ -92,8 +94,7 @@ "intended_boiler_temperature": 39.9, "modulation_level": 0.0, "return_temperature": 32.0, - "water_pressure": 2.2, - "water_temperature": 45.0 + "water_pressure": 2.2 }, "vendor": "Bosch Thermotechniek B.V." } diff --git a/tests/components/plugwise/fixtures/m_adam_cooling/data.json b/tests/components/plugwise/fixtures/m_adam_cooling/data.json index c5b321660..c388b60a6 100644 --- a/tests/components/plugwise/fixtures/m_adam_cooling/data.json +++ b/tests/components/plugwise/fixtures/m_adam_cooling/data.json @@ -7,24 +7,24 @@ "flame_state": false, "heating_state": false }, + "boiler_temperature": { + "current": 19.0, + "lower_bound": 25.0, + "resolution": 0.01, + "setpoint": 50.0, + "upper_bound": 95.0 + }, "dev_class": "heater_central", "dhw_modes": [ "comfort", "off" ], "location": "bc93488efab249e5bc54fd7e175a6f91", - "maximum_boiler_temperature": { - "lower_bound": 25.0, - "resolution": 0.01, - "setpoint": 50.0, - "upper_bound": 95.0 - }, "model": "Generic heater", "name": "OpenTherm", "select_dhw_mode": "off", "sensors": { - "intended_boiler_temperature": 17.5, - "water_temperature": 19.0 + "intended_boiler_temperature": 17.5 } }, "14df5c4dc8cb4ba69f9d1ac0eaf7c5c6": { diff --git a/tests/components/plugwise/fixtures/m_adam_heating/data.json b/tests/components/plugwise/fixtures/m_adam_heating/data.json index f29aa84c7..a45d345d8 100644 --- a/tests/components/plugwise/fixtures/m_adam_heating/data.json +++ b/tests/components/plugwise/fixtures/m_adam_heating/data.json @@ -6,30 +6,31 @@ "flame_state": false, "heating_state": true }, + "boiler_temperature": { + "current": 37.0, + "lower_bound": 25.0, + "resolution": 0.01, + "setpoint": 50.0, + "upper_bound": 95.0 + }, "dev_class": "heater_central", "dhw_modes": [ "comfort", "off" ], - "location": "bc93488efab249e5bc54fd7e175a6f91", - "max_dhw_temperature": { + "dhw_temperature": { + "current": 37.0, "lower_bound": 40.0, "resolution": 0.01, "setpoint": 60.0, "upper_bound": 60.0 }, - "maximum_boiler_temperature": { - "lower_bound": 25.0, - "resolution": 0.01, - "setpoint": 50.0, - "upper_bound": 95.0 - }, + "location": "bc93488efab249e5bc54fd7e175a6f91", "model": "Generic heater", "name": "OpenTherm", "select_dhw_mode": "off", "sensors": { - "intended_boiler_temperature": 38.1, - "water_temperature": 37.0 + "intended_boiler_temperature": 38.1 } }, "14df5c4dc8cb4ba69f9d1ac0eaf7c5c6": { diff --git a/tests/components/plugwise/fixtures/m_adam_heating_off_schedule/data.json b/tests/components/plugwise/fixtures/m_adam_heating_off_schedule/data.json index aaabc1495..a3c7095c4 100644 --- a/tests/components/plugwise/fixtures/m_adam_heating_off_schedule/data.json +++ b/tests/components/plugwise/fixtures/m_adam_heating_off_schedule/data.json @@ -6,30 +6,31 @@ "flame_state": false, "heating_state": false }, + "boiler_temperature": { + "current": 37.0, + "lower_bound": 25.0, + "resolution": 0.01, + "setpoint": 50.0, + "upper_bound": 95.0 + }, "dev_class": "heater_central", "dhw_modes": [ "comfort", "off" ], - "location": "bc93488efab249e5bc54fd7e175a6f91", - "max_dhw_temperature": { + "dhw_temperature": { + "current": 37.0, "lower_bound": 40.0, "resolution": 0.01, "setpoint": 60.0, "upper_bound": 60.0 }, - "maximum_boiler_temperature": { - "lower_bound": 25.0, - "resolution": 0.01, - "setpoint": 50.0, - "upper_bound": 95.0 - }, + "location": "bc93488efab249e5bc54fd7e175a6f91", "model": "Generic heater", "name": "OpenTherm", "select_dhw_mode": "off", "sensors": { - "intended_boiler_temperature": 0.0, - "water_temperature": 37.0 + "intended_boiler_temperature": 0.0 } }, "14df5c4dc8cb4ba69f9d1ac0eaf7c5c6": { diff --git a/tests/components/plugwise/fixtures/m_adam_jip/data.json b/tests/components/plugwise/fixtures/m_adam_jip/data.json index ff33d77c2..fd2ccd4dc 100644 --- a/tests/components/plugwise/fixtures/m_adam_jip/data.json +++ b/tests/components/plugwise/fixtures/m_adam_jip/data.json @@ -392,25 +392,27 @@ "flame_state": false, "heating_state": false }, + "boiler_temperature": { + "current": 37.3, + "lower_bound": 20.0, + "resolution": 0.01, + "setpoint": 90.0, + "upper_bound": 90.0 + }, "dev_class": "heater_central", "dhw_mode": "off", "dhw_modes": [ "comfort", "off" ], - "location": "9e4433a9d69f40b3aefd15e74395eaec", - "max_dhw_temperature": { + "dhw_temperature": { + "current": 37.3, "lower_bound": 40.0, "resolution": 0.01, "setpoint": 60.0, "upper_bound": 60.0 }, - "maximum_boiler_temperature": { - "lower_bound": 20.0, - "resolution": 0.01, - "setpoint": 90.0, - "upper_bound": 90.0 - }, + "location": "9e4433a9d69f40b3aefd15e74395eaec", "model": "Generic heater", "model_id": "10.20", "name": "OpenTherm", @@ -418,8 +420,7 @@ "intended_boiler_temperature": 0.0, "modulation_level": 0.0, "return_temperature": 37.1, - "water_pressure": 1.4, - "water_temperature": 37.3 + "water_pressure": 1.4 }, "vendor": "Remeha B.V." }, diff --git a/tests/components/plugwise/fixtures/m_anna_heatpump_cooling/data.json b/tests/components/plugwise/fixtures/m_anna_heatpump_cooling/data.json index fb4085270..44729c758 100644 --- a/tests/components/plugwise/fixtures/m_anna_heatpump_cooling/data.json +++ b/tests/components/plugwise/fixtures/m_anna_heatpump_cooling/data.json @@ -28,35 +28,35 @@ "heating_state": false, "secondary_boiler_state": false }, + "boiler_temperature": { + "current": 22.7, + "lower_bound": 0.0, + "resolution": 1.0, + "setpoint": 60.0, + "upper_bound": 100.0 + }, "dev_class": "heater_central", "dhw_mode": "off", "dhw_modes": [ "comfort", "off" ], - "location": "a57efe5f145f498c9be62a9b63626fbf", - "max_dhw_temperature": { + "dhw_temperature": { + "current": 41.5, "lower_bound": 35.0, "resolution": 0.01, "setpoint": 53.0, "upper_bound": 60.0 }, - "maximum_boiler_temperature": { - "lower_bound": 0.0, - "resolution": 1.0, - "setpoint": 60.0, - "upper_bound": 100.0 - }, + "location": "a57efe5f145f498c9be62a9b63626fbf", "model": "Generic heater/cooler", "name": "OpenTherm", "sensors": { - "dhw_temperature": 41.5, "intended_boiler_temperature": 0.0, "modulation_level": 40, "outdoor_air_temperature": 28.0, "return_temperature": 23.8, - "water_pressure": 1.57, - "water_temperature": 22.7 + "water_pressure": 1.57 }, "vendor": "Techneco" }, From 891b2a01e0f5763b1db110f120d272598ec4c3b1 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 21 Jun 2026 18:43:54 +0200 Subject: [PATCH 03/42] Rework water_heater to support the updated backend library --- custom_components/plugwise/water_heater.py | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/custom_components/plugwise/water_heater.py b/custom_components/plugwise/water_heater.py index d7758a242..c37fecc13 100644 --- a/custom_components/plugwise/water_heater.py +++ b/custom_components/plugwise/water_heater.py @@ -50,7 +50,7 @@ def _add_entities() -> None: entities: list[PlugwiseWaterHeaterEntity] = [] for device_id in coordinator.new_devices: device = coordinator.data[device_id] - if device.get(MAX_DHW_TEMP) is not None: + if device.get(DHW_TEMP) is not None: entities.append(PlugwiseWaterHeaterEntity(coordinator, device_id)) LOGGER.debug("Add %s water_heater", device[ATTR_NAME]) async_add_entities(entities) @@ -76,10 +76,10 @@ def __init__( entity_name = f"{self.device[ATTR_NAME]}".lower() self._attr_unique_id = f"{device_id}-{entity_name}" - max_dhw_temp_bounds = self.device.get(MAX_DHW_TEMP, {}) - if max_dhw_temp_bounds: - self._attr_max_temp = max_dhw_temp_bounds.get(UPPER_BOUND, 75.0) - self._attr_min_temp = max_dhw_temp_bounds.get(LOWER_BOUND, 40.0) + self.dhw_temp = self.device.get(DHW_TEMP, {}) + if self.dhw_temp: + self._attr_max_temp = self.dhw_temp.get(UPPER_BOUND, 75.0) + self._attr_min_temp = self.dhw_temp.get(LOWER_BOUND, 40.0) self._attr_supported_features = WaterHeaterEntityFeature.OPERATION_MODE self._attr_supported_features |= WaterHeaterEntityFeature.TARGET_TEMPERATURE @@ -94,9 +94,7 @@ def current_operation(self) -> str | None: @override def current_temperature(self) -> float | None: """Return the current water temperature.""" - boiler_temperature = self.device.get(SENSORS, {}).get(WATER_TEMP) - dhw_temperature = self.device.get(SENSORS, {}).get(DHW_TEMP) - return dhw_temperature or boiler_temperature + return self.dhw_temp.get("current") @property @override @@ -110,10 +108,7 @@ def operation_list(self) -> list[str]: @override def target_temperature(self) -> float | None: """Return the water temperature we try to reach.""" - return ( - self.device.get(MAX_DHW_TEMP, {}).get(TARGET_TEMP) - or self.device.get(SENSORS, {}).get(DHW_SETPOINT) - ) + return self.dhw_temp.get("setpoint") @plugwise_command @override @@ -127,4 +122,4 @@ async def async_set_operation_mode(self, operation_mode: str) -> None: async def async_set_temperature(self, **kwargs: Any) -> None: """Set new target temperature.""" if (temperature := kwargs.get(ATTR_TEMPERATURE)) is not None: - await self.coordinator.api.set_number(self._dev_id, MAX_DHW_TEMP, float(temperature)) + await self.coordinator.api.set_number(self._dev_id, DHW_TEMP, float(temperature)) From 2642e485f278a315b83da1a1585ce51998404d88 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 21 Jun 2026 18:56:34 +0200 Subject: [PATCH 04/42] Update constants and deploy --- custom_components/plugwise/const.py | 7 +++---- custom_components/plugwise/number.py | 6 +++--- custom_components/plugwise/water_heater.py | 1 - 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/custom_components/plugwise/const.py b/custom_components/plugwise/const.py index 99f66b67b..4c568eb9f 100644 --- a/custom_components/plugwise/const.py +++ b/custom_components/plugwise/const.py @@ -77,8 +77,7 @@ VENDOR: Final = "vendor" # Number constants -MAX_BOILER_TEMP: Final = "maximum_boiler_temperature" -MAX_DHW_TEMP: Final = "max_dhw_temperature" +BOILER_TEMP: Final = "boiler_temperature" LOWER_BOUND: Final = "lower_bound" RESOLUTION: Final = "resolution" TEMPERATURE_OFFSET: Final = "temperature_offset" @@ -188,8 +187,8 @@ } type NumberType = Literal[ - "maximum_boiler_temperature", - "max_dhw_temperature", + "boiler_temperature", + "dhw_temperature", "temperature_offset", ] diff --git a/custom_components/plugwise/number.py b/custom_components/plugwise/number.py index 5f88a80a3..a42dd8b08 100644 --- a/custom_components/plugwise/number.py +++ b/custom_components/plugwise/number.py @@ -14,9 +14,9 @@ from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback from .const import ( + BOILER_TEMP, LOGGER, LOWER_BOUND, - MAX_BOILER_TEMP, RESOLUTION, TEMPERATURE_OFFSET, UPPER_BOUND, @@ -41,8 +41,8 @@ class PlugwiseNumberEntityDescription(NumberEntityDescription): # Upstream + is there a reason we didn't rename this one prefixed? NUMBER_TYPES = ( PlugwiseNumberEntityDescription( - key=MAX_BOILER_TEMP, - translation_key=MAX_BOILER_TEMP, + key=BOILER_TEMP, + translation_key=BOILER_TEMP, device_class=NumberDeviceClass.TEMPERATURE, entity_category=EntityCategory.CONFIG, native_unit_of_measurement=UnitOfTemperature.CELSIUS, diff --git a/custom_components/plugwise/water_heater.py b/custom_components/plugwise/water_heater.py index c37fecc13..f72fc90e6 100644 --- a/custom_components/plugwise/water_heater.py +++ b/custom_components/plugwise/water_heater.py @@ -22,7 +22,6 @@ DHW_TEMP, LOGGER, LOWER_BOUND, - MAX_DHW_TEMP, SENSORS, TARGET_TEMP, UPPER_BOUND, From 1856c6f9bfdebf5ba29a791ddd48d63936d60245 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 21 Jun 2026 19:02:34 +0200 Subject: [PATCH 05/42] Updates --- custom_components/plugwise/number.py | 10 +++++----- tests/components/plugwise/test_number.py | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/custom_components/plugwise/number.py b/custom_components/plugwise/number.py index a42dd8b08..2ab24c736 100644 --- a/custom_components/plugwise/number.py +++ b/custom_components/plugwise/number.py @@ -116,11 +116,11 @@ def __init__( self.entity_description = description self._attr_unique_id = f"{device_id}-{description.key}" self._attr_mode = NumberMode.BOX - ctrl = self.device.get(description.key, {}) - self._attr_native_max_value = ctrl.get(UPPER_BOUND, 100.0) # Upstream const - self._attr_native_min_value = ctrl.get(LOWER_BOUND, 0.0) # Upstream const + self.ctrl = self.device.get(description.key, {}) + self._attr_native_max_value = self.ctrl.get(UPPER_BOUND, 100.0) # Upstream const + self._attr_native_min_value = self.ctrl.get(LOWER_BOUND, 0.0) # Upstream const - native_step = ctrl.get(RESOLUTION, 0.5) # Upstream const + native_step = self.ctrl.get(RESOLUTION, 0.5) # Upstream const if description.key != TEMPERATURE_OFFSET: # Upstream const native_step = max(native_step, 0.5) self._attr_native_step = native_step @@ -129,7 +129,7 @@ def __init__( @override def native_value(self) -> float | None: """Return the present setpoint value.""" - return self.device.get(self.entity_description.key, {}).get("setpoint") + return self.ctrl.get("setpoint") @plugwise_command @override diff --git a/tests/components/plugwise/test_number.py b/tests/components/plugwise/test_number.py index 87ea6f1f9..15cbd1c3a 100644 --- a/tests/components/plugwise/test_number.py +++ b/tests/components/plugwise/test_number.py @@ -92,7 +92,7 @@ async def test_anna_max_boiler_temp_change( NUMBER_DOMAIN, SERVICE_SET_VALUE, { - ATTR_ENTITY_ID: "number.opentherm_maximum_boiler_temperature_setpoint", + ATTR_ENTITY_ID: "number.opentherm_boiler_temperature_setpoint", ATTR_VALUE: 65, }, blocking=True, @@ -100,5 +100,5 @@ async def test_anna_max_boiler_temp_change( assert mock_smile_anna.set_number.call_count == 1 mock_smile_anna.set_number.assert_called_with( - "1cbf783bb11e4a7c8a6843dee3a86927", "maximum_boiler_temperature", 65.0 + "1cbf783bb11e4a7c8a6843dee3a86927", "boiler_temperature", 65.0 ) From 21b8a7ac0426087e0b0c72cc2fd1d5792a809fbb Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 21 Jun 2026 19:07:01 +0200 Subject: [PATCH 06/42] Update water_heater testcase --- tests/components/plugwise/test_water_heater.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/components/plugwise/test_water_heater.py b/tests/components/plugwise/test_water_heater.py index 11bc7af3a..7e46ff4f7 100644 --- a/tests/components/plugwise/test_water_heater.py +++ b/tests/components/plugwise/test_water_heater.py @@ -47,7 +47,7 @@ async def test_adam_water_heater_setpoint_change( ) assert mock_smile_adam_jip.set_number.call_count == 1 mock_smile_adam_jip.set_number.assert_called_with( - "e4684553153b44afbef2200885f379dc", "max_dhw_temperature", 65.0, + "e4684553153b44afbef2200885f379dc", "dhw_temperature", 65.0, ) await hass.services.async_call( From e8ad57822a0fe76feacbb99ebf6947f40d8b04cc Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 21 Jun 2026 19:16:45 +0200 Subject: [PATCH 07/42] Fix len asserts in test_update_device() --- tests/components/plugwise/test_init.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/components/plugwise/test_init.py b/tests/components/plugwise/test_init.py index 5bee97c70..f85c97a59 100644 --- a/tests/components/plugwise/test_init.py +++ b/tests/components/plugwise/test_init.py @@ -318,7 +318,7 @@ async def test_update_device( assert ( len(er.async_entries_for_config_entry(entity_registry, mock_config_entry.entry_id)) - == 53 + == 52 ) assert ( len(dr.async_entries_for_config_entry(device_registry, mock_config_entry.entry_id)) @@ -342,7 +342,7 @@ async def test_update_device( assert ( len(er.async_entries_for_config_entry(entity_registry, mock_config_entry.entry_id)) - == 60 + == 59 ) assert ( len(dr.async_entries_for_config_entry(device_registry, mock_config_entry.entry_id)) @@ -369,7 +369,7 @@ async def test_update_device( assert ( len(er.async_entries_for_config_entry(entity_registry, mock_config_entry.entry_id)) - == 53 + == 52 ) assert ( len(dr.async_entries_for_config_entry(device_registry, mock_config_entry.entry_id)) From 59181b2b5b4ab2212edfa2aa5adf34fe444d1578 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 21 Jun 2026 19:20:29 +0200 Subject: [PATCH 08/42] Update translations --- custom_components/plugwise/translations/en.json | 7 ++----- custom_components/plugwise/translations/nl.json | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/custom_components/plugwise/translations/en.json b/custom_components/plugwise/translations/en.json index 0015e95e4..0f410e0c3 100644 --- a/custom_components/plugwise/translations/en.json +++ b/custom_components/plugwise/translations/en.json @@ -93,11 +93,8 @@ } }, "number": { - "max_dhw_temperature": { - "name": "Domestic hot water setpoint" - }, - "maximum_boiler_temperature": { - "name": "Maximum boiler temperature setpoint" + "boiler_temperature": { + "name": "Boiler temperature setpoint" }, "temperature_offset": { "name": "Temperature offset" diff --git a/custom_components/plugwise/translations/nl.json b/custom_components/plugwise/translations/nl.json index b76c57143..675a9e972 100644 --- a/custom_components/plugwise/translations/nl.json +++ b/custom_components/plugwise/translations/nl.json @@ -93,11 +93,8 @@ } }, "number": { - "max_dhw_temperature": { - "name": "Instelpunt sanitair warm water" - }, - "maximum_boiler_temperature": { - "name": "Instelpunt maximale boiler temperatuur" + "boiler_temperature": { + "name": "Instelpunt boiler temperatuur" }, "temperature_offset": { "name": "Temperatuurcompensatie" From 5ef1c558ad4e12df3c1be25153953307920bc308 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 21 Jun 2026 19:22:46 +0200 Subject: [PATCH 09/42] Save updated snapshot files --- .../plugwise/snapshots/test_number.ambr | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/components/plugwise/snapshots/test_number.ambr b/tests/components/plugwise/snapshots/test_number.ambr index 1fdd2ea6e..0d1601e30 100644 --- a/tests/components/plugwise/snapshots/test_number.ambr +++ b/tests/components/plugwise/snapshots/test_number.ambr @@ -609,7 +609,7 @@ 'state': '-0.5', }) # --- -# name: test_anna_number_entities[platforms0-True-anna_heatpump_heating][number.opentherm_maximum_boiler_temperature_setpoint-entry] +# name: test_anna_number_entities[platforms0-True-anna_heatpump_heating][number.opentherm_boiler_temperature_setpoint-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ None, @@ -628,7 +628,7 @@ 'disabled_by': None, 'domain': 'number', 'entity_category': , - 'entity_id': 'number.opentherm_maximum_boiler_temperature_setpoint', + 'entity_id': 'number.opentherm_boiler_temperature_setpoint', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -636,22 +636,22 @@ 'labels': set({ }), 'name': None, - 'object_id_base': 'Maximum boiler temperature setpoint', + 'object_id_base': 'Boiler temperature setpoint', 'options': dict({ }), 'original_device_class': , 'original_icon': None, - 'original_name': 'Maximum boiler temperature setpoint', + 'original_name': 'Boiler temperature setpoint', 'platform': 'plugwise', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, - 'translation_key': 'maximum_boiler_temperature', - 'unique_id': '1cbf783bb11e4a7c8a6843dee3a86927-maximum_boiler_temperature', + 'translation_key': 'boiler_temperature', + 'unique_id': '1cbf783bb11e4a7c8a6843dee3a86927-boiler_temperature', 'unit_of_measurement': , }) # --- -# name: test_anna_number_entities[platforms0-True-anna_heatpump_heating][number.opentherm_maximum_boiler_temperature_setpoint-state] +# name: test_anna_number_entities[platforms0-True-anna_heatpump_heating][number.opentherm_boiler_temperature_setpoint-state] StateSnapshot({ 'attributes': ReadOnlyDict({ : 'temperature', @@ -663,7 +663,7 @@ : , }), 'context': , - 'entity_id': 'number.opentherm_maximum_boiler_temperature_setpoint', + 'entity_id': 'number.opentherm_boiler_temperature_setpoint', 'last_changed': , 'last_reported': , 'last_updated': , From 0dfa069263f3e5dcace4c06821c757a851eb9628 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 21 Jun 2026 19:23:22 +0200 Subject: [PATCH 10/42] Ruffed --- custom_components/plugwise/water_heater.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/custom_components/plugwise/water_heater.py b/custom_components/plugwise/water_heater.py index f72fc90e6..cfa0dd9f7 100644 --- a/custom_components/plugwise/water_heater.py +++ b/custom_components/plugwise/water_heater.py @@ -15,18 +15,7 @@ from homeassistant.core import HomeAssistant, callback from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback -from .const import ( - DHW_MODE, - DHW_MODES, - DHW_SETPOINT, - DHW_TEMP, - LOGGER, - LOWER_BOUND, - SENSORS, - TARGET_TEMP, - UPPER_BOUND, - WATER_TEMP, -) +from .const import DHW_MODE, DHW_MODES, DHW_TEMP, LOGGER, LOWER_BOUND, UPPER_BOUND from .coordinator import PlugwiseConfigEntry, PlugwiseDataUpdateCoordinator from .entity import PlugwiseEntity from .util import plugwise_command From 867c5272ad18f3e7b774f11ba82b0100dd0ca9d4 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 21 Jun 2026 19:43:36 +0200 Subject: [PATCH 11/42] More updates --- custom_components/plugwise/const.py | 17 +++++++--- custom_components/plugwise/water_heater.py | 37 ++++++++++++++++++++-- 2 files changed, 46 insertions(+), 8 deletions(-) diff --git a/custom_components/plugwise/const.py b/custom_components/plugwise/const.py index 4c568eb9f..0c741b718 100644 --- a/custom_components/plugwise/const.py +++ b/custom_components/plugwise/const.py @@ -77,14 +77,12 @@ VENDOR: Final = "vendor" # Number constants -BOILER_TEMP: Final = "boiler_temperature" LOWER_BOUND: Final = "lower_bound" RESOLUTION: Final = "resolution" TEMPERATURE_OFFSET: Final = "temperature_offset" UPPER_BOUND: Final = "upper_bound" # Sensor constants -DHW_TEMP: Final = "dhw_temperature" DHW_SETPOINT: Final = "domestic_hot_water_setpoint" EL_CONSUMED: Final = "electricity_consumed" EL_CONS_INTERVAL: Final = "electricity_consumed_interval" @@ -149,6 +147,10 @@ COOLING_ENA_SWITCH: Final ="cooling_ena_switch" SWITCHES: Final = "switches" +# Water_heater constants +BOILER_TEMP: Final = "boiler_temperature" +DHW_TEMP: Final = "dhw_temperature" + # Default directives DEFAULT_PORT: Final[int] = 80 DEFAULT_TIMEOUT: Final[int] = 30 @@ -187,11 +189,8 @@ } type NumberType = Literal[ - "boiler_temperature", - "dhw_temperature", "temperature_offset", ] - type SelectType = Literal[ "select_dhw_mode", "select_gateway_mode", @@ -206,3 +205,11 @@ "regulation_modes", "zone_profiles", ] +type WaterHeaterType = Literal[ + "boiler_temperature", + "dhw_temperature", +] +type WaterHeaterOptionsType = Literal[ + "boiler_modes", + "dhw_modes", +] diff --git a/custom_components/plugwise/water_heater.py b/custom_components/plugwise/water_heater.py index cfa0dd9f7..0ffcbc06e 100644 --- a/custom_components/plugwise/water_heater.py +++ b/custom_components/plugwise/water_heater.py @@ -4,12 +4,14 @@ from homeassistant.components.water_heater import ( WaterHeaterEntity, + WaterHeaterEntityDescription, WaterHeaterEntityFeature, ) from homeassistant.const import ( ATTR_NAME, ATTR_TEMPERATURE, STATE_OFF, + STATE_ON, UnitOfTemperature, ) from homeassistant.core import HomeAssistant, callback @@ -21,6 +23,32 @@ from .util import plugwise_command +@dataclass(frozen=True, kw_only=True) +class PlugwiseWaterHeaterEntityDescription(WaterHeaterEntityDescription): + """Class describing Plugwise WaterHeater entities.""" + + key: WaterHeaterType + options_key: WaterHeaterOptionsType + +# Upstream + is there a reason we didn't rename this one prefixed? +WATERHEATER_TYPES = ( + PlugwiseWaterHeaterEntityDescription( + key=BOILER_TEMP, + translation_key=BOILER_TEMP, + device_class=NumberDeviceClass.TEMPERATURE, + entity_category=EntityCategory.CONFIG, + native_unit_of_measurement=UnitOfTemperature.CELSIUS, + ), + PlugwiseWaterHeaterEntityDescription( + key=DHW_TEMP, + translation_key=DHW_TEMP, + device_class=NumberDeviceClass.TEMPERATURE, + entity_category=EntityCategory.CONFIG, + options_key=DHW_MODES + native_unit_of_measurement=UnitOfTemperature.CELSIUS, + ), +) + async def async_setup_entry( _hass: HomeAssistant, entry: PlugwiseConfigEntry, @@ -87,10 +115,13 @@ def current_temperature(self) -> float | None: @property @override def operation_list(self) -> list[str]: - """Return the list of available operation modes.""" - if (op_list := self.device.get(DHW_MODES, [])): + """Return the list of available operation modes. + + When no list is available the water_heater only has an "on" mode. + """ + if (op_list := self.device.get(self.entity_description.options_key, [])): return op_list - return [STATE_OFF] # pragma: no cover + return [STATE_ON] @property @override From fcb0106df9467eda80bb6f3f74a06279e78c2f90 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Mon, 22 Jun 2026 19:28:06 +0200 Subject: [PATCH 12/42] Remove boiler_temperature as number, moved to water_heater --- custom_components/plugwise/number.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/custom_components/plugwise/number.py b/custom_components/plugwise/number.py index 2ab24c736..107c2adf9 100644 --- a/custom_components/plugwise/number.py +++ b/custom_components/plugwise/number.py @@ -40,13 +40,6 @@ class PlugwiseNumberEntityDescription(NumberEntityDescription): # Upstream + is there a reason we didn't rename this one prefixed? NUMBER_TYPES = ( - PlugwiseNumberEntityDescription( - key=BOILER_TEMP, - translation_key=BOILER_TEMP, - device_class=NumberDeviceClass.TEMPERATURE, - entity_category=EntityCategory.CONFIG, - native_unit_of_measurement=UnitOfTemperature.CELSIUS, - ), PlugwiseNumberEntityDescription( key=TEMPERATURE_OFFSET, translation_key=TEMPERATURE_OFFSET, From 97382ddfad6a48cb00be5c37d29c5d76dccf073b Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Mon, 22 Jun 2026 19:29:12 +0200 Subject: [PATCH 13/42] Water_heater updates --- custom_components/plugwise/water_heater.py | 38 +++++++++++++++------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/custom_components/plugwise/water_heater.py b/custom_components/plugwise/water_heater.py index 0ffcbc06e..26e4a1231 100644 --- a/custom_components/plugwise/water_heater.py +++ b/custom_components/plugwise/water_heater.py @@ -1,5 +1,6 @@ """Plugwise water heater component for HomeAssistant.""" +from dataclasses import dataclass from typing import Any, override from homeassistant.components.water_heater import ( @@ -10,14 +11,24 @@ from homeassistant.const import ( ATTR_NAME, ATTR_TEMPERATURE, - STATE_OFF, STATE_ON, + EntityCategory, UnitOfTemperature, ) from homeassistant.core import HomeAssistant, callback from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback -from .const import DHW_MODE, DHW_MODES, DHW_TEMP, LOGGER, LOWER_BOUND, UPPER_BOUND +from .const import ( + BOILER_TEMP, + DHW_MODE, + DHW_MODES, + DHW_TEMP, + LOGGER, + LOWER_BOUND, + UPPER_BOUND, + WaterHeaterOptionsType, + WaterHeaterType, +) from .coordinator import PlugwiseConfigEntry, PlugwiseDataUpdateCoordinator from .entity import PlugwiseEntity from .util import plugwise_command @@ -28,24 +39,23 @@ class PlugwiseWaterHeaterEntityDescription(WaterHeaterEntityDescription): """Class describing Plugwise WaterHeater entities.""" key: WaterHeaterType - options_key: WaterHeaterOptionsType + options_key: WaterHeaterOptionsType | None # Upstream + is there a reason we didn't rename this one prefixed? WATERHEATER_TYPES = ( PlugwiseWaterHeaterEntityDescription( key=BOILER_TEMP, translation_key=BOILER_TEMP, - device_class=NumberDeviceClass.TEMPERATURE, entity_category=EntityCategory.CONFIG, - native_unit_of_measurement=UnitOfTemperature.CELSIUS, + options_key=None, + unit_of_measurement=UnitOfTemperature.CELSIUS, ), PlugwiseWaterHeaterEntityDescription( key=DHW_TEMP, translation_key=DHW_TEMP, - device_class=NumberDeviceClass.TEMPERATURE, entity_category=EntityCategory.CONFIG, - options_key=DHW_MODES - native_unit_of_measurement=UnitOfTemperature.CELSIUS, + options_key=DHW_MODES, + unit_of_measurement=UnitOfTemperature.CELSIUS, ), ) @@ -66,9 +76,15 @@ def _add_entities() -> None: entities: list[PlugwiseWaterHeaterEntity] = [] for device_id in coordinator.new_devices: device = coordinator.data[device_id] - if device.get(DHW_TEMP) is not None: - entities.append(PlugwiseWaterHeaterEntity(coordinator, device_id)) - LOGGER.debug("Add %s water_heater", device[ATTR_NAME]) + for description in WATERHEATER_TYPES: + if description.key in device: + entities.append( + PlugwiseWaterHeaterEntity(coordinator, device_id, description) + ) + LOGGER.debug( + "Add %s %s water_heater", device["name"], description.translation_key + ) + async_add_entities(entities) _add_entities() From 6519640b5830ad84c145934e76ba315557d9e5a1 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Mon, 22 Jun 2026 19:46:57 +0200 Subject: [PATCH 14/42] More fixture updates --- .../components/plugwise/fixtures/adam_plus_anna_new/data.json | 4 ++-- .../plugwise/fixtures/anna_heatpump_heating/data.json | 4 ++-- tests/components/plugwise/fixtures/anna_p1/data.json | 2 +- tests/components/plugwise/fixtures/anna_v4/data.json | 4 ++-- tests/components/plugwise/fixtures/anna_v4_dhw/data.json | 4 ++-- tests/components/plugwise/fixtures/m_adam_cooling/data.json | 4 ++-- tests/components/plugwise/fixtures/m_adam_heating/data.json | 4 ++-- .../plugwise/fixtures/m_adam_heating_off_schedule/data.json | 4 ++-- tests/components/plugwise/fixtures/m_adam_jip/data.json | 4 ++-- .../plugwise/fixtures/m_anna_heatpump_cooling/data.json | 4 ++-- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/tests/components/plugwise/fixtures/adam_plus_anna_new/data.json b/tests/components/plugwise/fixtures/adam_plus_anna_new/data.json index 5a199f12a..1f0aa4196 100644 --- a/tests/components/plugwise/fixtures/adam_plus_anna_new/data.json +++ b/tests/components/plugwise/fixtures/adam_plus_anna_new/data.json @@ -16,12 +16,12 @@ "dev_class": "heater_central", "dhw_modes": [ "comfort", - "off" + "eco" ], "location": "bc93488efab249e5bc54fd7e175a6f91", "model": "Generic heater", "name": "OpenTherm", - "select_dhw_mode": "off", + "select_dhw_mode": "eco", "sensors": { "intended_boiler_temperature": 22.5 } diff --git a/tests/components/plugwise/fixtures/anna_heatpump_heating/data.json b/tests/components/plugwise/fixtures/anna_heatpump_heating/data.json index 69ea20098..53b710551 100644 --- a/tests/components/plugwise/fixtures/anna_heatpump_heating/data.json +++ b/tests/components/plugwise/fixtures/anna_heatpump_heating/data.json @@ -36,10 +36,10 @@ "upper_bound": 100.0 }, "dev_class": "heater_central", - "dhw_mode": "off", + "dhw_mode": "eco", "dhw_modes": [ "comfort", - "off" + "eco" ], "dhw_temperature": { "current": 46.3, diff --git a/tests/components/plugwise/fixtures/anna_p1/data.json b/tests/components/plugwise/fixtures/anna_p1/data.json index 6ee72b54c..4a7f5aa03 100644 --- a/tests/components/plugwise/fixtures/anna_p1/data.json +++ b/tests/components/plugwise/fixtures/anna_p1/data.json @@ -50,7 +50,7 @@ "dev_class": "heater_central", "dhw_modes": [ "comfort", - "off" + "eco" ], "location": "da7be222ab3b420c927f3e49fade0304", "model": "Generic heater", diff --git a/tests/components/plugwise/fixtures/anna_v4/data.json b/tests/components/plugwise/fixtures/anna_v4/data.json index fbf163590..cecb3e0a8 100644 --- a/tests/components/plugwise/fixtures/anna_v4/data.json +++ b/tests/components/plugwise/fixtures/anna_v4/data.json @@ -74,10 +74,10 @@ "upper_bound": 100.0 }, "dev_class": "heater_central", - "dhw_mode": "off", + "dhw_mode": "eco", "dhw_modes": [ "comfort", - "off" + "eco" ], "dhw_temperature": { "current": 45.0, diff --git a/tests/components/plugwise/fixtures/anna_v4_dhw/data.json b/tests/components/plugwise/fixtures/anna_v4_dhw/data.json index 6ec073250..01c6bb25d 100644 --- a/tests/components/plugwise/fixtures/anna_v4_dhw/data.json +++ b/tests/components/plugwise/fixtures/anna_v4_dhw/data.json @@ -74,10 +74,10 @@ "upper_bound": 100.0 }, "dev_class": "heater_central", - "dhw_mode": "off", + "dhw_mode": "eco", "dhw_modes": [ "comfort", - "off" + "eco" ], "dhw_temperature": { "current": 45.0, diff --git a/tests/components/plugwise/fixtures/m_adam_cooling/data.json b/tests/components/plugwise/fixtures/m_adam_cooling/data.json index c388b60a6..6aaec3e90 100644 --- a/tests/components/plugwise/fixtures/m_adam_cooling/data.json +++ b/tests/components/plugwise/fixtures/m_adam_cooling/data.json @@ -17,12 +17,12 @@ "dev_class": "heater_central", "dhw_modes": [ "comfort", - "off" + "eco" ], "location": "bc93488efab249e5bc54fd7e175a6f91", "model": "Generic heater", "name": "OpenTherm", - "select_dhw_mode": "off", + "select_dhw_mode": "eco", "sensors": { "intended_boiler_temperature": 17.5 } diff --git a/tests/components/plugwise/fixtures/m_adam_heating/data.json b/tests/components/plugwise/fixtures/m_adam_heating/data.json index a45d345d8..ad2fb4df1 100644 --- a/tests/components/plugwise/fixtures/m_adam_heating/data.json +++ b/tests/components/plugwise/fixtures/m_adam_heating/data.json @@ -16,7 +16,7 @@ "dev_class": "heater_central", "dhw_modes": [ "comfort", - "off" + "eco" ], "dhw_temperature": { "current": 37.0, @@ -28,7 +28,7 @@ "location": "bc93488efab249e5bc54fd7e175a6f91", "model": "Generic heater", "name": "OpenTherm", - "select_dhw_mode": "off", + "select_dhw_mode": "eco", "sensors": { "intended_boiler_temperature": 38.1 } diff --git a/tests/components/plugwise/fixtures/m_adam_heating_off_schedule/data.json b/tests/components/plugwise/fixtures/m_adam_heating_off_schedule/data.json index a3c7095c4..9b2b1b245 100644 --- a/tests/components/plugwise/fixtures/m_adam_heating_off_schedule/data.json +++ b/tests/components/plugwise/fixtures/m_adam_heating_off_schedule/data.json @@ -16,7 +16,7 @@ "dev_class": "heater_central", "dhw_modes": [ "comfort", - "off" + "eco" ], "dhw_temperature": { "current": 37.0, @@ -28,7 +28,7 @@ "location": "bc93488efab249e5bc54fd7e175a6f91", "model": "Generic heater", "name": "OpenTherm", - "select_dhw_mode": "off", + "select_dhw_mode": "eco", "sensors": { "intended_boiler_temperature": 0.0 } diff --git a/tests/components/plugwise/fixtures/m_adam_jip/data.json b/tests/components/plugwise/fixtures/m_adam_jip/data.json index fd2ccd4dc..28867a99d 100644 --- a/tests/components/plugwise/fixtures/m_adam_jip/data.json +++ b/tests/components/plugwise/fixtures/m_adam_jip/data.json @@ -400,10 +400,10 @@ "upper_bound": 90.0 }, "dev_class": "heater_central", - "dhw_mode": "off", + "dhw_mode": "eco", "dhw_modes": [ "comfort", - "off" + "eco" ], "dhw_temperature": { "current": 37.3, diff --git a/tests/components/plugwise/fixtures/m_anna_heatpump_cooling/data.json b/tests/components/plugwise/fixtures/m_anna_heatpump_cooling/data.json index 44729c758..018610533 100644 --- a/tests/components/plugwise/fixtures/m_anna_heatpump_cooling/data.json +++ b/tests/components/plugwise/fixtures/m_anna_heatpump_cooling/data.json @@ -36,10 +36,10 @@ "upper_bound": 100.0 }, "dev_class": "heater_central", - "dhw_mode": "off", + "dhw_mode": "eco", "dhw_modes": [ "comfort", - "off" + "eco" ], "dhw_temperature": { "current": 41.5, From b7b790c4aeb47251fd6004d7e8891e5b81a9566b Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Mon, 22 Jun 2026 19:49:19 +0200 Subject: [PATCH 15/42] More water_heater updates --- custom_components/plugwise/water_heater.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/custom_components/plugwise/water_heater.py b/custom_components/plugwise/water_heater.py index 26e4a1231..3f593071f 100644 --- a/custom_components/plugwise/water_heater.py +++ b/custom_components/plugwise/water_heater.py @@ -101,9 +101,11 @@ def __init__( self, coordinator: PlugwiseDataUpdateCoordinator, device_id: str, + description: PlugwiseWaterHeaterEntityDescription, ) -> None: """Initialise the water_heater.""" super().__init__(coordinator, device_id) + self.entity_description = description entity_name = f"{self.device[ATTR_NAME]}".lower() self._attr_unique_id = f"{device_id}-{entity_name}" @@ -114,7 +116,7 @@ def __init__( self._attr_min_temp = self.dhw_temp.get(LOWER_BOUND, 40.0) self._attr_supported_features = WaterHeaterEntityFeature.OPERATION_MODE self._attr_supported_features |= WaterHeaterEntityFeature.TARGET_TEMPERATURE - + self._attr_unique_id = f"{device_id}-water_heater" @property @override From dac1b019a84fb5ba76f07cc77f304428646eddf4 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Mon, 22 Jun 2026 19:51:35 +0200 Subject: [PATCH 16/42] Update water_heater unique_id --- custom_components/plugwise/water_heater.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/plugwise/water_heater.py b/custom_components/plugwise/water_heater.py index 3f593071f..8a06bef24 100644 --- a/custom_components/plugwise/water_heater.py +++ b/custom_components/plugwise/water_heater.py @@ -116,7 +116,7 @@ def __init__( self._attr_min_temp = self.dhw_temp.get(LOWER_BOUND, 40.0) self._attr_supported_features = WaterHeaterEntityFeature.OPERATION_MODE self._attr_supported_features |= WaterHeaterEntityFeature.TARGET_TEMPERATURE - self._attr_unique_id = f"{device_id}-water_heater" + self._attr_unique_id = f"{device_id}-{description.key}" @property @override From db07f84212f5fdf184386efd36e883b315af918c Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Mon, 22 Jun 2026 19:56:34 +0200 Subject: [PATCH 17/42] Update translation strings --- .../plugwise/translations/en.json | 23 ++++++++++--------- .../plugwise/translations/nl.json | 23 ++++++++++--------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/custom_components/plugwise/translations/en.json b/custom_components/plugwise/translations/en.json index 0f410e0c3..ffb4dd2ab 100644 --- a/custom_components/plugwise/translations/en.json +++ b/custom_components/plugwise/translations/en.json @@ -93,9 +93,6 @@ } }, "number": { - "boiler_temperature": { - "name": "Boiler temperature setpoint" - }, "temperature_offset": { "name": "Temperature offset" } @@ -296,14 +293,18 @@ } }, "water_heater": { - "plugwise": { - "state": { - "auto": "Auto", - "boost": "Boost", - "comfort": "Comfort", - "eco": "Eco", - "off": "Off" - } + "boiler_temperature": { + "name": "Boiler temperature" + }, + "dhw_temperature": { + "name": "DHW temperature" + }, + "state": { + "auto": "Auto", + "boost": "Boost", + "comfort": "Comfort", + "eco": "Eco", + "off": "Off" } } }, diff --git a/custom_components/plugwise/translations/nl.json b/custom_components/plugwise/translations/nl.json index 675a9e972..4bfa4ba6a 100644 --- a/custom_components/plugwise/translations/nl.json +++ b/custom_components/plugwise/translations/nl.json @@ -93,9 +93,6 @@ } }, "number": { - "boiler_temperature": { - "name": "Instelpunt boiler temperatuur" - }, "temperature_offset": { "name": "Temperatuurcompensatie" } @@ -296,14 +293,18 @@ } }, "water_heater": { - "plugwise": { - "state": { - "auto": "Auto", - "boost": "Boost", - "comfort": "Comfort", - "eco": "Eco", - "off": "Off" - } + "boiler_temperature": { + "name": "Boiler temperatuur" + } + "dhw_temperature": { + "name": "SWW temperatuur" + } + "state": { + "auto": "Auto", + "boost": "Boost", + "comfort": "Comfort", + "eco": "Eco", + "off": "Off" } } }, From aa58cf62f4e44e6a3820c189e493472ebf18e36e Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Mon, 22 Jun 2026 20:10:57 +0200 Subject: [PATCH 18/42] Updates --- custom_components/plugwise/water_heater.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/custom_components/plugwise/water_heater.py b/custom_components/plugwise/water_heater.py index 8a06bef24..a19b2718b 100644 --- a/custom_components/plugwise/water_heater.py +++ b/custom_components/plugwise/water_heater.py @@ -48,14 +48,12 @@ class PlugwiseWaterHeaterEntityDescription(WaterHeaterEntityDescription): translation_key=BOILER_TEMP, entity_category=EntityCategory.CONFIG, options_key=None, - unit_of_measurement=UnitOfTemperature.CELSIUS, ), PlugwiseWaterHeaterEntityDescription( key=DHW_TEMP, translation_key=DHW_TEMP, entity_category=EntityCategory.CONFIG, options_key=DHW_MODES, - unit_of_measurement=UnitOfTemperature.CELSIUS, ), ) @@ -94,8 +92,7 @@ def _add_entities() -> None: class PlugwiseWaterHeaterEntity(PlugwiseEntity, WaterHeaterEntity): """Representation of a Plugwise water heater.""" - _attr_name = None - _attr_temperature_unit = UnitOfTemperature.CELSIUS + entity_description: PlugwiseWaterHeaterEntityDescription def __init__( self, @@ -116,6 +113,7 @@ def __init__( self._attr_min_temp = self.dhw_temp.get(LOWER_BOUND, 40.0) self._attr_supported_features = WaterHeaterEntityFeature.OPERATION_MODE self._attr_supported_features |= WaterHeaterEntityFeature.TARGET_TEMPERATURE + self._attr_temperature_unit = UnitOfTemperature.CELSIUS self._attr_unique_id = f"{device_id}-{description.key}" @property From 49b8160463432791461759b779212960c06bd2fc Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Mon, 22 Jun 2026 20:14:34 +0200 Subject: [PATCH 19/42] Water_heater test updates --- tests/components/plugwise/test_water_heater.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/components/plugwise/test_water_heater.py b/tests/components/plugwise/test_water_heater.py index 7e46ff4f7..974b16a07 100644 --- a/tests/components/plugwise/test_water_heater.py +++ b/tests/components/plugwise/test_water_heater.py @@ -42,7 +42,7 @@ async def test_adam_water_heater_setpoint_change( await hass.services.async_call( WATER_HEATER_DOMAIN, SERVICE_SET_TEMPERATURE, - {ATTR_ENTITY_ID: "water_heater.opentherm", ATTR_TEMPERATURE: 65}, + {ATTR_ENTITY_ID: "water_heater.opentherm_dhw_temperature", ATTR_TEMPERATURE: 65}, blocking=True, ) assert mock_smile_adam_jip.set_number.call_count == 1 @@ -53,12 +53,12 @@ async def test_adam_water_heater_setpoint_change( await hass.services.async_call( WATER_HEATER_DOMAIN, SERVICE_SET_OPERATION_MODE, - {ATTR_ENTITY_ID: "water_heater.opentherm", ATTR_OPERATION_MODE: "off"}, + {ATTR_ENTITY_ID: "water_heater.opentherm_dhw_temperature", ATTR_OPERATION_MODE: "eco"}, blocking=True, ) assert mock_smile_adam_jip.set_dhw_mode.call_count == 1 mock_smile_adam_jip.set_dhw_mode.assert_called_with( - "dhw_mode", "e4684553153b44afbef2200885f379dc", 2, "off" + "dhw_mode", "e4684553153b44afbef2200885f379dc", 2, "eco" ) From 436c3acd99a1ca80ca12b11faed7c5d20cabfc62 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Mon, 22 Jun 2026 20:17:28 +0200 Subject: [PATCH 20/42] Test-number: remove test case, number removed --- tests/components/plugwise/test_number.py | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/tests/components/plugwise/test_number.py b/tests/components/plugwise/test_number.py index 15cbd1c3a..7279276b9 100644 --- a/tests/components/plugwise/test_number.py +++ b/tests/components/plugwise/test_number.py @@ -80,25 +80,3 @@ async def test_anna_number_entities( ) -> None: """Test Anna number snapshot.""" await snapshot_platform(hass, entity_registry, snapshot, setup_platform.entry_id) - - -@pytest.mark.parametrize("chosen_env", ["anna_heatpump_heating"], indirect=True) -@pytest.mark.parametrize("cooling_present", [True], indirect=True) -async def test_anna_max_boiler_temp_change( - hass: HomeAssistant, mock_smile_anna: MagicMock, init_integration: MockConfigEntry -) -> None: - """Test changing of number entities.""" - await hass.services.async_call( - NUMBER_DOMAIN, - SERVICE_SET_VALUE, - { - ATTR_ENTITY_ID: "number.opentherm_boiler_temperature_setpoint", - ATTR_VALUE: 65, - }, - blocking=True, - ) - - assert mock_smile_anna.set_number.call_count == 1 - mock_smile_anna.set_number.assert_called_with( - "1cbf783bb11e4a7c8a6843dee3a86927", "boiler_temperature", 65.0 - ) From 300795218fb5ab1e894aaa86d60ddee7065801a8 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Mon, 22 Jun 2026 20:22:51 +0200 Subject: [PATCH 21/42] Fix code --- custom_components/plugwise/number.py | 2 -- custom_components/plugwise/water_heater.py | 8 +++++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/custom_components/plugwise/number.py b/custom_components/plugwise/number.py index 107c2adf9..6e93d1c52 100644 --- a/custom_components/plugwise/number.py +++ b/custom_components/plugwise/number.py @@ -114,8 +114,6 @@ def __init__( self._attr_native_min_value = self.ctrl.get(LOWER_BOUND, 0.0) # Upstream const native_step = self.ctrl.get(RESOLUTION, 0.5) # Upstream const - if description.key != TEMPERATURE_OFFSET: # Upstream const - native_step = max(native_step, 0.5) self._attr_native_step = native_step @property diff --git a/custom_components/plugwise/water_heater.py b/custom_components/plugwise/water_heater.py index a19b2718b..190a931c5 100644 --- a/custom_components/plugwise/water_heater.py +++ b/custom_components/plugwise/water_heater.py @@ -9,7 +9,6 @@ WaterHeaterEntityFeature, ) from homeassistant.const import ( - ATTR_NAME, ATTR_TEMPERATURE, STATE_ON, EntityCategory, @@ -135,8 +134,11 @@ def operation_list(self) -> list[str]: When no list is available the water_heater only has an "on" mode. """ - if (op_list := self.device.get(self.entity_description.options_key, [])): - return op_list + if self.entity_description.options_key is not None: + op_list = self.device.get(self.entity_description.options_key) + if op_list is not None: + return cast(list[str], op_list) + return [STATE_ON] @property From 7c3995ee1bb18790c1d7f889ee2f10e66d6e386c Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Tue, 23 Jun 2026 08:01:41 +0200 Subject: [PATCH 22/42] Save updated snapshot files --- .../plugwise/snapshots/test_select.ambr | 6 +-- .../plugwise/snapshots/test_water_heater.ambr | 48 +++++++++---------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/tests/components/plugwise/snapshots/test_select.ambr b/tests/components/plugwise/snapshots/test_select.ambr index 1b6804115..f9427f3b9 100644 --- a/tests/components/plugwise/snapshots/test_select.ambr +++ b/tests/components/plugwise/snapshots/test_select.ambr @@ -386,7 +386,7 @@ 'capabilities': dict({ : list([ 'comfort', - 'off', + 'eco', ]), }), 'config_entry_id': , @@ -425,7 +425,7 @@ : 'OpenTherm DHW mode', : list([ 'comfort', - 'off', + 'eco', ]), }), 'context': , @@ -433,7 +433,7 @@ 'last_changed': , 'last_reported': , 'last_updated': , - 'state': 'off', + 'state': 'eco', }) # --- # name: test_adam_select_entities[platforms0][select.badkamer_thermostat_schedule-entry] diff --git a/tests/components/plugwise/snapshots/test_water_heater.ambr b/tests/components/plugwise/snapshots/test_water_heater.ambr index 2f3ef30d5..29dee55b4 100644 --- a/tests/components/plugwise/snapshots/test_water_heater.ambr +++ b/tests/components/plugwise/snapshots/test_water_heater.ambr @@ -1,5 +1,5 @@ # serializer version: 1 -# name: test_adam_water_heater_snapshot[platforms0][water_heater.opentherm-entry] +# name: test_adam_water_heater_snapshot[platforms0][water_heater.opentherm_boiler_temperature-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ None, @@ -10,7 +10,7 @@ : 40.0, : list([ 'comfort', - 'off', + 'eco', ]), }), 'config_entry_id': , @@ -19,8 +19,8 @@ 'device_id': , 'disabled_by': None, 'domain': 'water_heater', - 'entity_category': None, - 'entity_id': 'water_heater.opentherm', + 'entity_category': , + 'entity_id': 'water_heater.opentherm_dhw_temperature', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -28,22 +28,22 @@ 'labels': set({ }), 'name': None, - 'object_id_base': None, + 'object_id_base': 'DHW temperature', 'options': dict({ }), 'original_device_class': None, 'original_icon': None, - 'original_name': None, + 'original_name': 'DHW temperature', 'platform': 'plugwise', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': , - 'translation_key': None, - 'unique_id': 'e4684553153b44afbef2200885f379dc-opentherm', + 'translation_key': 'dhw_temperature', + 'unique_id': 'e4684553153b44afbef2200885f379dc-dhw_temperature', 'unit_of_measurement': None, }) # --- -# name: test_adam_water_heater_snapshot[platforms0][water_heater.opentherm-state] +# name: test_adam_water_heater_snapshot[platforms0][water_heater.opentherm_dhw_temperature-state] StateSnapshot({ 'attributes': ReadOnlyDict({ : 37.3, @@ -52,7 +52,7 @@ : 40.0, : list([ 'comfort', - 'off', + 'eco', ]), : 'off', : , @@ -61,14 +61,14 @@ : 60.0, }), 'context': , - 'entity_id': 'water_heater.opentherm', + 'entity_id': 'water_heater.opentherm_dhw_temperature', 'last_changed': , 'last_reported': , 'last_updated': , - 'state': 'off', + 'state': 'eco', }) # --- -# name: test_anna_water_heater_snapshot[platforms0-False-anna_v4_dhw][water_heater.opentherm-entry] +# name: test_anna_water_heater_snapshot[platforms0-False-anna_v4_dhw][water_heater.opentherm_boiler_temperature-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ None, @@ -79,7 +79,7 @@ : 30.0, : list([ 'comfort', - 'off', + 'eco', ]), }), 'config_entry_id': , @@ -88,8 +88,8 @@ 'device_id': , 'disabled_by': None, 'domain': 'water_heater', - 'entity_category': None, - 'entity_id': 'water_heater.opentherm', + 'entity_category': , + 'entity_id': 'water_heater.opentherm_dhw_temperature', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -97,22 +97,22 @@ 'labels': set({ }), 'name': None, - 'object_id_base': None, + 'object_id_base': 'DHW temperature', 'options': dict({ }), 'original_device_class': None, 'original_icon': None, - 'original_name': None, + 'original_name': 'DHW temperature', 'platform': 'plugwise', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': , - 'translation_key': None, - 'unique_id': 'cd0e6156b1f04d5f952349ffbe397481-opentherm', + 'translation_key': 'dhw_temperature', + 'unique_id': 'cd0e6156b1f04d5f952349ffbe397481-dhw_temperature', 'unit_of_measurement': None, }) # --- -# name: test_anna_water_heater_snapshot[platforms0-False-anna_v4_dhw][water_heater.opentherm-state] +# name: test_anna_water_heater_snapshot[platforms0-False-anna_v4_dhw][water_heater.opentherm_dhw_temperature-state] StateSnapshot({ 'attributes': ReadOnlyDict({ : 45.0, @@ -121,7 +121,7 @@ : 30.0, : list([ 'comfort', - 'off', + 'eco', ]), : 'off', : , @@ -130,10 +130,10 @@ : 60.0, }), 'context': , - 'entity_id': 'water_heater.opentherm', + 'entity_id': 'water_heater.opentherm_dhw_temperature', 'last_changed': , 'last_reported': , 'last_updated': , - 'state': 'off', + 'state': 'eco', }) # --- From bd6a3850612ca008a0df876cfaa4290f1ce69180 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Tue, 23 Jun 2026 08:02:12 +0200 Subject: [PATCH 23/42] Clean up --- custom_components/plugwise/number.py | 1 - 1 file changed, 1 deletion(-) diff --git a/custom_components/plugwise/number.py b/custom_components/plugwise/number.py index 6e93d1c52..13e777359 100644 --- a/custom_components/plugwise/number.py +++ b/custom_components/plugwise/number.py @@ -14,7 +14,6 @@ from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback from .const import ( - BOILER_TEMP, LOGGER, LOWER_BOUND, RESOLUTION, From f6d7f25a4ce0273f80b681173c49a357dc2355b2 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Tue, 23 Jun 2026 08:08:56 +0200 Subject: [PATCH 24/42] Correct translation files --- custom_components/plugwise/translations/en.json | 7 ------- custom_components/plugwise/translations/nl.json | 9 +-------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/custom_components/plugwise/translations/en.json b/custom_components/plugwise/translations/en.json index ffb4dd2ab..c6a52b3b8 100644 --- a/custom_components/plugwise/translations/en.json +++ b/custom_components/plugwise/translations/en.json @@ -298,13 +298,6 @@ }, "dhw_temperature": { "name": "DHW temperature" - }, - "state": { - "auto": "Auto", - "boost": "Boost", - "comfort": "Comfort", - "eco": "Eco", - "off": "Off" } } }, diff --git a/custom_components/plugwise/translations/nl.json b/custom_components/plugwise/translations/nl.json index 4bfa4ba6a..1a70c6ddb 100644 --- a/custom_components/plugwise/translations/nl.json +++ b/custom_components/plugwise/translations/nl.json @@ -295,17 +295,10 @@ "water_heater": { "boiler_temperature": { "name": "Boiler temperatuur" - } + }, "dhw_temperature": { "name": "SWW temperatuur" } - "state": { - "auto": "Auto", - "boost": "Boost", - "comfort": "Comfort", - "eco": "Eco", - "off": "Off" - } } }, "exceptions": { From 85898ce608af3b0093fff27241c2c2d2fba5c257 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Tue, 23 Jun 2026 08:15:47 +0200 Subject: [PATCH 25/42] Fix requirements format --- custom_components/plugwise/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/plugwise/manifest.json b/custom_components/plugwise/manifest.json index 3c0b27bcc..23e5c8a65 100644 --- a/custom_components/plugwise/manifest.json +++ b/custom_components/plugwise/manifest.json @@ -8,7 +8,7 @@ "iot_class": "local_polling", "loggers": ["plugwise"], "requirements": [ - "plugwise@git+https://github.com/plugwise/python-plugwise.git/@water_heater_2" + "plugwise@git+https://github.com/plugwise/python-plugwise.git@water_heater_2" ], "version": "0.65.0", "zeroconf": ["_plugwise._tcp.local."] From 2c1325e7eda133a4257eb55d3cc0ea8335f2e1c3 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Tue, 23 Jun 2026 08:21:17 +0200 Subject: [PATCH 26/42] Implement suggested fixes --- custom_components/plugwise/number.py | 10 ++++---- custom_components/plugwise/water_heater.py | 29 ++++++++++++++-------- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/custom_components/plugwise/number.py b/custom_components/plugwise/number.py index 13e777359..39a71179a 100644 --- a/custom_components/plugwise/number.py +++ b/custom_components/plugwise/number.py @@ -108,18 +108,18 @@ def __init__( self.entity_description = description self._attr_unique_id = f"{device_id}-{description.key}" self._attr_mode = NumberMode.BOX - self.ctrl = self.device.get(description.key, {}) - self._attr_native_max_value = self.ctrl.get(UPPER_BOUND, 100.0) # Upstream const - self._attr_native_min_value = self.ctrl.get(LOWER_BOUND, 0.0) # Upstream const + ctrl = self.device.get(description.key, {}) + self._attr_native_max_value = ctrl.get(UPPER_BOUND, 100.0) # Upstream const + self._attr_native_min_value = ctrl.get(LOWER_BOUND, 0.0) # Upstream const - native_step = self.ctrl.get(RESOLUTION, 0.5) # Upstream const + native_step = ctrl.get(RESOLUTION, 0.5) # Upstream const self._attr_native_step = native_step @property @override def native_value(self) -> float | None: """Return the present setpoint value.""" - return self.ctrl.get("setpoint") + return self.device.get(self.entity_description.key, {}).get("setpoint") @plugwise_command @override diff --git a/custom_components/plugwise/water_heater.py b/custom_components/plugwise/water_heater.py index 190a931c5..6bfa4db45 100644 --- a/custom_components/plugwise/water_heater.py +++ b/custom_components/plugwise/water_heater.py @@ -102,16 +102,15 @@ def __init__( """Initialise the water_heater.""" super().__init__(coordinator, device_id) self.entity_description = description - entity_name = f"{self.device[ATTR_NAME]}".lower() self._attr_unique_id = f"{device_id}-{entity_name}" - - self.dhw_temp = self.device.get(DHW_TEMP, {}) - if self.dhw_temp: - self._attr_max_temp = self.dhw_temp.get(UPPER_BOUND, 75.0) - self._attr_min_temp = self.dhw_temp.get(LOWER_BOUND, 40.0) - self._attr_supported_features = WaterHeaterEntityFeature.OPERATION_MODE - self._attr_supported_features |= WaterHeaterEntityFeature.TARGET_TEMPERATURE + temp_data = self.device.get(description.key, {}) + if temp_data: + self._attr_max_temp = temp_data.get(UPPER_BOUND, 75.0) + self._attr_min_temp = temp_data.get(LOWER_BOUND, 40.0) + self._attr_supported_features = WaterHeaterEntityFeature.TARGET_TEMPERATURE + if description.options_key is not None: + self._attr_supported_features |= WaterHeaterEntityFeature.OPERATION_MODE self._attr_temperature_unit = UnitOfTemperature.CELSIUS self._attr_unique_id = f"{device_id}-{description.key}" @@ -119,13 +118,15 @@ def __init__( @override def current_operation(self) -> str | None: """Return current readable operation mode.""" + if self.entity_description.options_key is None: + return STATE_ON return self.device.get(DHW_MODE) @property @override def current_temperature(self) -> float | None: """Return the current water temperature.""" - return self.dhw_temp.get("current") + return self.device.get(self.entity_description.key, {}).get("current") @property @override @@ -145,12 +146,14 @@ def operation_list(self) -> list[str]: @override def target_temperature(self) -> float | None: """Return the water temperature we try to reach.""" - return self.dhw_temp.get("setpoint") + return self.device.get(self.entity_description.key, {}).get("setpoint") @plugwise_command @override async def async_set_operation_mode(self, operation_mode: str) -> None: """Set the operation mode.""" + if self.entity_description.options_key is None: + return list_type: int = len(self.operation_list) await self.coordinator.api.set_dhw_mode(DHW_MODE, self._dev_id, list_type, operation_mode) @@ -159,4 +162,8 @@ async def async_set_operation_mode(self, operation_mode: str) -> None: async def async_set_temperature(self, **kwargs: Any) -> None: """Set new target temperature.""" if (temperature := kwargs.get(ATTR_TEMPERATURE)) is not None: - await self.coordinator.api.set_number(self._dev_id, DHW_TEMP, float(temperature)) + await self.coordinator.api.set_number( + self._dev_id, + self.entity_description.key, + float(temperature), + ) From 8a51f1a8e91b59464c8a677fdbf9f098144a1937 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 25 Jun 2026 17:53:02 +0200 Subject: [PATCH 27/42] Update dhw-select translations --- custom_components/plugwise/translations/en.json | 2 +- custom_components/plugwise/translations/nl.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/plugwise/translations/en.json b/custom_components/plugwise/translations/en.json index c6a52b3b8..e3c262381 100644 --- a/custom_components/plugwise/translations/en.json +++ b/custom_components/plugwise/translations/en.json @@ -102,7 +102,7 @@ "name": "DHW mode", "state": { "comfort": "Comfort", - "off": "Off" + "eco": "Eco" } }, "select_gateway_mode": { diff --git a/custom_components/plugwise/translations/nl.json b/custom_components/plugwise/translations/nl.json index 1a70c6ddb..0c7687071 100644 --- a/custom_components/plugwise/translations/nl.json +++ b/custom_components/plugwise/translations/nl.json @@ -102,7 +102,7 @@ "name": "SWW modus", "state": { "comfort": "Comfort", - "off": "Uit" + "eco": "Eco" } }, "select_gateway_mode": { From 27a8b056323c96fcb76477d93915bbbf3af8ecfa Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 25 Jun 2026 17:57:24 +0200 Subject: [PATCH 28/42] Add water_heater state translation string --- custom_components/plugwise/translations/en.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/custom_components/plugwise/translations/en.json b/custom_components/plugwise/translations/en.json index e3c262381..f7b7a9985 100644 --- a/custom_components/plugwise/translations/en.json +++ b/custom_components/plugwise/translations/en.json @@ -297,7 +297,14 @@ "name": "Boiler temperature" }, "dhw_temperature": { - "name": "DHW temperature" + "name": "DHW temperature", + "state": { + "auto": "Auto", + "boost": "Boost", + "comfort": "Comfort", + "eco": "Eco", + "off": "Off" + } } } }, From 8eefb4397faa663766ab7b16055a95b211d64ade Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 25 Jun 2026 18:18:34 +0200 Subject: [PATCH 29/42] Correct water_heater translation string --- custom_components/plugwise/translations/en.json | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/custom_components/plugwise/translations/en.json b/custom_components/plugwise/translations/en.json index f7b7a9985..d3436c798 100644 --- a/custom_components/plugwise/translations/en.json +++ b/custom_components/plugwise/translations/en.json @@ -298,12 +298,16 @@ }, "dhw_temperature": { "name": "DHW temperature", - "state": { - "auto": "Auto", - "boost": "Boost", - "comfort": "Comfort", - "eco": "Eco", - "off": "Off" + "state_attributes": { + "dhw_modes": { + "state": { + "auto": "Auto", + "boost": "Boost", + "comfort": "Comfort", + "eco": "Eco", + "off": "Off" + } + } } } } From 62148ce30b6b8168f260a680ff54beb3ee757321 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Fri, 26 Jun 2026 20:27:13 +0200 Subject: [PATCH 30/42] Fix removed import after rebase --- custom_components/plugwise/water_heater.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/plugwise/water_heater.py b/custom_components/plugwise/water_heater.py index 6bfa4db45..b74ec5a9e 100644 --- a/custom_components/plugwise/water_heater.py +++ b/custom_components/plugwise/water_heater.py @@ -1,7 +1,7 @@ """Plugwise water heater component for HomeAssistant.""" from dataclasses import dataclass -from typing import Any, override +from typing import Any, cast, override from homeassistant.components.water_heater import ( WaterHeaterEntity, From 49324083caa286ca046b9917ddb431fc25c42dfe Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Fri, 26 Jun 2026 20:29:39 +0200 Subject: [PATCH 31/42] Regenerate snapshots after rebase --- .../plugwise/snapshots/test_number.ambr | 61 ------ .../plugwise/snapshots/test_sensor.ambr | 174 ------------------ .../plugwise/snapshots/test_water_heater.ambr | 128 ++++++++++++- 3 files changed, 124 insertions(+), 239 deletions(-) diff --git a/tests/components/plugwise/snapshots/test_number.ambr b/tests/components/plugwise/snapshots/test_number.ambr index 0d1601e30..ed8383fff 100644 --- a/tests/components/plugwise/snapshots/test_number.ambr +++ b/tests/components/plugwise/snapshots/test_number.ambr @@ -609,64 +609,3 @@ 'state': '-0.5', }) # --- -# name: test_anna_number_entities[platforms0-True-anna_heatpump_heating][number.opentherm_boiler_temperature_setpoint-entry] - EntityRegistryEntrySnapshot({ - 'aliases': list([ - None, - ]), - 'area_id': None, - 'capabilities': dict({ - : 100.0, - : 0.0, - : , - : 1.0, - }), - 'config_entry_id': , - 'config_subentry_id': , - 'device_class': None, - 'device_id': , - 'disabled_by': None, - 'domain': 'number', - 'entity_category': , - 'entity_id': 'number.opentherm_boiler_temperature_setpoint', - 'has_entity_name': True, - 'hidden_by': None, - 'icon': None, - 'id': , - 'labels': set({ - }), - 'name': None, - 'object_id_base': 'Boiler temperature setpoint', - 'options': dict({ - }), - 'original_device_class': , - 'original_icon': None, - 'original_name': 'Boiler temperature setpoint', - 'platform': 'plugwise', - 'previous_unique_id': None, - 'suggested_object_id': None, - 'supported_features': 0, - 'translation_key': 'boiler_temperature', - 'unique_id': '1cbf783bb11e4a7c8a6843dee3a86927-boiler_temperature', - 'unit_of_measurement': , - }) -# --- -# name: test_anna_number_entities[platforms0-True-anna_heatpump_heating][number.opentherm_boiler_temperature_setpoint-state] - StateSnapshot({ - 'attributes': ReadOnlyDict({ - : 'temperature', - : 'OpenTherm Maximum boiler temperature setpoint', - : 100.0, - : 0.0, - : , - : 1.0, - : , - }), - 'context': , - 'entity_id': 'number.opentherm_boiler_temperature_setpoint', - 'last_changed': , - 'last_reported': , - 'last_updated': , - 'state': '60.0', - }) -# --- diff --git a/tests/components/plugwise/snapshots/test_sensor.ambr b/tests/components/plugwise/snapshots/test_sensor.ambr index 87fe0b387..8b430581f 100644 --- a/tests/components/plugwise/snapshots/test_sensor.ambr +++ b/tests/components/plugwise/snapshots/test_sensor.ambr @@ -1202,64 +1202,6 @@ 'state': '38.1', }) # --- -# name: test_adam_sensor_snapshot[platforms0-False-m_adam_heating][sensor.opentherm_water_temperature-entry] - EntityRegistryEntrySnapshot({ - 'aliases': list([ - None, - ]), - 'area_id': None, - 'capabilities': dict({ - : , - }), - 'config_entry_id': , - 'config_subentry_id': , - 'device_class': None, - 'device_id': , - 'disabled_by': None, - 'domain': 'sensor', - 'entity_category': , - 'entity_id': 'sensor.opentherm_water_temperature', - 'has_entity_name': True, - 'hidden_by': None, - 'icon': None, - 'id': , - 'labels': set({ - }), - 'name': None, - 'object_id_base': 'Water temperature', - 'options': dict({ - 'sensor': dict({ - 'suggested_display_precision': 1, - }), - }), - 'original_device_class': , - 'original_icon': None, - 'original_name': 'Water temperature', - 'platform': 'plugwise', - 'previous_unique_id': None, - 'suggested_object_id': None, - 'supported_features': 0, - 'translation_key': 'water_temperature', - 'unique_id': '056ee145a816487eaa69243c3280f8bf-water_temperature', - 'unit_of_measurement': , - }) -# --- -# name: test_adam_sensor_snapshot[platforms0-False-m_adam_heating][sensor.opentherm_water_temperature-state] - StateSnapshot({ - 'attributes': ReadOnlyDict({ - : 'temperature', - : 'OpenTherm Water temperature', - : , - : , - }), - 'context': , - 'entity_id': 'sensor.opentherm_water_temperature', - 'last_changed': , - 'last_reported': , - 'last_updated': , - 'state': '37.0', - }) -# --- # name: test_adam_sensor_snapshot[platforms0-False-m_adam_heating][sensor.tom_badkamer_battery-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ @@ -3501,64 +3443,6 @@ 'state': '19.3', }) # --- -# name: test_anna_sensor_snapshot[platforms0-True-anna_heatpump_heating][sensor.opentherm_dhw_temperature-entry] - EntityRegistryEntrySnapshot({ - 'aliases': list([ - None, - ]), - 'area_id': None, - 'capabilities': dict({ - : , - }), - 'config_entry_id': , - 'config_subentry_id': , - 'device_class': None, - 'device_id': , - 'disabled_by': None, - 'domain': 'sensor', - 'entity_category': , - 'entity_id': 'sensor.opentherm_dhw_temperature', - 'has_entity_name': True, - 'hidden_by': None, - 'icon': None, - 'id': , - 'labels': set({ - }), - 'name': None, - 'object_id_base': 'DHW temperature', - 'options': dict({ - 'sensor': dict({ - 'suggested_display_precision': 1, - }), - }), - 'original_device_class': , - 'original_icon': None, - 'original_name': 'DHW temperature', - 'platform': 'plugwise', - 'previous_unique_id': None, - 'suggested_object_id': None, - 'supported_features': 0, - 'translation_key': 'dhw_temperature', - 'unique_id': '1cbf783bb11e4a7c8a6843dee3a86927-dhw_temperature', - 'unit_of_measurement': , - }) -# --- -# name: test_anna_sensor_snapshot[platforms0-True-anna_heatpump_heating][sensor.opentherm_dhw_temperature-state] - StateSnapshot({ - 'attributes': ReadOnlyDict({ - : 'temperature', - : 'OpenTherm DHW temperature', - : , - : , - }), - 'context': , - 'entity_id': 'sensor.opentherm_dhw_temperature', - 'last_changed': , - 'last_reported': , - 'last_updated': , - 'state': '46.3', - }) -# --- # name: test_anna_sensor_snapshot[platforms0-True-anna_heatpump_heating][sensor.opentherm_intended_boiler_temperature-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ @@ -3845,64 +3729,6 @@ 'state': '1.57', }) # --- -# name: test_anna_sensor_snapshot[platforms0-True-anna_heatpump_heating][sensor.opentherm_water_temperature-entry] - EntityRegistryEntrySnapshot({ - 'aliases': list([ - None, - ]), - 'area_id': None, - 'capabilities': dict({ - : , - }), - 'config_entry_id': , - 'config_subentry_id': , - 'device_class': None, - 'device_id': , - 'disabled_by': None, - 'domain': 'sensor', - 'entity_category': , - 'entity_id': 'sensor.opentherm_water_temperature', - 'has_entity_name': True, - 'hidden_by': None, - 'icon': None, - 'id': , - 'labels': set({ - }), - 'name': None, - 'object_id_base': 'Water temperature', - 'options': dict({ - 'sensor': dict({ - 'suggested_display_precision': 1, - }), - }), - 'original_device_class': , - 'original_icon': None, - 'original_name': 'Water temperature', - 'platform': 'plugwise', - 'previous_unique_id': None, - 'suggested_object_id': None, - 'supported_features': 0, - 'translation_key': 'water_temperature', - 'unique_id': '1cbf783bb11e4a7c8a6843dee3a86927-water_temperature', - 'unit_of_measurement': , - }) -# --- -# name: test_anna_sensor_snapshot[platforms0-True-anna_heatpump_heating][sensor.opentherm_water_temperature-state] - StateSnapshot({ - 'attributes': ReadOnlyDict({ - : 'temperature', - : 'OpenTherm Water temperature', - : , - : , - }), - 'context': , - 'entity_id': 'sensor.opentherm_water_temperature', - 'last_changed': , - 'last_reported': , - 'last_updated': , - 'state': '29.1', - }) -# --- # name: test_anna_sensor_snapshot[platforms0-True-anna_heatpump_heating][sensor.smile_anna_outdoor_temperature-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ diff --git a/tests/components/plugwise/snapshots/test_water_heater.ambr b/tests/components/plugwise/snapshots/test_water_heater.ambr index 29dee55b4..0d4c3a827 100644 --- a/tests/components/plugwise/snapshots/test_water_heater.ambr +++ b/tests/components/plugwise/snapshots/test_water_heater.ambr @@ -1,5 +1,65 @@ # serializer version: 1 # name: test_adam_water_heater_snapshot[platforms0][water_heater.opentherm_boiler_temperature-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : 90.0, + : 20.0, + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'water_heater', + 'entity_category': , + 'entity_id': 'water_heater.opentherm_boiler_temperature', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Boiler temperature', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Boiler temperature', + 'platform': 'plugwise', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': , + 'translation_key': 'boiler_temperature', + 'unique_id': 'e4684553153b44afbef2200885f379dc-boiler_temperature', + 'unit_of_measurement': None, + }) +# --- +# name: test_adam_water_heater_snapshot[platforms0][water_heater.opentherm_boiler_temperature-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 37.3, + : 'OpenTherm Boiler temperature', + : 90.0, + : 20.0, + : , + : None, + : None, + : 90.0, + }), + 'context': , + 'entity_id': 'water_heater.opentherm_boiler_temperature', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'on', + }) +# --- +# name: test_adam_water_heater_snapshot[platforms0][water_heater.opentherm_dhw_temperature-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ None, @@ -47,14 +107,14 @@ StateSnapshot({ 'attributes': ReadOnlyDict({ : 37.3, - : 'OpenTherm', + : 'OpenTherm DHW temperature', : 60.0, : 40.0, : list([ 'comfort', 'eco', ]), - : 'off', + : 'eco', : , : None, : None, @@ -69,6 +129,66 @@ }) # --- # name: test_anna_water_heater_snapshot[platforms0-False-anna_v4_dhw][water_heater.opentherm_boiler_temperature-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : 100.0, + : 0.0, + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'water_heater', + 'entity_category': , + 'entity_id': 'water_heater.opentherm_boiler_temperature', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Boiler temperature', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Boiler temperature', + 'platform': 'plugwise', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': , + 'translation_key': 'boiler_temperature', + 'unique_id': 'cd0e6156b1f04d5f952349ffbe397481-boiler_temperature', + 'unit_of_measurement': None, + }) +# --- +# name: test_anna_water_heater_snapshot[platforms0-False-anna_v4_dhw][water_heater.opentherm_boiler_temperature-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 45.0, + : 'OpenTherm Boiler temperature', + : 100.0, + : 0.0, + : , + : None, + : None, + : 70.0, + }), + 'context': , + 'entity_id': 'water_heater.opentherm_boiler_temperature', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'on', + }) +# --- +# name: test_anna_water_heater_snapshot[platforms0-False-anna_v4_dhw][water_heater.opentherm_dhw_temperature-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ None, @@ -116,14 +236,14 @@ StateSnapshot({ 'attributes': ReadOnlyDict({ : 45.0, - : 'OpenTherm', + : 'OpenTherm DHW temperature', : 60.0, : 30.0, : list([ 'comfort', 'eco', ]), - : 'off', + : 'eco', : , : None, : None, From d541bd81daf360e3830c81f0255bd0b07c765014 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sat, 27 Jun 2026 11:06:15 +0200 Subject: [PATCH 32/42] Improve typing, test coverage --- custom_components/plugwise/const.py | 5 +--- custom_components/plugwise/water_heater.py | 23 ++++++++----------- .../components/plugwise/test_water_heater.py | 10 ++++++++ 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/custom_components/plugwise/const.py b/custom_components/plugwise/const.py index 0c741b718..90554e7d5 100644 --- a/custom_components/plugwise/const.py +++ b/custom_components/plugwise/const.py @@ -209,7 +209,4 @@ "boiler_temperature", "dhw_temperature", ] -type WaterHeaterOptionsType = Literal[ - "boiler_modes", - "dhw_modes", -] +type WaterHeaterOptionsType = Literal["dhw_modes"] diff --git a/custom_components/plugwise/water_heater.py b/custom_components/plugwise/water_heater.py index b74ec5a9e..55498795a 100644 --- a/custom_components/plugwise/water_heater.py +++ b/custom_components/plugwise/water_heater.py @@ -1,7 +1,7 @@ """Plugwise water heater component for HomeAssistant.""" from dataclasses import dataclass -from typing import Any, cast, override +from typing import Any, override from homeassistant.components.water_heater import ( WaterHeaterEntity, @@ -32,6 +32,7 @@ from .entity import PlugwiseEntity from .util import plugwise_command +PARALLEL_UPDATES = 0 @dataclass(frozen=True, kw_only=True) class PlugwiseWaterHeaterEntityDescription(WaterHeaterEntityDescription): @@ -130,17 +131,12 @@ def current_temperature(self) -> float | None: @property @override - def operation_list(self) -> list[str]: - """Return the list of available operation modes. + def operation_list(self) -> list[str] | None: + """Return the list of available operation modes.""" + if (key := self.entity_description.options_key) is not None: + return self.device.get(key, []) - When no list is available the water_heater only has an "on" mode. - """ - if self.entity_description.options_key is not None: - op_list = self.device.get(self.entity_description.options_key) - if op_list is not None: - return cast(list[str], op_list) - - return [STATE_ON] + return None # pragma: no cover @property @override @@ -152,8 +148,9 @@ def target_temperature(self) -> float | None: @override async def async_set_operation_mode(self, operation_mode: str) -> None: """Set the operation mode.""" - if self.entity_description.options_key is None: - return + if self.operation_list is None: + return # pragma: no cover + list_type: int = len(self.operation_list) await self.coordinator.api.set_dhw_mode(DHW_MODE, self._dev_id, list_type, operation_mode) diff --git a/tests/components/plugwise/test_water_heater.py b/tests/components/plugwise/test_water_heater.py index 974b16a07..bbbe1c403 100644 --- a/tests/components/plugwise/test_water_heater.py +++ b/tests/components/plugwise/test_water_heater.py @@ -12,6 +12,7 @@ ) from homeassistant.const import ATTR_ENTITY_ID, ATTR_TEMPERATURE from homeassistant.core import HomeAssistant +from homeassistant.exceptions import ServiceNotSupported from homeassistant.helpers import entity_registry as er from syrupy.assertion import SnapshotAssertion @@ -50,6 +51,15 @@ async def test_adam_water_heater_setpoint_change( "e4684553153b44afbef2200885f379dc", "dhw_temperature", 65.0, ) + with pytest.raises(ServiceNotSupported): + await hass.services.async_call( + WATER_HEATER_DOMAIN, + SERVICE_SET_OPERATION_MODE, + {ATTR_ENTITY_ID: "water_heater.opentherm_boiler_temperature", ATTR_OPERATION_MODE: "eco"}, + blocking=True, + ) + assert mock_smile_adam_jip.set_dhw_mode.call_count == 0 + await hass.services.async_call( WATER_HEATER_DOMAIN, SERVICE_SET_OPERATION_MODE, From cb59e5c86e43246a631164b20234711e06403f1e Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Tue, 30 Jun 2026 18:00:13 +0200 Subject: [PATCH 33/42] Update NL translation --- custom_components/plugwise/translations/nl.json | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/custom_components/plugwise/translations/nl.json b/custom_components/plugwise/translations/nl.json index 0c7687071..6fdfc7d50 100644 --- a/custom_components/plugwise/translations/nl.json +++ b/custom_components/plugwise/translations/nl.json @@ -298,6 +298,17 @@ }, "dhw_temperature": { "name": "SWW temperatuur" + "state_attributes": { + "dhw_modes": { + "state": { + "auto": "Auto", + "boost": "Boost", + "comfort": "Comfort", + "eco": "Eco", + "off": "Uit" + } + } + } } } }, From 2dfd46460809f0963021e9e3185c59b6c720e6d0 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Tue, 30 Jun 2026 18:44:50 +0200 Subject: [PATCH 34/42] Correct nl.json --- custom_components/plugwise/translations/nl.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/plugwise/translations/nl.json b/custom_components/plugwise/translations/nl.json index 6fdfc7d50..2bccdbeae 100644 --- a/custom_components/plugwise/translations/nl.json +++ b/custom_components/plugwise/translations/nl.json @@ -297,7 +297,7 @@ "name": "Boiler temperatuur" }, "dhw_temperature": { - "name": "SWW temperatuur" + "name": "SWW temperatuur", "state_attributes": { "dhw_modes": { "state": { From fb837a7b194877282155cdd81a405081b5667b85 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Wed, 1 Jul 2026 08:22:45 +0200 Subject: [PATCH 35/42] Clean up after rebase --- custom_components/plugwise/water_heater.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/custom_components/plugwise/water_heater.py b/custom_components/plugwise/water_heater.py index 55498795a..5beb8c20b 100644 --- a/custom_components/plugwise/water_heater.py +++ b/custom_components/plugwise/water_heater.py @@ -103,8 +103,6 @@ def __init__( """Initialise the water_heater.""" super().__init__(coordinator, device_id) self.entity_description = description - entity_name = f"{self.device[ATTR_NAME]}".lower() - self._attr_unique_id = f"{device_id}-{entity_name}" temp_data = self.device.get(description.key, {}) if temp_data: self._attr_max_temp = temp_data.get(UPPER_BOUND, 75.0) From 0fde6d76dbb15fb5c1c3a91b1b35b7b88e1f63bb Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Fri, 3 Jul 2026 20:04:00 +0200 Subject: [PATCH 36/42] Add async_turn_off()/on() functions --- custom_components/plugwise/water_heater.py | 35 ++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/custom_components/plugwise/water_heater.py b/custom_components/plugwise/water_heater.py index 5beb8c20b..d2c5857e0 100644 --- a/custom_components/plugwise/water_heater.py +++ b/custom_components/plugwise/water_heater.py @@ -10,6 +10,7 @@ ) from homeassistant.const import ( ATTR_TEMPERATURE, + STATE_OFF, STATE_ON, EntityCategory, UnitOfTemperature, @@ -112,6 +113,9 @@ def __init__( self._attr_supported_features |= WaterHeaterEntityFeature.OPERATION_MODE self._attr_temperature_unit = UnitOfTemperature.CELSIUS self._attr_unique_id = f"{device_id}-{description.key}" + self._list_type = 0 + self._mode_off = self.device.get(DHW_MODE) == STATE_OFF + self._operation_mode: str | None = None @property @override @@ -149,8 +153,17 @@ async def async_set_operation_mode(self, operation_mode: str) -> None: if self.operation_list is None: return # pragma: no cover - list_type: int = len(self.operation_list) - await self.coordinator.api.set_dhw_mode(DHW_MODE, self._dev_id, list_type, operation_mode) + self._list_type = len(self.operation_list) + self._operation_mode = operation_mode + if self._operation_mode == STATE_OFF and not self._mode_off: + await self.async_turn_off() + return + + if self._mode_off and self._operation_mode != STATE_OFF: + await self.async_turn_on() + return + + await self.coordinator.api.set_dhw_mode(DHW_MODE, self._dev_id, self._list_type, self._operation_mode) @plugwise_command @override @@ -162,3 +175,21 @@ async def async_set_temperature(self, **kwargs: Any) -> None: self.entity_description.key, float(temperature), ) + + @plugwise_command + @override + async def async_turn_off(self, **kwargs: Any) -> None: + """Turn the water_heater off.""" + await self.coordinator.api.set_dhw_mode( + DHW_MODE, self._dev_id, self._list_type, STATE_OFF + ) + self._mode_off = True + + @plugwise_command + @override + async def async_turn_on(self, **kwargs: Any) -> None: + """Turn the water_heater on and set the operation mode.""" + await self.coordinator.api.set_dhw_mode( + DHW_MODE, self._dev_id, self._list_type, self._operation_mode + ) + self._mode_off = False From af4f8ab890d10e173d03da6d67f762ef7d36a4a1 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sat, 4 Jul 2026 08:37:02 +0200 Subject: [PATCH 37/42] Fix typing --- custom_components/plugwise/water_heater.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/plugwise/water_heater.py b/custom_components/plugwise/water_heater.py index d2c5857e0..d90552062 100644 --- a/custom_components/plugwise/water_heater.py +++ b/custom_components/plugwise/water_heater.py @@ -115,7 +115,7 @@ def __init__( self._attr_unique_id = f"{device_id}-{description.key}" self._list_type = 0 self._mode_off = self.device.get(DHW_MODE) == STATE_OFF - self._operation_mode: str | None = None + self._operation_mode: str = STATE_OFF @property @override From 6cc7bbd4a03640fc2b4af1bf970628df06e314a4 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sat, 4 Jul 2026 08:50:22 +0200 Subject: [PATCH 38/42] Add Anna-Loria test fixture --- .../anna_loria_cooling_active/data.json | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 tests/components/plugwise/fixtures/anna_loria_cooling_active/data.json diff --git a/tests/components/plugwise/fixtures/anna_loria_cooling_active/data.json b/tests/components/plugwise/fixtures/anna_loria_cooling_active/data.json new file mode 100644 index 000000000..13c3b2432 --- /dev/null +++ b/tests/components/plugwise/fixtures/anna_loria_cooling_active/data.json @@ -0,0 +1,111 @@ +{ + "582dfbdace4d4aeb832923ce7d1ddda0": { + "active_preset": "home", + "available_schedules": [ + "Winter", + "Test ", + "off" + ], + "climate_mode": "auto", + "control_state": "cooling", + "dev_class": "thermostat", + "firmware": "2018-02-08T11:15:53+01:00", + "hardware": "6539-1301-5002", + "location": "15da035090b847e7a21f93e08c015ebc", + "model": "ThermoTouch", + "name": "Anna", + "preset_modes": [ + "away", + "vacation", + "no_frost", + "home", + "asleep" + ], + "select_schedule": "Winter", + "sensors": { + "illuminance": 45.0, + "setpoint_high": 23.5, + "setpoint_low": 4.0, + "temperature": 24.1 + }, + "temperature_offset": { + "lower_bound": -2.0, + "resolution": 0.1, + "setpoint": 0.0, + "upper_bound": 2.0 + }, + "thermostat": { + "lower_bound": 4.0, + "resolution": 0.1, + "setpoint_high": 23.5, + "setpoint_low": 4.0, + "upper_bound": 30.0 + }, + "vendor": "Plugwise" + }, + "9ff0569b4984459fb243af64c0901894": { + "binary_sensors": { + "plugwise_notification": false + }, + "dev_class": "gateway", + "firmware": "4.3.8", + "hardware": "AME Smile 2.0 board", + "location": "674b657c138a41a291d315d7471deb06", + "mac_address": "C493000278E2", + "model": "Gateway", + "model_id": "smile_thermo", + "name": "Smile Anna", + "notifications": {}, + "sensors": { + "outdoor_temperature": 15.5 + }, + "vendor": "Plugwise" + }, + "bfb5ee0a88e14e5f97bfa725a760cc49": { + "available": true, + "binary_sensors": { + "cooling_enabled": true, + "cooling_state": true, + "dhw_state": false, + "flame_state": false, + "heating_state": false + }, + "boiler_temperature": { + "current": 25.3, + "lower_bound": 25.0, + "resolution": 0.01, + "setpoint": 40.0, + "upper_bound": 45.0 + }, + "dev_class": "heater_central", + "dhw_mode": "auto", + "dhw_modes": [ + "off", + "auto", + "boost", + "eco", + "comfort" + ], + "dhw_temperature": { + "current": 52.9, + "lower_bound": 35.0, + "resolution": 0.01, + "setpoint": 53.0, + "upper_bound": 60.0 + }, + "location": "674b657c138a41a291d315d7471deb06", + "model": "Generic heater/cooler", + "model_id": "173", + "name": "OpenTherm", + "sensors": { + "intended_boiler_temperature": 0.0, + "modulation_level": 100, + "outdoor_air_temperature": 17.2, + "return_temperature": 26.3 + }, + "switches": { + "cooling_ena_switch": true + }, + "vendor": "Atlantic" + } +} From 5bbbcb200a8c1f13873815bed04dec632f95d5cb Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sat, 4 Jul 2026 08:52:27 +0200 Subject: [PATCH 39/42] Change wh-testcase to the added fixture --- tests/components/plugwise/test_water_heater.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/components/plugwise/test_water_heater.py b/tests/components/plugwise/test_water_heater.py index bbbe1c403..9ae45f23c 100644 --- a/tests/components/plugwise/test_water_heater.py +++ b/tests/components/plugwise/test_water_heater.py @@ -72,7 +72,7 @@ async def test_adam_water_heater_setpoint_change( ) -@pytest.mark.parametrize("chosen_env", ["anna_v4_dhw"], indirect=True) +@pytest.mark.parametrize("chosen_env", ["anna_loria_cooling_active"], indirect=True) @pytest.mark.parametrize("cooling_present", [False], indirect=True) @pytest.mark.parametrize("platforms", [(WATER_HEATER_DOMAIN,)]) @pytest.mark.usefixtures("entity_registry_enabled_by_default") From 80a36fd9068a31890ecadbe330ad57aad80336f6 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sat, 4 Jul 2026 08:55:36 +0200 Subject: [PATCH 40/42] Save updated shapshot --- .../plugwise/snapshots/test_water_heater.ambr | 46 +++++++++++-------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/tests/components/plugwise/snapshots/test_water_heater.ambr b/tests/components/plugwise/snapshots/test_water_heater.ambr index 0d4c3a827..0311ec93d 100644 --- a/tests/components/plugwise/snapshots/test_water_heater.ambr +++ b/tests/components/plugwise/snapshots/test_water_heater.ambr @@ -128,15 +128,15 @@ 'state': 'eco', }) # --- -# name: test_anna_water_heater_snapshot[platforms0-False-anna_v4_dhw][water_heater.opentherm_boiler_temperature-entry] +# name: test_anna_water_heater_snapshot[platforms0-False-anna_loria_cooling_active][water_heater.opentherm_boiler_temperature-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ None, ]), 'area_id': None, 'capabilities': dict({ - : 100.0, - : 0.0, + : 45.0, + : 25.0, }), 'config_entry_id': , 'config_subentry_id': , @@ -164,21 +164,21 @@ 'suggested_object_id': None, 'supported_features': , 'translation_key': 'boiler_temperature', - 'unique_id': 'cd0e6156b1f04d5f952349ffbe397481-boiler_temperature', + 'unique_id': 'bfb5ee0a88e14e5f97bfa725a760cc49-boiler_temperature', 'unit_of_measurement': None, }) # --- -# name: test_anna_water_heater_snapshot[platforms0-False-anna_v4_dhw][water_heater.opentherm_boiler_temperature-state] +# name: test_anna_water_heater_snapshot[platforms0-False-anna_loria_cooling_active][water_heater.opentherm_boiler_temperature-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - : 45.0, + : 25.3, : 'OpenTherm Boiler temperature', - : 100.0, - : 0.0, + : 45.0, + : 25.0, : , : None, : None, - : 70.0, + : 40.0, }), 'context': , 'entity_id': 'water_heater.opentherm_boiler_temperature', @@ -188,7 +188,7 @@ 'state': 'on', }) # --- -# name: test_anna_water_heater_snapshot[platforms0-False-anna_v4_dhw][water_heater.opentherm_dhw_temperature-entry] +# name: test_anna_water_heater_snapshot[platforms0-False-anna_loria_cooling_active][water_heater.opentherm_dhw_temperature-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ None, @@ -196,10 +196,13 @@ 'area_id': None, 'capabilities': dict({ : 60.0, - : 30.0, + : 35.0, : list([ - 'comfort', + 'off', + 'auto', + 'boost', 'eco', + 'comfort', ]), }), 'config_entry_id': , @@ -228,32 +231,35 @@ 'suggested_object_id': None, 'supported_features': , 'translation_key': 'dhw_temperature', - 'unique_id': 'cd0e6156b1f04d5f952349ffbe397481-dhw_temperature', + 'unique_id': 'bfb5ee0a88e14e5f97bfa725a760cc49-dhw_temperature', 'unit_of_measurement': None, }) # --- -# name: test_anna_water_heater_snapshot[platforms0-False-anna_v4_dhw][water_heater.opentherm_dhw_temperature-state] +# name: test_anna_water_heater_snapshot[platforms0-False-anna_loria_cooling_active][water_heater.opentherm_dhw_temperature-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - : 45.0, + : 52.9, : 'OpenTherm DHW temperature', : 60.0, - : 30.0, + : 35.0, : list([ - 'comfort', + 'off', + 'auto', + 'boost', 'eco', + 'comfort', ]), - : 'eco', + : 'auto', : , : None, : None, - : 60.0, + : 53.0, }), 'context': , 'entity_id': 'water_heater.opentherm_dhw_temperature', 'last_changed': , 'last_reported': , 'last_updated': , - 'state': 'eco', + 'state': 'auto', }) # --- From 186cf27182f12db8641e05cb20b2c88d29566772 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sat, 4 Jul 2026 09:00:17 +0200 Subject: [PATCH 41/42] Add testcase setting dhw_mode to off --- .../components/plugwise/test_water_heater.py | 46 +++++++++++++++++-- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/tests/components/plugwise/test_water_heater.py b/tests/components/plugwise/test_water_heater.py index 9ae45f23c..83bc10deb 100644 --- a/tests/components/plugwise/test_water_heater.py +++ b/tests/components/plugwise/test_water_heater.py @@ -1,9 +1,10 @@ """Tests for the Plugwise water_heater platform.""" - -from unittest.mock import MagicMock +from datetime import timedelta +from unittest.mock import MagicMock, patch import pytest +from freezegun.api import FrozenDateTimeFactory from homeassistant.components.water_heater import ( ATTR_OPERATION_MODE, DOMAIN as WATER_HEATER_DOMAIN, @@ -16,7 +17,7 @@ from homeassistant.helpers import entity_registry as er from syrupy.assertion import SnapshotAssertion -from tests.common import MockConfigEntry, snapshot_platform +from tests.common import MockConfigEntry, async_fire_time_changed, snapshot_platform HA_PLUGWISE_SMILE_ASYNC_UPDATE = ( "homeassistant.components.plugwise.coordinator.Smile.async_update" @@ -85,3 +86,42 @@ async def test_anna_water_heater_snapshot( ) -> None: """Test Anna water_heater snapshot with dhw_state on.""" await snapshot_platform(hass, entity_registry, snapshot, setup_platform.entry_id) + + +@pytest.mark.parametrize("chosen_env", ["anna_loria_cooling_active"], indirect=True) +@pytest.mark.parametrize("cooling_present", [False], indirect=True) +async def test_anna_water_heater_mode_change( + hass: HomeAssistant, + mock_smile_anna: MagicMock, + init_integration: MockConfigEntry, + freezer: FrozenDateTimeFactory, +) -> None: + """Test Anna water_heater dhw_mode changes.""" + await hass.services.async_call( + WATER_HEATER_DOMAIN, + SERVICE_SET_OPERATION_MODE, + {ATTR_ENTITY_ID: "water_heater.opentherm_dhw_temperature", ATTR_OPERATION_MODE: "off"}, + blocking=True, + ) + assert mock_smile_anna.set_dhw_mode.call_count == 1 + mock_smile_anna.set_dhw_mode.assert_called_with( + "dhw_mode", "bfb5ee0a88e14e5f97bfa725a760cc49", 5, "off" + ) + + data = mock_smile_anna.async_update.return_value + data["bfb5ee0a88e14e5f97bfa725a760cc49"]["dhw_mode"] = "off" + with patch(HA_PLUGWISE_SMILE_ASYNC_UPDATE, return_value=data): + freezer.tick(timedelta(minutes=1)) + async_fire_time_changed(hass) + await hass.async_block_till_done() + + await hass.services.async_call( + WATER_HEATER_DOMAIN, + SERVICE_SET_OPERATION_MODE, + {ATTR_ENTITY_ID: "water_heater.opentherm_dhw_temperature", ATTR_OPERATION_MODE: "boost"}, + blocking=True, + ) + assert mock_smile_anna.set_dhw_mode.call_count == 2 + mock_smile_anna.set_dhw_mode.assert_called_with( + "dhw_mode", "bfb5ee0a88e14e5f97bfa725a760cc49", 5, "boost" + ) From 8cdd41149c3fb8eb55c30273acecc42342a46435 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sat, 4 Jul 2026 18:51:38 +0200 Subject: [PATCH 42/42] Reorder --- custom_components/plugwise/water_heater.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/custom_components/plugwise/water_heater.py b/custom_components/plugwise/water_heater.py index d90552062..424e32cb0 100644 --- a/custom_components/plugwise/water_heater.py +++ b/custom_components/plugwise/water_heater.py @@ -165,17 +165,6 @@ async def async_set_operation_mode(self, operation_mode: str) -> None: await self.coordinator.api.set_dhw_mode(DHW_MODE, self._dev_id, self._list_type, self._operation_mode) - @plugwise_command - @override - async def async_set_temperature(self, **kwargs: Any) -> None: - """Set new target temperature.""" - if (temperature := kwargs.get(ATTR_TEMPERATURE)) is not None: - await self.coordinator.api.set_number( - self._dev_id, - self.entity_description.key, - float(temperature), - ) - @plugwise_command @override async def async_turn_off(self, **kwargs: Any) -> None: @@ -193,3 +182,14 @@ async def async_turn_on(self, **kwargs: Any) -> None: DHW_MODE, self._dev_id, self._list_type, self._operation_mode ) self._mode_off = False + + @plugwise_command + @override + async def async_set_temperature(self, **kwargs: Any) -> None: + """Set new target temperature.""" + if (temperature := kwargs.get(ATTR_TEMPERATURE)) is not None: + await self.coordinator.api.set_number( + self._dev_id, + self.entity_description.key, + float(temperature), + )