Writing a component for Luxtronik Heatpumps

First I think merge with the current ha version.
Second change the code like the comments from ### frenck

@benpr I’m testing your integration, nice work! I do think it will need some more flexibility in configuring the entities that are visible.

Some of that can probably be done based on the brand and model of the system attached to the controller.

Others would really need to be configurable, for instance the presence of a solar collector or buffer, or passive or active cooling function, extra circulation pumps, extra temperature measurements, etc.

Let me know if I can help!

@benpr There are some warnings about luxtronik2 in my logs:

This one occurs very often:

Deze fout is ontstaan door een aangepaste integratie.

Logger: custom_components.luxtronik2
Source: custom_components/luxtronik2/helpers/helper.py:70 
Integration: Luxtronik 
First occurred: 08:40:39 (522 occurrences) 
Last logged: 10:50:39

get_sensor_value_text key luxtronik2__status_line_1 / value heatpump running not found in {'state': {'luxtronik2__status': {'heating': 'Heating', 'hot water': 'Domestic water', 'swimming pool/solar': 'Pool / Solar', 'evu': 'Grid lock - no power', 'defrost': 'Defrost', 'heating external source': 'Heating external source', 'cooling': 'Cooling', 'no request': 'Idle (no request)'}, 'luxtronik2__status_line_1': {'heatpump running': 'The heatpump runs', 'heatpump idle': 'The heatpump is idle', 'heatpump coming': 'The heatpump is coming', 'errorcode slot': 'Heatpump error code in slot 0', 'pump forerun': 'Pump forerun', 'defrost': 'Defrost', 'writing on LIN connection': 'Writing on LIN connection', 'compressor heating up': 'Der Kompressor heizt auf'}, 'luxtronik2__status_line_2': {'since': 'since', 'in': 'in'}, 'luxtronik2__status_line_3': {'heating': 'heating', 'defrost': 'defrost', 'cooling': 'cooling', 'pump forerun': 'pump forerun', 'thermal desinfection': 'thermal desinfection', 'swimming pool/solar': 'swimming pool/solar', 'no request': 'no request', 'cycle lock': 'cycle lock', 'lock time': 'lock time', 'domestic water': 'domestic water', 'flow monitoring': 'flow monitoring', 'grid switch on delay': 'grid switch on delay', 'info bake out program': 'info bake out program', 'heating external engery source': 'heating external engery source', 'domestic water external energy source': 'Domestic water external energy source', 'second heat generator 1 active': 'second heat generator 1 active'}}}
get_sensor_value_text key luxtronik2__status_line_2 / value since not found in {'state': {'luxtronik2__status': {'heating': 'Heating', 'hot water': 'Domestic water', 'swimming pool/solar': 'Pool / Solar', 'evu': 'Grid lock - no power', 'defrost': 'Defrost', 'heating external source': 'Heating external source', 'cooling': 'Cooling', 'no request': 'Idle (no request)'}, 'luxtronik2__status_line_1': {'heatpump running': 'The heatpump runs', 'heatpump idle': 'The heatpump is idle', 'heatpump coming': 'The heatpump is coming', 'errorcode slot': 'Heatpump error code in slot 0', 'pump forerun': 'Pump forerun', 'defrost': 'Defrost', 'writing on LIN connection': 'Writing on LIN connection', 'compressor heating up': 'Der Kompressor heizt auf'}, 'luxtronik2__status_line_2': {'since': 'since', 'in': 'in'}, 'luxtronik2__status_line_3': {'heating': 'heating', 'defrost': 'defrost', 'cooling': 'cooling', 'pump forerun': 'pump forerun', 'thermal desinfection': 'thermal desinfection', 'swimming pool/solar': 'swimming pool/solar', 'no request': 'no request', 'cycle lock': 'cycle lock', 'lock time': 'lock time', 'domestic water': 'domestic water', 'flow monitoring': 'flow monitoring', 'grid switch on delay': 'grid switch on delay', 'info bake out program': 'info bake out program', 'heating external engery source': 'heating external engery source', 'domestic water external energy source': 'Domestic water external energy source', 'second heat generator 1 active': 'second heat generator 1 active'}}}

