KNXD add-on: convert your KNX-USB interface into an IP interface that can be used by HA

Hi,
I’m using KNX integration in HA with knxd addon to connect to KNX bus. HA server uses USB interface to connect to KNX.

Everything works fine until I remove network cable from HA server. In that moment knxd looses network connetion and shuts down and the connection to KNX bus is broken.

Any advice how to solve this issue?

I want to stay connected from HA to KNX bus even the network cable is not connected to the server.

thanks

have you tried restarting the add-on after you have cut the network connection? But since the add-on is running on the host network (so that you can use the provided IP-Interface also from other devices and use tools like ETS etc) and not just on the internal docker network, I doubt that it will work without any active network connection.

If you have used autoconfiguration of the KNX HA component, chances are that it uses your devices IP to talk to knxd. You could try a manual configuration and use the internal IP of the add-on/docker, but no idea if that would work. So sorry, I have no real solution for you. There might be ways with docker and knxd, but I do not know them.

years ago i used eibd to interface with a siemens n151 so that i could have multiple connections instead of one. (tunnel vs router)

i have just downloaded and installed this addon but i can’t see any clear reference to that specific feature of eibd.

is that possible with this addon or do i need to install eibd?

[main]
addr = %%ADDRESS%%
client-addrs = %%CLIENT_ADDRESS%%
connections = server,A.tcp,interface-%%INTERFACE%%
logfile = /dev/stdout
debug = debug

[A.tcp]
server = knxd_tcp

[server]
server = ets_router
tunnel = tunnel
router = router
discover = true
name = knxd

this is the default configuration (strings with %%% will be replaced with values from the add-on configuration). You should also be able to pass a custom ini config in the according add-on setting (you might need to use YAML mode since multi-line textfield support got dropped from HA a while back). No guarantee that the custom ini feature still works as intended. I should probably change this to a field for custom command line parameters.

This is the according documentation for the ini file settings

as you can see, tunneling and routing should be enabled by the default config of this add-on, but can’t guarantee that your usecase is fully supported

1 Like

thanks for the reply, i will try this.

the fact that it is built for TPUART or USB bus adaptors got me ‘side tracked’ .

these are only mentioned because they are the most common and are known to work. I could be that other interfaces might need tweaks in the container config so that knxd can correctly see the hardware, but this is something I was not able to test (I only have a TPUART device and community so far reported USB devices as working)

1 Like

Very nice add-on!

I have built my own KNX BCU that I’m already using on a raspberry pi running KNXD, though this is without home-assistant.

Would this add-on be able to work with the UART pins of the Raspberry PI 4? for example, instead of defining the interface to USB, would it work to define it to serial/uart and then use the /dev/serial1 as the device ?

I use it via UART, so yes, it should

Thanks for your answer, I should have tried before asking of course, but I’m not at home right now and I was very happy that I found this add-on.

Did you manage to use the hardware UART while still keeping bluetooth activated ?

Dear all, I am new to hass-io and therefore quite learning a lot. Apologies upfront in case my questions are too noob-ish.

My objective:
Combine my existing KNX-environment with hass-io to create scenes for my home cinema:
hass-io integration: control AVR and projector ← DONE
KNX: control lightning ← DONE via busware adater (edited: 30.03.2024)

My problem:
I cannot connect my existing Divus KNX server (2015) via IP to hass-io. Currently I assume that my knx server does not support the IP-interface as it’s too old (nevertheless the manual states that it should support this, I am currently in contact with the manufacture).
The technician performed the ETS-programming years ago using a USB-KNX-adapter.
The Divus KNX server is connected to the KNX-bus and offers a RJ45-interface. On the server an eibd is running in tunneling mode (eibd -D -R -S -u tpuarts:/dev/ttyS3)

My querstion:
Using the USB-KNX-stick from busware with the knxd should solve my issue to get access to the KNX-bus with hass-io right? I assume it can be configured either in tunneling or routing mode.

