Skip to content

Commit ba35112

Browse files
committed
Fix active cooling detection
1 parent 48d71ec commit ba35112

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

custom_components/luxtronik/common.py

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
LuxOperationMode,
2222
LuxParameter as LP,
2323
LuxStatus1Option,
24+
LuxStatus3Option,
2425
LuxVisibility as LV,
2526
)
2627
from .model import LuxtronikCoordinatorData
@@ -99,11 +100,32 @@ def correct_key_value(
99100
if (
100101
sensor_id == LC.C0080_STATUS
101102
and value == LuxOperationMode.no_request
102-
and bool(get_sensor_data(sensors, LC.C0119_STATUS_LINE_3) == "cooling")
103+
and bool(get_sensor_data(sensors, LC.C0119_STATUS_LINE_3) == LuxStatus3Option.cooling.value)
103104
):
104105
return LuxOperationMode.cooling
105106
# endregion Workaround Detect passive cooling operation mode
106-
107+
# region Workaround Detect active cooling operation mode
108+
if (
109+
sensor_id == LC.C0080_STATUS
110+
and value == LuxOperationMode.no_request
111+
and bool(get_sensor_data(sensors, LC.C0119_STATUS_LINE_3) in LuxStatus3Option.heating.value)
112+
):
113+
T_in = get_sensor_data(sensors, LC.C0010_FLOW_IN_TEMPERATURE)
114+
T_out = get_sensor_data(sensors, LC.C0011_FLOW_OUT_TEMPERATURE)
115+
T_heat_in = get_sensor_data(sensors, LC.C0204_HEAT_SOURCE_INPUT_TEMPERATURE)
116+
T_heat_out = get_sensor_data(sensors, LC.C0024_HEAT_SOURCE_OUTPUT_TEMPERATURE)
117+
Flow_WQ = get_sensor_data(sensors, LC.C0173_HEAT_SOURCE_FLOW_RATE)
118+
Pump = get_sensor_data(sensors, LC.C0043_PUMP_FLOW)
119+
if (
120+
(T_out > T_in)
121+
and (T_heat_out > T_heat_in)
122+
and (Flow_WQ > 0)
123+
and Pump
124+
):
125+
return LuxOperationMode.cooling
126+
# endregion Workaround Detect active cooling operation mode
127+
128+
# no changes needed, return sensor value
107129
return value
108130

109131

0 commit comments

Comments
 (0)