KNX Communication Issues - Failing with 2 Switches

I have a working KNX domotica system that works 100% with OpenRemote, so I am certain that there is nothing wrong with the basic KNX configuration.

I have tried to evaluate Home-Assistant on Raspberry Pi 3, using manual install on Jessie Lite.

If I have only one switch defined, it works.

Here is the switch definitions in config file:

knx:
          host: 10.4.1.5
          port: 3671

switch:
            platform: knx
            name: "Entrance Hall"
            address: 1/1/1
            state_address: 1/5/111

Here is the log file with one switch:

cat home-assistant.log 
16-10-29 11:07:12 homeassistant.core: Bus:Handling <Event component_loaded[L]: component=recorder>
16-10-29 11:07:12 homeassistant.core: Bus:Handling <Event component_loaded[L]: component=logger>
16-10-29 11:07:12 root: Started data server on UDP port 35982
16-10-29 11:07:12 root: Connected KNX IP tunnel (Channel: 122, HPAI: 8 1)
16-10-29 11:07:12 homeassistant.components.knx: Res = True
16-10-29 11:07:12 homeassistant.components.knx: KNX IP tunnel to 10.4.1.5:3671 established
16-10-29 11:07:12 homeassistant.core: Bus:Handling <Event component_loaded[L]: component=knx>
16-10-29 11:07:12 homeassistant.core: Bus:Handling <Event component_loaded[L]: component=http>
16-10-29 11:07:12 homeassistant.core: Bus:Handling <Event component_loaded[L]: component=history>
16-10-29 11:07:12 homeassistant.core: Bus:Handling <Event component_loaded[L]: component=discovery>
16-10-29 11:07:12 homeassistant.core: Bus:Handling <Event component_loaded[L]: component=api>
16-10-29 11:07:12 homeassistant.core: Bus:Handling <Event component_loaded[L]: component=frontend>
16-10-29 11:07:12 homeassistant.core: Bus:Handling <Event component_loaded[L]: component=updater>
16-10-29 11:07:12 homeassistant.loader: Loaded switch.knx from homeassistant.components.switch.knx
16-10-29 11:07:12 homeassistant.bootstrap: Component knx already set up.
16-10-29 11:07:12 homeassistant.bootstrap: Component knx already set up.
16-10-29 11:07:12 homeassistant.components.knx: Initalizing KNX group address 2305
16-10-29 11:07:12 root: Received tunneling ACK
16-10-29 11:07:13 homeassistant.components.knx: Unable to read from KNX address: 2305 (None)
16-10-29 11:07:13 root: Got value of group address 3439 from cache: [0]
16-10-29 11:07:13 homeassistant.core: Bus:Handling <Event state_changed[L]: new_state=<state switch.entrance_hall=off; friendly_name=Entrance Hall @ 2016-10-29T11:07:13.870973+02:00>, old_state=None, entity_id=switch.entrance_hall>
16-10-29 11:07:13 root: Got value of group address 3439 from cache: [0]
16-10-29 11:07:13 root: Got value of group address 3439 from cache: [0]
16-10-29 11:07:13 homeassistant.loader: Loaded group from homeassistant.components.group
16-10-29 11:07:13 homeassistant.core: Bus:Handling <Event state_changed[L]: new_state=<state group.all_switches=off; hidden=True, order=0, auto=True, entity_id=('switch.entrance_hall',), friendly_name=all switches @ 2016-10-29T11:07:13.877617+02:00>, old_state=None, entity_id=group.all_switches>
16-10-29 11:07:13 homeassistant.core: Bus:Handling <Event service_registered[L]: service=turn_off, domain=switch>
16-10-29 11:07:13 homeassistant.core: Bus:Handling <Event service_registered[L]: service=turn_on, domain=switch>
16-10-29 11:07:13 homeassistant.core: Bus:Handling <Event service_registered[L]: service=toggle, domain=switch>
16-10-29 11:07:13 homeassistant.core: Bus:Handling <Event component_loaded[L]: component=switch>
16-10-29 11:07:13 homeassistant.core: Bus:Handling <Event service_registered[L]: service=log, domain=logbook>
16-10-29 11:07:13 homeassistant.core: Bus:Handling <Event component_loaded[L]: component=logbook>
16-10-29 11:07:13 homeassistant.core: Bus:Handling <Event service_registered[L]: service=process, domain=conversation>
16-10-29 11:07:13 homeassistant.core: Bus:Handling <Event component_loaded[L]: component=conversation>
16-10-29 11:07:13 homeassistant.core: Starting Home Assistant (11 threads)
16-10-29 11:07:13 homeassistant.core: Starting Home Assistant core loop
16-10-29 11:07:13 homeassistant.core: Bus:Handling <Event homeassistant_start[L]>
16-10-29 11:07:13 homeassistant.core: Bus:Handling <Event service_registered[L]: service=stop, domain=homeassistant>
16-10-29 11:07:13 homeassistant.core: Bus:Handling <Event service_registered[L]: service=restart, domain=homeassistant>
16-10-29 11:07:13 homeassistant.core: Timer:starting
16-10-29 11:07:14 netdisco.service: Scanning
16-10-29 11:07:30 root: Got value of group address 3439 from cache: [0]
16-10-29 11:07:30 root: Got value of group address 3439 from cache: [0]
16-10-29 11:07:30 root: Got value of group address 3439 from cache: [0]
16-10-29 11:08:00 root: Got value of group address 3439 from cache: [0]
16-10-29 11:08:00 root: Got value of group address 3439 from cache: [0]
16-10-29 11:08:00 root: Got value of group address 3439 from cache: [0]
16-10-29 11:08:23 root: Heartbeat: Send connection state request
16-10-29 11:08:23 root: Heartbeat: Successful
16-10-29 11:08:30 root: Got value of group address 3439 from cache: [0]
16-10-29 11:08:30 root: Got value of group address 3439 from cache: [0]
16-10-29 11:08:30 root: Got value of group address 3439 from cache: [0]
16-10-29 11:08:54 homeassistant.components.http: Serving / to 10.4.1.28 (auth: True)
16-10-29 11:08:55 homeassistant.components.http: Serving /api/bootstrap to 10.4.1.28 (auth: True)
16-10-29 11:08:55 homeassistant.components.http: Serving /api/stream to 10.4.1.28 (auth: True)
16-10-29 11:08:55 homeassistant.components.api: STREAM 1990442776 ATTACHED
16-10-29 11:08:55 homeassistant.components.api: STREAM 1990442776 WRITING data: ping
16-10-29 11:09:00 root: Got value of group address 3439 from cache: [0]
16-10-29 11:09:00 root: Got value of group address 3439 from cache: [0]
16-10-29 11:09:00 root: Got value of group address 3439 from cache: [0]
16-10-29 11:09:02 homeassistant.components.http: Serving /api/services/homeassistant/turn_on to 10.4.1.28 (auth: True)
16-10-29 11:09:02 homeassistant.core: Bus:Handling <Event call_service[L]: service=turn_on, service_data=entity_id=switch.entrance_hall, service_call_id=1977579888-1, domain=homeassistant>
16-10-29 11:09:02 homeassistant.core: Bus:Handling <Event call_service[L]: service=turn_on, service_data=entity_id=['switch.entrance_hall'], service_call_id=1977579888-2, domain=switch>
16-10-29 11:09:02 root: Received tunneling ACK
16-10-29 11:09:02 root: Got value of group address 3439 from cache: [0]
16-10-29 11:09:02 root: Got value of group address 3439 from cache: [0]
16-10-29 11:09:02 root: Got value of group address 3439 from cache: [0]
16-10-29 11:09:02 homeassistant.core: Bus:Handling <Event service_executed[L]: service_call_id=1977579888-2>
16-10-29 11:09:02 homeassistant.core: Bus:Handling <Event service_executed[L]: service_call_id=1977579888-1>
16-10-29 11:09:02 root: Got value of group address 3439 from cache: [0]
16-10-29 11:09:02 root: Got value of group address 3439 from cache: [0]
16-10-29 11:09:02 root: Got value of group address 3439 from cache: [1]
16-10-29 11:09:02 root: Got value of group address 3439 from cache: [1]
16-10-29 11:09:02 homeassistant.core: Bus:Handling <Event state_changed[L]: new_state=<state switch.entrance_hall=on; friendly_name=Entrance Hall @ 2016-10-29T11:09:02.601299+02:00>, old_state=<state switch.entrance_hall=off; friendly_name=Entrance Hall @ 2016-10-29T11:07:13.870973+02:00>, entity_id=switch.entrance_hall>
16-10-29 11:09:02 homeassistant.components.api: STREAM 1990442776 FORWARDING <Event state_changed[L]: new_state=<state switch.entrance_hall=on; friendly_name=Entrance Hall @ 2016-10-29T11:09:02.601299+02:00>, old_state=<state switch.entrance_hall=off; friendly_name=Entrance Hall @ 2016-10-29T11:07:13.870973+02:00>, entity_id=switch.entrance_hall>
16-10-29 11:09:02 homeassistant.core: Bus:Handling <Event state_changed[L]: new_state=<state group.all_switches=on; hidden=True, order=0, auto=True, entity_id=('switch.entrance_hall',), friendly_name=all switches @ 2016-10-29T11:09:02.610225+02:00>, old_state=<state group.all_switches=off; hidden=True, order=0, auto=True, entity_id=('switch.entrance_hall',), friendly_name=all switches @ 2016-10-29T11:07:13.877617+02:00>, entity_id=group.all_switches>
16-10-29 11:09:02 homeassistant.components.api: STREAM 1990442776 WRITING data: {"data": {"new_state": {"last_updated": "2016-10-29T09:09:02.601299+00:00", "attributes": {"friendly_name": "Entrance Hall"}, "state": "on", "last_changed": "2016-10-29T09:09:02.601299+00:00", "entity_id": "switch.entrance_hall"}, "old_state": {"last_updated": "2016-10-29T09:07:13.870973+00:00", "attributes": {"friendly_name": "Entrance Hall"}, "state": "off", "last_changed": "2016-10-29T09:07:13.870973+00:00", "entity_id": "switch.entrance_hall"}, "entity_id": "switch.entrance_hall"}, "time_fired": "2016-10-29T09:09:02.601537+00:00", "event_type": "state_changed", "origin": "LOCAL"}
16-10-29 11:09:02 homeassistant.components.api: STREAM 1990442776 FORWARDING <Event state_changed[L]: new_state=<state group.all_switches=on; hidden=True, order=0, auto=True, entity_id=('switch.entrance_hall',), friendly_name=all switches @ 2016-10-29T11:09:02.610225+02:00>, old_state=<state group.all_switches=off; hidden=True, order=0, auto=True, entity_id=('switch.entrance_hall',), friendly_name=all switches @ 2016-10-29T11:07:13.877617+02:00>, entity_id=group.all_switches>
16-10-29 11:09:02 homeassistant.components.api: STREAM 1990442776 WRITING data: {"data": {"new_state": {"last_updated": "2016-10-29T09:09:02.610225+00:00", "attributes": {"hidden": true, "order": 0, "auto": true, "entity_id": ["switch.entrance_hall"], "friendly_name": "all switches"}, "state": "on", "last_changed": "2016-10-29T09:09:02.610225+00:00", "entity_id": "group.all_switches"}, "old_state": {"last_updated": "2016-10-29T09:07:13.877617+00:00", "attributes": {"hidden": true, "order": 0, "auto": true, "entity_id": ["switch.entrance_hall"], "friendly_name": "all switches"}, "state": "off", "last_changed": "2016-10-29T09:07:13.877617+00:00", "entity_id": "group.all_switches"}, "entity_id": "group.all_switches"}, "time_fired": "2016-10-29T09:09:02.610410+00:00", "event_type": "state_changed", "origin": "LOCAL"}
16-10-29 11:09:23 root: Heartbeat: Send connection state request
16-10-29 11:09:23 root: Heartbeat: Successful
16-10-29 11:09:30 root: Got value of group address 3439 from cache: [1]
16-10-29 11:09:30 root: Got value of group address 3439 from cache: [1]
16-10-29 11:09:30 root: Got value of group address 3439 from cache: [1]

