Skip to content

Commit 8c187bb

Browse files
committed
* Fixed incorrect register for Free Cooling
* Added missed Free Cooling parameters (can be configured by custom card via https://github.com/AN3Orik/systemair-lovelace) * Moved Eco-Mode & Free Cooling switch to proper section (Configuration) * Cleanup
1 parent 5dcb20e commit 8c187bb

File tree

10 files changed

+192
-34
lines changed

10 files changed

+192
-34
lines changed

custom_components/systemair/binary_sensor.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ async def async_setup_entry(
7575
class SystemairBinarySensor(SystemairEntity, BinarySensorEntity):
7676
"""Systemair binary_sensor class."""
7777

78-
_attr_has_entity_name = True
79-
8078
entity_description: SystemairBinarySensorEntityDescription
8179

8280
def __init__(

custom_components/systemair/button.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ async def async_setup_entry(
5353
class SystemairButton(SystemairEntity, ButtonEntity):
5454
"""Systemair button class."""
5555

56-
_attr_has_entity_name = True
57-
5856
def __init__(
5957
self,
6058
coordinator: SystemairDataUpdateCoordinator,

custom_components/systemair/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
"aiohttp",
1616
"async-timeout"
1717
],
18-
"version": "1.0.7"
18+
"version": "1.0.8"
1919
}

custom_components/systemair/modbus.py

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1600,36 +1600,40 @@ class ModbusParameter:
16001600
description="Time in specific defrosting state, s.",
16011601
),
16021602
ModbusParameter(
1603-
register=4100,
1603+
register=4101,
16041604
sig=IntegerType.UINT,
16051605
reg_type=RegisterType.Holding,
16061606
short="REG_FREE_COOLING_ON_OFF",
1607-
description="Enabling of free cooling. 0 - Disabled; 1 - Enabled",
1607+
description="Free cooling on/off: 0 - Disabled; 1 - Enabled",
16081608
boolean=True,
16091609
),
16101610
ModbusParameter(
1611-
register=4101,
1611+
register=4102,
16121612
sig=IntegerType.UINT,
16131613
reg_type=RegisterType.Holding,
1614-
short="REG_FREE_COOLING_ON_OFF_DEPRECATED",
1615-
description="Free cooling status: 0 - Disabled; 1 - Enabled",
1616-
boolean=True,
1614+
short="REG_FREE_COOLING_OUTDOOR_NIGHTTIME_ACTIVATION_HIGH_T_LIMIT",
1615+
description="Outdoor nighttime activation high limit, °C * 10",
1616+
scale_factor=10,
1617+
min_value=70,
1618+
max_value=300,
16171619
),
16181620
ModbusParameter(
16191621
register=4103,
16201622
sig=IntegerType.UINT,
16211623
reg_type=RegisterType.Holding,
1622-
short="REG_FREE_COOLING_OUTDOOR_NIGHT_TIME_DEACTIVATION_HIGH_T_LIMIT",
1623-
description="Outdoor activation low limit.",
1624+
short="REG_FREE_COOLING_OUTDOOR_NIGHTTIME_DEACTIVATION_LOW_T_LIMIT",
1625+
description="Outdoor activation low limit, °C * 10",
1626+
scale_factor=10,
16241627
min_value=70,
16251628
max_value=300,
16261629
),
16271630
ModbusParameter(
16281631
register=4104,
16291632
sig=IntegerType.UINT,
16301633
reg_type=RegisterType.Holding,
1631-
short="REG_FREE_COOLING_OUTDOOR_NIGHT_TIME_DEACTIVATION_LOW_T_LIMIT",
1632-
description="Outdoor activation high limit.",
1634+
short="REG_FREE_COOLING_OUTDOOR_NIGHTTIME_DEACTIVATION_HIGH_T_LIMIT",
1635+
description="Outdoor activation high limit, °C * 10",
1636+
scale_factor=10,
16331637
min_value=70,
16341638
max_value=300,
16351639
),
@@ -1638,7 +1642,8 @@ class ModbusParameter:
16381642
sig=IntegerType.UINT,
16391643
reg_type=RegisterType.Holding,
16401644
short="REG_FREE_COOLING_ROOM_CANCEL_T",
1641-
description="Extract/Room cancel temperature.",
1645+
description="Extract/Room cancel temperature, °C * 10",
1646+
scale_factor=10,
16421647
min_value=120,
16431648
max_value=300,
16441649
),
@@ -1647,16 +1652,16 @@ class ModbusParameter:
16471652
sig=IntegerType.UINT,
16481653
reg_type=RegisterType.Holding,
16491654
short="REG_FREE_COOLING_START_TIME_H",
1650-
description="Free cooling start time, h.",
1651-
min_value=21,
1652-
max_value=8,
1655+
description="Free cooling start time, hours (21-23 or 0-8)",
1656+
min_value=0,
1657+
max_value=23,
16531658
),
16541659
ModbusParameter(
16551660
register=4107,
16561661
sig=IntegerType.UINT,
16571662
reg_type=RegisterType.Holding,
16581663
short="REG_FREE_COOLING_START_TIME_M",
1659-
description="Free cooling start time, minutes.",
1664+
description="Free cooling start time, minutes",
16601665
min_value=0,
16611666
max_value=59,
16621667
),
@@ -1665,16 +1670,16 @@ class ModbusParameter:
16651670
sig=IntegerType.UINT,
16661671
reg_type=RegisterType.Holding,
16671672
short="REG_FREE_COOLING_END_TIME_H",
1668-
description="Free cooling end time, h.",
1669-
min_value=None,
1670-
max_value=8,
1673+
description="Free cooling end time, hours",
1674+
min_value=0,
1675+
max_value=23,
16711676
),
16721677
ModbusParameter(
16731678
register=4109,
16741679
sig=IntegerType.UINT,
16751680
reg_type=RegisterType.Holding,
16761681
short="REG_FREE_COOLING_END_TIME_M",
1677-
description="Free cooling end time, minutes.",
1682+
description="Free cooling end time, minutes",
16781683
min_value=0,
16791684
max_value=59,
16801685
),

