Writing a component for Luxtronik Heatpumps

Hi marvandorth,

This is my configuration files. Everything is working perfectly and you can write variables with the command luxtronik.write :

configuration.yaml
luxtronik:
host: “192.168.1.20”
port: 8889
safe: true ## linea añadida para poder leer ##

sensors.yaml

  • platform: luxtronik
    scan_interval: 20
    sensors:
    • group: calculations
      id: ID_WEB_Temperatur_TVL
      friendly_name: Impulsion
      icon: mdi:thermometer
    • group: calculations
      id: ID_WEB_Temperatur_TRL
      friendly_name: Retorno
      icon: mdi:thermometer
    • group: calculations
      id: ID_WEB_Sollwert_TRL_HZ
      friendly_name: Set Retorno
      icon: mdi:thermometer
    • group: calculations
      id: ID_WEB_Temperatur_TBW
      friendly_name: ACS
      icon: mdi:thermometer
    • group: calculations
      id: ID_WEB_Einst_BWS_akt
      friendly_name: Set ACS
      icon: mdi:thermometer
    • group: calculations
      id: ID_WEB_Temperatur_TA
      friendly_name: Tª Ambiente
      icon: mdi:thermometer
    • group: calculations
      id: ID_WEB_HauptMenuStatus_Zeile1
      friendly_name: Estado
      icon: mdi:fan
    • group: calculations
      id: ID_WEB_Zaehler_BetrZeitVD1
      friendly_name: H func Compresor 1
      icon: mdi:home
    • group: calculations
      id: ID_WEB_Zaehler_BetrZeitImpVD1
      friendly_name: Impulsos Compresor 1
      icon: mdi:home

custom_components --> Bouni´s files you are using

That are my cards:

I hope this helps you.

Greetings,
David

Hi,

Still receiving the same error as described before.

Logger: homeassistant.components.sensor
Source: custom_components/luxtronik/sensor.py:77
Integration: Sensor (documentation, issues)
First occurred: 16:26:47 (1 occurrences)
Last logged: 16:26:47

Error while setting up luxtronik platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 178, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/luxtronik/sensor.py", line 59, in setup_platform
    entities.append(LuxtronikSensor(luxtronik, sensor, sensor_cfg))
  File "/config/custom_components/luxtronik/sensor.py", line 77, in __init__
    self._name = sensor_cfg[CONF_FRIENDLY_NAME]
KeyError: 'friendly_name'

I just can’t get it to work.

The only thing that is working is the luxtronik.write service?

if you type ip address of your heatpump in your browser do you watch this screen ?

I had to update my heatpump firmware to the latest version to be able to access it.

Yep I can access the heat pump via the IP address in my browser

Did you install the right Luxtronik library (version 0.0.4) with the same user and source as Home Assistant is running:
pip3 install luxtronik==‘0.0.4’

I don’t really understand what you mean with this.
I’ve placed Bouni’s files in the custom component folder.
My HA instance is running in a docker on a Synology NAS.

I’ve installed the library via SSH onto the NAS with pip install luxtronik==0.0.4.
Still the same issue and logs.
Perhaps someone who got it working can describe a step by step guide on how to install this?

You need to use pip3, otherwise it is installed as a python 2.7 library.
You are running ons a NAS?
What is the os, which linux distrubution?
Have you a separate user voor HA , for instance “homeassistant”.
Then you have to do something like “sudo -u homeassistant -H -s”
And also “source /srv/homeassistant/bin/activate”
These are also the commands which are necessary for install and upgrade of HA

Oh you are running in a docker?
Then you have to install pip3
and then run:

  FROM homeassistant/home-assistant
  RUN pip3 install luxtronik==0.0.4

Sounds that familiar?

Try adding a friendly_name for each of your sensor.

Ok, I managed to install the library from within the docker container as you said.
Rebooted the whole thing and well, something changed?
The logs now spit an error about ‘icon’.
I’ll paste the log below.

  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 178, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/luxtronik/sensor.py", line 59, in setup_platform
    entities.append(LuxtronikSensor(luxtronik, sensor, sensor_cfg))
  File "/config/custom_components/luxtronik/sensor.py", line 78, in __init__
    self._icon = sensor_cfg[CONF_ICON]
KeyError: 'icon'

Have you any icon mentioned in the luxtronik part in your configuration.yaml (or sensor.yaml)?
What happens when you remove these?

Try to add friendly_name and icon for each of your sensor.

1 Like

No didn’t defined any icon but when I did and defined a friendly name it seemed to work!
Thanks to you all!

Thanks for helping out, the sensors are now visible

Graag gedaan!

@Bouni Thanks for the great support for the community. Hopefully your pull request for the official integration will be accepted soon.

Have you also find something to fix the problem that we can’t see the status cooling? Same as a last year I got yesterday my heatpump in cooling mode and the integration sensor ‘luxtronik.id_web_wp_bz_akt’ displayed status ‘No request’. I can see that the pump is in cooling mode because of the status of ‘luxtronik.id_web_vboout’ and the input and output temperatures.

Good afternoon, everyone.

Can anyone tell me the name of this signal to enable it in the program?

No, not yet. To be honest I totally forgot about that, sorry :grimacing:

Hi everyone,

I just uploaded a HACS repo to GitHub: https://github.com/Bouni/luxtronik
At this point you’ll need to add it as a custom HACS repo, but thats fairly simple and should make setup and upgrade much easier!
I hope this gets included with HACS soon, as I fear that the official integration will take much more time and effort. Especially since they dropped YAML for new integrations and require a config flow.
I totally understand that they did that step as it is much more intuitive for non coders to config a integartion from the GUI rather than in YAML files.

Please test and give feedback!

@marvandorth @WhistleMaster @kc1950
That issue with friendly_name and icon is fixed in the HACS repo.
I did that on request of the HA maintainers and never tested that change :see_no_evil:
If you install via HACS you can drop friendly_name and icon from your config if you want to.

Update:

Hi everyone, I just pushed a bugfix release to Github.
If you have added the repo into HACS manually you should already see a V0.1.1 Version.

Please test and report issues here: https://github.com/Bouni/luxtronik

P.S. please post a comment underneath. The forum does not llow more than 3 posts on the same author in a row. Thats why I’m editing this post :man_facepalming:

3 Likes