If I define two switches, there is a problem.

Configuration file for two switches:

knx:
          host: 10.4.1.5
          port: 3671

switch toilet:
            platform: knx
            name: "Guest Toilet"
            address: 1/1/3
            state_address: 1/5/110

switch hall:
            platform: knx
            name: "Entrance Hall"
            address: 1/1/1
            state_address: 1/5/111

Log file for two switches:

cat home-assistant.log 
16-10-29 11:12:00 homeassistant.core: Bus:Handling <Event component_loaded[L]: component=recorder>
16-10-29 11:12:00 homeassistant.core: Bus:Handling <Event component_loaded[L]: component=logger>
16-10-29 11:12:00 homeassistant.core: Bus:Handling <Event component_loaded[L]: component=updater>
16-10-29 11:12:01 homeassistant.core: Bus:Handling <Event component_loaded[L]: component=http>
16-10-29 11:12:01 homeassistant.core: Bus:Handling <Event service_registered[L]: domain=conversation, service=process>
16-10-29 11:12:02 homeassistant.core: Bus:Handling <Event component_loaded[L]: component=conversation>
16-10-29 11:12:02 root: Started data server on UDP port 39416
16-10-29 11:12:02 root: Connected KNX IP tunnel (Channel: 123, HPAI: 8 1)
16-10-29 11:12:02 homeassistant.components.knx: Res = True
16-10-29 11:12:02 homeassistant.components.knx: KNX IP tunnel to 10.4.1.5:3671 established
16-10-29 11:12:02 homeassistant.core: Bus:Handling <Event component_loaded[L]: component=knx>
16-10-29 11:12:02 homeassistant.core: Bus:Handling <Event component_loaded[L]: component=api>
16-10-29 11:12:02 homeassistant.core: Bus:Handling <Event component_loaded[L]: component=frontend>
16-10-29 11:12:02 homeassistant.core: Bus:Handling <Event service_registered[L]: domain=logbook, service=log>
16-10-29 11:12:02 homeassistant.core: Bus:Handling <Event component_loaded[L]: component=logbook>
16-10-29 11:12:02 homeassistant.loader: Loaded switch.knx from homeassistant.components.switch.knx
16-10-29 11:12:02 homeassistant.bootstrap: Component knx already set up.
16-10-29 11:12:02 homeassistant.bootstrap: Component knx already set up.
16-10-29 11:12:02 homeassistant.bootstrap: Component knx already set up.
16-10-29 11:12:02 homeassistant.bootstrap: Component knx already set up.
16-10-29 11:12:02 homeassistant.components.knx: Initalizing KNX group address 2305
16-10-29 11:12:02 homeassistant.components.knx: Initalizing KNX group address 2307
16-10-29 11:12:02 root: Received tunneling ACK
16-10-29 11:12:03 homeassistant.components.knx: Unable to read from KNX address: 2305 (None)
16-10-29 11:12:03 root: Got value of group address 3439 from cache: [1]
16-10-29 11:12:03 homeassistant.core: Bus:Handling <Event state_changed[L]: old_state=None, entity_id=switch.entrance_hall, new_state=<state switch.entrance_hall=on; friendly_name=Entrance Hall @ 2016-10-29T11:12:03.383047+02:00>>
16-10-29 11:12:03 root: Got value of group address 3439 from cache: [1]
16-10-29 11:12:03 root: Got value of group address 3439 from cache: [1]
16-10-29 11:12:03 homeassistant.loader: Loaded group from homeassistant.components.group
16-10-29 11:12:03 homeassistant.core: Bus:Handling <Event state_changed[L]: old_state=None, entity_id=group.all_switches, new_state=<state group.all_switches=on; auto=True, order=0, entity_id=('switch.entrance_hall',), hidden=True, friendly_name=all switches @ 2016-10-29T11:12:03.389861+02:00>>
16-10-29 11:12:03 root: Received tunneling ACK
16-10-29 11:12:04 homeassistant.components.knx: Unable to read from KNX address: 2307 (None)
16-10-29 11:12:04 root: Received tunneling ACK
16-10-29 11:12:16 homeassistant.components.knx: Unable to read from KNX address: 2307 (None)
16-10-29 11:12:16 homeassistant.core: Bus:Handling <Event state_changed[L]: old_state=None, entity_id=switch.guest_toilet, new_state=<state switch.guest_toilet=off; friendly_name=Guest Toilet @ 2016-10-29T11:12:16.742816+02:00>>
16-10-29 11:12:16 root: Got value of group address 3439 from cache: [1]
16-10-29 11:12:16 root: Got value of group address 3439 from cache: [1]
16-10-29 11:12:16 homeassistant.core: Bus:Handling <Event state_changed[L]: old_state=<state group.all_switches=on; auto=True, order=0, entity_id=('switch.entrance_hall',), hidden=True, friendly_name=all switches @ 2016-10-29T11:12:03.389861+02:00>, entity_id=group.all_switches, new_state=None>
16-10-29 11:12:16 homeassistant.core: Bus:Handling <Event state_changed[L]: old_state=None, entity_id=group.all_switches, new_state=<state group.all_switches=on; auto=True, order=0, entity_id=('switch.entrance_hall', 'switch.guest_toilet'), hidden=True, friendly_name=all switches @ 2016-10-29T11:12:16.751034+02:00>>
16-10-29 11:12:16 homeassistant.core: Bus:Handling <Event service_registered[L]: domain=switch, service=turn_off>
16-10-29 11:12:16 homeassistant.core: Bus:Handling <Event service_registered[L]: domain=switch, service=turn_on>
16-10-29 11:12:16 homeassistant.core: Bus:Handling <Event service_registered[L]: domain=switch, service=toggle>
16-10-29 11:12:16 homeassistant.core: Bus:Handling <Event component_loaded[L]: component=switch>
16-10-29 11:12:16 homeassistant.core: Bus:Handling <Event component_loaded[L]: component=history>
16-10-29 11:12:16 homeassistant.core: Bus:Handling <Event component_loaded[L]: component=discovery>
16-10-29 11:12:16 homeassistant.core: Starting Home Assistant (11 threads)
16-10-29 11:12:16 homeassistant.core: Starting Home Assistant core loop
16-10-29 11:12:16 homeassistant.core: Bus:Handling <Event homeassistant_start[L]>
16-10-29 11:12:16 homeassistant.core: Bus:Handling <Event service_registered[L]: domain=homeassistant, service=stop>
16-10-29 11:12:16 homeassistant.core: Bus:Handling <Event service_registered[L]: domain=homeassistant, service=restart>
16-10-29 11:12:16 homeassistant.core: Timer:starting
16-10-29 11:12:17 netdisco.service: Scanning
16-10-29 11:12:30 root: Got value of group address 3439 from cache: [1]
16-10-29 11:12:30 root: Got value of group address 3439 from cache: [1]
16-10-29 11:12:30 root: Got value of group address 3439 from cache: [1]
16-10-29 11:12:32 homeassistant.components.http: Serving /api/stream to 10.4.1.28 (auth: True)
16-10-29 11:12:32 homeassistant.components.api: STREAM 1991089944 ATTACHED
16-10-29 11:12:32 homeassistant.components.api: STREAM 1991089944 WRITING data: ping
16-10-29 11:12:32 homeassistant.components.http: Serving /api/bootstrap to 10.4.1.28 (auth: True)
16-10-29 11:12:32 root: Disconnecting KNX/IP tunnel...
16-10-29 11:12:32 root: Data server already running, not starting again
16-10-29 11:12:32 root: Connected KNX IP tunnel (Channel: 124, HPAI: 8 1)
16-10-29 11:12:33 homeassistant.components.knx: Unable to read from KNX address: 2307 (None)
16-10-29 11:12:35 root: Disconnecting KNX/IP tunnel...
16-10-29 11:12:35 root: Data server already running, not starting again
16-10-29 11:12:35 root: Connected KNX IP tunnel (Channel: 125, HPAI: 8 1)
16-10-29 11:12:36 homeassistant.components.knx: Unable to read from KNX address: 2307 (None)
16-10-29 11:12:38 root: Disconnecting KNX/IP tunnel...
16-10-29 11:12:38 root: Data server already running, not starting again
16-10-29 11:12:38 root: Connected KNX IP tunnel (Channel: 126, HPAI: 8 1)
16-10-29 11:12:39 homeassistant.components.knx: Unable to read from KNX address: 2307 (None)
16-10-29 11:13:02 root: Disconnecting KNX/IP tunnel...
16-10-29 11:13:02 root: Disconnecting KNX/IP tunnel...
16-10-29 11:13:02 root: Data server already running, not starting again
16-10-29 11:13:02 root: Data server already running, not starting again
16-10-29 11:13:02 root: Connected KNX IP tunnel (Channel: 128, HPAI: 8 1)
16-10-29 11:13:03 homeassistant.components.knx: Unable to read from KNX address: 2305 (None)
16-10-29 11:13:04 root: KNX/IP gateway did not respond to connect request
16-10-29 11:13:05 homeassistant.components.knx: Unable to read from KNX address: 2307 (None)
16-10-29 11:13:05 root: Disconnecting KNX/IP tunnel...
16-10-29 11:13:05 homeassistant.core: Error inside async loop: Task exception was never retrieved
16-10-29 11:13:05 homeassistant.core: Exception inside async loop: 
Traceback (most recent call last):
  File "/usr/lib/python3.4/asyncio/tasks.py", line 237, in _step
    result = next(coro)
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/helpers/entity.py", line 210, in async_update_ha_state
    state = STATE_UNKNOWN if self.state is None else str(self.state)
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/helpers/entity.py", line 298, in state
    return STATE_ON if self.is_on else STATE_OFF
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/knx.py", line 165, in is_on
    self.update()
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/knx.py", line 194, in update
    self.state_address, use_cache=self.cache)
  File "/home/pi/.homeassistant/deps/knxip/ip.py", line 557, in group_read
    self.send_tunnelling_request(cemi)
  File "/home/pi/.homeassistant/deps/knxip/ip.py", line 539, in send_tunnelling_request
    self.disconnect()
  File "/home/pi/.homeassistant/deps/knxip/ip.py", line 387, in disconnect
    frame.body = self.hpai_body()
  File "/home/pi/.homeassistant/deps/knxip/ip.py", line 497, in hpai_body
    body.extend(ip_to_array(self.control_socket.getsockname()[0]))
