Skip to content

Commit fc0d1e6

Browse files
committed
Add new binary sensors:
* Compressor (calculations.ID_WEB_VD1out) * Circulating_pump_domestic_water (calculations.ID_WEB_ZIPout) * Circulating_pump_heating (calculations.ID_WEB_ZUPout) * Circulating_pump_water (calculations.ID_WEB_BUPout) * Unloading_pump (calculations.ID_WEB_HUPout) Add new sensors: * Overheating_temperature (calculations.ID_WEB_LIN_UH) * Overheating_target_temperature (calculations.ID_WEB_LIN_UH_Soll) * High_pressure (calculations.ID_WEB_LIN_HD) * Low_pressure (calculations.ID_WEB_LIN_ND) Add new config params: * PUMP_OPTIMIZATION (parameters.ID_Einst_Popt_akt) * PUMP_OPTIMIZATION_TIME (parameters.ID_Einst_Popt_Nachlauf_akt) * Pump_heat_control (parameters.ID_Einst_P155_PumpHeatCtrl) * MAXIMUM_CIRCULATION_PUMP_SPEED (parameters.ID_Einst_P155_PumpHeat_Max) * EFFICIENCY_PUMP (parameters.ID_Einst_Effizienzpumpe_akt) * Heating_room_temperature_impact_factor (parameters.ID_RBE_Einflussfaktor_RT_akt) Create room thermostat temperature only if it is activated (parameters.ID_RBE_Einflussfaktor_RT_akt) Simplify temperature names.
1 parent 6b5fd7c commit fc0d1e6

File tree

8 files changed

+287
-114
lines changed

8 files changed

+287
-114
lines changed

custom_components/luxtronik/binary_sensor.py

+90-24
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,32 @@
44

55
import homeassistant.helpers.config_validation as cv
66
import voluptuous as vol
7-
from homeassistant.components.binary_sensor import (
8-
DEVICE_CLASS_LOCK,
9-
DEVICE_CLASS_RUNNING,
10-
PLATFORM_SCHEMA,
11-
BinarySensorEntity,
12-
)
7+
from homeassistant.components.binary_sensor import (DEVICE_CLASS_LOCK,
8+
DEVICE_CLASS_RUNNING,
9+
PLATFORM_SCHEMA,
10+
BinarySensorEntity)
1311
from homeassistant.components.sensor import ENTITY_ID_FORMAT
1412
from homeassistant.config_entries import ConfigEntry
15-
from homeassistant.const import CONF_FRIENDLY_NAME, CONF_ICON, CONF_ID, CONF_SENSORS, ENTITY_CATEGORIES
13+
from homeassistant.const import (CONF_FRIENDLY_NAME, CONF_ICON, CONF_ID,
14+
CONF_SENSORS, ENTITY_CATEGORIES)
1615
from homeassistant.core import HomeAssistant
1716
from homeassistant.helpers.entity import DeviceInfo
1817
from homeassistant.helpers.entity_platform import AddEntitiesCallback
1918
from homeassistant.helpers.restore_state import RestoreEntity
2019
from homeassistant.helpers.typing import ConfigType
2120
from homeassistant.util import slugify
2221

23-
from .const import (
24-
CONF_CALCULATIONS,
25-
CONF_GROUP,
26-
CONF_INVERT_STATE,
27-
CONF_LANGUAGE_SENSOR_NAMES,
28-
CONF_PARAMETERS,
29-
CONF_VISIBILITIES,
30-
DEFAULT_DEVICE_CLASS,
31-
DEVICE_CLASSES,
32-
DOMAIN,
33-
LOGGER,
34-
LUX_BINARY_SENSOR_EVU_UNLOCKED,
35-
LUX_BINARY_SENSOR_SOLAR_PUMP,
36-
)
37-
from .helpers.helper import get_sensor_text
38-
from .luxtronik_device import LuxtronikDevice
22+
from custom_components.luxtronik.const import (CONF_CALCULATIONS, CONF_GROUP,
23+
CONF_INVERT_STATE,
24+
CONF_LANGUAGE_SENSOR_NAMES,
25+
CONF_PARAMETERS,
26+
CONF_VISIBILITIES,
27+
DEFAULT_DEVICE_CLASS,
28+
DEVICE_CLASSES, DOMAIN, LOGGER,
29+
LUX_BINARY_SENSOR_EVU_UNLOCKED,
30+
LUX_BINARY_SENSOR_SOLAR_PUMP)
31+
from custom_components.luxtronik.helpers.helper import get_sensor_text
32+
from custom_components.luxtronik.luxtronik_device import LuxtronikDevice
3933

