Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented power limitation, #306

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions custom_components/luxtronik/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ class FirmwareVersionMinor(Enum):

minor_80: Final = 80
minor_88: Final = 88
minor_90: Final = 90


LUXTRONIK_HA_SIGNAL_UPDATE_ENTITY = "luxtronik_entry_update"
Expand Down Expand Up @@ -378,6 +379,9 @@ class LuxParameter(StrEnum):
P1032_HEATING_MAXIMUM_CIRCULATION_PUMP_SPEED: Final = (
"parameters.ID_Einst_P155_PumpHeat_Max"
)
P1030_SMART_GRID_SWITCH: Final = (
"parameters.ID_Einst_SmartGrid"
)
P1033_PUMP_HEAT_CONTROL: Final = "parameters.ID_Einst_P155_PumpHeatCtrl"
P1059_ADDITIONAL_HEAT_GENERATOR_AMOUNT_COUNTER: Final = (
"parameters.ID_Waermemenge_ZWE"
Expand All @@ -393,7 +397,8 @@ class LuxParameter(StrEnum):
# ? P1138_SWIMMING_POOL_ENERGY_INPUT: Final = "parameters.Unknown_Parameter_1138" -->
P1139_COOLING_ENERGY_INPUT: Final = "parameters.Unknown_Parameter_1139"
P1140_SECOND_HEAT_GENERATOR_AMOUNT_COUNTER: Final = "parameters.Unknown_Parameter_1140"

P1158_POWER_LIMIT_SWITCH: Final = "parameters.Unknown_Parameter_1158"
P1159_POWER_LIMIT_VALUE: Final = "parameters.Unknown_Parameter_1159"

# endregion Lux parameters

Expand Down Expand Up @@ -577,7 +582,7 @@ class LuxVisibility(StrEnum):
V0324_ADDITIONAL_HEAT_GENERATOR_AMOUNT_COUNTER: Final = (
"visibilities.ID_Visi_Waermemenge_ZWE"
)
V0357_SILENT_MODE_TIME_MENU: Final = "visibilities.Unknown_Parameter_357"
V0357_ELECTRICAL_POWER_LIMITATION_SWITCH: Final = "visibilities.Unknown_Parameter_357"


# endregion visibilities
Expand Down Expand Up @@ -650,6 +655,8 @@ class SensorKey(StrEnum):
EFFICIENCY_PUMP = "efficiency_pump"
EFFICIENCY_PUMP_NOMINAL = "efficiency_pump_nominal"
EFFICIENCY_PUMP_MINIMAL = "efficiency_pump_minimal"
ELECTRICAL_POWER_LIMITATION_SWITCH = "electrical_power_limitation_switch"
ELECTRICAL_POWER_LIMITATION_VALUE = "electrical_power_limitation_value"
PUMP_HEAT_CONTROL = "pump_heat_control"
HEATING = "heating"
PUMP_OPTIMIZATION = "pump_optimization"
Expand Down Expand Up @@ -717,6 +724,7 @@ class SensorKey(StrEnum):
COOLING_TARGET_TEMPERATURE_MK1 = "cooling_target_temperature_mk1"
COOLING_TARGET_TEMPERATURE_MK2 = "cooling_target_temperature_mk2"
COOLING_TARGET_TEMPERATURE_MK3 = "cooling_target_temperature_mk3"
SMART_GRID_SWITCH = "smartgrid"
SWITCHOFF_REASON = "switchoff_reason"
SILENT_MODE = "silent_mode"

Expand Down
15 changes: 15 additions & 0 deletions custom_components/luxtronik/number_entities_predefined.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
UnitOfElectricPotential,
UnitOfTemperature,
UnitOfTime,
UnitOfPower,
)
from homeassistant.helpers.entity import EntityCategory