AttributeError: 'NoneType' object has no attribute 'getsockname'
16-10-29 11:13:07 root: Disconnecting KNX/IP tunnel...
16-10-29 11:13:07 homeassistant.core: Error inside async loop: Task exception was never retrieved
16-10-29 11:13:07 homeassistant.core: Exception inside async loop: 
Traceback (most recent call last):
  File "/usr/lib/python3.4/asyncio/tasks.py", line 237, in _step
    result = next(coro)
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/helpers/entity.py", line 210, in async_update_ha_state
    state = STATE_UNKNOWN if self.state is None else str(self.state)
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/helpers/entity.py", line 298, in state
    return STATE_ON if self.is_on else STATE_OFF
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/knx.py", line 165, in is_on
    self.update()
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/knx.py", line 194, in update
    self.state_address, use_cache=self.cache)
  File "/home/pi/.homeassistant/deps/knxip/ip.py", line 557, in group_read
    self.send_tunnelling_request(cemi)
  File "/home/pi/.homeassistant/deps/knxip/ip.py", line 539, in send_tunnelling_request
    self.disconnect()
  File "/home/pi/.homeassistant/deps/knxip/ip.py", line 387, in disconnect
    frame.body = self.hpai_body()
  File "/home/pi/.homeassistant/deps/knxip/ip.py", line 497, in hpai_body
    body.extend(ip_to_array(self.control_socket.getsockname()[0]))
