Help with KNX: Can't connect to KNX interface: Could not establish connection

I try to connect hassio to Siemens 5wg1 151 ip viewer but not success.
It show in the log: “Can’t connect to KNX interface: Could not establish connection”
This is the config:

knx:
tunneling:
host: ‘192.168.1.67’
port: 3671
local_ip: ‘192.168.1.68’

Host is the knx ip address local is the pi address. I also check form the ssh: ifconfig eth0 but it show difference ip for the pi:

eth0 Link encap:Ethernet HWaddr 02:42:AC:1E:21:02
inet addr:172.30.33.2 Bcast:0.0.0.0 Mask:255.255.254.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:672 errors:0 dropped:0 overruns:0 frame:0
TX packets:374 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:132878 (129.7 KiB) TX bytes:128090 (125.0 KiB)

1 Like

Hi Viet,
Here is my config :

knx:
  tunneling:
    host: 'X.Y.Z.96'
    port: 3671
    local_ip: 'X.Y.Z.99'

With .96 being my KNX/IP gateway, and .99 being my Raspberry Pi with Home Assistant.

The IP address 172.30.33.2 is different than the LAN address because you run Home Assistant in a docker container. I’m not sure how it’s supposed to work with the KNX/IP gateway, but you can try with the docker IP address (172.30.33.2) in the “local_ip” config option.

If it’s still not working, you can add debug logs (from my memory, not tested) :

logs:
  homeassistant.components.xknx: debug

Best
Ronnie

1 Like

Hi!

I have a similar issue, I would be pleased for any advice. I am running Home Assistant in a Docker container on my Synology D918+ (Intel Celeron).

My KNX device is a BAOS 771, work fine with two other devices and ETS5.

The config lines in the config.yaml are as such:
knx:
tunneling:
host: ‘192.168.0.252’ #BAOS 771 Address
port: 3671
local_ip: ‘172.17.0.2’

Docker IP Address proven thus:

root@homeassistant-home-assistant1:/usr/src/app# ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: sit0@NONE: mtu 1480 qdisc noop state DOWN group default qlen 1
link/sit 0.0.0.0 brd 0.0.0.0
31: eth0@if32: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 02:42:ac:11:00:02 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 172.17.0.2/16 scope global eth0
valid_lft forever preferred_lft forever
root@homeassistant-home-assistant1:/usr/src/app#

home-assistant.log output:

2018-10-18 08:36:19 WARNING (MainThread) [homeassistant.components.knx] Can’t connect to KNX interface: Could not establish connection

Any ideas as I am lost with this one!

If I alter the Source IP Address I get a page of errors, so there certainly seems to be an established tunnel to the BAOS 771

Only thought is that perhaps I have to specify a address for the BAOS 771? (1.0.63), but I don’t think this is necessary.

regards.
Justin

Hello,

I don’t know if it helps. Depending on the KNX IP gateway and gateway configuration only one active connection is allowed.

So if you have the KNX programming tool (ETS) open and your home assistant tryes to connect only one instance can astablish an connection.

Hi Ludga, alas no, the gateway can support 10 connections at once. Also I have been experimenting with OpenHAB and that connects just fine, however I prefer some of the aspects of Home Assistant, if only KNX would work!

Hi,

Have you tried to just set the local_ip to your host ip, and disable the tunneling and use the auto discover feature? (It is possible that this only works with routers, not with gateways)

example:

config_file: 'xknx.yaml'
expose:
  - type: 'time'
   address: '9/0/2'
  - type: 'datetime'
    address: '9/0/3'
routing:
  #tunneling:
    #host: '192.168.0.101'
    #port: 3671
  local_ip: '192.168.0.250'

