libknx
KNX interface library
Author
Norbert Schmitz, knx@n.nosp@m.agil.nosp@m.o.de
Date
May 2021
Version
1.2.6

This library can be used to access the home automation bus system KNX using an IP gateway. More information on the bus may be found at www.knx.com .

Changes since version 1.2.5

  • Bugfix for DPT 3.007 which caused small changes to be ignored.
  • Added function wait_until_connected which allows to check if connection has been created.

Changes since version 1.2.4

  • Added heartbeat callback function in case of connection loss.

Changes since version 1.2.3

  • Complete redesign of the internal library structure with the conclusion to avoid boost includes on the public header files
  • Simplification of the integration due to removed boost compile time dependency
  • Set default local IP to 0.0.0.0 which now allows to omit the local host address in many cases

Changes since version 1.2.2

  • Added dpts. Now supporting: 1_001,2_001,3_007,4_001,5_001,6_001,7_001,8_001,9_001,10_001,11_001,12_001,13_001,14_000,15_000,16_000,17_001,18_001,19_001,20_011,21_001,26_001,219_001,232_600
  • Added class knx::group for group address handling
  • Supporting two part group addresses (at receive time 3 part addresses are assumed)

Changes since version 1.2.1

  • Added support for dpt 7.001, 8.001
  • Bugfix for dpt 9 & 10 (incorrect value setting)

Changes since version 1.0.0

  • Added listener interface
  • Added several new dpts. Now supporting dpt 1.001, 2.001, 3.007, 4.001, 5.001, 6.001, 9.001, 10.001.

The whole program including the header files are free to be used in any non-commercial application. A notification of usage to the author would be very nice.

Commercial use is strictly forbidden. In case you are interested in a commercial license please contact the author.

Example

A minimal code example would look like this when setting group 1/2/3 to on using a data point type of 1.001 .

#include "knx.hpp"
int main(int argc, char ** argv) {
knx::config config(argc, argv);
knx::connection connection(config);
knx::handle handle(connection);
connection.set<knx::dpt_switch>(knx::group("1/2/3"), knx::dpt_switch::ON);
return 0;
}
This class represents the configuration of the knx connection.
Definition: config.hpp:19
This class handles the ip connection(s) to the knx gateway.
Definition: connection.hpp:24
data point type 1.001 simple boolean value
Definition: dpt.hpp:68
This class represents a KNX group address which might be either 3 compnent "a/b/c" or 2 component "a/...
Definition: group.hpp:17
Thread management for connection handling.
Definition: handle.hpp:19

Features

Although there are many eib/knx libraries available I started to develop an new knx library from scratch. The reasons for this are the following:

  • Minimal dependencies:

    Many existing libraries contain dependencies to additional libraries which make the compiltion process harder. libknx depends solely on boost. No other dependencies are allowed.

  • Platform independence:

    libknx is portable. It is able to run on any linux operating system including Raspberry PI and on any Mac or Windows computer. The main development is realized on a Linux Debian 7.0 32bit machine but other distros and platforms will follow.

  • Reduce to the maximum:

    The library on its own does not contain any additional overhead. It is capable of writing and reading knx messages – nothing more and nothing less. Any additional ideas I or other may have should be based on libknx without extending the base system.

Current limitations

libknx is a brand new development which means that many features are currently missing. Most of them will be added in future. The current version has the following limitations:

  • Only UDP communication is available

Ideas

The development of such a library directly creates tons of ideas what can be done with it. Besides others these are:

  • Control your curtains using a Kinect
  • Control your lights using a LeapMotion
  • ...

Yours Norbert Schmitz