Skip to content

Commit e1d5e6a

Browse files
committed
Add sensors
1 parent 88a1da6 commit e1d5e6a

6 files changed

Lines changed: 81 additions & 14 deletions

File tree

custom_components/luxtronik/climate.py

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,12 @@ async def async_setup_entry(
9090

9191
deviceInfoCooling = hass.data[f"{DOMAIN}_DeviceInfo_Cooling"]
9292
if deviceInfoCooling is not None:
93+
text_cooling = get_sensor_text(lang, 'cooling')
9394
entities += [
94-
LuxtronikCoolingThermostat(hass, luxtronik, deviceInfoCooling)
95+
# TODO:
96+
# LuxtronikCoolingThermostat(hass, luxtronik, deviceInfoCooling, name=text_cooling,
97+
# control_mode_home_assistant=control_mode_home_assistant,
98+
# current_temperature_sensor=LUX_SENSOR_DOMESTIC_WATER_CURRENT_TEMPERATURE, entity_category=None)
9599
]
96100

97101
async_add_entities(entities)
@@ -369,10 +373,27 @@ class LuxtronikHeatingThermostat(LuxtronikThermostat):
369373

370374

371375
class LuxtronikCoolingThermostat(LuxtronikThermostat):
372-
_unique_id = 'cooling'
373-
_name = "Kühlung"
374-
_icon = 'far:snowflake'
375-
_device_class = _unique_id
376+
_attr_unique_id = 'cooling'
377+
_attr_icon = 'mdi:snowflake'
378+
_attr_device_class: Final = f"{DOMAIN}__{_attr_unique_id}"
379+
380+
_attr_target_temperature = 20.5
381+
_attr_target_temperature_step = 0.5
382+
_attr_min_temp = 18.0
383+
_attr_max_temp = 30.0
384+
385+
# _heater_sensor: Final = LUX_SENSOR_MODE_HEATING
386+
387+
# temperature setpoint for cooling
388+
# parameters.ID_Sollwert_KuCft2_akt
389+
# 20.0
390+
391+
# parameters.ID_Einst_Kuhl_Zeit_Ein_akt
392+
# start cooling after this timeout
393+
# 12.0
376394

395+
# parameters.ID_Einst_Kuhl_Zeit_Aus_akt
396+
# stop cooling after this timeout
397+
# 12.0
377398
_heater_sensor = 'calculations.ID_WEB_FreigabKuehl'
378399
_heat_status = ['cooling']

custom_components/luxtronik/const.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ class LuxMode(Enum):
155155
LUX_SENSOR_HEATING_THRESHOLD: Final = 'parameters.ID_Einst_Heizgrenze_Temp'
156156
LUX_SENSOR_MODE_HEATING: Final = 'parameters.ID_Ba_Hz_akt'
157157

158+
LUX_SENSOR_COOLING_THRESHOLD: Final = 'parameters.ID_Einst_KuehlFreig_akt'
159+
158160
LUX_SENSOR_DOMESTIC_WATER_CURRENT_TEMPERATURE: Final = 'calculations.ID_WEB_Temperatur_TBW'
159161
LUX_SENSOR_DOMESTIC_WATER_TARGET_TEMPERATURE: Final = 'parameters.ID_Einst_BWS_akt'
160162
# LUX_SENSOR_DOMESTIC_WATER_TARGET_TEMPERATURE: Final = 'calculations.ID_WEB_Einst_BWS_akt'

custom_components/luxtronik/number.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ async def async_setup_entry(
6060
icon='mdi:plus-minus-variant', min_value=-5.0, max_value=5.0, step=0.5, mode=MODE_BOX),
6161
LuxtronikNumber(hass, luxtronik, deviceInfoHeating, number_key=LUX_SENSOR_HEATING_THRESHOLD,
6262
unique_id='heating_threshold_temperature', name=f"{text_heating_threshold}",
63-
icon='mdi:thermometer-low', unit_of_measurement=TEMP_CELSIUS, min_value=5.0, max_value=12.0, step=0.5, mode=MODE_BOX)
63+
icon='mdi:download-outline', unit_of_measurement=TEMP_CELSIUS, min_value=5.0, max_value=12.0, step=0.5, mode=MODE_BOX)
6464
]
6565

6666
deviceInfoDomesticWater = hass.data[f"{DOMAIN}_DeviceInfo_Domestic_Water"]
@@ -74,6 +74,13 @@ async def async_setup_entry(
7474
]
7575

7676
deviceInfoCooling = hass.data[f"{DOMAIN}_DeviceInfo_Cooling"]
77+
if deviceInfoCooling is not None:
78+
text_cooling_threshold_temperature = get_sensor_text(lang, 'cooling_threshold_temperature')
79+
entities += [
80+
LuxtronikNumber(hass, luxtronik, deviceInfoCooling, number_key=LUX_SENSOR_COOLING_THRESHOLD,
81+
unique_id='cooling_threshold_temperature', name=f"{text_cooling_threshold_temperature}",
82+
icon='mdi:upload-outline', unit_of_measurement=TEMP_CELSIUS, min_value=18.0, max_value=30.0, step=0.5, mode=MODE_BOX)
83+
]
7784

7885
async_add_entities(entities)
7986
# endregion Setup

