KNX integrations

Hi guys,

My first post around here, I’m trying out HA for the first time to see if it might be the sucessor to my Gira HomeServer.

I have a TrueNAS Scale server (ver. 22.02.0). I have then installed the Home Assistant app.
(have not set up a VM containing HA, just added the plugin in scale.)

First thing I’m trying is to establish a connection to my KNX-based home. I have installed the KNX integration in HA.
I cannot find much to configurate, however I get the message that no gateway found.

Shouldn’t I be able to specify the IP-routers IP-adress somewhere?
What am I missing? :slight_smile:

Hi :wave:!

You’re missing the next step of the option flow. When you selec “Tunnelling” it will ask you for the IP address.

It shouldn’t be necessary though - "automatic should figure it out when Multicast is working properly in your environment (no idea what a “plugin in scale” is so 🤷).

If you want to use “routing” you’ll have to make sure that Multicast works, for tunneling there are workarounds.

1 Like

Thanks @farmio

I’m using routing with multicast on other devices inside the network and it works as intended.
But for the sake, I just tried Tunneling and assigning the IP-adress of the IP-interface without any sucess.
Also tried setting the option to Routing.

I’m running HA in a docker/container, inside the TrueNAS machine. Not a full install of HassOS on RPi for example. Maybe there is a virtual-IP problem here? and I need to assign a psycal NIC to HA?

How to do that is a great question, think I need to ask the TrueNAS community :smiley:

You need to run the docker container with --net=host.
Or use a HA OS VM.

You can also try to select “tunneling” with route-back enabled. But I’d try to get multicast working for other integrations too. I guess a VM is the nicest option as you can use Add-ons too then.

1 Like

Thanks,

Just realized that TrueNAS doesn’t use Dockers, they use “kubernetes”
Haven’t really found where to confugrutare net host yet, digging into it now. :slight_smile:

Kubernetes is Docker orchestration, isn’t it?

Another workaround would be to just use TCP tunneling - if your Knx interface supports it (newer ones do, also all Knx Secure enabled).

1 Like

Thanks,

I tried setting the Tunneling to TCP, and it seem to work? (Atleast no errors).

Tried making a simple button to recall a scene, but the YAML editor don’t agree with with the cut’n’paste example…


knx2

You are configuring a lovelace Button Card. This is not the place to put KNX integration configuration - it goes in configuration.yaml. See Configuration.yaml - Home Assistant

@sx3: this is the way I have it.
In configation.yaml

knx:
  switch: !include knx_switch.yaml

In knx_switch.yaml

  - name: Kitchen.Light
    address: '0/0/1'

and in your dashboard, you add a button/entity/… with that switch

1 Like

@Nick4 @farmio Thanks guys, will try it out.

But first, i need to find out how I can edit the configuration.yaml. Since i have HA-Core installed I’m not able to put in add-ons, like Code-Server. Need a way to access the HA and edit thoose files.

It would been nice if the GUI hade an built in editor :smiley:

Is knx_switch.yaml already in the folder, or is it something I have to create?

No knx_switch.yaml is not a thing everyone uses - it’s only defined by the !include statement. This is an advanced topic you should not need to worry about now.

I would strongly recommend to put everything in configuration.yaml (no knx_*.yaml and include) for the beginning. When everything works well you can think about splitting up the config into multiple files (or leave it as is and never look at it again 🤷).

You should be able to mount the config directory into the container. That way you will have access to it from the host system. I’m sure there are plenty threads and tutorials for that. Hint: you are using HA container, not HA core.

1 Like

As @farmio states: splitting the configuration.yaml is not necessary, this was just a suggestion.
You have to create this file manually, it helps to unclutter things.

If you got the basics working, you might have a look at it.

1 Like

Thanks guys,

I installed HA-OS as a virtual machine instead of as a plugin in TrueNAS.
With that option I cold install Code Server add-on to edit the YAML file.

Got the KNX integration to work, I can now recall scenes set in my KNX devices.
Is it possible to save/learn in new scenes from the HA to the KNX devices? In the normal KNX world, I would just hold the scene button save it after I’ve made adjustments.

I understand that HA can make own scenes but I would rather not making my depending on a server.
I also need to learn how to make the UI/LoveLace more sexy, I can’t deny that the Gira HomeServer UI is IMO one of the most attractive UI’s.

No, this is not implemented. You can, however, create this function manually by using a scene number of 128 + scene_number_to_save_to and send it to the scene GA (the first bit to 1 means “learn the scene corresponding to the field Scene Number”).
Not sure if this works with the scene entity, but you can use a button entity or some lovlace card / service that calls knx.send to send it as raw payload or 1byte_unsigned.

PS. remember that scene numbers in raw are 0-indexed while in ETS they are 1-indexed. So ETS scene number 3 has a knx payload of 2 and a save-payload of 130.

Doing this will of course not have any effect on HA scenes unless you have some automation to do so, but you don’t want to use these anyway.