AttributeError: 'NoneType' object has no attribute 'getsockname'
16-10-29 11:13:22 homeassistant.components.api: STREAM 1991089944 WRITING data: ping
16-10-29 11:13:32 root: Disconnecting KNX/IP tunnel...
16-10-29 11:13:32 root: Disconnecting KNX/IP tunnel...
16-10-29 11:13:32 homeassistant.core: Error inside async loop: Task exception was never retrieved
16-10-29 11:13:32 homeassistant.core: Exception inside async loop: 
Traceback (most recent call last):
  File "/usr/lib/python3.4/asyncio/tasks.py", line 233, in _step
    result = coro.throw(exc)
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/helpers/entity.py", line 208, in async_update_ha_state
    yield from self.hass.loop.run_in_executor(None, self.update)
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/knx.py", line 194, in update
    self.state_address, use_cache=self.cache)
  File "/home/pi/.homeassistant/deps/knxip/ip.py", line 557, in group_read
    self.send_tunnelling_request(cemi)
  File "/home/pi/.homeassistant/deps/knxip/ip.py", line 539, in send_tunnelling_request
    self.disconnect()
  File "/home/pi/.homeassistant/deps/knxip/ip.py", line 387, in disconnect
    frame.body = self.hpai_body()
  File "/home/pi/.homeassistant/deps/knxip/ip.py", line 497, in hpai_body
    body.extend(ip_to_array(self.control_socket.getsockname()[0]))
