Need help with setting up KNX

Hi guys,
my name is Sebastian and i am new to this community. I am looking for some help with smarthome-stuff but i am not really experienced with that kind of stuff (noob ;)) Sorry for this wall of text, but my problem is kinda “complicated…”

Here is the situation and what i am trying to do:
We bought a house with A LOT of Smarthome features. So far everything runs pretty okayish. We have two PIs runnig homebridge-servers which are then integrated into IOS and Homekit. We have EnOcean and KNX devices all over the Place (garden, windows, lights …).

Here the reason why i want to mess with the running system (i know… never touch it…)

  1. I want to get into this, so i know what my house is doing :wink:
  2. I want to controll the devices with IOS, Android and Windows, cause we got different devices :wink:
  3. These homebridges sometimes crash and i need to manually reboot them (not possible on vacation).
  4. Homebridge is not supported any longer (?)

So here is my plan:
I wanna try and set up a brand new PI (PI 4b) with Home Assistant and be able to mess around with it until it works, so i dont have to touch the existing (and working) system on the Homebridge-PIs (Pi 3). This way i have a fallback in case i screw up :wink: First step for me is trying to get access to the KNX-Devices.

Here is my setup and what i have done:
Pi4b is running HA and is connected directly to the router. The SSH-Connection is working and i am able to get to the HA-UI. I found the KNX/IP interface which is connected to the same network, too. I changed the HA-config following the official manual here: https://www.home-assistant.io/integrations/knx/. I even tried the tunneling-method.

When i boot up HA it says:
“The following components and platforms could not be set up:
knx
Please check your config.”

I have been working on this for the last three days, getting a little frustrated :wink:

So any help or hint would be really appreciated, thank you so much in advance!

Hi Sebastian, can you share your config, I have my KNX connected to HA even in a different subnet using a MDT IP Interface. Be aware that security is not possible yet.

knx:
  config_file: 'xknx.yaml'
  tunneling:
    host: 192.168.1.200
    port: 3671
    #local_ip: '192.168.0.80'
  fire_event: true
  fire_event_filter: ["*"]
  expose:
    #- type: 'temperature'
    #  entity_id: 'sensor.owm_temperature'
    #  address: '0/0/2'
    #- type: 'string'
    #  address: '0/0/4'
    #  entity_id: "sensor.owm_weather"

Cheers

1 Like

Hi Chris, thank you for your reply.

How could i forget that? :wink: Here it comes:


# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
# http:
#   base_url: example.duckdns.org:8123

# Text to speech
tts:
  - platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

knx:
  tunneling:
    host: 192.168.178.47
    port: 3671
    local_ip: 192.168.2.109

Here is a screenshot of my router:

I can see in your config that you have a xknx.yaml. Looks very different from mine, so maybe this is the way? How can i try?
Cheers

Hi!
I’d advise against using a dedicated xknx.yaml for you. It needs a different syntax that is not as well documented as the HA-configuration style. Otherwise it is pretty much the same.

It seems that your local_ip is wrong. You have …2.109 instead of …178.109 .
The knx integration can find ips and ports on its own. try it with just

knx:
# omit any other parameters (except expose and fire_event if you need them)

If there isn’t any more logs regarding knx you can enable debug loging for the knx integration like this:

logger:
  default: info
  logs:
    xknx: debug
    # xknx provides xknx.log, xknx.knx and xknx.telegram loggers.

Can you also show your configuration of a knx device?

Last thing that comes to my mind is your tunneling device. Check how many concurrent tunneling connections are available and how many are already used - it seems you have some devices there and interfaces that are lazy to free up unused tunneling slots are not unheared of. You should see this in the xknx logs (something like “no more connections”)

Hi guys,

sorry for the late reply… New year and familiy-stuff :wink:

I changed the local_ip to the correct values (OMG…). Scince then i dont get the knx-error message anymore, which seems to be a good thing.
But still i dont see any new devices beeing found.

What do you mean by “show a configuration of a knx device”? You mean in this ETS5 software maybe? I dont own a full license, only the trial version is installed. I can see at least, that the KNX/IP interface is recognized and i can see the port, too.

I activated the log. My config looks like this now:


# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
# http:
#   base_url: example.duckdns.org:8123

# Text to speech
tts:
  - platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

knx:
  tunneling:
    host: 192.168.178.47
    port: 3671
    local_ip: 192.168.178.109
    
logger:
  default: info
  logs:
    xknx: debug
    # xknx provides xknx.log, xknx.knx and xknx.telegram loggers.