custom_components/luxtronik/sensor.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ async def async_setup_entry(
104104
lang = config_entry.options.get(CONF_LANGUAGE_SENSOR_NAMES)
105105
text_time = get_sensor_text(lang, 'time')
106106
text_temp = get_sensor_text(lang, 'temperature')
107-
text_output = get_sensor_text(lang, 'output')
107+
text_heat_source_output = get_sensor_text(lang, 'heat_source_output')
108+
text_heat_source_input = get_sensor_text(lang, 'heat_source_input')
108109
text_outdoor = get_sensor_text(lang, 'outdoor')
109110
text_average = get_sensor_text(lang, 'average')
110111
text_compressor_impulses = get_sensor_text(lang, 'compressor_impulses')
@@ -126,7 +127,9 @@ async def async_setup_entry(
126127
LuxtronikSensor(hass, luxtronik, deviceInfo, 'calculations.ID_WEB_HauptMenuStatus_Zeile3',
127128
'status_line_3', 'Status 3', 'mdi:numeric-3-circle', f"{DOMAIN}__status_line_3", None, None, entity_category=ENTITY_CATEGORY_DIAGNOSTIC),
128129
LuxtronikSensor(hass, luxtronik, deviceInfo, 'calculations.ID_WEB_Temperatur_TWA',
129-
'output_temperature', f"{text_output} {text_temp}", entity_category=None),
130+
'heat_source_output_temperature', f"{text_heat_source_output} {text_temp}", entity_category=None),
131+
LuxtronikSensor(hass, luxtronik, deviceInfo, 'calculations.ID_WEB_Temperatur_TWE',
132+
'heat_source_input_temperature', f"{text_heat_source_input} {text_temp}", entity_category=None),
130133
LuxtronikSensor(hass, luxtronik, deviceInfo, 'calculations.ID_WEB_Temperatur_TA',
131134
'outdoor_temperature', f"{text_outdoor} {text_temp}", entity_category=None),
132135
LuxtronikSensor(hass, luxtronik, deviceInfo, 'calculations.ID_WEB_Mitteltemperatur',
Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,33 @@
11
{
22
"average": "Mittel",
3-
"outdoor": "Außen",
4-
"output": "Ausgang",
3+
"outdoor": "Aussen",
4+
"heat_source_output": "Heizquelle Ausgang",
5+
"heat_source_input": "Heizquelle Eingang",
56
"time": "Zeit",
67
"domestic_water": "Brauchwasser",
8+
"cooling": "K\u00fchlung",
79
"target": "Soll",
810
"temperature": "Temperatur",
911
"buffer": "Puffer",
1012
"collector": "Kollektor",
1113
"flow_in": "Vorlauf",
12-
"flow_out": "Rücklauf",
14+
"flow_out": "R\u00fccklauf",
1315
"correction": "Korrektur",
1416
"heating": "Heizung",
15-
"heatpump": "Wärmepumpe"
17+
"heating_mode_auto": "Heizungsmodus Automatik",
18+
"domestic_water_mode_auto": "Brauchwassermodus Automatik",
19+
"heatpump": "W\u00e4rmepumpe",
20+
"heating_threshold": "Heizgrenze",
21+
"evu_unlocked": "Sperrzeit Freigabe",
22+
"solar_pump": "Solar Pumpe",
23+
"compressor_impulses": "Impulse Verdichter",
24+
"operation_hours": "Betriebsstunden Gesamt",
25+
"operation_hours_heating": "Betriebsstunden Heizung",
26+
"operation_hours_domestic_water": "Betriebsstunden Brauchwasser",
27+
"operation_hours_solar": "Betriebsstunden Solar",
28+
"operation_hours_cooling": "Betriebsstunden K\u00fchlung",
29+
"heat_amount_counter": "W\u00e4rmemenge Z\u00e4hler",
30+
"heat_amount_heating": "W\u00e4rmemenge Heizung",
31+
"heat_amount_domestic_water": "W\u00e4rmemenge Brauchwasser",
32+
"approval_cooling": "K\u00fchlung Freigabe"
1633
}
Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
{
22
"average": "Average",
33
"outdoor": "Outdoor",
4-
"output": "Output",
4+
"heat_source_output": "Heat source output",
5+
"heat_source_input": "Heat source input",
56
"time": "Time",
67
"domestic_water": "Domestic Water",
8+
"cooling": "Cooling",
79
"target": "Target",
810
"temperature": "Temperature",
911
"buffer": "Buffer",
@@ -12,5 +14,20 @@
1214
"flow_out": "Flow Out",
1315
"correction": "Correction",
1416
"heating": "Heating",
15-
"heatpump": "Heatpump"
17+
"heating_mode_auto": "Heating mode automatic",
18+
"domestic_water_mode_auto": "Domestic Water mode automatic",
19+
"heatpump": "Heatpump",
20+
"heating_threshold": "Heating Threshold",
21+
"evu_unlocked": "Locktime",
22+
"solar_pump": "Solarpump",
23+
"compressor_impulses": "Compressor Impulses",
24+
"operation_hours": "Operation hours",
25+
"operation_hours_heating": "Operation hours heating",
26+
"operation_hours_domestic_water": "Operation hours domestic water",
27+
"operation_hours_solar": "Operation hours solar",
28+
"operation_hours_cooling": "Operation hours cooling",
29+
"heat_amount_counter": "Heat amount counter",
30+
"heat_amount_heating": "Heat amount heating",
31+
"heat_amount_domestic_water": "Heat amount domestic water",
32+
"approval_cooling": "Approval cooling"
1633
}

0 commit comments

Comments
 (0)