AttributeError: 'NoneType' object has no attribute 'getsockname'
16-10-29 11:13:32 homeassistant.core: Error inside async loop: Task exception was never retrieved
16-10-29 11:13:32 homeassistant.core: Exception inside async loop: 
Traceback (most recent call last):
  File "/usr/lib/python3.4/asyncio/tasks.py", line 233, in _step
    result = coro.throw(exc)
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/helpers/entity.py", line 208, in async_update_ha_state
    yield from self.hass.loop.run_in_executor(None, self.update)
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/knx.py", line 194, in update
    self.state_address, use_cache=self.cache)
  File "/home/pi/.homeassistant/deps/knxip/ip.py", line 557, in group_read
    self.send_tunnelling_request(cemi)
  File "/home/pi/.homeassistant/deps/knxip/ip.py", line 539, in send_tunnelling_request
    self.disconnect()
  File "/home/pi/.homeassistant/deps/knxip/ip.py", line 387, in disconnect
    frame.body = self.hpai_body()
  File "/home/pi/.homeassistant/deps/knxip/ip.py", line 497, in hpai_body
    body.extend(ip_to_array(self.control_socket.getsockname()[0]))
AttributeError: 'NoneType' object has no attribute 'getsockname'
pi@raspberrypi:~/.homeassistant $ 