I checked the logfile. Ofc its a really long list but it seems like it is repeating at some point. Last page looks like this: (EDIT: Not really sure if i got the correct log. I found another one but its even longer. Can´t paste it here)

2020-01-04 19:41:23 DEBUG (MainThread) [xknx.knx] Sending: <KNXIPFrame <KNXIPHeader HeaderLength="6" ProtocolVersion="16" KNXIPServiceType="KNXIPServiceType.TUNNELLING_ACK" Reserve="0" TotalLength="10" />
 body="<TunnellingAck communication_channel_id="81" sequence_counter="51" status_code="ErrorCode.E_NO_ERROR" />" />
2020-01-04 19:41:23 DEBUG (MainThread) [xknx.telegram] <Telegram group_address="GroupAddress("3/1/1")", payload="<DPTArray value="[0x44,0x16,0xc0,0x0]" />" telegramtype="TelegramType.GROUP_WRITE" direction="TelegramDirection.INCOMING" />
2020-01-04 19:41:26 DEBUG (MainThread) [xknx.knx] Received: <KNXIPFrame <KNXIPHeader HeaderLength="6" ProtocolVersion="16" KNXIPServiceType="KNXIPServiceType.TUNNELLING_REQUEST" Reserve="0" TotalLength="21" />
 body="<TunnellingRequest communication_channel_id="81" sequence_counter="52" cemi="<CEMIFrame SourceAddress="PhysicalAddress("1.1.2")" DestinationAddress="GroupAddress("4/0/0")" Flags="1011110011100000" Command="APCICommand.GROUP_WRITE" payload="<DPTBinary value="0" />" />" />" />
2020-01-04 19:41:26 DEBUG (MainThread) [xknx.knx] Sending: <KNXIPFrame <KNXIPHeader HeaderLength="6" ProtocolVersion="16" KNXIPServiceType="KNXIPServiceType.TUNNELLING_ACK" Reserve="0" TotalLength="10" />
 body="<TunnellingAck communication_channel_id="81" sequence_counter="52" status_code="ErrorCode.E_NO_ERROR" />" />
2020-01-04 19:41:26 DEBUG (MainThread) [xknx.telegram] <Telegram group_address="GroupAddress("4/0/0")", payload="<DPTBinary value="0" />" telegramtype="TelegramType.GROUP_WRITE" direction="TelegramDirection.INCOMING" />
2020-01-04 19:41:26 DEBUG (MainThread) [xknx.knx] Received: <KNXIPFrame <KNXIPHeader HeaderLength="6" ProtocolVersion="16" KNXIPServiceType="KNXIPServiceType.TUNNELLING_REQUEST" Reserve="0" TotalLength="25" />
 body="<TunnellingRequest communication_channel_id="81" sequence_counter="53" cemi="<CEMIFrame SourceAddress="PhysicalAddress("1.1.4")" DestinationAddress="GroupAddress("3/1/1")" Flags="1011110011100000" Command="APCICommand.GROUP_WRITE" payload="<DPTArray value="[0x44,0x17,0x0,0x0]" />" />" />" />
2020-01-04 19:41:26 DEBUG (MainThread) [xknx.knx] Sending: <KNXIPFrame <KNXIPHeader HeaderLength="6" ProtocolVersion="16" KNXIPServiceType="KNXIPServiceType.TUNNELLING_ACK" Reserve="0" TotalLength="10" />
 body="<TunnellingAck communication_channel_id="81" sequence_counter="53" status_code="ErrorCode.E_NO_ERROR" />" />
2020-01-04 19:41:26 DEBUG (MainThread) [xknx.telegram] <Telegram group_address="GroupAddress("3/1/1")", payload="<DPTArray value="[0x44,0x17,0x0,0x0]" />" telegramtype="TelegramType.GROUP_WRITE" direction="TelegramDirection.INCOMING" />

That looks good! You may remove the whole tunneling: section - if IP addresses change at some point you will not have to reconfigure.

Disable debug logging for xknx again - no need to log every telegram that’s seen on the bus.

Knx has no auto-discovery of any sort. You will have to configure every device you want to integrate in HA - light, sensor, binary_sensor, climate. See the HA Knx documentation for more info about how to configure each device.

1 Like

Where can i find the HA KNX documentation?
Do you mean this? https://www.home-assistant.io/integrations/knx/

Maybe also the config from others may help:

e.g.

1 Like

Yes exactly. Check out the links to sensors, light, etc.

1 Like

Guys, i can´t beleive it´s working! :wink:
Thank you so much!

Starting to configure the different devices now!

1 Like