Skip to content

Commit 10dde94

Browse files
authored
Merge pull request #439 from plugwise/elga_bug
Anna+Elga update - retry
2 parents c171931 + ba401dc commit 10dde94

File tree

10 files changed

+117
-101
lines changed

10 files changed

+117
-101
lines changed

CHANGELOG.md

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

3+
## v0.34.3
4+
5+
- Anna+Elga now always has `cooling_present` set to `True`: the Elga (always) has cooling-capability.
6+
- Cooling-mode on/off is determined from specific Elga status-codes
7+
38
## v0.34.2
49

510
- Add a list of Plugwise devices to the API.

fixtures/anna_elga_2/all_data.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"binary_sensors": {
66
"compressor_state": false,
77
"cooling_enabled": false,
8+
"cooling_state": false,
89
"dhw_state": false,
910
"flame_state": false,
1011
"heating_state": false,
@@ -18,7 +19,7 @@
1819
"setpoint": 60.0,
1920
"upper_bound": 100.0
2021
},
21-
"model": "Generic heater",
22+
"model": "Generic heater/cooler",
2223
"name": "OpenTherm",
2324
"sensors": {
2425
"domestic_hot_water_setpoint": 60.0,
@@ -50,7 +51,8 @@
5051
"cooling_activation_outdoor_temperature": 26.0,
5152
"cooling_deactivation_threshold": 3.0,
5253
"illuminance": 0.5,
53-
"setpoint": 19.5,
54+
"setpoint_high": 30.0,
55+
"setpoint_low": 19.5,
5456
"temperature": 20.9
5557
},
5658
"temperature_offset": {
@@ -62,7 +64,8 @@
6264
"thermostat": {
6365
"lower_bound": 4.0,
6466
"resolution": 0.1,
65-
"setpoint": 19.5,
67+
"setpoint_high": 30.0,
68+
"setpoint_low": 19.5,
6669
"upper_bound": 30.0
6770
},
6871
"vendor": "Plugwise"
@@ -85,10 +88,10 @@
8588
}
8689
},
8790
"gateway": {
88-
"cooling_present": false,
91+
"cooling_present": true,
8992
"gateway_id": "fb49af122f6e4b0f91267e1cf7666d6f",
9093
"heater_id": "573c152e7d4f4720878222bd75638f5b",
91-
"item_count": 59,
94+
"item_count": 62,
9295
"notifications": {},
9396
"smile_name": "Smile Anna"
9497
}

fixtures/anna_elga_2_schedule_off/all_data.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"binary_sensors": {
66
"compressor_state": false,
77
"cooling_enabled": false,
8+
"cooling_state": false,
89
"dhw_state": false,
910
"flame_state": false,
1011
"heating_state": false,
@@ -18,7 +19,7 @@
1819
"setpoint": 60.0,
1920
"upper_bound": 100.0
2021
},
21-
"model": "Generic heater",
22+
"model": "Generic heater/cooler",
2223
"name": "OpenTherm",
2324
"sensors": {
2425
"domestic_hot_water_setpoint": 60.0,
@@ -41,7 +42,7 @@
4142
"firmware": "2018-02-08T11:15:53+01:00",
4243
"hardware": "6539-1301-5002",
4344
"location": "d3ce834534114348be628b61b26d9220",
44-
"mode": "heat",
45+
"mode": "heat_cool",
4546
"model": "ThermoTouch",
4647
"name": "Anna",
4748
"preset_modes": ["away", "no_frost", "vacation", "home", "asleep"],
@@ -50,7 +51,8 @@
5051
"cooling_activation_outdoor_temperature": 26.0,
5152
"cooling_deactivation_threshold": 3.0,
5253
"illuminance": 0.5,
53-
"setpoint": 19.5,
54+
"setpoint_high": 30.0,
55+
"setpoint_low": 19.5,
5456
"temperature": 20.9
5557
},
5658
"temperature_offset": {
@@ -62,7 +64,8 @@
6264
"thermostat": {
6365
"lower_bound": 4.0,
6466
"resolution": 0.1,
65-
"setpoint": 19.5,
67+
"setpoint_high": 30.0,
68+
"setpoint_low": 19.5,
6669
"upper_bound": 30.0
6770
},
6871
"vendor": "Plugwise"
@@ -85,10 +88,10 @@
8588
}
8689
},
8790
"gateway": {
88-
"cooling_present": false,
91+
"cooling_present": true,
8992
"gateway_id": "fb49af122f6e4b0f91267e1cf7666d6f",
9093
"heater_id": "573c152e7d4f4720878222bd75638f5b",
91-
"item_count": 59,
94+
"item_count": 62,
9295
"notifications": {},
9396
"smile_name": "Smile Anna"
9497
}

