KNX support

In european countries the KNX bus system is widespread, therefore this feature request to support KNX in Home Assistant.

2 Likes

Iā€™m currently working on basic KNX support. I hope to have basic switch/light/binary sensor support ready in the next weeks.

1 Like

Great, let me know if you need some help, but I will also require several weeks to dive into home assistant right now.

1 Like

Ok, I have my first KNX switch functionality here running. The code still need some work and packaging of my KNX library (no knxd or any other additional daemon needed).

Configuration will look like this:

knx:
   host: 192.168.1.128
   port: 3671

switch 2:
  name: KNX Switch
  platform: knx
  address: 0/0/1
  state_address: 0/0/3

switch 3:
  name: KNX Switch (Timer)
  platform: knx
  address: 0/0/2
  state_address: 0/0/3

If you want to have a look, you can download the code from my fork:
https://github.com/usul27/home-assistant

Have a look and give me feedback. If it works fine, I will create a pull request for this initial version.

At this time only switches and binary sensors are supported as I donā€™t have any other actuators here for tests.

If you want to test it on an existing installation, just copy the knx.py files to your installation.

That sounds great. I will check asap.
Are there any requirements to the KNX IP gateway? Will it also work using the multicast address of a Gira router?

It needs an IP tunnelling interface. These are usually much cheaper than KNX routers.
The code has been tested with the Weinzierl 730, but should also work with other KNX/IP tunneling interfaces.

I just checked the documentation of the Gira IP router:

It also supports IP tunneling, therefore the module should work with it. You need to configure a tunnelling interface. Check the section ā€œFunction as IP data interfaceā€ in the manual of the Gira router.

Did you already have the chance to test it? If it work fine for you, I would create a pull request to get it integrated into the official release.

Ok, worked quite a lot on this during the last days to improve code quality and get better logging. Testers welcome!

After quite some testing, debugging and bugfixing, the first version has been made available in a pull request:

Awesome, looking forward to testing it out!

I mostly have Gira equipment, except for the Weinzierl 730. Iā€™ve mostly been using OpenRemote up till now.

Using centralized KNX sure is cable heavy, these old pictures are from the main installation:

Nice installation. The KNX code is not merged into the development release.
Right now it supports only switching actors, but Iā€™m working on a thermostat.

In my system, the thermostats are located in the wall switches. But what about reading broadcasted values?

All the switches broadcast the temperature, and external sensors also broadcast sunlight, rain, and wind.

1 Like

In general this is possible, but it hasnā€™t been implemented yet. I will first work on a thermostat module, but an KNX temperature sensor should be easy to implement based on this.

This is awesome! Would love to see support for KNX dimmers and shutter and can help with testing. Thanks for the effort @openha.

@sandervd Unfortunately I donā€™t have a dimmer and/or shutter actor in my lab. I would need somebody sponsoring these for development purposes.
Other option is that somebody else does this code. I

It looks like KNX component keeps disconnecting from the KNX router. Iā€™ve noticed that at some point all switches stop working i.e. they stop receiving feedback from physical buttons and also if you try flipping any switch from HASS UI it just jumps back to off position in a second. The only way to solve it is to restart HASS. Iā€™ve also tried setting logger to debug level but there are no error messages, just regular ones:

16-08-09 11:59:18 homeassistant.core: Bus:Handling <Event call_service[L]: domain=homeassistant, service_data=entity_id=switch.av_room_spotlights, service=turn_on, service_call_id=140409023294376-42>

Is there anything I can do to help you debug it? Iā€™ve tried running HASS on wired RPI3 and moved to Ubuntu Server VM so it is nothing to do with power saving of WiFi in RPI.

What IP interface are you using? I might need to build in a reconnect feature.