custom_components/systemair/number.py

Lines changed: 67 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,68 @@ class SystemairNumberEntityDescription(NumberEntityDescription):
9898
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
9999
registry=parameter_map["REG_ECO_T_Y1_OFFSET"],
100100
),
101+
SystemairNumberEntityDescription(
102+
key="free_cooling_outdoor_low_limit",
103+
translation_key="free_cooling_outdoor_low_limit",
104+
entity_category=EntityCategory.CONFIG,
105+
device_class=NumberDeviceClass.TEMPERATURE,
106+
native_step=0.1,
107+
mode=NumberMode.BOX,
108+
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
109+
registry=parameter_map["REG_FREE_COOLING_OUTDOOR_NIGHTTIME_DEACTIVATION_LOW_T_LIMIT"],
110+
),
111+
SystemairNumberEntityDescription(
112+
key="free_cooling_outdoor_high_limit",
113+
translation_key="free_cooling_outdoor_high_limit",
114+
entity_category=EntityCategory.CONFIG,
115+
device_class=NumberDeviceClass.TEMPERATURE,
116+
native_step=0.1,
117+
mode=NumberMode.BOX,
118+
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
119+
registry=parameter_map["REG_FREE_COOLING_OUTDOOR_NIGHTTIME_DEACTIVATION_HIGH_T_LIMIT"],
120+
),
121+
SystemairNumberEntityDescription(
122+
key="free_cooling_room_cancel_temp",
123+
translation_key="free_cooling_room_cancel_temp",
124+
entity_category=EntityCategory.CONFIG,
125+
device_class=NumberDeviceClass.TEMPERATURE,
126+
native_step=0.1,
127+
mode=NumberMode.BOX,
128+
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
129+
registry=parameter_map["REG_FREE_COOLING_ROOM_CANCEL_T"],
130+
),
131+
SystemairNumberEntityDescription(
132+
key="free_cooling_start_time_hours",
133+
translation_key="free_cooling_start_time_hours",
134+
entity_category=EntityCategory.CONFIG,
135+
native_step=1,
136+
mode=NumberMode.BOX,
137+
registry=parameter_map["REG_FREE_COOLING_START_TIME_H"],
138+
),
139+
SystemairNumberEntityDescription(
140+
key="free_cooling_start_time_minutes",
141+
translation_key="free_cooling_start_time_minutes",
142+
entity_category=EntityCategory.CONFIG,
143+
native_step=1,
144+
mode=NumberMode.BOX,
145+
registry=parameter_map["REG_FREE_COOLING_START_TIME_M"],
146+
),
147+
SystemairNumberEntityDescription(
148+
key="free_cooling_end_time_hours",
149+
translation_key="free_cooling_end_time_hours",
150+
entity_category=EntityCategory.CONFIG,
151+
native_step=1,
152+
mode=NumberMode.BOX,
153+
registry=parameter_map["REG_FREE_COOLING_END_TIME_H"],
154+
),
155+
SystemairNumberEntityDescription(
156+
key="free_cooling_end_time_minutes",
157+
translation_key="free_cooling_end_time_minutes",
158+
entity_category=EntityCategory.CONFIG,
159+
native_step=1,
160+
mode=NumberMode.BOX,
161+
registry=parameter_map["REG_FREE_COOLING_END_TIME_M"],
162+
),
101163
)
102164