Then there’s these:

Logger: homeassistant.components.number
Source: components/number/__init__.py:462 
Integration: Nummer (documentation, issues) 
First occurred: 08:39:38 (3 occurrences) 
Last logged: 08:39:38

Entity sensor.luxtronik2_heating_temperature_correction (<class 'custom_components.luxtronik2.number.LuxtronikNumber'>) is using deprecated NumberEntity features which will be unsupported from Home Assistant Core 2022.10, please report it to the custom component author.
Entity sensor.luxtronik2_heating_threshold_temperature (<class 'custom_components.luxtronik2.number.LuxtronikNumber'>) is using deprecated NumberEntity features which will be unsupported from Home Assistant Core 2022.10, please report it to the custom component author.
Entity sensor.luxtronik2_domestic_water_target_temperature (<class 'custom_components.luxtronik2.number.LuxtronikNumber'>) is using deprecated NumberEntity features which will be unsupported from Home Assistant Core 2022.10, please report it to the custom component author.

And:

Logger: homeassistant.components.number
Source: components/number/__init__.py:220 
Integration: Nummer (documentation, issues) 
First occurred: 08:39:38 (1 occurrences) 
Last logged: 08:39:38

custom_components.luxtronik2.number::LuxtronikNumber is overriding deprecated methods on an instance of NumberEntity, this is not valid and will be unsupported from Home Assistant 2022.10. Please report it to the custom component author.

The first warning occurs not in my current used code. I think I have already changed something locally and fixed it.
The second and third warning occurs also in my installation. I think its a new change in the current ha version. I try to fix this next time.

Its all fixed and pushed to the repo.

1 Like

My first attempt to create a version for integration into core has failed, but I learned a lot. I still need to learn more about debugging the dev container to work efficiently. This weekend I’m going for a second attempt.

As per the coding guidelines, each pull request needs to add a small part, so I’m trying to create a basic version with the manual setup and just a couple of sensors. The thermostat will be the second pull request.
Also some refactoring of the languages is required. The German translation will be removed in the first version so it can be added again using the standard translation files.

Overall, I’m confident that it can make it into core.

2 Likes

I try to detect the heatpump options. For example see “cooling” → “calculations.ID_WEB_FreigabKuehl”:

I have create a new ticket to collect possible luxtronik heatpump options and their flags:

Perhaps you can describe your model and options there. Solar collector, buffer and so on.

1 Like

I don’t think that is the option - that is the cooling release, it determines whether cooling is allowed (wired-and from RBE (room thermostat) and e.g. a dew point sensor).

You should probably check whether one of parameter.ID_Einst_MK1Typ_akt, parameter.ID_Einst_MK2Typ_akt or parameter.ID_Einst_MK3Typ_akt is set to value 3 (=cool) or 4 (=heat+cool). That’s what the web socket protocol seems to return, my heat pump uses mixing group 2 for cooling, and these values match what I get back on those parameters:

  <item id="0x4242a66c">
    <name>Menggroep 1</name>
    <option value="0">Nee</option>
    <option value="1">Ontladen</option>
    <option value="2">Laden</option>
    <option value="3">Koelen</option>
    <option value="4">Verw.+koel</option>
    <raw>0</raw>
    <value>Nee</value>
  </item>
  <item id="0x42434cd4">
    <name>Menggroep 2</name>
    <option value="0">Nee</option>
    <option value="1">Ontladen</option>
    <option value="2">Laden</option>
    <option value="3">Koelen</option>
    <option value="4">Verw.+koel</option>
    <raw>3</raw><value>Koelen</value>
  </item>
  <item id="0x42439534">
    <name>Menggroep 3</name>
    <option value="0">Nee</option>
    <option value="1">Ontladen</option>
    <option value="4">Verw.+koel</option>
    <raw>0</raw>
    <value>Nee</value>
  </item>

