Writing a component for Luxtronik Heatpumps

Wow great work so far. Are you going to push it to github?

I still think we should try to manually name all the sensors we know to have consistent and logical names.

Yes, I’ll defenitely push it as soon as I’ve cleaned it up a bit.
At the moment I think about giving users serveral ways to chose which sensors the want to use:

by index (the index of the lookup table)

- calculations:
    - 123

by id (the id from the java files)

- calculations:
    - id_web_temperature_trl

by name (the nice name we need to create)

- calculations:
    - supply_flow_temperature

What do you think about that?

1 Like

Here you go:

Disclaimer: Its quick and dirty, possibly some issues in there :wink:

Wow great, seems to work (after also running pip install luxtronik). Will have a detailed look later.

1 Like

Except that updating seems not to work, I always get:

ERROR
Tue Aug 21 2018 07:57:19 GMT+0200 (Central European Summer Time)
Hub Update

in the log every configured interval.

:grimacing: My bad, I’ve used a _LOGGER.error to put a message into the Log whenever the Component update is triggered

Will push a fixed version in a minute

Oh on more thing,

would you guys @Roemer and @hhermsen be so kind and fetch me the data coming from the heat pump so that I can compare them to mine?
I’m really interested in seeing the difference between the versions / heatpump models!

from luxtronik import Luxtronik

lx = Luxtronik('192.168.1.1', 8889)
with open('data.txt', 'w') as f:
    f.write(lx.get_data())

This should create a data.txt file that contains the data, make sure to adjust the IP to your heatpump!

Will do when I have some spare time!

I’ve sent you my data in a PM.
Had to add str() into the f.write in order to write the file.

Compared them, and the structure looks equal. Some more unknown fields at the end of all three categories but thats due to the higher version on my controller.

I run HA in a docker container, but the setup of luxtronic fails. Any ideas why?

2018-09-13 21:34:48 ERROR (MainThread) [homeassistant.setup] Error during setup of component luxtronik

Traceback (most recent call last):

File “/usr/src/app/homeassistant/setup.py”, line 148, in _async_setup_component

component.setup, hass, processed_config)  # type: ignore

File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 56, in run

result = self.fn(*self.args, **self.kwargs)

File “/config/custom_components/luxtronik.py”, line 44, in setup

lt = LuxtronikData(host, port)

File “/config/custom_components/luxtronik.py”, line 57, in init

from luxtronik import Luxtronik

ModuleNotFoundError: No module named ‘luxtronik’

pip install luxtronic did the trick. How can I make sure this dependency is installed on first run in a docker container?

Create your own Dockerfile. Are there any plans to integrate this component into the official home assistant release? I’m running it for some time now and haven’t had an issue.

1 Like

So the custom component is working great! Thanks.

I’m creating friendly names in dutch. But I’m having trouble to convert the seconds to hours. What’s wrong here?

sensor.luxtronik_id_web_zaehler_betrzeitwp:
friendly_name: Bedrijfsuren compressor
value_template: ‘{{(sensor.luxtronik_id_web_zaehler_betrzeitwp | (time % 86400) / 3600) | int %}}’

@Bouni
Found a list of identifiers for the Luxtronik heatpump. Works well with this component!

https://www.loxwiki.eu/pages/viewpage.action?pageId=18219334

Hi,

sorry for the late reply, I was on vacation.
The list of identifiers you’ve found is also by me. I hope to include translations into the component anytime soon, but I need to figure out how to do it the HA way.

Hi Bouni/Roemer,

I have just installed this component, but i cannot seem to get it configured.
I have copied the github files to the custom_compents folder. I have run pip install luxtronik.
And configured it like stated:

luxtronik:
  host: "192.168.1.95"
  port: 8889

sensors:
- platform: luxtronik
  scan_interval: 60
  sensors:
    - 'ID_WEB_Temperatur_TVL'
    - 'ID_WEB_Temperatur_TBW'

After adding the sensors it all went wrong. i could not do a check config anymore, it would just keep on turning the wheels.

What am i doing wrong?

Thanks!

I found these messages in the logs, do these help?

Mon Oct 29 2018 21:17:59 GMT+0100 (CET)

Error during setup of component luxtronik

Traceback (most recent call last):
File “/usr/lib/python3.5/site-packages/homeassistant/setup.py”, line 148, in _async_setup_component
component.setup, hass, processed_config) # type: ignore
File “/usr/lib64/python3.5/asyncio/futures.py”, line 381, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib64/python3.5/asyncio/tasks.py”, line 310, in _wakeup
future.result()
File “/usr/lib64/python3.5/asyncio/futures.py”, line 294, in result
raise self._exception
File “/usr/lib64/python3.5/concurrent/futures/thread.py”, line 55, in run
result = self.fn(*self.args, **self.kwargs)
File “/root/.homeassistant/custom_components/luxtronik.py”, line 44, in setup
lt = LuxtronikData(host, port)
File “/root/.homeassistant/custom_components/luxtronik.py”, line 57, in init
from luxtronik import Luxtronik
File “/root/.homeassistant/deps/lib/python3.5/site-packages/luxtronik/init.py”, line 81
self._data[target][i] = {“id”:l[“id”], “unit”:“ipaddress”, “value”:f"{raw >> 24 & 0xFF}.{raw >> 16 & 0xFF}.{raw >> 8 & 0xFF}.{raw & 0xFF}"}
^
SyntaxError: invalid syntax

I seemed to have fixed it, there was a letter ‘f’ inserted in some places of the code…
It works now, just need to sort out the names… they now all show up as {DOMAIN}_{self._sensor}. is that what you would expect?

@Bouni, @Roemer I am not a coder, but is there anyway I can help this development?