KNX Cookbook

thank you guys. after my findings ill posted it here

Hi

I have the .knxproj file. However I cannot find the KNX addresses

Iā€™m trying to find the KNX address like this
address: ā€œ1/0/9ā€
in the XML files that I have for all the KNX devices in my home.
I have project.xml, 0.xml, Hardware.xml and more xml files. I donā€™t have the KNX application.
So far Iā€™ve found these types of address in the 0.xml files.
<GroupAddress Id=ā€œP-1778-0_GA-69ā€ Address=ā€œ2110ā€ Name=ā€œEnter floor office spotsā€
Is this the right address? how do I covert to the simple address format above?
Or am I looking in the wrong file?

This .knxproj file is usually opened with ETS. Youā€™ll need a license if there are > 5 devices in the Project.
There are however tools that can parse these files. Not for HA but for other means. You can probably find something on GitHub.
If you want to find things manually that is fine too. You will need the addresses and their DPST / DPT.
I guess 2110 is the raw address. You can just use this in xknx / HA.
To convert them into 3-level structure see https://support.knx.org/hc/en-us/articles/115003188109-Group-Addresses or
https://github.com/XKNX/xknx/blob/c6e51b7b008daabc87fb520b6d9a55952ca3f55b/xknx/telegram/address.py#L179

Thanks. I used this script and was able to get the addresses.

However, the KNX lights that I have are not working. This is from the log files. What might be wrong?
021-03-23 22:22:23 DEBUG (MainThread) [xknx.log] Error: KNX bus responded to request of type ā€˜Connectā€™ with error in ā€˜ConnectResponseā€™: ErrorCode.E_NO_MORE_CONNECTIONS

2021-03-23 22:22:23 DEBUG (MainThread) [xknx.log] Could not establish connection to KNX/IP interface. CommunicationError: ConnectRequest failed. Status code: ErrorCode.E_NO_MORE_CONNECTIONS

2021-03-23 22:22:23 DEBUG (MainThread) [xknx.log] Closing transport.

2021-03-23 22:22:26 DEBUG (MainThread) [xknx.knx] Sending: <KNXIPFrame

body="" />

2021-03-23 22:22:26 DEBUG (MainThread) [xknx.raw_socket] Received from (ā€˜192.168.1.210ā€™, 3671): 0610020600080024

2021-03-23 22:22:26 DEBUG (MainThread) [xknx.knx] Received: <KNXIPFrame

body="" />

2021-03-23 22:22:26 DEBUG (MainThread) [xknx.log] Error: KNX bus responded to request of type ā€˜Connectā€™ with error in ā€˜ConnectResponseā€™: ErrorCode.E_NO_MORE_CONNECTIONS

2021-03-23 22:22:26 DEBUG (MainThread) [xknx.log] Could not establish connection to KNX/IP interface. CommunicationError: ConnectRequest failed. Status code: ErrorCode.E_NO_MORE_CONNECTIONS

2021-03-23 22:22:26 DEBUG (MainThread) [xknx.log] Closing transport.

2021-03-23 22:22:29 DEBUG (MainThread) [xknx.knx] Sending: <KNXIPFrame

body="" />

2021-03-23 22:22:29 DEBUG (MainThread) [xknx.raw_socket] Received from (ā€˜192.168.1.210ā€™, 3671): 0610020600080024

2021-03-23 22:22:29 DEBUG (MainThread) [xknx.knx] Received: <KNXIPFrame

body="" />

A knx ip interface supports a certain amount of concurrent tunneling connections (usually 1-8). Yours seems to be already using all available connections.

Thanks!!!
I have an AMX controller (that Iā€™m looking to replace with HA). I unplugged that controller and now my lights and shades are working. my log now looks like this below.
Iā€™m also not able to get the lights on one card like I see in HA demo screen for KNX. Rather I get this.
Screenshot 2021-03-23 23.03.39

What are you referring to? Is this a frontend issue or has it to do with knx?

PS please put logs in code blocks (marked by backticks) or upload them to a code sharing site and just past the link here. Else information gets lost and it is unreadable.