Each time I start with a clean reboot between config changes:

Any help?

No help unfortunately, but I can confirm, that I have the exact same issue:

INFO:root:Data server already running, not starting again
INFO:root:Data server already running, not starting again
ERROR:root:KNX/IP gateway did not respond to connect request
WARNING:homeassistant.core:Error inside async loop: Task exception was never retrieved
WARNING:homeassistant.core:Error inside async loop: Task exception was never retrieved
Exception in thread Thread-5:
Traceback (most recent call last):
File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/threading.py”, line 914, in _bootstrap_inner
self.run()
File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/threading.py”, line 862, in run
self._target(*self._args, **self._kwargs)
File “/Users/olebak/.homeassistant/deps/knxip/ip.py”, line 272, in keepalive
self.check_connection_state()
File “/Users/olebak/.homeassistant/deps/knxip/ip.py”, line 418, in check_connection_state
frame.body = self.hpai_body()
File “/Users/olebak/.homeassistant/deps/knxip/ip.py”, line 497, in hpai_body
body.extend(ip_to_array(self.control_socket.getsockname()[0]))
AttributeError: ‘NoneType’ object has no attribute ‘getsockname’

WARNING:homeassistant.core:Error inside async loop: Task exception was never retrieved
WARNING:homeassistant.core:Error inside async loop: Task exception was never retrieved
WARNING:homeassistant.core:Error inside async loop: Task exception was never retrieved
WARNING:homeassistant.core:Error inside async loop: Task exception was never retrieved
WARNING:homeassistant.core:Error inside async loop: Task exception was never retrieved
WARNING:homeassistant.core:Error inside async loop: Task exception was never retrieved
WARNING:homeassistant.core:Error inside async loop: Task exception was never retrieved
WARNING:homeassistant.core:Error inside async loop: Task exception was never retrieved
WARNING:homeassistant.core:Error inside async loop: Task exception was never retrieved
WARNING:homeassistant.core:Error inside async loop: Task exception was never retrieved