BR

I’m not using bluetooth, so no idea if it’s still working, but I guess so

If your main goal is to get a KNX IP-interface, buy an actual IP-interface instead of buying something USB based and convert it to an IP-interface. While it does work, I’d only see this as a workaround for already existing hardware. If you are buying new these days, directly get an IP-interface and save yourself the trouble of this or any other add-on to make it work.

However, if all you care about is triggering a specific scene, I am certain that you could get it working also with your current setup, since the website of your KNX server claims that it has scripting capabilities. So you could probably have it trigger/call an HomeAssistant WebHook which can take care of the HA side of the scene, while your server does the KNX side. This ofc would only work if the trigger to activate the scene is done via KNX, so that your server can act on it

thx for you replies. I played around now quite some days and my resume is that I’ll stick with the busware-adapter.
I was able to get a ABB IP-Router, acting as an interface between network and KNX, but it caused me more trouble than joy (telegrams have been forwarded indefinitely between my Divus KNX-server and the KNX-server resulting in KNX-madness).
With the busware adapter, it just was a piece of cake: installation was easy and no hick-ups on the KNX -bus.

So: everything is working just fine, I am happy and now start to automatize everything I can in my home :rofl:

Hi,

I can confirm that my homemade KNX BCU works with your ADDON as well. I connected it to the GPIO15 & 16 on my RPI3, however, I had to disable Bluetooth and enable serial1 from the config.txt on my SD card to get it to work.

My BCU is based on the NCN5121 chip from Omnesi FYI.

Now it’s working flawlessly with my BCU and also as a router :smiley:

Thanks for making knxd work with HASSIO!


Here’s my working config if anyone is interested:

address: 0.0.1
client_address: 0.0.2:8
interface: tpuart
device: /dev/ttyAMA0
log_error_level: warning
usb_filters: single
ip_address: ""
dest_port: "99"
custom_config: |-
  [main]
  addr = 0.0.1
  client-addrs = 0.0.2:10
  connections = server,A.tcp,interface
  logfile = /dev/stdout

  [A.tcp]
  server = knxd_tcp

  [server]
  server = ets_router
  tunnel = tunnel
  router = router
  discover = true
  name = knxd

  [interface]
  driver = usb
  device = 
  filters = single,queue

Thanks to someone above who shared most of this code.

2 Likes

Thanks for making knxd as add-on.
Makes thing a lot more cleaner!

I have a question about more or less knxd

I have Gira X1 in my home, which give me 4 up tunneling sessions.
I would like to use knxd to have ipt interface connected to the my X1(or any IP interface) and have knxd serve over multicast.

This way I can use third party devices such as ESP based Tasmota talking over knx multicast via knxd to TP devices

However I don’t see option in the GUI to use ipt interface?

you can use a custom_config like shown in the post above you and provide your own knxd config using the ipt driver and whatever specific config options this will need.

Adding specific config options for each and every driver would just bloat the config UI and make it confusing as heck, while it won’t be used by the majority of users. For advanced usecases, I had added the custom_config section.

Yeah ok, thanks!
I think it’s quite common to have only tunnel connection to some kind of server and want to convert that data to multicast, so other 3rd party knx tools can read it.

Either way, I have hard times entering the custom_config in ini style like this
[A.ipt]
driver = ipt
ip-address = ip.a.d.r

[debug-server]
name = mcast:knxd

[main]
addr = 1.0.90
client-addrs = 1.0.91:5
connections = A.ipt,server

systemd = systemd

[server]
debug = debug-server
discover = true
router = router
server = ets_router
tunnel = tunnel

Same goes if you try with command line options


1 Like

you probably have to disable the visual editor for the custom_config to work. Need to find a better solution for this in the future

and the main goal of this add-on is to convert USB/UART interfaces into IP interfaces so that they can be used with HomeAssistant

Feel stupid, can’t figure what am I doing wrong here