Skip to content

Commit 9b541bf

Browse files
authored
Merge pull request #248 from plugwise/max_b_temp_bug
Improve, bugfix
2 parents 64d83c0 + 7760e8d commit 9b541bf

File tree

7 files changed

+32
-13
lines changed

7 files changed

+32
-13
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
# v0.25.14: Improve, bugfix
4+
- Anna+Elga: final solution for https://github.com/plugwise/plugwise-beta/issues/320
5+
- Related to https://github.com/home-assistant/core/issues/83068: handle actuator_functionality or sensor depending on which one is present
6+
37
# v0.25.13: Anna+Elga, OnOff device: base heating_state, cooling_state on central_heating_state key only
48
- Partial solution for https://github.com/plugwise/plugwise-beta/issues/320
59
- Improving the solution for https://github.com/home-assistant/core/issues/81839

plugwise/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Plugwise module."""
22

3-
__version__ = "0.25.13"
3+
__version__ = "0.25.14"
44

55
from plugwise.smile import Smile
66
from plugwise.stick import Stick

plugwise/constants.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,8 @@
477477
HEATER_CENTRAL_MEASUREMENTS: Final[dict[str, DATA | UOM]] = {
478478
"boiler_temperature": DATA("water_temperature", TEMP_CELSIUS),
479479
"domestic_hot_water_mode": DATA("dhw_mode", NONE),
480-
"domestic_hot_water_state": DATA("dhw_state", TEMP_CELSIUS),
480+
"domestic_hot_water_setpoint": UOM(TEMP_CELSIUS),
481+
"domestic_hot_water_state": DATA("dhw_state", NONE),
481482
"domestic_hot_water_temperature": DATA("dhw_temperature", TEMP_CELSIUS),
482483
"elga_status_code": UOM(NONE),
483484
"intended_boiler_temperature": UOM(
@@ -547,6 +548,7 @@
547548
"cooling_activation_outdoor_temperature",
548549
"cooling_deactivation_threshold",
549550
"dhw_temperature",
551+
"domestic_hot_water_setpoint",
550552
"temperature",
551553
"electricity_consumed",
552554
"electricity_consumed_interval",
@@ -571,6 +573,7 @@
571573
"humidity",
572574
"illuminance",
573575
"intended_boiler_temperature",
576+
"maximum_boiler_temperature",
574577
"modulation_level",
575578
"net_electricity_cumulative",
576579
"net_electricity_point",
@@ -758,7 +761,8 @@ class DeviceData(ApplianceData, DeviceDataPoints, TypedDict, total=False):
758761
"""The Device Data class, covering the collected and ordere output-data per device."""
759762

760763
binary_sensors: SmileBinarySensors
761-
domestic_hot_water_setpoint: ActuatorData
764+
domestic_hot_water_setpoint: ActuatorData | float
765+
maximum_boiler_temperature: ActuatorData | float
762766
sensors: SmileSensors
763767
switches: SmileSwitches
764768
thermostat: ActuatorData

plugwise/helper.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -975,6 +975,12 @@ def _get_appliance_data(self, d_id: str) -> DeviceData:
975975
self.smile_name in ("Adam", "Smile Anna") and self._on_off_device
976976
):
977977
data["heating_state"] = data["c_heating_state"]
978+
# Heating is not active when intended_boiler_temperature is 0
979+
if (
980+
"intended_boiler_temperature" in data
981+
and data["intended_boiler_temperature"] == 0
982+
):
983+
data["heating_state"] = False
978984
# For Adam + OnOff cooling, central_heating_state = True means cooling is active
979985
# For Smile Anna, _cooling_active will be corrected in the next if-construc
980986
if self._cooling_present:
@@ -1422,7 +1428,8 @@ def _update_device_with_dicts(
14221428
if self._opentherm_device or self._on_off_device:
14231429
bs_dict[key] = value # type: ignore[literal-required]
14241430
for item in SENSORS:
1425-
if item == key:
1431+
# Filter for actuator_functionalities, they are not sensors
1432+
if item == key and not isinstance(value, dict):
14261433
data.pop(key) # type: ignore [misc]
14271434
s_dict[key] = value # type: ignore[literal-required]
14281435
for item in SWITCHES:

tests/test_smile.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3726,8 +3726,9 @@ async def test_connect_anna_heatpump_heating(self):
37263726
},
37273727
"sensors": {
37283728
"water_temperature": 29.1,
3729+
"domestic_hot_water_setpoint": 60.0,
37293730
"dhw_temperature": 46.3,
3730-
"intended_boiler_temperature": 0.0,
3731+
"intended_boiler_temperature": 35.0,
37313732
"modulation_level": 52,
37323733
"return_temperature": 25.1,
37333734
"water_pressure": 1.57,
@@ -3791,7 +3792,7 @@ async def test_connect_anna_heatpump_heating(self):
37913792

37923793
await self.device_test(smile, testdata)
37933794
assert smile.gateway_id == "015ae9ea3f964e668e490fa39da3870b"
3794-
assert self.device_items == 56
3795+
assert self.device_items == 57
37953796
assert not self.cooling_present
37963797
assert not self.notifications
37973798

@@ -3854,6 +3855,7 @@ async def test_connect_anna_heatpump_cooling(self):
38543855
},
38553856
"sensors": {
38563857
"water_temperature": 24.7,
3858+
"domestic_hot_water_setpoint": 60.0,
38573859
"intended_boiler_temperature": 0.0,
38583860
"modulation_level": 40,
38593861
"return_temperature": 23.8,
@@ -3907,7 +3909,7 @@ async def test_connect_anna_heatpump_cooling(self):
39073909
assert not smile._smile_legacy
39083910

39093911
await self.device_test(smile, testdata)
3910-
assert self.device_items == 58
3912+
assert self.device_items == 59
39113913
assert self.cooling_present
39123914
assert not self.notifications
39133915

@@ -3966,7 +3968,7 @@ async def test_connect_anna_heatpump_cooling_fake_firmware(self):
39663968
assert smile.smile_version[0] == "4.10.10"
39673969

39683970
await self.device_test(smile, testdata)
3969-
assert self.device_items == 59
3971+
assert self.device_items == 60
39703972
assert smile._cooling_present
39713973
assert smile._cooling_enabled
39723974
assert smile._cooling_active
@@ -4067,6 +4069,7 @@ async def test_connect_anna_elga_2(self):
40674069
},
40684070
"sensors": {
40694071
"water_temperature": 22.8,
4072+
"domestic_hot_water_setpoint": 60.0,
40704073
"intended_boiler_temperature": 0.0,
40714074
"modulation_level": 0.0,
40724075
"return_temperature": 23.4,
@@ -4102,7 +4105,7 @@ async def test_connect_anna_elga_2(self):
41024105
assert not smile._smile_legacy
41034106

41044107
await self.device_test(smile, testdata)
4105-
assert self.device_items == 57
4108+
assert self.device_items == 58
41064109
assert smile.gateway_id == "fb49af122f6e4b0f91267e1cf7666d6f"
41074110
assert self.cooling_present
41084111
assert not self.notifications
@@ -4154,7 +4157,7 @@ async def test_connect_anna_elga_2_schedule_off(self):
41544157

41554158
await self.device_test(smile, testdata)
41564159
assert smile._cooling_present
4157-
assert self.device_items == 57
4160+
assert self.device_items == 58
41584161

41594162
await smile.close_connection()
41604163
await self.disconnect(server, client)
@@ -4221,6 +4224,7 @@ async def test_connect_anna_elga_2_cooling(self):
42214224
},
42224225
"sensors": {
42234226
"water_temperature": 22.8,
4227+
"domestic_hot_water_setpoint": 60.0,
42244228
"intended_boiler_temperature": 0.0,
42254229
"modulation_level": 0.0,
42264230
"return_temperature": 23.4,
@@ -4256,7 +4260,7 @@ async def test_connect_anna_elga_2_cooling(self):
42564260
assert not smile._smile_legacy
42574261

42584262
await self.device_test(smile, testdata)
4259-
assert self.device_items == 58
4263+
assert self.device_items == 59
42604264
assert self.cooling_present
42614265
assert not self.notifications
42624266

userdata/adam_onoff_cooling_fake_firmware/core.appliances.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<interval/>
2929
<thermo_meter id='a98b220b5a7e4834ae0fbcb949caa7b8'/>
3030
<period start_date="2021-12-31T13:36:00.350+01:00" end_date="2021-12-31T13:36:00.350+01:00">
31-
<measurement log_date="2021-12-31T13:36:00.350+01:00">0.00</measurement>
31+
<measurement log_date="2021-12-31T13:36:00.350+01:00">35.00</measurement>
3232
</period>
3333
</point_log>
3434
<point_log id='0ffcb99c5efe4b26bc2fe33232be4bb2'>

userdata/anna_heatpump_heating/core.appliances.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@
302302
<unit>C</unit>
303303
<last_consecutive_log_date>2020-04-03T07:54:47.729+02:00</last_consecutive_log_date>
304304
<period start_date="2020-04-08T19:24:39.363+02:00" end_date="2020-04-08T19:24:39.363+02:00">
305-
<measurement log_date="2020-04-08T19:24:39.363+02:00">0.00</measurement>
305+
<measurement log_date="2020-04-08T19:24:39.363+02:00">35.00</measurement>
306306
</period>
307307
<thermo_meter id='6a3b56382ef04a2db54c35c349a6521f'/>
308308
</point_log>

0 commit comments

Comments
 (0)