103165

@@ -119,8 +181,6 @@ async def async_setup_entry(
119181
class SystemairNumber(SystemairEntity, NumberEntity):
120182
"""Representation of a Systemair Number."""
121183

122-
_attr_has_entity_name = True
123-
124184
entity_description: SystemairNumberEntityDescription
125185

126186
def __init__(
@@ -133,8 +193,11 @@ def __init__(
133193

134194
self.entity_description = entity_description
135195
self._attr_unique_id = f"{coordinator.config_entry.entry_id}-{entity_description.key}"
136-
self.native_min_value = float(entity_description.registry.min_value or 0)
137-
self.native_max_value = float(entity_description.registry.max_value or 100)
196+
197+
# Apply scale_factor to min/max values if present
198+
scale_factor = entity_description.registry.scale_factor or 1
199+
self.native_min_value = float(entity_description.registry.min_value or 0) / scale_factor
200+
self.native_max_value = float(entity_description.registry.max_value or 100) / scale_factor
138201

139202
@property
140203
def native_value(self) -> float:

custom_components/systemair/select.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,30 @@ class SystemairSelectEntityDescription(SelectEntityDescription):
6969
2: "hard",
7070
},
7171
),
72+
SystemairSelectEntityDescription(
73+
key="free_cooling_supply_fan_level",
74+
translation_key="free_cooling_supply_fan_level",
75+
icon="mdi:fan",
76+
entity_category=EntityCategory.CONFIG,
77+
registry=parameter_map["REG_FREE_COOLING_MIN_SPEED_LEVEL_SAF"],
78+
options_map={
79+
3: "normal",
80+
4: "high",
81+
5: "maximum",
82+
},
83+
),
84+
SystemairSelectEntityDescription(
85+
key="free_cooling_extract_fan_level",
86+
translation_key="free_cooling_extract_fan_level",
87+
icon="mdi:fan",
88+
entity_category=EntityCategory.CONFIG,
89+
registry=parameter_map["REG_FREE_COOLING_MIN_SPEED_LEVEL_EAF"],
90+
options_map={
91+
3: "normal",
92+
4: "high",
93+
5: "maximum",
94+
},
95+
),
7296
)
7397

7498