Hi Jens, many thanks! I’ve not added an xknx.yaml file yet (all within the configuration.yaml right now, but is the path not required when both files are in the same folder?

Sounds like a job for this evening… :slight_smile:

I worked solidly on this yesterday and the issue was 100% down to the Docker container not communicating properly with the physical LAN. The switches --net=host in the configuration.yaml file are supposed to do this, but they don’t. However if you run the executable with these switches

<sudo docker run --name home-assistant --net=host>

then it all works ok - the local_ip is then the address of the Synology. And guess what, My Bravia TV, Yamaha AV and even my FLIC hub are all discovered!

So KNX is now running, but there are quite a few bugs/omissions in the Dimmer and Thermostat interfaces. For example I want to step up/down temperature of a thermostat in 0.5C steps, but only step-down works, also some of the documentation is missing. I wish they would show the Data Point Types.

Another issue for light/dimmer is that the status indications are responded to on a change of state, but periodic updates to synchronise the initial state are ignored by the Home Assistant Device. Perhaps I need to “expose” the group addresses like in your example?

I must say the Software has a lot of promising integrations, works really well for our Tesla and BMW i3 Cars and for iCloud for location tracking, but it does not like two iPhones with the same name, even one is inactive (was stolen from my daughter).

Next step is for the Cisco Meraki integration - send a notification when the cleaner arrives to clean the house and when she leaves! :slight_smile:

After another evening of hard work, I’ve come to the conclusion that I need to purchase a router, though I can use tunnelling and set devices manually there are too many issues, partially with status synchronisation. Unless anyone knows better?

Which router is recommended for Home Assistant? The WEINZIERL IP router 751 seems to tick all the right boxes for compatibility…

Have you tried using a config file with own_address filled in?
I have documented this over here: KNX - Looking for basic step by step guide

Because the manual of the BAOS 771 says it has different addresses for different connections:

The KNX IP BAOS 771 can only act as an interface to KNX
when the IP-configuration is valid.
The following configuration steps are required:
Select the button ‘Settings’ on the tab ‘Communication’ in the
main window of ETS4. All available connections are listed
under ‘Discovered connections’. Select the desired
connection.
The KNX IP BAOS 771 supports up to 5 simultaneous
tunneling connections. Each connection uses its own physical
address. The address of the first tunneling connection can be
changed within the ‘Local Interface Settings’.
Physical addresses of the additional tunneling connections
can be assigned directly on the device.
This is done by pressing the learn key on the device (3) longer
than one second. After that, the Learn-LED will start blinking,
which indicates that the assignment of the additional
addresses was successful.
The additional addresses are assigned as follows:
Tunneling connection 2 receives the next higher address than
tunneling connection 1, tunneling connection 3 the next higher
address than tunneling connection 2 etc..
For example:
Device address: 1.1.255 (address within ETS topology)
Connection 1: 1.1.250 (address within local settings)
Connection 2: 1.1.251 (assigned by learn key)
Connection 3: 1.1.252 (assigned by learn key)
Connection 4: 1.1.253 (assigned by learn key)
Connection 5: 1.1.254 (assigned by learn key)
All addresses have to be unique and valid within the sub line
of the KNX IP BAOS 771. Note: be careful not to assign the
same address as the device address for a connection. The 
device address can be changed within the topology view of
the ETS software.
For new devices (i.e. in the factory settings state), only the
additional individual address of the first connection is active
with the address 15.15.250. To support multiple concurrent
connections additional address assignment is required.

source: https://www.weinzierl.de/images/download/products/771/Weinzierl_771_KNX_IP_BAOS_Manual_EN.pdf

It would try setting own_address to 15.15.250 (= tunneling connection 1)

Otherwise, the wienzler router would do the trick.

Jens,

Really helpful, particularly your link. It sounds like the router is the best and least flakey way of achieving this, supports multicast to the IP network so I’ve ordered a Weinzierl KNX IP Router 751, Home Assistant to auto-learn the KNX devices. I’ve been putting off the day of getting a router so now I’ve bitten the bullet!

My network has two lines, the TP and the RF (used for handheld remotes)

Question is do I now put the KNX on a separate V-LAN (VLAN 4)? I have a trunk port to the Synology, but then I have to think how I like a virtual adaptor to the docker container, anyone on here done this before? Ideally I still want the web front end exposed to VLAN 1 though.

I have another couple of questions:

a) My room controllers are Gira Touch Sensor 3 Plus types, the thermostat (set-point) down works, but not up. The set-point status and Current Temperature, Heating Mode etc all works just fine. The Thermostats ares set for Absolute, not relative, but I can’t see this should make a difference. Running 0.80.3 on Synology/Docker.

b) I have just ordered a NUC i3 (8th Gen) with a basic configuration 128GB NVME and 8GB RAM to run Ubuntu 18.04 LTS, purely for Home Assistant. I’m going to use the Synology as my DEV environment. Which version of Home Assistant is recommended? Should I continue to run it in a Docker container or native, and should I consider HASS? TBH I’m not exactly sure what the difference is between HA and HASS. I’ve gone for the i3 NUC rather than a Raspberry Pi as likely I can use it for other building related applications in the future and lots of nice pictures etc.

BTW 0.81 broke my Lovelace interface, there seems to be an issue with CARDS, so I reverted to 0.80.3

configuration.yaml

  • platform: knx
    name: ‘Master Ensuite Climate’
    temperature_address: ‘3/1/12’
    target_temperature_address: ‘3/3/12’
    setpoint_shift_address: ‘3/4/12’
    operation_mode_address: ‘3/7/12’

And in Lovelace:

  - type: entities
    title: Master Suite
    entities:
    #  - sensor: sensor.
      - entity: climate.master_suite_climate
      - type: divider
      - entity: light.master_bedroom_downlights
      - entity: light.master_suite_wall_lh
      - entity: light.master_suite_wall_rh
      - type: divider
      - entity: climate.master_ensuite_climate
      - type: divider
      - entity: light.master_ensuite_downlights
      - entity: light.master_ensuite_mirror
      - entity: light.master_ensuite_shower