Skip to content

Commit

Permalink
* Added additional sensors for flow in temperatur and target of circu…
Browse files Browse the repository at this point in the history
…it 2 and 3

* Added counter of additional heat  generator2
  • Loading branch information
toggm committed Oct 29, 2024
1 parent 215c8ab commit 6871771
Show file tree
Hide file tree
Showing 10 changed files with 178 additions and 4 deletions.
30 changes: 30 additions & 0 deletions custom_components/luxtronik/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,36 @@ def _up(ident: str, new_id: SK, platform: P = P.SENSOR) -> None:
config_entry.version = 7
hass.config_entries.async_update_entry(config_entry, data=new_data)

if config_entry.version == 7:
_up(
"flow_in_circuit2_temperature",
SK.FLOW_IN_CIRCUIT2_TEMPERATURE,
P.NUMBER,
)
_up(
"flow_in_circuit3_temperature",
SK.FLOW_IN_CIRCUIT3_TEMPERATURE,
P.NUMBER,
)
_up(
"flow_in_circuit2_target_temperature",
SK.FLOW_IN_CIRCUIT2_TARGET_TEMPERATURE,
P.NUMBER,
)
_up(
"flow_in_circuit3_target_temperature",
SK.FLOW_IN_CIRCUIT3_TARGET_TEMPERATURE,
P.NUMBER,
)
_up(
"additional_heat_generator2_operation_hours",
SK.ADDITIONAL_HEAT_GENERATOR2_OPERATION_HOURS,
P.NUMBER,
)

new_data = {**config_entry.data}
hass.config_entries.async_update_entry(config_entry, data=new_data)

LOGGER.info("Migration to version %s successful", config_entry.version)

return True
Expand Down
2 changes: 1 addition & 1 deletion custom_components/luxtronik/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ async def _async_has_devices(hass: HomeAssistant) -> bool:
class LuxtronikFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
"""Handle a Luxtronik heatpump controller config flow."""