@@ -90,7 +114,6 @@ async def async_setup_entry(
90114
class SystemairSelect(SystemairEntity, SelectEntity):
91115
"""Systemair select class."""
92116

93-
_attr_has_entity_name = True
94117
entity_description: SystemairSelectEntityDescription
95118

96119
def __init__(

custom_components/systemair/sensor.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,6 @@ async def async_setup_entry(
328328
class SystemairSensor(SystemairEntity, SensorEntity):
329329
"""Systemair Sensor class for all sensors."""
330330

331-
_attr_has_entity_name = True
332331
entity_description: SystemairSensorEntityDescription
333332

334333
_KEY_TO_MAP: ClassVar[dict[str, dict[int, str]]] = {
@@ -423,7 +422,6 @@ def extra_state_attributes(self) -> dict[str, Any] | None:
423422
class SystemairPowerSensor(SystemairEntity, SensorEntity):
424423
"""Systemair Power Sensor class for calculated values."""
425424

426-
_attr_has_entity_name = True
427425
entity_description: SystemairPowerSensorEntityDescription
428426

429427
def __init__(
@@ -482,7 +480,6 @@ def native_value(self) -> float | None:
482480
class SystemairEnergySensor(SystemairEntity, RestoreSensor):
483481
"""Systemair Energy Sensor class."""
484482

485-
_attr_has_entity_name = True
486483
entity_description: SystemairEnergySensorEntityDescription
487484

488485
def __init__(

custom_components/systemair/switch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,14 @@ class SystemairSwitchEntityDescription(SwitchEntityDescription):
3131
SystemairSwitchEntityDescription(
3232
key="eco_mode",
3333
translation_key="eco_mode",
34+
entity_category=EntityCategory.CONFIG,
3435
icon="mdi:leaf",
3536
registry=parameter_map["REG_ECO_MODE_ON_OFF"],
3637
),
3738
SystemairSwitchEntityDescription(
3839
key="free_cooling",
3940
translation_key="free_cooling",
41+
entity_category=EntityCategory.CONFIG,
4042
icon="mdi:snowflake",
4143
registry=parameter_map["REG_FREE_COOLING_ON_OFF"],
4244
),
@@ -68,8 +70,6 @@ async def async_setup_entry(
6870
class SystemairSwitch(SystemairEntity, SwitchEntity):
6971
"""Systemair switch class."""
7072

71-
_attr_has_entity_name = True
72-
7373
entity_description: SystemairSwitchEntityDescription
7474

7575
def __init__(

custom_components/systemair/translations/en.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,27 @@
109109
},
110110
"eco_mode_temperature_offset": {
111111
"name": "Eco Mode Temperature Offset"
112+
},
113+
"free_cooling_outdoor_low_limit": {
114+
"name": "Free Cooling: Outdoor Low Limit"
115+
},
116+
"free_cooling_outdoor_high_limit": {
117+
"name": "Free Cooling: Outdoor High Limit"
118+
},
119+
"free_cooling_room_cancel_temp": {
120+
"name": "Free Cooling: Room Cancel Temperature"
121+
},
122+
"free_cooling_start_time_hours": {
123+
"name": "Free Cooling: Start Time Hours"
124+
},
125+
"free_cooling_start_time_minutes": {
126+
"name": "Free Cooling: Start Time Minutes"
127+
},
128+
"free_cooling_end_time_hours": {
129+
"name": "Free Cooling: End Time Hours"
130+
},
131+
"free_cooling_end_time_minutes": {
132+
"name": "Free Cooling: End Time Minutes"
112133
}
113134
},
114135
"sensor": {
@@ -261,6 +282,22 @@
261282
"normal": "Normal",
262283
"hard": "Hard"
263284
}
285+
},
286+
"free_cooling_supply_fan_level": {
287+
"name": "Free Cooling: Supply Fan Level",
288+
"state": {
289+
"normal": "Normal",
290+
"high": "High",
291+
"maximum": "Maximum"
292+
}
293+
},
294+
"free_cooling_extract_fan_level": {
295+
"name": "Free Cooling: Extract Fan Level",
296+
"state": {
297+
"normal": "Normal",
298+
"high": "High",
299+
"maximum": "Maximum"
300+
}
264301
}
265302
},
266303
"button": {

0 commit comments

Comments
 (0)