But that might be different for other heat pumps (like air/water or air/air systems).

Thanks for the great development here works like a charm!

One thing that didn’t work for me is, we have 3 heatpumps here in 3 houses and i was trying to add them all - however the integration only works for one heatpump or the other. We run them with slightly different settings, and it would be great to overlap the graphs to see utilization, domestic water etc.
Would it be possible to modify the code in a way to access several of them? They are all in the same subnet, so are accessible network wise

Thanks!

Martin

For some reason I have no luck getting your integration to run.
I have it downloaded with HACS but the Autodiscovery wont work adding it via the Settings → Devices & Services nothing shows up under Luxtronik.

Help greatly appreciated. Thanks

nvm → it was an issue with my cache. Proper Reload did the trick.

Can you add every heatpump to ha or run the setup in an error?
Can you provide the logs while adding the second heatpump? → Perhaps as github issue

I just did see there is also a feature request in the Project from Bouni (from Feb this year) with a response from him that this will not be that easy - so seems the underlying model is currently not supporting multiple heatpumps simultanously.
I can add all three of them, however the sensors and entities are then overwritten by the one which has been added as the last one. Also new to Github, but will try to post it there as well

Okay.
I think I can add an optional heatpump name in the setup that I can add in the sensor names.

If that’s all to resolve this then this would be brilliant!

I did open an issue via Github to stay consistent & do things right here. Hope this helps :slight_smile:

Hi,

I’m used to Domoticz and now setting up a 2nd raspberry with Home Assistant. Looks great so far :slight_smile: On domoticz I’'ve used a python script to poll for data from my nathan/alpha heatpump. Works.

I’ve added this repo to my HACS, it did not find the heatpump. Added it manually, added my ip and port, but it threw some erorrs:

I’m running HA OS, so I cannot just install a module with python as I understand. Is there something more I need to do first? I did restart, removed it again, same error. Other language too.

Logger: homeassistant.setup
Source: setup.py:320
First occurred: 11:13:05 (5 occurrences)
Last logged: 11:13:05

  • Unable to prepare setup for platform luxtronik2.sensor: Platform not found (No module named ‘custom_components.luxtronik’).
  • Unable to prepare setup for platform luxtronik2.binary_sensor: Platform not found (No module named ‘custom_components.luxtronik’).
  • Unable to prepare setup for platform luxtronik2.climate: Platform not found (cannot import name ‘LUX_SENSOR_HEATING_TARGET_CORRECTION’ from ‘custom_components.luxtronik2.const’ (/config/custom_components/luxtronik2/const.py)).
  • Unable to prepare setup for platform luxtronik2.number: Platform not found (cannot import name ‘LUX_SENSOR_HEATING_TARGET_CORRECTION’ from ‘custom_components.luxtronik2.const’ (/config/custom_components/luxtronik2/const.py)).
  • Unable to prepare setup for platform luxtronik2.switch: Platform not found (No module named ‘custom_components.luxtronik’).

Thanks in advance !

@snahsiub I think I have fixed it. Please try the current version.

Hello,

I’ owning a hetapump with a Luxtronik controller. Is there a how to or something similar on how to get this integration going? I’m quite new to HA and don’t know much about coding and stuff. But I’m very interested in monitoring (not changing settings) my Novelan heatpump through HA. I’ve read the github text but can’t see how to start from there.
Can anybody give an hint on how to start?

Welcome @tebald1 - here a short instruction:

  1. Install HACS (Home Assistant Community Store)
  2. In HACS add as userdefined repository (3 dots in the right corner → Userdefined repository)
    Repository: https://github.com/BenPru/luxtronik
    Category: Integration
  3. Follow the setup assistent after your heatpump was discovered. If not you can add it under devices.