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

Great! Looking forward to testing the new version! With none or more hardcoded devices.

I just got some new problems when HASS.io updated to 0.95 yesterday… seems I get lots of errors everywhere. I’ll let you know. Please keep me in the loop about what you find out as well.

compile just finished and it’s still working fine for me. So I hope it’s also working fine for you now.

Is it working for you now?

No my USB HID device is never attached to DietPi, Rapbian og Hass.io (ResinOS) Linuxes. I can see it in dmesg and the vendor and product codes under lsusb, but is not attached. My ttyAMA0 is something else, and this should be ttyUSB*. Wondering if I have to dabble with dev rules and get them applied system-wide.:frowning:

Thanks for this add-on da-anda.

I kindly ask for help, because I was not able to get it running.
Always get an error:
F00000000: [12:interface] Link down, terminating
Maybe it’s just a lack in understanding and setting it up correctly.
I have to admit, that I’am pretty new to hass.

I use a Hager USB device, which I had been running for years with the old eibd. So HW and HW-connections to the TP should be the problem.
[ 2.111609] usb 1-1.5: new full-speed USB device number 4 using dwc_otg
[ 2.271115] usb 1-1.5: New USB device found, idVendor=135e, idProduct=0025
[ 2.274001] usb 1-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 2.274010] usb 1-1.5: Product: KNX-USB Data Interface
[ 2.274016] usb 1-1.5: Manufacturer: Hager Electro
[ 2.292879] hid-generic 0003:135E:0025.0001: hiddev96,hidraw0: USB HID v1.01 Device [Hager Electro KNX-USB Data Interfa
ce] on usb-3f980000.usb-1.5/input0

ls -l /dev/ttyA*
crw-rw---- 1 root audio 204, 64 Jul 30 22:42 /dev/ttyAMA0
Is ownership and group ok for knxd ?

knxd Config:
{
“address”: “0.0.1”,
“client_address”: “0.0.1:10”,
“interface”: “tpuart”,
“device”: “/dev/ttyAMA0”,
“custom_config”: “”
}
I assume address is the knx adress that th IF uses for TPUART comm.
But what is “client address” ?

Network:
Container Host
3671/udp 3671
6720/tcp 6720

configuration.yaml:
#KNX/EIB
knx:
config_file: xknx.yaml
routing:
local_ip: 192.168.2.30

How could I further trace this down ?
Thanks for any help.

Hey. Sorry for the delayed response. I honestly don’t know the answer to your question. I’m neither a linux export nor know much about knxd itself. I followed the online documentation of knxd and with a little help of the knxd-user-forum.de I was finally able to find the correct configuration for my setup. Haven’t touched it ever since.
But see here on how those HASS add-on variables are mapped to the knxd configuration file:
https://github.com/da-anda/hass-io-addons/blob/master/knxd/run.sh#L13

And if my default config template doesn’t suite your needs, you can specify your own knxd config to use in the setting “custom_config”.

edit: having a brief read on https://github.com/knxd/knxd#adding-any-other-usb-interface I think “tpuart” is the wrong interface to use in your case. Try “usb”

edit2: also see https://github.com/knxd/knxd/blob/master/doc/inifile.rst#usb

Problem SOLVED !!!