Same issue here:

16-11-01 09:18:04 root: KNX/IP gateway did not respond to connect request
16-11-01 09:18:07 homeassistant.core: Error inside async loop: Task exception was never retrieved
16-11-01 09:18:32 homeassistant.core: Error inside async loop: Task exception was never retrieved
16-11-01 09:18:32 homeassistant.core: Error inside async loop: Task exception was never retrieved
16-11-01 09:19:02 homeassistant.core: Error inside async loop: Task exception was never retrieved
16-11-01 09:19:02 homeassistant.core: Error inside async loop: Task exception was never retrieved
...

Any solutions yet ?

I’ve found out, that it’s related to the IP interface. I switched to an old Gira, and this works. I was using a Schneider before. Don’t know if this helps?

Unfortunately I only have the Schneider 9nterface, which is a well-known unit.
It works 100% with OpenRemote.

I think we need to try and find the author of the KNX driver and get his help.

The software has been tested with a Siemens and a Weinzierl USB interface. Unfortunately I can’t so debugging on an interface I don’t have. If somebody wants to send me an interface to test I can look into this. Otherwise somebody who owns such an interface needs to debug and fix this.

The problem has now been fixed by the latest async loop upgrade.
Thanks to all the developers for this quick response

It now works fine on my system

I seem to have an issue now with my setup, i am actually testing with just a switch:

Sometimes it works, sometimes it just doesn’t.
Finally i think i found what causes the problem: the lightening symbol sometimes has another state than the switch, if this is the case it doesn’t work. A KNX bus monitor shows HASS sends a packet but the wrong one, it sends OFF but the switch wass allready off (but lighting symbol on)…
After some time and a refresh, the symbol gets grey and it works for a few times.

Any ideas ?

Yes, I spoke too soon.

There is still a problem, it does not work.

I will have to investigate further and get some logs to help the devs

Just let me know if you need any testing / logs/ traces.

There is still a problem with the KNX communication.

I have added a comment for the developers on site https://goo.gl/Nvioub (Github) and uploaded a config and log file to that post on GitHub

Is there a solution to be able to use more than one KNX switch?

One KNX switch works just fine for me.
Adding additional KNX switches creates the following error log:

knx:
  host: 192.168.188.47
  port: 3671
#KNX Lights
switch switch1:
  - platform: knx
    name: switch1
    address: 1/0/1
switch switch2:
  - platform: knx
    name: switch2
    adress: 1/0/5
switch switch3:
  - platform: knx
    name: switch3
    adress: 1/0/3
