From fc0d1e60fadea1e8a05261bdca424f75d5a96b77 Mon Sep 17 00:00:00 2001 From: BenPru Date: Fri, 18 Nov 2022 23:20:42 +0100 Subject: [PATCH] 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. --- custom_components/luxtronik/binary_sensor.py | 114 ++++++++--- custom_components/luxtronik/const.py | 8 +- custom_components/luxtronik/manifest.json | 2 +- custom_components/luxtronik/number.py | 38 +++- custom_components/luxtronik/sensor.py | 178 ++++++++++-------- custom_components/luxtronik/switch.py | 25 ++- .../luxtronik/translations/texts.de.json | 19 +- .../luxtronik/translations/texts.en.json | 17 +- 8 files changed, 287 insertions(+), 114 deletions(-) diff --git a/custom_components/luxtronik/binary_sensor.py b/custom_components/luxtronik/binary_sensor.py index 6632739..67de7c4 100644 --- a/custom_components/luxtronik/binary_sensor.py +++ b/custom_components/luxtronik/binary_sensor.py @@ -4,15 +4,14 @@ import homeassistant.helpers.config_validation as cv import voluptuous as vol -from homeassistant.components.binary_sensor import ( - DEVICE_CLASS_LOCK, - DEVICE_CLASS_RUNNING, - PLATFORM_SCHEMA, - BinarySensorEntity, -) +from homeassistant.components.binary_sensor import (DEVICE_CLASS_LOCK, + DEVICE_CLASS_RUNNING, + PLATFORM_SCHEMA, + BinarySensorEntity) from homeassistant.components.sensor import ENTITY_ID_FORMAT from homeassistant.config_entries import ConfigEntry -from homeassistant.const import CONF_FRIENDLY_NAME, CONF_ICON, CONF_ID, CONF_SENSORS, ENTITY_CATEGORIES +from homeassistant.const import (CONF_FRIENDLY_NAME, CONF_ICON, CONF_ID, + CONF_SENSORS, ENTITY_CATEGORIES) from homeassistant.core import HomeAssistant from homeassistant.helpers.entity import DeviceInfo from homeassistant.helpers.entity_platform import AddEntitiesCallback @@ -20,22 +19,17 @@ from homeassistant.helpers.typing import ConfigType from homeassistant.util import slugify -from .const import ( - CONF_CALCULATIONS, - CONF_GROUP, - CONF_INVERT_STATE, - CONF_LANGUAGE_SENSOR_NAMES, - CONF_PARAMETERS, - CONF_VISIBILITIES, - DEFAULT_DEVICE_CLASS, - DEVICE_CLASSES, - DOMAIN, - LOGGER, - LUX_BINARY_SENSOR_EVU_UNLOCKED, - LUX_BINARY_SENSOR_SOLAR_PUMP, -) -from .helpers.helper import get_sensor_text -from .luxtronik_device import LuxtronikDevice +from custom_components.luxtronik.const import (CONF_CALCULATIONS, CONF_GROUP, + CONF_INVERT_STATE, + CONF_LANGUAGE_SENSOR_NAMES, + CONF_PARAMETERS, + CONF_VISIBILITIES, + DEFAULT_DEVICE_CLASS, + DEVICE_CLASSES, DOMAIN, LOGGER, + LUX_BINARY_SENSOR_EVU_UNLOCKED, + LUX_BINARY_SENSOR_SOLAR_PUMP) +from custom_components.luxtronik.helpers.helper import get_sensor_text +from custom_components.luxtronik.luxtronik_device import LuxtronikDevice # endregion Imports @@ -154,6 +148,12 @@ async def async_setup_entry( # Build Sensor names with local language: lang = config_entry.options.get(CONF_LANGUAGE_SENSOR_NAMES) text_evu_unlocked = get_sensor_text(lang, "evu_unlocked") + text_compressor = get_sensor_text(lang, "compressor") + text_circulating_pump_domestic_water = get_sensor_text(lang, "circulating_pump_domestic_water") + text_circulating_pump_heating = get_sensor_text(lang, "circulating_pump_heating") + text_circulating_pump_water = get_sensor_text(lang, "circulating_pump_water") + text_unloading_pump = get_sensor_text(lang, "unloading_pump") + entities = [ LuxtronikBinarySensor( hass=hass, @@ -164,9 +164,75 @@ async def async_setup_entry( name=text_evu_unlocked, icon="mdi:lock", device_class=DEVICE_CLASS_LOCK, - ) + ), + LuxtronikBinarySensor( + hass=hass, + luxtronik=luxtronik, + deviceInfo=deviceInfo, + sensor_key='calculations.ID_WEB_VD1out', + unique_id="compressor", + name=text_compressor, + icon="mdi:heat-pump", + device_class=DEVICE_CLASS_RUNNING, + ), + LuxtronikBinarySensor( + hass=hass, + luxtronik=luxtronik, + deviceInfo=deviceInfo, + sensor_key='calculations.ID_WEB_ZIPout', + unique_id="circulating_pump_domestic_water", + name=text_circulating_pump_domestic_water, + icon="mdi:pump", + device_class=DEVICE_CLASS_RUNNING, + ), + LuxtronikBinarySensor( + hass=hass, + luxtronik=luxtronik, + deviceInfo=deviceInfo, + sensor_key='calculations.ID_WEB_ZUPout', + unique_id="circulating_pump_heating", + name=text_circulating_pump_heating, + icon="mdi:pump", + device_class=DEVICE_CLASS_RUNNING, + ), + LuxtronikBinarySensor( + hass=hass, + luxtronik=luxtronik, + deviceInfo=deviceInfo, + sensor_key='calculations.ID_WEB_BUPout', + unique_id="circulating_pump_water", + name=text_circulating_pump_water, + icon="mdi:pump", + device_class=DEVICE_CLASS_RUNNING, + ), + + # calculations.ID_WEB_ASDin Soledruck ausreichend + # calculations.ID_WEB_HDin Hochdruck OK + # calculations.ID_WEB_MOTin Motorschutz OK + # calculations.ID_WEB_FP2out FBH Umwälzpumpe 2 + # calculations.ID_WEB_MA1out Mischer 1 auf + # calculations.ID_WEB_MZ1out Mischer 1 zu + # calculations.ID_WEB_MA2out Mischer 2 auf + # calculations.ID_WEB_MZ2out Mischer 2 zu + # calculations.ID_WEB_VBOout Brunnenwasserpumpe (true) ] + deviceInfoHeating = hass.data[f"{DOMAIN}_DeviceInfo_Heating"] + if deviceInfoHeating is not None: + text_solar_pump = get_sensor_text(lang, "solar_pump") + entities += [ + LuxtronikBinarySensor( + hass=hass, + luxtronik=luxtronik, + deviceInfo=deviceInfo, + sensor_key='calculations.ID_WEB_HUPout', + unique_id="unloading_pump", + name=text_unloading_pump, + icon="mdi:pump", + device_class=DEVICE_CLASS_RUNNING, + ), + ] + deviceInfoDomesticWater = hass.data[f"{DOMAIN}_DeviceInfo_Domestic_Water"] if deviceInfoDomesticWater is not None: text_solar_pump = get_sensor_text(lang, "solar_pump") diff --git a/custom_components/luxtronik/const.py b/custom_components/luxtronik/const.py index 1d51188..fe8af37 100644 --- a/custom_components/luxtronik/const.py +++ b/custom_components/luxtronik/const.py @@ -196,10 +196,15 @@ class LuxMode(Enum): LUX_SENSOR_STATUS3: Final = "calculations.ID_WEB_HauptMenuStatus_Zeile3" LUX_SENSOR_REMOTE_MAINTENANCE: Final = "parameters.ID_Einst_Fernwartung_akt" +LUX_SENSOR_PUMP_OPTIMIZATION: Final = "parameters.ID_Einst_Popt_akt" +LUX_SENSOR_EFFICIENCY_PUMP: Final = "parameters.ID_Einst_Effizienzpumpe_akt" LUX_SENSOR_OUTDOOR_TEMPERATURE: Final = "calculations.ID_WEB_Temperatur_TA" -LUX_SENSOR_HEATING_TARGET_CORRECTION: Final = "parameters.ID_Einst_WK_akt" +LUX_SENSOR_PUMP_OPTIMIZATION_TIME: Final = "parameters.ID_Einst_Popt_Nachlauf_akt" +LUX_SENSOR_MAXIMUM_CIRCULATION_PUMP_SPEED: Final = "parameters.ID_Einst_P155_PumpHeat_Max" +LUX_SENSOR_HEATING_TEMPERATURE_CORRECTION: Final = "parameters.ID_Einst_WK_akt" +LUX_SENSOR_HEATING_ROOM_TEMPERATURE_IMPACT_FACTOR: Final = "parameters.ID_RBE_Einflussfaktor_RT_akt" LUX_SENSOR_HEATING_THRESHOLD: Final = "parameters.ID_Einst_Heizgrenze" LUX_SENSOR_HEATING_THRESHOLD_TEMPERATURE: Final = "parameters.ID_Einst_Heizgrenze_Temp" LUX_SENSOR_HEATING_MIN_FLOW_OUT_TEMPERATURE: Final = "parameters.ID_Einst_Minimale_Ruecklaufsolltemperatur" @@ -225,6 +230,7 @@ class LuxMode(Enum): LUX_SENSOR_MODE_FAN: Final = "parameters.ID_Einst_BA_Lueftung_akt" LUX_BINARY_SENSOR_EVU_UNLOCKED: Final = "calculations.ID_WEB_EVUin" LUX_BINARY_SENSOR_SOLAR_PUMP: Final = "calculations.ID_WEB_SLPout" +LUX_BINARY_SENSOR_Circulation_Pump: Final = "calculations.ID_WEB_HUPout" # Future use: # LUX_SENSOR_MODE_???: Final = 'parameters.ID_Ba_Sw_akt' diff --git a/custom_components/luxtronik/manifest.json b/custom_components/luxtronik/manifest.json index d6d0cfd..612ac9e 100644 --- a/custom_components/luxtronik/manifest.json +++ b/custom_components/luxtronik/manifest.json @@ -1,7 +1,7 @@ { "domain": "luxtronik2", "name": "Luxtronik", - "version": "2022.11.17", + "version": "2022.11.18", "config_flow": true, "iot_class": "local_polling", "documentation": "https://www.home-assistant.io/integrations/luxtronik", diff --git a/custom_components/luxtronik/number.py b/custom_components/luxtronik/number.py index c85b24b..17a275d 100644 --- a/custom_components/luxtronik/number.py +++ b/custom_components/luxtronik/number.py @@ -9,7 +9,7 @@ from homeassistant.config_entries import ConfigEntry from homeassistant.const import (DEVICE_CLASS_TEMPERATURE, ENTITY_CATEGORIES, TEMP_CELSIUS, - TIME_HOURS) + TIME_HOURS, TIME_MINUTES, PERCENTAGE) from homeassistant.core import HomeAssistant from homeassistant.helpers.entity import DeviceInfo, EntityCategory from homeassistant.helpers.entity_platform import AddEntitiesCallback @@ -23,12 +23,15 @@ LUX_SENSOR_COOLING_STOP_DELAY, LUX_SENSOR_COOLING_TARGET, LUX_SENSOR_DOMESTIC_WATER_TARGET_TEMPERATURE, - LUX_SENSOR_HEATING_CIRCUIT_CURVE1_TEMPERATURE, - LUX_SENSOR_HEATING_CIRCUIT_CURVE2_TEMPERATURE, - LUX_SENSOR_HEATING_CIRCUIT_CURVE_NIGHT_TEMPERATURE, + LUX_SENSOR_HEATING_CIRCUIT_CURVE1_TEMPERATURE, + LUX_SENSOR_HEATING_CIRCUIT_CURVE2_TEMPERATURE, + LUX_SENSOR_HEATING_CIRCUIT_CURVE_NIGHT_TEMPERATURE, LUX_SENSOR_HEATING_MIN_FLOW_OUT_TEMPERATURE, + LUX_SENSOR_PUMP_OPTIMIZATION_TIME, + LUX_SENSOR_MAXIMUM_CIRCULATION_PUMP_SPEED, LUX_SENSOR_HEATING_TARGET_CORRECTION, - LUX_SENSOR_HEATING_THRESHOLD_TEMPERATURE) + LUX_SENSOR_HEATING_THRESHOLD_TEMPERATURE, + LUX_SENSOR_HEATING_ROOM_TEMPERATURE_IMPACT_FACTOR) from .helpers.helper import get_sensor_text # endregion Imports @@ -60,10 +63,26 @@ async def async_setup_entry( # Build Sensor names with local language: lang = config_entry.options.get(CONF_LANGUAGE_SENSOR_NAMES) text_temp = get_sensor_text(lang, 'temperature') - entities = [] + + deviceInfo = hass.data[f"{DOMAIN}_DeviceInfo"] + text_pump_optimization_time = get_sensor_text(lang, 'pump_optimization_time') + text_maximum_circulation_pump_speed = get_sensor_text(lang, 'maximum_circulation_pump_speed') + entities = [ + LuxtronikNumber( + hass, luxtronik, deviceInfo, + number_key=LUX_SENSOR_PUMP_OPTIMIZATION_TIME, + unique_id='pump_optimization_time', name=f"{text_pump_optimization_time}", + icon='mdi:timer-settings', unit_of_measurement=TIME_MINUTES, min_value=5, max_value=180, step=5, mode=MODE_AUTO, entity_category=EntityCategory.CONFIG), + LuxtronikNumber( + hass, luxtronik, deviceInfo, + number_key=LUX_SENSOR_MAXIMUM_CIRCULATION_PUMP_SPEED, + unique_id='maximum_circulation_pump_speed', name=f"{text_maximum_circulation_pump_speed}", + icon='mdi:speedometer', unit_of_measurement=PERCENTAGE, min_value=0, max_value=100, step=10, mode=MODE_AUTO, entity_category=EntityCategory.CONFIG) + ] deviceInfoHeating = hass.data[f"{DOMAIN}_DeviceInfo_Heating"] if deviceInfoHeating is not None: + text_heating_room_temperature_impact_factor = get_sensor_text(lang, 'heating_room_temperature_impact_factor') text_heating_threshold = get_sensor_text(lang, 'heating_threshold') text_correction = get_sensor_text(lang, 'correction') text_min_flow_out_temperature = get_sensor_text(lang, 'min_flow_out_temperature') @@ -71,6 +90,11 @@ async def async_setup_entry( text_heating_circuit_curve2_temperature = get_sensor_text(lang, 'circuit_curve2_temperature') text_heating_circuit_curve_night_temperature = get_sensor_text(lang, 'circuit_curve_night_temperature') entities += [ + LuxtronikNumber( + hass, luxtronik, deviceInfoHeating, + number_key=LUX_SENSOR_HEATING_ROOM_TEMPERATURE_IMPACT_FACTOR, + unique_id='heating_room_temperature_impact_factor', name=f"{text_heating_room_temperature_impact_factor}", + icon='mdi:thermometer-chevron-up', unit_of_measurement=PERCENTAGE, min_value=100, max_value=200, step=5, mode=MODE_AUTO, entity_category=EntityCategory.CONFIG), LuxtronikNumber( hass, luxtronik, deviceInfoHeating, number_key=LUX_SENSOR_HEATING_TARGET_CORRECTION, @@ -111,7 +135,7 @@ async def async_setup_entry( LuxtronikNumber( hass, luxtronik, deviceInfoDomesticWater, number_key=LUX_SENSOR_DOMESTIC_WATER_TARGET_TEMPERATURE, - unique_id='domestic_water_target_temperature', name=f"{text_domestic_water} {text_target} {text_temp}", + unique_id='domestic_water_target_temperature', name=f"{text_domestic_water} {text_target}", icon='mdi:water-boiler', unit_of_measurement=TEMP_CELSIUS, min_value=40.0, max_value=60.0, step=1.0, mode=MODE_BOX) ] diff --git a/custom_components/luxtronik/sensor.py b/custom_components/luxtronik/sensor.py index ef95cc5..06e2891 100644 --- a/custom_components/luxtronik/sensor.py +++ b/custom_components/luxtronik/sensor.py @@ -1,64 +1,43 @@ """Luxtronik heatpump sensor.""" # region Imports -from typing import Any, Final - -from homeassistant.components.sensor import ( - ENTITY_ID_FORMAT, - STATE_CLASS_MEASUREMENT, - STATE_CLASS_TOTAL_INCREASING, - SensorEntity, - SensorEntityDescription, -) + +from homeassistant.components.sensor import (ENTITY_ID_FORMAT, + STATE_CLASS_MEASUREMENT, + STATE_CLASS_TOTAL_INCREASING, + SensorEntity) from homeassistant.config_entries import ConfigEntry -from homeassistant.const import ( - CONF_FRIENDLY_NAME, - CONF_ICON, - CONF_ID, - CONF_SENSORS, - DEVICE_CLASS_ENERGY, - DEVICE_CLASS_TEMPERATURE, - ENERGY_KILO_WATT_HOUR, - ENTITY_CATEGORIES, - EVENT_HOMEASSISTANT_STOP, - STATE_UNAVAILABLE, - TEMP_CELSIUS, - TIME_HOURS, - TIME_SECONDS, -) +from homeassistant.const import (CONF_FRIENDLY_NAME, CONF_ICON, CONF_ID, + CONF_SENSORS, DEVICE_CLASS_ENERGY, + DEVICE_CLASS_TEMPERATURE, + ENERGY_KILO_WATT_HOUR, ENTITY_CATEGORIES, + EVENT_HOMEASSISTANT_STOP, STATE_UNAVAILABLE, + TEMP_CELSIUS, TEMP_KELVIN, TIME_HOURS, + TIME_SECONDS, UnitOfPressure) from homeassistant.core import HomeAssistant from homeassistant.helpers.entity import DeviceInfo, EntityCategory from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.restore_state import RestoreEntity from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType -from .const import ( - ATTR_STATUS_TEXT, - CONF_GROUP, - CONF_LANGUAGE_SENSOR_NAMES, - DEFAULT_DEVICE_CLASS, - DEVICE_CLASSES, - DOMAIN, - GLOBAL_SENSOR_TYPES, - GLOBAL_STATUS_SENSOR_TYPES, - ICONS, - LOGGER, - LUX_SENSOR_STATUS, - LUX_SENSOR_STATUS1, - LUX_SENSOR_STATUS3, - LUX_STATE_ICON_MAP, - LUX_STATES_ON, - LUX_STATUS1_WORKAROUND, - LUX_STATUS3_WORKAROUND, - LUX_STATUS_HEATING, - LUX_STATUS_NO_REQUEST, - LUX_STATUS_THERMAL_DESINFECTION, - PLATFORMS, - SECOUND_TO_HOUR_FACTOR, - UNITS, -) -from .helpers.helper import get_sensor_text, get_sensor_value_text -from .luxtronik_device import LuxtronikDevice -from .model import LuxtronikStatusExtraAttributes +from custom_components.luxtronik.const import (ATTR_STATUS_TEXT, CONF_GROUP, + CONF_LANGUAGE_SENSOR_NAMES, + DEFAULT_DEVICE_CLASS, + DEVICE_CLASSES, DOMAIN, ICONS, + LOGGER, LUX_SENSOR_STATUS, + LUX_SENSOR_STATUS1, + LUX_SENSOR_STATUS3, + LUX_STATE_ICON_MAP, + LUX_STATES_ON, + LUX_STATUS1_WORKAROUND, + LUX_STATUS3_WORKAROUND, + LUX_STATUS_HEATING, + LUX_STATUS_NO_REQUEST, + LUX_STATUS_THERMAL_DESINFECTION, + SECOUND_TO_HOUR_FACTOR, UNITS) +from custom_components.luxtronik.helpers.helper import (get_sensor_text, + get_sensor_value_text) +from custom_components.luxtronik.luxtronik_device import LuxtronikDevice +from custom_components.luxtronik.model import LuxtronikStatusExtraAttributes # endregion Imports @@ -173,6 +152,10 @@ async def async_setup_entry( text_suction_compressor = get_sensor_text(lang, "suction_compressor") text_suction_evaporator = get_sensor_text(lang, "suction_evaporator") text_compressor_heating = get_sensor_text(lang, "compressor_heating") + text_overheating = get_sensor_text(lang, "overheating") + text_overheating_target = get_sensor_text(lang, "overheating_target") + text_high_pressure = get_sensor_text(lang, "high_pressure") + text_low_pressure = get_sensor_text(lang, "low_pressure") # entities: list[LuxtronikSensor] = [ # LuxtronikStatusSensor(hass, luxtronik, device_info, description) # for description in GLOBAL_STATUS_SENSOR_TYPES @@ -257,7 +240,7 @@ async def async_setup_entry( device_info, "calculations.ID_WEB_Temperatur_TWA", "heat_source_output_temperature", - f"{text_heat_source_output} {text_temp}", + f"{text_heat_source_output}", entity_category=None, ), LuxtronikSensor( @@ -266,7 +249,7 @@ async def async_setup_entry( device_info, "calculations.ID_WEB_Temperatur_TWE", "heat_source_input_temperature", - f"{text_heat_source_input} {text_temp}", + f"{text_heat_source_input}", entity_category=None, ), LuxtronikSensor( @@ -344,7 +327,7 @@ async def async_setup_entry( device_info, "calculations.ID_WEB_Temperatur_THG", "hot_gas_temperature", - f"{text_hot_gas} {text_temp}", + f"{text_hot_gas}", entity_category=None, ), LuxtronikSensor( @@ -353,7 +336,7 @@ async def async_setup_entry( device_info, "calculations.ID_WEB_LIN_ANSAUG_VERDICHTER", "suction_compressor_temperature", - f"{text_suction_compressor} {text_temp}", + f"{text_suction_compressor}", entity_category=None, ), LuxtronikSensor( @@ -362,7 +345,7 @@ async def async_setup_entry( device_info, "calculations.ID_WEB_LIN_ANSAUG_VERDAMPFER", "suction_evaporator_temperature", - f"{text_suction_evaporator} {text_temp}", + f"{text_suction_evaporator}", entity_category=None, ), LuxtronikSensor( @@ -371,36 +354,81 @@ async def async_setup_entry( device_info, "calculations.ID_WEB_LIN_VDH", "compressor_heating_temperature", - f"{text_compressor_heating} {text_temp}", + f"{text_compressor_heating}", entity_category=None, ), + LuxtronikSensor( + hass, + luxtronik, + device_info, + "calculations.ID_WEB_LIN_UH", + "overheating_temperature", + f"{text_overheating}", + entity_category=None, + unit_of_measurement=TEMP_KELVIN, + ), + LuxtronikSensor( + hass, + luxtronik, + device_info, + "calculations.ID_WEB_LIN_UH_Soll", + "overheating_target_temperature", + f"{text_overheating_target}", + entity_category=None, + unit_of_measurement=TEMP_KELVIN, + ), + LuxtronikSensor( + hass, + luxtronik, + device_info, + "calculations.ID_WEB_LIN_HD", + "high_pressure", + f"{text_high_pressure}", + entity_category=None, + unit_of_measurement=UnitOfPressure.BAR, + ), + LuxtronikSensor( + hass, + luxtronik, + device_info, + "calculations.ID_WEB_LIN_ND", + "low_pressure", + f"{text_low_pressure}", + entity_category=None, + unit_of_measurement=UnitOfPressure.BAR, + ), ] device_info_heating = hass.data[f"{DOMAIN}_DeviceInfo_Heating"] if device_info_heating is not None: text_flow_in = get_sensor_text(lang, "flow_in") text_flow_out = get_sensor_text(lang, "flow_out") - text_room = get_sensor_text(lang, "room") text_target = get_sensor_text(lang, "target") text_operation_hours_heating = get_sensor_text(lang, "operation_hours_heating") text_heat_amount_heating = get_sensor_text(lang, "heat_amount_heating") + has_room_temp = luxtronik.get_value("parameters.ID_Einst_RFVEinb_akt") != 0 + if has_room_temp: + text_room = get_sensor_text(lang, "room") + entities += [ + LuxtronikSensor( + hass, + luxtronik, + device_info_heating, + "calculations.ID_WEB_RBE_RT_Ist", + "room_temperature", + f"{text_room}", + entity_category=None, + ) + ] + entities += [ - LuxtronikSensor( - hass, - luxtronik, - device_info_heating, - "calculations.ID_WEB_RBE_RT_Ist", - "room_temperature", - f"{text_room} {text_temp}", - entity_category=None, - ), LuxtronikSensor( hass, luxtronik, device_info_heating, "calculations.ID_WEB_Temperatur_TVL", "flow_in_temperature", - f"{text_flow_in} {text_temp}", + f"{text_flow_in}", "mdi:waves-arrow-left", entity_category=None, ), @@ -410,7 +438,7 @@ async def async_setup_entry( device_info_heating, "calculations.ID_WEB_Temperatur_TRL", "flow_out_temperature", - f"{text_flow_out} {text_temp}", + f"{text_flow_out}", "mdi:waves-arrow-right", entity_category=None, ), @@ -420,7 +448,7 @@ async def async_setup_entry( device_info_heating, "calculations.ID_WEB_Temperatur_TRL_ext", "flow_out_temperature_external", - f"{text_flow_out} {text_temp} ({text_external})", + f"{text_flow_out} ({text_external})", "mdi:waves-arrow-right", entity_category=None, ), @@ -430,7 +458,7 @@ async def async_setup_entry( device_info_heating, "calculations.ID_WEB_Sollwert_TRL_HZ", "flow_out_temperature_target", - f"{text_flow_out} {text_temp} {text_target}", + f"{text_flow_out} {text_target}", entity_category=None, ), LuxtronikSensor( @@ -481,7 +509,7 @@ async def async_setup_entry( device_info_domestic_water, "calculations.ID_WEB_Temperatur_TSK", "solar_collector_temperature", - f"Solar {text_collector} {text_temp}", + f"Solar {text_collector}", "mdi:solar-panel-large", entity_category=None, ), @@ -491,7 +519,7 @@ async def async_setup_entry( device_info_domestic_water, "calculations.ID_WEB_Temperatur_TSS", "solar_buffer_temperature", - f"Solar {text_buffer} {text_temp}", + f"Solar {text_buffer}", "mdi:propane-tank-outline", entity_category=None, ), @@ -501,7 +529,7 @@ async def async_setup_entry( device_info_domestic_water, "calculations.ID_WEB_Temperatur_TBW", "domestic_water_temperature", - f"{text_domestic_water} {text_temp}", + f"{text_domestic_water}", "mdi:coolant-temperature", entity_category=None, ), diff --git a/custom_components/luxtronik/switch.py b/custom_components/luxtronik/switch.py index 9a7c42f..71d84d6 100644 --- a/custom_components/luxtronik/switch.py +++ b/custom_components/luxtronik/switch.py @@ -16,7 +16,9 @@ LUX_SENSOR_MODE_DOMESTIC_WATER, LUX_SENSOR_MODE_HEATING, LUX_SENSOR_MODE_COOLING, - LuxMode, LUX_SENSOR_HEATING_THRESHOLD, LUX_SENSOR_REMOTE_MAINTENANCE) + LuxMode, LUX_SENSOR_HEATING_THRESHOLD, LUX_SENSOR_REMOTE_MAINTENANCE, + LUX_SENSOR_PUMP_OPTIMIZATION, + LUX_SENSOR_EFFICIENCY_PUMP) from .helpers.helper import get_sensor_text # endregion Imports @@ -46,15 +48,32 @@ async def async_setup_entry( device_info = hass.data[f"{DOMAIN}_DeviceInfo"] text_remote_maintenance = get_sensor_text(lang, 'remote_maintenance') + text_pump_optimization = get_sensor_text(lang, 'pump_optimization') + text_efficiency_pump = get_sensor_text(lang, 'efficiency_pump') + text_pump_heat_control = get_sensor_text(lang, 'pump_heat_control') entities += [ LuxtronikSwitch( hass=hass, luxtronik=luxtronik, deviceInfo=device_info, sensor_key=LUX_SENSOR_REMOTE_MAINTENANCE, unique_id='remote_maintenance', name=f"{text_remote_maintenance}", icon='mdi:remote-desktop', - device_class=DEVICE_CLASS_HEAT, entity_category=EntityCategory.CONFIG) + device_class=DEVICE_CLASS_HEAT, entity_category=EntityCategory.CONFIG), + LuxtronikSwitch( + hass=hass, luxtronik=luxtronik, deviceInfo=device_info, + sensor_key=LUX_SENSOR_PUMP_OPTIMIZATION, unique_id='pump_optimization', + name=f"{text_pump_optimization}", icon='mdi:tune', + device_class=DEVICE_CLASS_HEAT, entity_category=EntityCategory.CONFIG), + LuxtronikSwitch( + hass=hass, luxtronik=luxtronik, deviceInfo=device_info, + sensor_key=LUX_SENSOR_EFFICIENCY_PUMP, unique_id='efficiency_pump', + name=f"{text_efficiency_pump}", icon='mdi:leaf-circle', + device_class=DEVICE_CLASS_HEAT, entity_category=EntityCategory.CONFIG), + LuxtronikSwitch( + hass=hass, luxtronik=luxtronik, deviceInfo=device_info, + sensor_key='parameters.ID_Einst_P155_PumpHeatCtrl', unique_id='pump_heat_control', + name=text_pump_heat_control, icon='mdi:pump', + device_class=DEVICE_CLASS_HEAT, entity_category=EntityCategory.CONFIG), ] - deviceInfoHeating = hass.data[f"{DOMAIN}_DeviceInfo_Heating"] if deviceInfoHeating is not None: text_heating_mode = get_sensor_text(lang, 'heating_mode_auto') diff --git a/custom_components/luxtronik/translations/texts.de.json b/custom_components/luxtronik/translations/texts.de.json index 57b2a3d..1cad7a3 100644 --- a/custom_components/luxtronik/translations/texts.de.json +++ b/custom_components/luxtronik/translations/texts.de.json @@ -1,8 +1,9 @@ { "average": "Mittel", "outdoor": "Aussen", - "room": "Zimmer", + "room": "Raum", "pump": "Verdichter", + "compressor": "Verdichter", "heat_source_output": "Heizquelle Ausgang", "heat_source_input": "Heizquelle Eingang", "time": "Zeit", @@ -46,5 +47,19 @@ "hot_gas": "Heissgas", "suction_compressor": "Ansaug Verdichter", "suction_evaporator": "Ansaug Verdampfer", - "compressor_heating": "Verdichter Heizung" + "compressor_heating": "Verdichter Heizung", + "pump_optimization": "Pumpenoptimierung", + "pump_optimization_time": "Pumpenoptimierung", + "efficiency_pump": "Effizienzpumpe", + "maximum_circulation_pump_speed": "Maximale Pumpen Zirkulations Geschwindigkeit", + "heating_room_temperature_impact_factor": "Raum Temperatur Einflußfaktor", + "overheating": "Überhitzung", + "overheating_target": "Überhitzung Soll", + "high_pressure": "Hochdruck", + "low_pressure": "Niederdruck", + "circulating_pump_domestic_water": "Zirkulationspumpe Brauchwasser", + "circulating_pump_heating": "Zusatzumwälzpumpe Heizung", + "circulating_pump_water": "Warmwasserumwälzpumpe", + "unloading_pump": "Entladepumpe Heizkreis", + "pump_heat_control": "Pumpenheizkontrolle" } diff --git a/custom_components/luxtronik/translations/texts.en.json b/custom_components/luxtronik/translations/texts.en.json index 0299628..7dac422 100644 --- a/custom_components/luxtronik/translations/texts.en.json +++ b/custom_components/luxtronik/translations/texts.en.json @@ -3,6 +3,7 @@ "outdoor": "Outdoor", "room": "Room", "pump": "Compressor", + "compressor": "Compressor", "heat_source_output": "To heat source", "heat_source_input": "From heat source", "time": "Time", @@ -46,5 +47,19 @@ "hot_gas": "Hot gas", "suction_compressor": "Suction compressor", "suction_evaporator": "Suction evaporator", - "compressor_heating": "Compressor heating" + "compressor_heating": "Compressor heating", + "pump_optimization": "Pump optimization", + "pump_optimization_time": "Pump optimization", + "efficiency_pump": "Efficiency pump", + "maximum_circulation_pump_speed": "Maximum circulation pump speed", + "heating_room_temperature_impact_factor": "Room temperature impact factor", + "overheating": "Overheating", + "overheating_target": "Overheating target", + "high_pressure": "High pressure", + "low_pressure": "Low pressure", + "circulating_pump_domestic_water": "Circulating pump domestic water", + "circulating_pump_heating": "Circulating pump heating", + "circulating_pump_water": "Circulating pump water", + "unloading_pump": "Unloading pump", + "pump_heat_control": "Pump heat control" }