Thanks for the response da-anda.
In the meantime I have connected the same TPUART USB-stick from (http://busware.de) and used the same default knxd config.

My fault was, that after logged intop hassio with the standard ssh, I believed this is the “real” system, but now I understand its only a docker instance not showing up the read physical world of the raspi. This led to the wrong assumption, that the only USB device I found as /dev/ttyAMA0 must be the KNS-USB IF.

Now I learned how to ssh into the “real” sysem, to see whats really going on
Then changed knxd config back to default with “device”: “/dev/ttyACM0”.
Now I could see the knxd successfull started up and running.

Secondly I had to remove the ip-addresses under knx: section in configuration.yaml, just leaving single line:
knx:

This is a huge step forward in setting up ha, because knx gives access to nearly everything in my house.

Hi, hopefully someone can help me.
The only way our alarmsystem can communicate with home automation is thru KNX.
The first thing I was thinking, ‘hmm I’ve seen a KNX component somewhere’.
After some reading I discovered that Hass needs to connect to a KNX IP gateway.
Because I don’t own any KNX hardware I went on a search for a software solution and stumbled on knxd and this topic.
I am wondering if knxd can be used to act as sort of a broker (router/relay/server or so) to pickup the messages send by our alarmsystem and relay them to Hass?

Any help would be great!

Hi, basically knxd can act as IP router/relay/gateway for your KNX bus, but you will still need KNX hardware (and likely also software). So in order for the KNX bus to work, it needs a power supply. Then, you have to give your alarm system a KNX address and also assign group addresses to it’s “entry points” (via additional software like ETS5), so that you can read specific values from it or turn things on/off. And in order for KNXD to do it’s job, you also need some sort of KNX interface (USB, IP, …). Now, since you don’t have any KNX hw yet, I would suggest to go and buy a KNX IP interface, which makes knxd and this add-on basically obsolete, since you can use this interface directly with the KNX component of HomeAssistant. IP interfaces are not that much more expensive than USB interfaces (at least not the one from the brand MDT IIRC).
The aim of this add-on basically is to turn any existing KNX interface you have into a IP interface to which HomeAssistant can connect to. So if you would already have a USB interface, you could turn it into a IP interface using knxd and this add-on. If you want to save a few bucks and like tinkering, you can also grab a USB interface and use this add-on, but it’s way easier for you to directly get a IP interface.

As for the additional software you will need: You can get some sort of “Demo” version of the ETS5 KNX software after you passed the free ETS5 online training (it’s not hard, basically watching videos and answering questions right after each video). Alternatively you could buy ETS-Inside . But since I never used ETS-Inside and thus don’t know if you in addition will still need a IP/USB interface to control it, you’d have to do some research on it on your own.

Hi,
Did you get the KNX-rf stick working in Hassio? I also need to interface some KNX-rf termostats…

I don’t have a RF stick, so can’t tell if it will be working. If you are able to use it running knxd on your device (or in a linux VM) it should also work using this add-on as long as you configure the ports etc correctly

1 Like

I went with the only working solution I could find for KNX-RF: Calimero-tools. It’s a java command line (or GUI) suite, and I’m not familiar with java so i just run it in monitor mode as a daemon from inside node-red and read the stdout in there. This I then pipe into HomeKit and Grafana etc. from there.

It’s developed by the automation department of the University of Vienna, so it’s very stable but wasn’t actually working with my USB stick and my KNX-RF system before I contacted them and they very helpfully updated Calimero to support both.

Is there anyway this add-on will work with a “mdt USB-Interface” ? My current setup is this usb interface hooked up with an raspberry pi and hass.io.

SCN-USBR.02 USB Interface 2TE REG
https://www.mdt.de/Interfaces.html

likely, but you need to figure out the correct knxd configuration for it. See my previous answer KNXD add-on: covert your KNX-USB interface into an IP interface that can be used by HA

So basicly I probably will need a custom config to get this setup running? I am currently out of ideas, I tried every setting for the normal config.

I’m no knxd expert, but you have to configure it correctly so that it can pick up your USB interface. I don’t know via which hardware path your USB interface does show up in Linux (/dev/…), so you first have to check that and then use that in the configuration. Once you changed this and the interface from TPUART to USB (please see the correct settings value in the knxd docs) it should work ™. You should not have to touch the other settings

Hi,
I use KNX-USB Interface(GVS) on raspberryPi2 with images from Hass.io.
On another image on this board knxd work correct.
I run findknxusb utility and then start knxd daemon:
sudo knxd -p /run/knxd/knxd.pid --eibaddr=1.1.128 --client-addrs=1.1.129:8 -D -T -R -S -i --listen-local=/tmp/knx -t 1023 usb:

I install KNXD add-on and set config:
{
“address”: “1.1.128”,
“client_address”: “1.1.129:8”,
“interface”: “usb”,
“device”: “”,
“custom_config”: “”
}
Than I start this add-on and get such log:

E00000040: [15:interface] USBLoop-Create: No such file or directory
E00000103: [15:interface] setting up USB failed
E00000064: [12:interface] interface: setup interface: failed
F00000109: [ 1:main] Error setting up the KNX router.

Could you help me to fix this problem?

Hi. I’m sorry, I’m really no KNXD expert. But this add-on doesn’t use bash parameters to start knxd but uses the ini config (https://github.com/knxd/knxd/blob/8228dad55079573973161f7ac917e1129439b662/doc/inifile.rst). In this config ( https://github.com/da-anda/hass-io-addons/blob/c743ef89ee4c865755910eb70d529f62623dd8d2/knxd/run.sh#L12 ) I have a line that defines the interface device. You didn’t specify a device in your add-on config and thus the value of this parameter is empty. My guess is that knxd sees the config line and tries to find an empty device which doesn’t exist. Try specifying the hardware path to your USB interface there (which is also mandatory if you have plugged more than one USB device AFAIK)

@sergg did you get it working?

Sorry for later answer. I checked it - it d’not work. I temporary use KNX/IP router for my purpose.