Yosef, your posting really is a mess and you obviously didnā€™t even care to clean it up. But you still expect others to decifer it to help you. Sorry to be so blunt but I consider this disrespectful.

1 Like

Hi Matthias.

Thank for the assistance.

  1. FrontEnd - I figured out what I was doing wrong and Iā€™m now using the Entity Card and I see the full list of lights.
  2. Log. HA is working fine. As I mentioned earlier - Iā€™m replacing an AMX Controller that was the "brainā€™ - automation/control/macros for the KNX installation with HA.

Stuff that Iā€™ve learned that might be helpful to others looking to get off AMX and have KNX continue to function.

  1. If you have the .knxproj file - but donā€™t have ETS the script that I pasted earlier in this thread works great to pull out the address.
    I have found that it only pulls out the one KNX address - not state move_short_address, stop_address. So I expect some pain with configuring dimmers, shutters and motion sensors.

  2. AMX controller and HA donā€™t play well together running at the same time. When AMX is connected, the HA cannot connect. When HA is connected - the AMX is not able to reach the KNX bus. It is probably because the Siemens KNX IP 148 1aB21 only accepts 1 concurrent connection.

  3. My Mitsubishi HVAC is connected directly to an old Rs-232 Connection to AMX and then uses KNX to update the KNX Touchpads in every room. This is not going to be easy to connect to HA without spending money on a new IP based interface.

Apologies. Will be more careful in the future.

1 Like

It may help to use the HA KNX integration itself to log the traffic on the KNX bus. That way you would see all communication on the bus and can conclude the function of each group address. I have never done this as I have an ETS license. But @farmio explained it in this other thread:
Activate debug log for KNX - #2 by farmio

It can only extract group addresses that are configured. It is possible that some functions are just not liked to a group address. Also note that in the knx project itself there is no relation whatsoever between eg. brightness and brightness_state of a light etc. (except for very new projects using ā€œFunctionsā€).

The 2nd thing is just a shortcoming of the ip interface you are using. With one supporting multiple tunneling connections this should work just fine.

If KNX is not using functions that are linked to addresses - how can I control these from HA?

For example, I have dimmer lights that can be dimmed using the KNX switch - long Press. Or Blinds that a short press goes up or down a little bit, long press all the way down.

Thanks.

You can only interact with group addresses. If a communication object is not linked to one you canā€™t use it. But you could always get ETS and change this.

The light canā€™t be dimmed from HA if you donā€™t have a ā€œdimming %ā€ address (DPT 5).
The blinds should work. Your switch probably sends to different addresses on long/short.

Hello,
I have an Entities card from HA in which I select a date and time; I wanted to write the date and time in 2 GA. Is it possible ? This does not work :
configuration.yaml

# KNX
knx: !include_dir_merge_named knx/

knx_expose.yaml

expose:
  - type: datetime
    entity_id: input_datetime.heure_debut_chauffage
    address: "4/7/0""

No. You can only send current (system time) date, time or datetime to the bus - just omit entity_id.

Thank you. This is bad news because I was thinking of using the Calendar module of my ABB ABA / S 1.2.1.
In addition, building this function with HA while keeping an interface that receives the start and end dates and times is not very easy.

Personally, I would not manage automations in two systems. Make HA your main automation engine and control all devices from there. KNX integration should be good enough to control any device connected to KNX bus. But I must admit that this ABB logic module was an over investment :slight_smile:

I prefer to keep ABA / S 1.2.1 which has advanced functions as the main automation engine because I believe it is more reliable than HA and the installation remains maintainable by an integrator KNX certified.
I want to use HA for supervision and some non-essential functions.

1 Like

Use the best tool for the job. I also donā€™t like to be bound to one system - this is not what knx is intended for.

You could try to create a value template forging the raw time payload to send it with knx.send which is probably doable, but a pita to set up.
Or you try if knx.send accepts time as type - I have Never tried this, but it could theoretically work. It would require the time as a Python time.struct_time object then (again probably templating required). it doesnā€™t.