Expand All @@ -18,6 +19,7 @@
SensorAttrFormat,
SensorAttrKey as SA,
SensorKey,
FirmwareVersionMinor,
)
from .model import (
LuxtronikEntityAttributeDescription as attr,
Expand Down Expand Up @@ -106,6 +108,19 @@
entity_registry_enabled_default=False,
visibility=LV.V0105_HEAT_SOURCE_INPUT_TEMPERATURE_MIN,
),
LuxtronikNumberDescription(
key=SensorKey.ELECTRICAL_POWER_LIMITATION_VALUE,
luxtronik_key=LP.P1159_POWER_LIMIT_VALUE,
icon="mdi:arrow-collapse-down",
device_class=SensorDeviceClass.POWER,
entity_category=EntityCategory.CONFIG,
native_unit_of_measurement=UnitOfPower.KILO_WATT,
native_min_value=0.0,
native_max_value=30.0,
native_step=0.1,
factor=0.1,
min_firmware_version_minor=FirmwareVersionMinor.minor_90,
),
# endregion Main heatpump
# region Heating
LuxtronikNumberDescription(
Expand Down
17 changes: 11 additions & 6 deletions custom_components/luxtronik/switch_entities_predefined.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
entity_category=EntityCategory.CONFIG,
entity_registry_enabled_default=False,
# device_class=SensorDeviceClass.HEAT
),
LuxtronikSwitchDescription(
key=SensorKey.SMART_GRID_SWITCH,
luxtronik_key=LP.P1030_SMART_GRID_SWITCH,
icon="mdi:grid",
entity_category=EntityCategory.CONFIG,
),
LuxtronikSwitchDescription(
luxtronik_key=LP.P1033_PUMP_HEAT_CONTROL,
Expand All @@ -40,13 +46,12 @@
# device_class=SensorDeviceClass.HEAT
),
LuxtronikSwitchDescription(
luxtronik_key=LP.P1087_SILENT_MODE,
key=SensorKey.SILENT_MODE,
icon="mdi:volume-minus",
key=SensorKey.ELECTRICAL_POWER_LIMITATION_SWITCH,
luxtronik_key=LP.P1158_POWER_LIMIT_SWITCH,
icon="mdi:leaf-circle-outline",
entity_category=EntityCategory.CONFIG,
visibility=LV.V0357_SILENT_MODE_TIME_MENU,
min_firmware_version_minor=FirmwareVersionMinor.minor_80,
update_interval=UPDATE_INTERVAL_VERY_SLOW,
visibility=LV.V0357_ELECTRICAL_POWER_LIMITATION_SWITCH,
min_firmware_version_minor=FirmwareVersionMinor.minor_90,
),
# LuxtronikSwitchDescription(
# luxtronik_key=LP.P0870_AMOUNT_COUNTER_ACTIVE,
Expand Down
11 changes: 10 additions & 1 deletion custom_components/luxtronik/translations/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@
"efficiency_pump": {
"name": "\u00da\u010dinnost \u010derpadla"
},
"electrical_power_limitation_switch": {
"name": "Power limitation"
},
"pump_heat_control": {
"name": "Ovl\u00e1d\u00e1n\u00ed \u010derpadla pro oh\u0159ev"
},
Expand All @@ -91,7 +94,10 @@
},
"cooling": {
"name": "Chlazen\u00ed"
}
},
"smartgrid": {
"name": "Smart Grid"
}
},
"update": {
"firmware": {
Expand All @@ -104,6 +110,9 @@
},
"pump_optimization": {
"name": "Optimalizace \u010derpadla"
},
"electrical_power_limitation_value": {
"name": "Power limit"
},
"heating_threshold": {
"name": "Teplotn\u00ed mez pro vyt\u00e1p\u011bn\u00ed"
Expand Down
10 changes: 10 additions & 0 deletions custom_components/luxtronik/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@
"efficiency_pump": {
"name": "Effizienzpumpe"
},
"electrical_power_limitation_switch": {
"name": "Leistungsbegrenzung"
},
"pump_heat_control": {
"name": "Pumpenheizkontrolle"
},
Expand All @@ -91,7 +94,11 @@
},
"cooling": {
"name": "K\u00fchlung"
},
"smartgrid": {
"name": "Smart Grid"
}

},
"update": {
"firmware": {
Expand All @@ -104,6 +111,9 @@
},
"pump_optimization": {
"name": "Pumpenoptimierung"
},
"electrical_power_limitation_value": {
"name": "Leistungslimit"
},
"heating_threshold": {
"name": "Heizgrenze"
Expand Down
11 changes: 10 additions & 1 deletion custom_components/luxtronik/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@
"remote_maintenance": {
"name": "Remote maintenance"
},
"electrical_power_limitation_switch": {
"name": "Power limitation"
},
"efficiency_pump": {
"name": "Efficiency pump"
},
Expand All @@ -94,7 +97,10 @@
},
"silent_mode": {
"name": "Silent mode"
}
},
"smartgrid": {
"name": "Smart Grid"
}
},
"update": {
"firmware": {
Expand All @@ -107,6 +113,9 @@
},
"pump_optimization": {
"name": "Pump optimization"
},
"electrical_power_limitation_value": {
"name": "Power limit"
},
"heating_threshold": {
"name": "Heating threshold"
Expand Down
11 changes: 10 additions & 1 deletion custom_components/luxtronik/translations/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@
"efficiency_pump": {
"name": "Efficiëntie Pomp"
},
"electrical_power_limitation_switch": {
"name": "Power limitation"
},
"pump_heat_control": {
"name": "Controle pompverwarming"
},
Expand All @@ -91,7 +94,10 @@
},
"cooling": {
"name": "Koeling"
}
},
"smartgrid": {
"name": "Smart Grid"
}
},
"update": {
"firmware": {
Expand All @@ -104,6 +110,9 @@
},
"pump_optimization": {
"name": "Pompoptimalisatie"
},
"electrical_power_limitation_value": {
"name": "Power limit"
},
"heating_threshold": {
"name": "Verwarmingslimiet"
Expand Down
11 changes: 10 additions & 1 deletion custom_components/luxtronik/translations/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@
"efficiency_pump": {
"name": "Pompa wydajna"
},
"electrical_power_limitation_switch": {
"name": "Power limitation"
},
"pump_heat_control": {
"name": "Sterowanie ogrzewaniem pompy"
},
Expand All @@ -88,7 +91,10 @@
},
"cooling": {
"name": "Ch\u0142odzenie"
}
},
"smartgrid": {
"name": "Smart Grid"
}
},
"update": {
"firmware": {
Expand All @@ -104,6 +110,9 @@
},
"heating_threshold": {
"name": "Pr\u00F3g ogrzewania"
},
"electrical_power_limitation_value": {
"name": "Power limit"
},
"heating_target_correction": {
"name": "Korekcja celu grzewczego"
Expand Down