fixtures/anna_heatpump_heating/all_data.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"binary_sensors": {
2222
"compressor_state": true,
2323
"cooling_enabled": false,
24+
"cooling_state": false,
2425
"dhw_state": false,
2526
"flame_state": false,
2627
"heating_state": true,
@@ -40,7 +41,7 @@
4041
"setpoint": 60.0,
4142
"upper_bound": 100.0
4243
},
43-
"model": "Generic heater",
44+
"model": "Generic heater/cooler",
4445
"name": "OpenTherm",
4546
"sensors": {
4647
"dhw_temperature": 46.3,
@@ -72,7 +73,8 @@
7273
"cooling_activation_outdoor_temperature": 21.0,
7374
"cooling_deactivation_threshold": 4.0,
7475
"illuminance": 86.0,
75-
"setpoint": 20.5,
76+
"setpoint_high": 30.0,
77+
"setpoint_low": 20.5,
7678
"temperature": 19.3
7779
},
7880
"temperature_offset": {
@@ -84,17 +86,18 @@
8486
"thermostat": {
8587
"lower_bound": 4.0,
8688
"resolution": 0.1,
87-
"setpoint": 20.5,
89+
"setpoint_high": 30.0,
90+
"setpoint_low": 20.5,
8891
"upper_bound": 30.0
8992
},
9093
"vendor": "Plugwise"
9194
}
9295
},
9396
"gateway": {
94-
"cooling_present": false,
97+
"cooling_present": true,
9598
"gateway_id": "015ae9ea3f964e668e490fa39da3870b",
9699
"heater_id": "1cbf783bb11e4a7c8a6843dee3a86927",
97-
"item_count": 63,
100+
"item_count": 66,
98101
"notifications": {},
99102
"smile_name": "Smile Anna"
100103
}

fixtures/m_anna_heatpump_cooling/all_data.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"cooling_activation_outdoor_temperature": 21.0,
7474
"cooling_deactivation_threshold": 4.0,
7575
"illuminance": 86.0,
76-
"setpoint_high": 24.0,
76+
"setpoint_high": 30.0,
7777
"setpoint_low": 20.5,
7878
"temperature": 26.3
7979
},
@@ -86,7 +86,7 @@
8686
"thermostat": {
8787
"lower_bound": 4.0,
8888
"resolution": 0.1,
89-
"setpoint_high": 24.0,
89+
"setpoint_high": 30.0,
9090
"setpoint_low": 20.5,
9191
"upper_bound": 30.0
9292
},
@@ -97,7 +97,7 @@
9797
"cooling_present": true,
9898
"gateway_id": "015ae9ea3f964e668e490fa39da3870b",
9999
"heater_id": "1cbf783bb11e4a7c8a6843dee3a86927",
100-
"item_count": 63,
100+
"item_count": 66,
101101
"notifications": {},
102102
"smile_name": "Smile Anna"
103103
}

