KNX - Looking for basic step by step guide

I have ofcourse also tried just to add:

knx:

Did you get it to work? Or do you still need some help?

Hi Jens!

Unfortunately I have not had time to try this out, to busy at work. What would the easiest setup be to just try to see if I can control anything. I do have some switches or scenarios I could call. Switches (switchactuator) that controls either lights or poweroutlets. Do you have an example of how to set that up that you have tried?

You did post the following for me in another thread:

It is optional the config file… You could also add everything directly in your own config files like this:
light:

  • platform: knx
    name: Kitchen-Light-1
    address: ‘1/0/9’
    brightness_address: ‘1/0/11’

I guess this would control a dimmable light? But the link to http://xknx.io/ just confused me. But as I said I have not had time to dig into this yet.

Okey, so basically there are two way of setting everything up. This is because the KNX component in homeassistant is build upon an existing library named xknx (That’s why i linked to http://xknx.io). They have expanded the library so it works with Home assistant.

So the first mode is to work with a xknx.yaml file which is used by the xknx library. This is what is documented over here: CONFIGURATION

knx:
  config_file: '/path/to/xknx.yaml'

I have a test version for my own test system and the yaml file looks like this:
xknx.yaml

general: 
  own_address: "15.15.249"
groups: 
  climate: 
    Bureau.Climate: 
      group_address_temperature: 4/0/1
  light: 
    Bureau.Light_1: 
      group_address_brightness: 0/2/1
      group_address_brightness_state: 2/1/1
      group_address_switch: 0/0/1
      group_address_switch_state: 2/0/1
    Bureau.Light_2: 
      group_address_brightness: 0/2/2
      group_address_brightness_state: 2/1/2
      group_address_switch: 0/0/2
      group_address_switch_state: 2/0/2
  binary_sensor:
    Bureau.Switch_1:
      group_address: "0/0/3"
  sensor:
    Bureau.Switch_1:
      group_address: "2/0/3"
      value_type: "percent"      
  time: 
    General.Time: 
      group_address: 11/11/11

The documentation for each item you can put in the yaml file can be found on the xknx.io website.

my knx configuration in HA looks like this:
configuration.yaml

knx: !include knx.yaml

knx.yaml

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'

If configurated in this way, all your KNX configuration is in this two files.

The second possibility is to define each KNX component in the corresponding file. For example
binary_sensor.yaml

  - platform: knx
    name: "Entrance.Motion.Sensor"
    address: '6/0/2'
    device_class: 'motion'
    #significant_bit: 2
    #reset_after: 100

as shown over here: Binary sensor KNX

I think it is also possible to combine these modes.

Hope this helps!

1 Like

Fantastic. You should definitively share your setup in the cookbook. You would be the first KNX dude over there :slight_smile: So after you have set this up how do you get it to display in the HA environment. Is this all you have to do or do you have to do other stuff with groups/views and such? I hope I get some time to look at this in the weekend. But thanks for sharing!

When you have added your KNX components to the xknx.yaml file OR to the respective files (lights.yaml etc) everything should be vissible and changeable in HA.

I’m currently redoing al my cables and adding all my KNX components, which i hope to have finished by the end of september. After that, i will try to write something about it!

Do you already have a working KNX setup? I was struggling quite a bit too getting this to work. But before adding anything to HA, just should have a working KNX setup with ETS. Then the setup process for HA isn’t that complex anymore, just adding your knx-ip-interface and the desired devices… (using example config)

knx:
  tunneling:
    host: '192.168.2.23' //knx ip gateway
    port: 3671
    local_ip: '192.168.2.109' //HA
light:
  - platform: knx
    address: '1/0/9' //f.e.adress for switching your first light (according KNX setup)

then you should have your first switch in HA, that toggles your light… (you should be able to see the command in ETS diagnose mode)

I have two HA instances: Here is my configuration.yaml for tunnelling (BAOS 771 in my case)
knx:
tunneling:
host: ‘192.168.0.254’
port: 3671
local_ip: ‘192.168.0.21’

And here for Routing if you have a router (in my other instance) state_updater is important to update statuses from boot.
knx:
routing:
local_ip: ‘192.168.0.24’
state_updater: true

The config file looks like this for both configs:
light:

  • platform: knx
    name: ‘Study Downlights’
    address: ‘2/3/3’
    brightness_address: ‘2/5/3’
    state_address: ‘0/4/3’
    brightness_state_address: ‘0/2/3’
  • platform: knx
    name: ‘Lounge Downlights’
    address: ‘2/3/4’
    brightness_address: ‘2/5/4’
    state_address: ‘0/4/4’
    brightness_state_address: ‘0/2/4’

For ui-lovelace.yaml
- type: entities
title: Dining & Hall
entities:
- entity: climate.dining__hall_climate
icon: mdi:radiator
- type: divider
- entity: light.dining_south
- entity: light.dining_north
- entity: light.dining_table_pendant
- entity: light.hall_downlights
- entity: light.dining_table_lamp_1
- entity: light.dining_table_lamp_2

The dots should be dashes of course!

Here is another complete example of a basic knx setup:

knx:
  # --- for me the auto detection of the knx ip gateway worked perfectly, 
  # --- so these parameters could all be removed or commented out!:
  #tunneling:
  #  host: '192.168.0.200'
  #  port: 3671

light:
  # switched light
  - platform: knx
    name: 'Eltern Decke'
    address: '1/2/10'
    state_address: '1/2/11'
    
  # dimmed light
  - platform: knx
    name: 'Eltern Bett'
    address: '1/2/12'
    state_address: '1/2/15'
    brightness_address: '1/2/13'
    brightness_state_address: '1/2/16' 

cover:
  - platform: knx
    name: "Eltern"
    move_long_address: '3/2/0'
    move_short_address: '3/2/1'
    position_address: '3/2/3'
    position_state_address: '3/2/2'
    travelling_time_up: 23
    travelling_time_down: 21
    invert_position: true
    
  - platform: knx
    name: "Büro"
    move_long_address: '3/2/4'
    move_short_address: '3/2/5'
    position_address: '3/2/7'
    position_state_address: '3/2/6'
    travelling_time_up: 23
    travelling_time_down: 21
    invert_position: true

Important detail:
The xknx.yaml file that can be loaded through…

knx: 
  config_file: '/config/xknx.yaml'

…contains a DIFFERENT yaml syntax!
See http://xknx.io/configuration for details

If you simply want to store your lights, covers etc. in separate yaml files you have to use this notation instead:

knx: 
  
light: !include knx-lights.yaml
cover: !include knx-covers.yaml

Within these yaml files, you dont repeat the light: or cover: keywords.
Instead you immediately start (i.e. in knx-lights.yaml) like this…

  - platform: knx
    name: 'Eltern Decke'
    address: '1/2/10'
    state_address: '1/2/11'

And another note:
For me the cover (= rollershutter) elements exposed a bug. They either use 100% for the shutter being fully open (which I think is counter intuitive). Or, if you set invert_position: true they use the percentage correctly but the up- and down-arrows are inverted too and the up-arrow will move the cover down. There are already issue reports about that.

This is now part of a new cookbook, that I created:

I will keep the examples in there growing over time.

1 Like

Hi guys! I’m new into Home Assistant and KNX. I’m coming from IP-Symcon and a bunch of Homematic and Z-Wave Devices. As it was pretty simple with IPS to control and configure these components it´s much harder for me with KNX.

HA is much simpler. I was able to configure a KNX Dimmer incl. Slider in a few minutes (+ a little bit of trial an error time to find the right addresses :slight_smile: ) I still can’t do it in IPS.

I was also able to put in an additional lamp switch which works fine. I had problems in the beginning getting the IP Gateway work (HA wasn’t able to find the “local Ip”) I put the path to the XKNX conf in and then it works (even if I had put nothing into the config)

Now im running into a few more issues. I added a bunch of more lights but they dont show up (and somehow I managed to destroy the ability to control my Apple TV) It would be great if someone could have a look at my config and give me some tips

    # knx
knx:
  config_file: '/path/to/xknx.yaml'
  
  tunneling:
    host: 'xxx.xxx.xxx.59'
    port: 3671
    local_ip: 'xxx.xxx.xxx.49'
    
light:
  - platform: knx
    name: Büro
    address: '1/1/16'
    state_address: '1/4/16'
    
  - platform: knx
    name: Flur EG
    address: '1/1/1'
    state_address: '1/4/1'
    
  - platform: knx
    name: Gäste Bad
    address: '1/1/2'
    state_address: '1/4/2'
    
  - platform: knx
    name: Wohnzimmer Decke
    address: '1/1/6'
    state_address: '1/4/6'
    brightness_address: '1/3/6'
    brightness_state_address: '1/5/6'

Edit: I deleted the path to the XKNX config and the IP address. Thats the magic auto config everyone was talking about :man_facepalming: But the other lights still dont work

Edit 2: Forget it. I found them in the Dashboard in “unused objects” :roll_eyes:

Thanks a lot guys!

Flo

Hey Guys, I have set up my Weinzierl 731 correctly.

HASS connects to the IP Interface and I can switch on/off my actuator.

The only problem I have now is that I can’t access the KNX bus with my ETS and my HASS at the same time. Any ideas? The 731 should be able to allow up to 5 connections at the same time.

My setup:

knx:
  tunneling:
    host: '10.0.0.27' #Interface IP
    port: 3671
    local_ip: '10.0.0.16' #HASS IP

Thanks a lot in advance!

BR Michael

Hi Michael,

I thought that the Weinzierl 731 had up to 5 connections but these needed to be activated. (I think the top button adds an extre tunnel, the down button removes one)

Hope this helps.

EDIT: Button 7 and 8 do this i think https://weinzierl.de/images/download/products/731/Weinzierl_731_KNX_IP_Interface_Manual_EN.pdf

Jens

1 Like

Thanks Jens,

I also read the docs of the 731 before but I did not get wiser.
I will try this today evening.
Thanks a lot,

BR Michael

Hi @JensVanhooydonck.

It works. The “Conn Up” button on the device opens another possible connection. ( Up to 5 )
After a reboot, the initial state comes back. So only one connection is openend.
Has anyone a solution for this?

Hi!

I did the connection between HA and KNX successfully, nevertheless I have a problem with the detector sensors…It does not work now. Is there anybody that know how combine both functions (switch lights from HA and swith lights with the detector)?

This is my configuration.yaml:

knx:
tunneling:
host: ‘192.168.0.9’
port: 3671
local_ip: ‘192.168.0.175’
light:
# Office light
- platform: knx
name: ‘Office’
address: ‘11/1/4’
state_address: ‘11/5/4’

#Meeting room lights
- platform: knx
  name: 'meeting room'
  address: '11/1/80'
  state_address: '11/5/80'
  brightness_address: '11/2/80'
  brightness_state_address: '11/3/80'

Thanks!

Hi,
I have a knx system, and bought 721 knx\ip interface

this knx\ip interface need a knx programmation or i can only connect it on the BUS?

THANKS

I need your support to configure my KNX climate, I read and tried many of the option i viewed in the forum, I couldn’t set this up.

The wording I have in my system is different from the one in home assistant, appreciate your support.

Lounge Actual Temp_A3 1/4/48

Lounge Set-Point Temp_A3 1/4/49

Lounge Automatic_A3 1/4/50

Lounge Status Auto_A3 1/4/51

Lounge Manual Speed_A3 1/4/52

Lounge Speed Monitor_A3 1/4/53

Lounge PI Monitor_A3 1/4/54

Lounge Cooling ON OFF_A3 1/4/55

Lounge Comfort Status_A3 1/4/56

Lounge Instantaneous Set-Point Temp_A3 1/4/57

Lounge FC Status_A3 1/4/58

May I use this thread here to also ask a KNX specific question? I want to use a xknx.yaml config file, just to have everything knx related in one place.
Now I am wondering how I can set a friendly name for a device?
Here’s what my config looks like currently. I did try to use the keyword ‘name’, but that did’t work.
Home-Assistant still calls my light light.entry_light. Is there a way to change that?

Thank you,
Cheers Georg

general:
    own_address: '15.15.249'

connection:
    tunneling:
        gateway_ip: '192.168.1.113'
        gateway_port: 3671
        local_ip: '192.168.1.9'

groups:
    light:
        entry.light:  {name: 'TestName', group_address_switch: '0/1/5', group_address_switch_state: '0/1/4'}