VERSION = 7
VERSION = 8
_hassio_discovery = None
_discovery_host = None
_discovery_port = None
Expand Down
19 changes: 18 additions & 1 deletion custom_components/luxtronik/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,11 @@ class LuxCalculation(StrEnum):
C0015_OUTDOOR_TEMPERATURE: Final = "calculations.ID_WEB_Temperatur_TA"
C0016_OUTDOOR_TEMPERATURE_AVERAGE: Final = "calculations.ID_WEB_Mitteltemperatur"
C0017_DHW_TEMPERATURE: Final = "calculations.ID_WEB_Temperatur_TBW"
C0020_HEAT_SOURCE_OUTPUT_TEMPERATURE: Final = "calculations.ID_WEB_Temperatur_TWA"
C0018_FLOW_IN_CIRCUIT2_TEMPERATURE: Final = "calculations.ID_WEB_Temperatur_TFB1"
C0019_FLOW_IN_CIRCUIT3_TEMPERATURE: Final = "calculations.ID_WEB_Temperatur_TFB2"
C0020_FLOW_IN_CIRCUIT2_TARGET_TEMPERATURE: Final = "calculations.ID_WEB_Sollwert_TVL_MK1"
C0021_FLOW_IN_CIRCUIT3_TARGET_TEMPERATURE: Final = "calculations.ID_WEB_Sollwert_TVL_MK2"
C0022_HEAT_SOURCE_OUTPUT_TEMPERATURE: Final = "calculations.ID_WEB_Temperatur_TWA"
C0026_SOLAR_COLLECTOR_TEMPERATURE: Final = "calculations.ID_WEB_Temperatur_TSK"
C0027_SOLAR_BUFFER_TEMPERATURE: Final = "calculations.ID_WEB_Temperatur_TSS"
C0029_DEFROST_END_FLOW_OKAY: Final = "calculations.ID_WEB_ASDin"
Expand Down Expand Up @@ -437,6 +441,9 @@ class LuxCalculation(StrEnum):
C0060_ADDITIONAL_HEAT_GENERATOR_OPERATION_HOURS: Final = (
"calculations.ID_WEB_Zaehler_BetrZeitZWE1"
)
C0061_ADDITIONAL_HEAT_GENERATOR2_OPERATION_HOURS: Final = (
"calculations.ID_WEB_Zaehler_BetrZeitZWE2"
)
C0063_OPERATION_HOURS: Final = "calculations.ID_WEB_Zaehler_BetrZeitWP"
C0064_OPERATION_HOURS_HEATING: Final = "calculations.ID_WEB_Zaehler_BetrZeitHz"
C0065_DHW_OPERATION_HOURS: Final = "calculations.ID_WEB_Zaehler_BetrZeitBW"
Expand Down Expand Up @@ -539,6 +546,9 @@ class LuxVisibility(StrEnum):
V0086_ADDITIONAL_HEAT_GENERATOR_OPERATION_HOURS: Final = (
"visibilities.ID_Visi_Bst_BStdZWE1"
)
V0087_ADDITIONAL_HEAT_GENERATOR2_OPERATION_HOURS: Final = (
"visibilities.ID_Visi_Bst_BStdZWE2"
)
V0105_HEAT_SOURCE_INPUT_TEMPERATURE_MIN: Final = "visibilities.ID_Visi_EinstTemp_TWQmin"
V0121_EVU_LOCKED: Final = "visibilities.ID_Visi_SysEin_EVUSperre"
V0122_ROOM_THERMOSTAT: Final = "visibilities.ID_Visi_SysEin_Raumstation"
Expand Down Expand Up @@ -601,6 +611,9 @@ class SensorKey(StrEnum):
ADDITIONAL_HEAT_GENERATOR_OPERATION_HOURS = (
"additional_heat_generator_operation_hours"
)
ADDITIONAL_HEAT_GENERATOR2_OPERATION_HOURS = (
"additional_heat_generator2_operation_hours"
)
ADDITIONAL_HEAT_GENERATOR_AMOUNT_COUNTER = (
"additional_heat_generator_amount_counter"
)
Expand All @@ -617,6 +630,10 @@ class SensorKey(StrEnum):
HEAT_SOURCE_OUTPUT_TEMPERATURE = "heat_source_output_temperature"
ERROR_REASON = "error_reason"
FLOW_IN_TEMPERATURE = "flow_in_temperature"
FLOW_IN_CIRCUIT2_TEMPERATURE = "flow_in_circuit2_temperature"
FLOW_IN_CIRCUIT3_TEMPERATURE = "flow_in_circuit3_temperature"
FLOW_IN_CIRCUIT2_TARGET_TEMPERATURE = "flow_in_circuit2_target_temperature"
FLOW_IN_CIRCUIT3_TARGET_TEMPERATURE = "flow_in_circuit3_target_temperature"
FLOW_OUT_TEMPERATURE = "flow_out_temperature"
FLOW_OUT_TEMPERATURE_TARGET = "flow_out_temperature_target"
FLOW_OUT_TEMPERATURE_EXTERNAL = "flow_out_temperature_external"
Expand Down
2 changes: 1 addition & 1 deletion custom_components/luxtronik/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def _handle_coordinator_update(
T_in = self._get_value(LC.C0010_FLOW_IN_TEMPERATURE)
T_out = self._get_value(LC.C0011_FLOW_OUT_TEMPERATURE)
T_heat_in = self._get_value(LC.C0204_HEAT_SOURCE_INPUT_TEMPERATURE)
T_heat_out = self._get_value(LC.C0020_HEAT_SOURCE_OUTPUT_TEMPERATURE)
T_heat_out = self._get_value(LC.C0022_HEAT_SOURCE_OUTPUT_TEMPERATURE)
Flow_WQ = self._get_value(LC.C0173_HEAT_SOURCE_FLOW_RATE)
Pump = self._get_value(LC.C0043_PUMP_FLOW)
if (T_out > T_in) and (T_heat_out > T_heat_in) and (Flow_WQ > 0) and Pump:
Expand Down
54 changes: 53 additions & 1 deletion custom_components/luxtronik/sensor_entities_predefined.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,18 @@
native_precision=2,
update_interval=UPDATE_INTERVAL_VERY_SLOW,
),
descr(
key=SensorKey.ADDITIONAL_HEAT_GENERATOR2_OPERATION_HOURS,
luxtronik_key=LC.C0061_ADDITIONAL_HEAT_GENERATOR2_OPERATION_HOURS,
icon="mdi:timer-sand",
state_class=SensorStateClass.TOTAL_INCREASING,
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfTime.HOURS,
visibility=LV.V0087_ADDITIONAL_HEAT_GENERATOR2_OPERATION_HOURS,
factor=SECOUND_TO_HOUR_FACTOR,
native_precision=2,
update_interval=UPDATE_INTERVAL_VERY_SLOW,
),
descr(
key=SensorKey.ADDITIONAL_HEAT_GENERATOR_AMOUNT_COUNTER,
luxtronik_key=LP.P1059_ADDITIONAL_HEAT_GENERATOR_AMOUNT_COUNTER,
Expand Down Expand Up @@ -438,7 +450,7 @@
),
descr(
key=SensorKey.HEAT_SOURCE_OUTPUT_TEMPERATURE,
luxtronik_key=LC.C0020_HEAT_SOURCE_OUTPUT_TEMPERATURE,
luxtronik_key=LC.C0022_HEAT_SOURCE_OUTPUT_TEMPERATURE,
icon="mdi:thermometer",
state_class=SensorStateClass.MEASUREMENT,
device_class=SensorDeviceClass.TEMPERATURE,
Expand Down Expand Up @@ -488,6 +500,46 @@
),
),
),
descr(
key=SensorKey.FLOW_IN_CIRCUIT2_TEMPERATURE,
luxtronik_key=LC.C0018_FLOW_IN_CIRCUIT2_TEMPERATURE,
device_key=DeviceKey.heating,
entity_category=None,
icon="mdi:waves-arrow-right",
state_class=SensorStateClass.MEASUREMENT,
device_class=SensorDeviceClass.TEMPERATURE,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
),
descr(
key=SensorKey.FLOW_IN_CIRCUIT3_TEMPERATURE,
luxtronik_key=LC.C0019_FLOW_IN_CIRCUIT3_TEMPERATURE,
device_key=DeviceKey.heating,
entity_category=None,
icon="mdi:waves-arrow-right",
state_class=SensorStateClass.MEASUREMENT,
device_class=SensorDeviceClass.TEMPERATURE,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
),
descr(
key=SensorKey.FLOW_IN_CIRCUIT2_TARGET_TEMPERATURE,
luxtronik_key=LC.C0020_FLOW_IN_CIRCUIT2_TARGET_TEMPERATURE,
device_key=DeviceKey.heating,
entity_category=None,
icon="mdi:thermometer",
state_class=SensorStateClass.MEASUREMENT,
device_class=SensorDeviceClass.TEMPERATURE,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
),
descr(
key=SensorKey.FLOW_IN_CIRCUIT3_TARGET_TEMPERATURE,
luxtronik_key=LC.C0021_FLOW_IN_CIRCUIT3_TARGET_TEMPERATURE,
device_key=DeviceKey.heating,
entity_category=None,
icon="mdi:thermometer",
state_class=SensorStateClass.MEASUREMENT,
device_class=SensorDeviceClass.TEMPERATURE,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
),
descr(
key=SensorKey.FLOW_OUT_TEMPERATURE,
luxtronik_key=LC.C0011_FLOW_OUT_TEMPERATURE,
Expand Down
15 changes: 15 additions & 0 deletions custom_components/luxtronik/translations/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
"additional_heat_generator": {
"name": "P\u0159\u00eddavn\u00fd zdroj tepla"
},
"additional_heat_generator2": {
"name": "P\u0159\u00eddavn\u00fd zdroj tepla 2"
},
"disturbance_output": {
"name": "Stav syst\u00e9mu"
},
Expand Down Expand Up @@ -711,6 +714,18 @@
"flow_in_temperature": {
"name": "Teplota vstupu"
},
"flow_in_circuit2_temperature": {
"name": "Okruh vstupní teploty 2"
},
"flow_in_circuit3_temperature": {
"name": "Okruh vstupní teploty 3"
},
"flow_in_circuit2_target_temperature": {
"name": "Obvod cílové teploty vstupu 2"
},
"flow_in_circuit3_target_temperature": {
"name": "Obvod cílové teploty vstupu 3"
},
"flow_out_temperature": {
"name": "Teplota zp\u00e1te\u010dky"
},
Expand Down
15 changes: 15 additions & 0 deletions custom_components/luxtronik/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
"additional_heat_generator": {
"name": "Zus\u00e4tzlicher W\u00e4rmeerzeuger"
},
"additional_heat_generator2": {
"name": "Zus\u00e4tzlicher W\u00e4rmeerzeuger 2"
},
"disturbance_output": {
"name": "Systemzustand"
},
Expand Down Expand Up @@ -713,6 +716,18 @@
"flow_in_temperature": {
"name": "Vorlauf Temperatur"
},
"flow_in_circuit2_temperature": {
"name": "Vorlauf Temperatur MK2"
},
"flow_in_circuit3_temperature": {
"name": "Vorlauf Temperatur MK3"
},
"flow_in_circuit2_target_temperature": {
"name": "Vorlauf Soll Temperatur MK2"
},
"flow_in_circuit3_target_temperature": {
"name": "Vorlauf Soll Temperatur MK3"
},
"flow_out_temperature": {
"name": "R\u00fccklauf Temperatur"
},
Expand Down
15 changes: 15 additions & 0 deletions custom_components/luxtronik/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
"additional_heat_generator": {
"name": "Additional heat generator"
},
"additional_heat_generator2": {
"name": "Additional heat generator 2"
},
"disturbance_output": {
"name": "Systemhealth"
},
Expand Down Expand Up @@ -478,6 +481,18 @@
"flow_in_temperature": {
"name": "Flow in temperature"
},
"flow_in_circuit2_temperature": {
"name": "Flow in temperature circuit 2"
},
"flow_in_circuit3_temperature": {
"name": "Flow in temperature circuit 3"
},
"flow_in_circuit2_target_temperature": {
"name": "Flow in target temperature circuit 2"
},
"flow_in_circuit3_target_temperature": {
"name": "Flow in target temperature circuit 3"
},
"flow_out_temperature": {
"name": "Flow out temperature"
},
Expand Down
15 changes: 15 additions & 0 deletions custom_components/luxtronik/translations/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
"additional_heat_generator": {
"name": "Extra warmtegenerator"
},
"additional_heat_generator2": {
"name": "Extra warmtegenerator 2"
},
"disturbance_output": {
"name": "Systeemstatus"
},
Expand Down Expand Up @@ -707,6 +710,18 @@
"flow_in_temperature": {
"name": "Aanvoertemperatuur"
},
"flow_in_circuit2_temperature": {
"name": "Circuit van de aanvoertemperatuur 2"
},
"flow_in_circuit3_temperature": {
"name": "Circuit van de aanvoertemperatuur 3"
},
"flow_in_circuit2_target_temperature": {
"name": "Voeding doeltemperatuurcircuit 2"
},
"flow_in_circuit3_target_temperature": {
"name": "Voeding doeltemperatuurcircuit 3"
},
"flow_out_temperature": {
"name": "Retourtemperatuur"
},
Expand Down
15 changes: 15 additions & 0 deletions custom_components/luxtronik/translations/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
"additional_heat_generator": {
"name": "Dodatkowy generator ciep\u0142a"
},
"additional_heat_generator2": {
"name": "Dodatkowy generator ciep\u0142a 2"
},
"disturbance_output": {
"name": "Stan systemu"
},
Expand Down Expand Up @@ -415,6 +418,18 @@
"flow_in_temperature": {
"name": "Temperatura na wej\u015Bciu"
},
"flow_in_circuit2_temperature": {
"name": "Obwód temperatury wlotowej 2"
},
"flow_in_circuit3_temperature": {
"name": "Obwód temperatury wlotowej 3"
},
"flow_in_circuit2_target_temperature": {
"name": "Obwód docelowej temperatury na wlocie 2"
},
"flow_in_circuit3_target_temperature": {
"name": "Obwód docelowej temperatury na wlocie 3"
},
"flow_out_temperature": {
"name": "Temperatura na wyj\u015Bciu"
},
Expand Down

0 comments on commit 6871771

Please sign in to comment.