fixtures/m_anna_heatpump_idle/all_data.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"cooling_activation_outdoor_temperature": 25.0,
7474
"cooling_deactivation_threshold": 4.0,
7575
"illuminance": 86.0,
76-
"setpoint_high": 24.0,
76+
"setpoint_high": 30.0,
7777
"setpoint_low": 20.5,
7878
"temperature": 23.0
7979
},
@@ -86,7 +86,7 @@
8686
"thermostat": {
8787
"lower_bound": 4.0,
8888
"resolution": 0.1,
89-
"setpoint_high": 24.0,
89+
"setpoint_high": 30.0,
9090
"setpoint_low": 20.5,
9191
"upper_bound": 30.0
9292
},
@@ -97,7 +97,7 @@
9797
"cooling_present": true,
9898
"gateway_id": "015ae9ea3f964e668e490fa39da3870b",
9999
"heater_id": "1cbf783bb11e4a7c8a6843dee3a86927",
100-
"item_count": 63,
100+
"item_count": 66,
101101
"notifications": {},
102102
"smile_name": "Smile Anna"
103103
}

plugwise/helper.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,16 +1028,13 @@ def _get_measurement_data(self, dev_id: str) -> DeviceData:
10281028
if self._is_thermostat and self.smile(ANNA) and dev_id == self._heater_id:
10291029
# Anna+Elga: base cooling_state on the elga-status-code
10301030
if "elga_status_code" in data:
1031-
# Determine _cooling_present and _cooling_enabled
1032-
if (
1033-
"cooling_enabled" in data["binary_sensors"]
1034-
and data["binary_sensors"]["cooling_enabled"]
1035-
):
1036-
self._cooling_present = self._cooling_enabled = True
1037-
data["model"] = "Generic heater/cooler"
1038-
data["binary_sensors"]["cooling_state"] = self._cooling_active = (
1039-
data["elga_status_code"] == 8
1040-
)
1031+
# Techneco Elga has cooling-capability
1032+
self._cooling_present = True
1033+
data["model"] = "Generic heater/cooler"
1034+
self._cooling_enabled = data["elga_status_code"] in [8, 9]
1035+
data["binary_sensors"]["cooling_state"] = self._cooling_active = (
1036+
data["elga_status_code"] == 8
1037+
)
10411038
data.pop("elga_status_code", None)
10421039
self._count -= 1
10431040
# Elga has no cooling-switch

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "plugwise"
7-
version = "0.34.2"
7+
version = "0.34.3"
88
license = {file = "LICENSE"}
99
description = "Plugwise Smile (Adam/Anna/P1) and Stretch module for Python 3."
1010
readme = "README.md"

scripts/manual_fixtures.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -282,19 +282,13 @@ def json_writer(manual_name: str, all_data: dict, notifications: dict):
282282
] = 28.2
283283

284284
# Go for 3cb7
285-
m_anna_heatpump_cooling["devices"]["3cb70739631c4d17a86b8b12e8a5161b"][
286-
"thermostat"
287-
].pop("setpoint")
288285
m_anna_heatpump_cooling["devices"]["3cb70739631c4d17a86b8b12e8a5161b"]["thermostat"][
289286
"setpoint_low"
290287
] = 20.5
291288
m_anna_heatpump_cooling["devices"]["3cb70739631c4d17a86b8b12e8a5161b"]["thermostat"][
292289
"setpoint_high"
293-
] = 24.0
290+
] = 30.0
294291

295-
m_anna_heatpump_cooling["devices"]["3cb70739631c4d17a86b8b12e8a5161b"]["sensors"].pop(
296-
"setpoint"
297-
)
298292
m_anna_heatpump_cooling["devices"]["3cb70739631c4d17a86b8b12e8a5161b"]["sensors"][
299293
"temperature"
300294
] = 26.3
@@ -303,7 +297,7 @@ def json_writer(manual_name: str, all_data: dict, notifications: dict):
303297
] = 20.5
304298
m_anna_heatpump_cooling["devices"]["3cb70739631c4d17a86b8b12e8a5161b"]["sensors"][
305299
"setpoint_high"
306-
] = 24.0
300+
] = 30.0
307301

308302
json_writer("m_anna_heatpump_cooling", m_anna_heatpump_cooling, base_n)
309303

0 commit comments

Comments
 (0)