Skip to content

Commit

Permalink
Add new binary sensors:
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
BenPru committed Nov 18, 2022
1 parent 6b5fd7c commit fc0d1e6
Show file tree
Hide file tree
Showing 8 changed files with 287 additions and 114 deletions.
114 changes: 90 additions & 24 deletions custom_components/luxtronik/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,32 @@

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
from homeassistant.helpers.restore_state import RestoreEntity
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

Expand Down Expand Up @@ -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,
Expand All @@ -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',

This comment has been minimized.

Copy link
@Kars-de-Jong

Kars-de-Jong Nov 20, 2022

Contributor

This name is not correct, it means Zusätzliche Umwälzpumpe, which is the additional pump(s) that is used for underfloor heating in high temperature systems.
There are more ZUP signals.

This comment has been minimized.

Copy link
@BenPru

BenPru Nov 20, 2022

Author Owner

What do you think about "additional_circulating_pump1" as name
and text "Zusätzliche Umwälzpumpe" / "Additional circulating pump"?

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)

This comment has been minimized.

Copy link
@Kars-de-Jong

Kars-de-Jong Nov 20, 2022

Contributor

This one is important, it is the signal for Ventilator, Brunnen- oder. Soleumwälzpumpe.
So either the fan (for a water-water or air-water system), the brine pump or the solar heat source pump.

This comment has been minimized.

Copy link
@BenPru

BenPru Nov 20, 2022

Author Owner

How can I detect if this pump is present?
Or should we create but disable it by default?

]

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")
Expand Down
8 changes: 7 additions & 1 deletion custom_components/luxtronik/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion custom_components/luxtronik/manifest.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
38 changes: 31 additions & 7 deletions custom_components/luxtronik/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -60,17 +63,38 @@ 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,

This comment has been minimized.

Copy link
@Kars-de-Jong

Kars-de-Jong Nov 20, 2022

Contributor

Note that this setting is for heating mode only. For cooling and hot water production there are separate settings.

This comment has been minimized.

Copy link
@BenPru

BenPru Nov 20, 2022

Author Owner

Okay.
visibility.ID_Visi_P155_Inverter --> Can I use this for detection enable/disable P155_* values?

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')
text_heating_circuit_curve1_temperature = get_sensor_text(lang, 'circuit_curve1_temperature')
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,
Expand Down Expand Up @@ -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)
]

Expand Down
Loading

0 comments on commit fc0d1e6

Please sign in to comment.