4034
# endregion Imports
4135

@@ -154,6 +148,12 @@ async def async_setup_entry(
154148
# Build Sensor names with local language:
155149
lang = config_entry.options.get(CONF_LANGUAGE_SENSOR_NAMES)
156150
text_evu_unlocked = get_sensor_text(lang, "evu_unlocked")
151+
text_compressor = get_sensor_text(lang, "compressor")
152+
text_circulating_pump_domestic_water = get_sensor_text(lang, "circulating_pump_domestic_water")
153+
text_circulating_pump_heating = get_sensor_text(lang, "circulating_pump_heating")
154+
text_circulating_pump_water = get_sensor_text(lang, "circulating_pump_water")
155+
text_unloading_pump = get_sensor_text(lang, "unloading_pump")
156+
157157
entities = [
158158
LuxtronikBinarySensor(
159159
hass=hass,
@@ -164,9 +164,75 @@ async def async_setup_entry(
164164
name=text_evu_unlocked,
165165
icon="mdi:lock",
166166
device_class=DEVICE_CLASS_LOCK,
167-
)
167+
),
168+
LuxtronikBinarySensor(
169+
hass=hass,
170+
luxtronik=luxtronik,
171+
deviceInfo=deviceInfo,
172+
sensor_key='calculations.ID_WEB_VD1out',
173+
unique_id="compressor",
174+
name=text_compressor,
175+
icon="mdi:heat-pump",
176+
device_class=DEVICE_CLASS_RUNNING,
177+
),
178+
LuxtronikBinarySensor(
179+
hass=hass,
180+
luxtronik=luxtronik,
181+
deviceInfo=deviceInfo,
182+
sensor_key='calculations.ID_WEB_ZIPout',
183+
unique_id="circulating_pump_domestic_water",
184+
name=text_circulating_pump_domestic_water,
185+
icon="mdi:pump",
186+
device_class=DEVICE_CLASS_RUNNING,
187+
),
188+
LuxtronikBinarySensor(
189+
hass=hass,
190+
luxtronik=luxtronik,
191+
deviceInfo=deviceInfo,
192+
sensor_key='calculations.ID_WEB_ZUPout',
193+
unique_id="circulating_pump_heating",
194+
name=text_circulating_pump_heating,
195+
icon="mdi:pump",
196+
device_class=DEVICE_CLASS_RUNNING,
197+
),
198+
LuxtronikBinarySensor(
199+
hass=hass,
200+
luxtronik=luxtronik,
201+
deviceInfo=deviceInfo,
202+
sensor_key='calculations.ID_WEB_BUPout',
203+
unique_id="circulating_pump_water",
204+
name=text_circulating_pump_water,
205+
icon="mdi:pump",
206+
device_class=DEVICE_CLASS_RUNNING,
207+
),
208+
209+
# calculations.ID_WEB_ASDin Soledruck ausreichend
210+
# calculations.ID_WEB_HDin Hochdruck OK
211+
# calculations.ID_WEB_MOTin Motorschutz OK
212+
# calculations.ID_WEB_FP2out FBH Umwälzpumpe 2
213+
# calculations.ID_WEB_MA1out Mischer 1 auf
214+
# calculations.ID_WEB_MZ1out Mischer 1 zu
215+
# calculations.ID_WEB_MA2out Mischer 2 auf
216+
# calculations.ID_WEB_MZ2out Mischer 2 zu
217+
# calculations.ID_WEB_VBOout Brunnenwasserpumpe (true)
168218
]
169219

220+
deviceInfoHeating = hass.data[f"{DOMAIN}_DeviceInfo_Heating"]
221+
if deviceInfoHeating is not None:
222+
text_solar_pump = get_sensor_text(lang, "solar_pump")
223+
entities += [
224+
LuxtronikBinarySensor(
225+
hass=hass,
226+
luxtronik=luxtronik,
227+
deviceInfo=deviceInfo,
228+
sensor_key='calculations.ID_WEB_HUPout',
229+
unique_id="unloading_pump",
230+
name=text_unloading_pump,
231+
icon="mdi:pump",
232+
device_class=DEVICE_CLASS_RUNNING,
233+
),
234+
]
235+
170236
deviceInfoDomesticWater = hass.data[f"{DOMAIN}_DeviceInfo_Domestic_Water"]
171237
if deviceInfoDomesticWater is not None:
172238
text_solar_pump = get_sensor_text(lang, "solar_pump")

custom_components/luxtronik/const.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,15 @@ class LuxMode(Enum):
196196
LUX_SENSOR_STATUS3: Final = "calculations.ID_WEB_HauptMenuStatus_Zeile3"
197197

198198
LUX_SENSOR_REMOTE_MAINTENANCE: Final = "parameters.ID_Einst_Fernwartung_akt"
199+
LUX_SENSOR_PUMP_OPTIMIZATION: Final = "parameters.ID_Einst_Popt_akt"
200+
LUX_SENSOR_EFFICIENCY_PUMP: Final = "parameters.ID_Einst_Effizienzpumpe_akt"
199201

200202
LUX_SENSOR_OUTDOOR_TEMPERATURE: Final = "calculations.ID_WEB_Temperatur_TA"
201203

202-
LUX_SENSOR_HEATING_TARGET_CORRECTION: Final = "parameters.ID_Einst_WK_akt"
204+
LUX_SENSOR_PUMP_OPTIMIZATION_TIME: Final = "parameters.ID_Einst_Popt_Nachlauf_akt"
205+
LUX_SENSOR_MAXIMUM_CIRCULATION_PUMP_SPEED: Final = "parameters.ID_Einst_P155_PumpHeat_Max"
206+
LUX_SENSOR_HEATING_TEMPERATURE_CORRECTION: Final = "parameters.ID_Einst_WK_akt"
207+
LUX_SENSOR_HEATING_ROOM_TEMPERATURE_IMPACT_FACTOR: Final = "parameters.ID_RBE_Einflussfaktor_RT_akt"
203208
LUX_SENSOR_HEATING_THRESHOLD: Final = "parameters.ID_Einst_Heizgrenze"
204209
LUX_SENSOR_HEATING_THRESHOLD_TEMPERATURE: Final = "parameters.ID_Einst_Heizgrenze_Temp"
205210
LUX_SENSOR_HEATING_MIN_FLOW_OUT_TEMPERATURE: Final = "parameters.ID_Einst_Minimale_Ruecklaufsolltemperatur"
@@ -225,6 +230,7 @@ class LuxMode(Enum):
225230
LUX_SENSOR_MODE_FAN: Final = "parameters.ID_Einst_BA_Lueftung_akt"
226231
LUX_BINARY_SENSOR_EVU_UNLOCKED: Final = "calculations.ID_WEB_EVUin"
227232
LUX_BINARY_SENSOR_SOLAR_PUMP: Final = "calculations.ID_WEB_SLPout"
233+
LUX_BINARY_SENSOR_Circulation_Pump: Final = "calculations.ID_WEB_HUPout"
228234
# Future use:
229235

230236
# LUX_SENSOR_MODE_???: Final = 'parameters.ID_Ba_Sw_akt'

custom_components/luxtronik/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"domain": "luxtronik2",
33
"name": "Luxtronik",
4-
"version": "2022.11.17",
4+
"version": "2022.11.18",
55
"config_flow": true,
66
"iot_class": "local_polling",
77
"documentation": "https://www.home-assistant.io/integrations/luxtronik",

custom_components/luxtronik/number.py

+31-7
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from homeassistant.config_entries import ConfigEntry
1010
from homeassistant.const import (DEVICE_CLASS_TEMPERATURE, ENTITY_CATEGORIES,
1111
TEMP_CELSIUS,
12-
TIME_HOURS)
12+
TIME_HOURS, TIME_MINUTES, PERCENTAGE)
1313
from homeassistant.core import HomeAssistant
1414
from homeassistant.helpers.entity import DeviceInfo, EntityCategory
1515
from homeassistant.helpers.entity_platform import AddEntitiesCallback
@@ -23,12 +23,15 @@
2323
LUX_SENSOR_COOLING_STOP_DELAY,
2424
LUX_SENSOR_COOLING_TARGET,
2525
LUX_SENSOR_DOMESTIC_WATER_TARGET_TEMPERATURE,
26-
LUX_SENSOR_HEATING_CIRCUIT_CURVE1_TEMPERATURE,
27-
LUX_SENSOR_HEATING_CIRCUIT_CURVE2_TEMPERATURE,
28-
LUX_SENSOR_HEATING_CIRCUIT_CURVE_NIGHT_TEMPERATURE,
26+
LUX_SENSOR_HEATING_CIRCUIT_CURVE1_TEMPERATURE,
27+
LUX_SENSOR_HEATING_CIRCUIT_CURVE2_TEMPERATURE,
28+
LUX_SENSOR_HEATING_CIRCUIT_CURVE_NIGHT_TEMPERATURE,
2929
LUX_SENSOR_HEATING_MIN_FLOW_OUT_TEMPERATURE,
30+
LUX_SENSOR_PUMP_OPTIMIZATION_TIME,
31+
LUX_SENSOR_MAXIMUM_CIRCULATION_PUMP_SPEED,
3032
LUX_SENSOR_HEATING_TARGET_CORRECTION,
31-
LUX_SENSOR_HEATING_THRESHOLD_TEMPERATURE)
33+
LUX_SENSOR_HEATING_THRESHOLD_TEMPERATURE,
34+
LUX_SENSOR_HEATING_ROOM_TEMPERATURE_IMPACT_FACTOR)
3235
from .helpers.helper import get_sensor_text
3336