Testing configuration at /home/pi/.homeassistant
2017-07-15 16:46:26 INFO (MainThread) [homeassistant.setup] Setting up introduction
2017-07-15 16:46:27 INFO (MainThread) [homeassistant.setup] Setup of domain introduction took 0.6 seconds.
2017-07-15 16:46:27 INFO (MainThread) [homeassistant.setup] Setting up http
2017-07-15 16:46:27 INFO (MainThread) [homeassistant.setup] Setting up recorder
2017-07-15 16:46:27 INFO (MainThread) [homeassistant.setup] Setup of domain http took 0.0 seconds.
2017-07-15 16:46:27 INFO (MainThread) [homeassistant.setup] Setup of domain recorder took 0.0 seconds.
2017-07-15 16:46:27 INFO (MainThread) [homeassistant.setup] Setting up api
2017-07-15 16:46:27 INFO (MainThread) [homeassistant.setup] Setting up websocket_api
2017-07-15 16:46:27 INFO (MainThread) [homeassistant.setup] Setting up history
2017-07-15 16:46:27 INFO (MainThread) [homeassistant.setup] Setup of domain api took 0.0 seconds.
2017-07-15 16:46:27 INFO (MainThread) [homeassistant.setup] Setup of domain websocket_api took 0.0 seconds.
2017-07-15 16:46:27 INFO (MainThread) [homeassistant.setup] Setup of domain history took 0.0 seconds.
2017-07-15 16:46:27 INFO (MainThread) [homeassistant.setup] Setting up frontend
2017-07-15 16:46:27 INFO (MainThread) [homeassistant.setup] Setup of domain frontend took 0.0 seconds.
2017-07-15 16:46:27 INFO (MainThread) [homeassistant.setup] Setting up sun
**2017-07-15 16:46:27 ERROR (MainThread) [homeassistant.config] Invalid config for [switch.knx]: required key not provided @ data['address']. Got None. (See ?, line ?). Please check the docs at https://home-assistant.io/components/switch.knx/**
**2017-07-15 16:46:27 ERROR (MainThread) [homeassistant.config] Invalid config for [switch.knx]: required key not provided @ data['address']. Got None. (See ?, line ?). Please check the docs at https://home-assistant.io/components/switch.knx/**
2017-07-15 16:46:27 INFO (MainThread) [homeassistant.setup] Setting up discovery
2017-07-15 16:46:27 INFO (MainThread) [homeassistant.setup] Setting up group
2017-07-15 16:46:27 INFO (MainThread) [homeassistant.setup] Setting up emulated_hue
2017-07-15 16:46:27 INFO (MainThread) [homeassistant.setup] Setting up updater
2017-07-15 16:46:27 INFO (MainThread) [homeassistant.setup] Setting up conversation
**2017-07-15 16:46:27 INFO (MainThread) [homeassistant.setup] Setting up knx**
2017-07-15 16:46:27 INFO (MainThread) [homeassistant.setup] Setting up sensor
2017-07-15 16:46:27 INFO (MainThread) [homeassistant.setup] Setup of domain sun took 0.1 seconds.
2017-07-15 16:46:27 INFO (MainThread) [homeassistant.setup] Setup of domain discovery took 0.1 seconds.
2017-07-15 16:46:27 INFO (MainThread) [homeassistant.setup] Setup of domain group took 0.1 seconds.
2017-07-15 16:46:27 INFO (MainThread) [homeassistant.setup] Setup of domain emulated_hue took 0.1 seconds.
2017-07-15 16:46:27 INFO (MainThread) [homeassistant.setup] Setup of domain updater took 0.1 seconds.
2017-07-15 16:46:27 INFO (MainThread) [homeassistant.setup] Setup of domain conversation took 0.1 seconds.
**2017-07-15 16:46:27 INFO (MainThread) [homeassistant.setup] Setup of domain knx took 0.1 seconds.**
2017-07-15 16:46:27 INFO (MainThread) [homeassistant.setup] Setup of domain sensor took 0.0 seconds.
2017-07-15 16:46:27 INFO (MainThread) [homeassistant.setup] Setting up config
2017-07-15 16:46:27 INFO (MainThread) [homeassistant.setup] Setting up logbook
2017-07-15 16:46:27 INFO (MainThread) [homeassistant.setup] Setting up tts
**2017-07-15 16:46:27 INFO (MainThread) [homeassistant.setup] Setting up switch**
2017-07-15 16:46:27 INFO (MainThread) [homeassistant.setup] Setting up automation
2017-07-15 16:46:27 INFO (MainThread) [homeassistant.setup] Setup of domain config took 0.0 seconds.
2017-07-15 16:46:27 INFO (MainThread) [homeassistant.setup] Setup of domain logbook took 0.0 seconds.
2017-07-15 16:46:27 INFO (MainThread) [homeassistant.setup] Setup of domain tts took 0.0 seconds.
**2017-07-15 16:46:27 INFO (MainThread) [homeassistant.setup] Setup of domain switch took 0.0 seconds.**
2017-07-15 16:46:27 INFO (MainThread) [homeassistant.setup] Setup of domain automation took 0.0 seconds.
**Failed config**
**  switch.knx: **
**    platform: knx**
**    adress: 1/0/3**
**    name: switch3**
**Successful config (partial)**
  switch.knx:

Your configuration is incorrect. It needs to be “address” not “adress”

jagter5, i have the same issue.
any solution?
and another Q,
is the state address work?
if you tern the light off, the switch on HA switches to off ?

Refael

I also have this issue since ever. Does anyone have a solution for it?

I think the correct way is (example):

knx:
  tunneling:
    host: '192.168.1.200'                     # knx interface IP
    port: 3671
    local_ip: '192.168.1.210'                 # hassio IP
switch:
  - platform: knx
    name: Kitchen.Coffee
    address: '1/1/6'
    state_address: '2/1/6'

  - platform: knx
    name: Kitchen.Socket
    address: '1/1/7'
    state_address: '2/1/7'
light:
  - platform: knx
    name: Kitchen.Light
    address: '1/0/9'
    state_address: '2/0/9'

  - platform: knx
    name: Room.Light
    address: '1/0/10'
    state_address: '2/0/10'

Under normal conditions (multicast working on your network) you can omit the connection parameters completely and just go with

knx:

switch:
  - platform: knx
    name: ""
....see above
... you can omit the connection parameters completely ...

Didn’t know this detail. Thanks.

switch:
  - platform: knx
    name: ""

My configuration is working fine without cotes in the name.

Anyway it seems @Heim0r haven’t configured the switches correctly.