3437
# endregion Imports
@@ -60,17 +63,38 @@ async def async_setup_entry(
6063
# Build Sensor names with local language:
6164
lang = config_entry.options.get(CONF_LANGUAGE_SENSOR_NAMES)
6265
text_temp = get_sensor_text(lang, 'temperature')
63-
entities = []
66+
67+
deviceInfo = hass.data[f"{DOMAIN}_DeviceInfo"]
68+
text_pump_optimization_time = get_sensor_text(lang, 'pump_optimization_time')
69+
text_maximum_circulation_pump_speed = get_sensor_text(lang, 'maximum_circulation_pump_speed')
70+
entities = [
71+
LuxtronikNumber(
72+
hass, luxtronik, deviceInfo,
73+
number_key=LUX_SENSOR_PUMP_OPTIMIZATION_TIME,
74+
unique_id='pump_optimization_time', name=f"{text_pump_optimization_time}",
75+
icon='mdi:timer-settings', unit_of_measurement=TIME_MINUTES, min_value=5, max_value=180, step=5, mode=MODE_AUTO, entity_category=EntityCategory.CONFIG),
76+
LuxtronikNumber(
77+
hass, luxtronik, deviceInfo,
78+
number_key=LUX_SENSOR_MAXIMUM_CIRCULATION_PUMP_SPEED,
79+
unique_id='maximum_circulation_pump_speed', name=f"{text_maximum_circulation_pump_speed}",
80+
icon='mdi:speedometer', unit_of_measurement=PERCENTAGE, min_value=0, max_value=100, step=10, mode=MODE_AUTO, entity_category=EntityCategory.CONFIG)
81+
]
6482

6583
deviceInfoHeating = hass.data[f"{DOMAIN}_DeviceInfo_Heating"]
6684
if deviceInfoHeating is not None:
85+
text_heating_room_temperature_impact_factor = get_sensor_text(lang, 'heating_room_temperature_impact_factor')
6786
text_heating_threshold = get_sensor_text(lang, 'heating_threshold')
6887
text_correction = get_sensor_text(lang, 'correction')
6988
text_min_flow_out_temperature = get_sensor_text(lang, 'min_flow_out_temperature')
7089
text_heating_circuit_curve1_temperature = get_sensor_text(lang, 'circuit_curve1_temperature')
7190
text_heating_circuit_curve2_temperature = get_sensor_text(lang, 'circuit_curve2_temperature')
7291
text_heating_circuit_curve_night_temperature = get_sensor_text(lang, 'circuit_curve_night_temperature')
7392
entities += [
93+
LuxtronikNumber(
94+
hass, luxtronik, deviceInfoHeating,
95+
number_key=LUX_SENSOR_HEATING_ROOM_TEMPERATURE_IMPACT_FACTOR,
96+
unique_id='heating_room_temperature_impact_factor', name=f"{text_heating_room_temperature_impact_factor}",
97+
icon='mdi:thermometer-chevron-up', unit_of_measurement=PERCENTAGE, min_value=100, max_value=200, step=5, mode=MODE_AUTO, entity_category=EntityCategory.CONFIG),
7498
LuxtronikNumber(
7599
hass, luxtronik, deviceInfoHeating,
76100
number_key=LUX_SENSOR_HEATING_TARGET_CORRECTION,
@@ -111,7 +135,7 @@ async def async_setup_entry(
111135
LuxtronikNumber(
112136
hass, luxtronik, deviceInfoDomesticWater,
113137
number_key=LUX_SENSOR_DOMESTIC_WATER_TARGET_TEMPERATURE,
114-
unique_id='domestic_water_target_temperature', name=f"{text_domestic_water} {text_target} {text_temp}",
138+
unique_id='domestic_water_target_temperature', name=f"{text_domestic_water} {text_target}",
115139
icon='mdi:water-boiler', unit_of_measurement=TEMP_CELSIUS, min_value=40.0, max_value=60.0, step=1.0, mode=MODE_BOX)
116140
]
117141

0 commit comments

Comments
 (0)