KNX

From HSYCO
Jump to navigation Jump to search

The KNX I/O Server provides for the control of a KNX installation compliant with the KNX Standard version 2.0.

The communication between HSYCO and the KNX network must employ a KNXnet/IP gateway supporting the Tunneling service.

The KNX framework must be programmed to work properly using the ETS tool.

Each defined KNX group is seen as a datapoint whose value is formatted with respect to its DPT type. Supported DPT types range from DPT 1 to DPT 18. Moreover, it is possible to have virtual datapoints that link a set of datapoints used for the control of devices such as lights, dimmers, automations and thermostats which require several KNX groups for commands and feedback.

HSYCO Configuration

Add a KNX I/O Server in the I/O Servers section of the Settings and set its parameters:

Communication

  • IP Address: IP address of the KNX/IP gateway
  • IP Port: TCP/IP port to use, leave blank to use default port 3671.

High Availability

  • Shutdown when inactive: defaults to false.

Options

ID Default Values Description
startupevents false true generate IO events also during the driver’s start-up phase
false start generating events only after HSYCO is aligned with the current status of the system
discovery true true automatically create the list of all detected datapoints with type DPT 1 and the defined virtual datapoints in the systemtopo.txt file. Should be enabled to allow the automatic update of (button) objects' states
false auto-detect for devices is disabled
fromevents false true generate events for commands sent on the KNX BUS reporting the source address and the value of the command
false disable command events
readaftercommand false true force the driver to read the value of a datapoint after a command is sent to it
false the driver will assume that commands detected on the BUS are always successful, thus no re-reading is performed to set the value of a datapoint
localport <port_number> the port number used locally by HSYCO to communicate with the KNXnet/IP gateway. This option might be necessary when employing network address translation (NAT)

Datapoints Declaration

It is required to provide the I/O Server with the KNX framework configuration. To this end, the KNX Utility provides a graphical interface to import ETS4 project files and to configure the datapoints.

It is also possible to manually define the datapoints in the knxtopo.txt file.

Datapoints

ID Value R/W Description
connection online R connection established to the gateway and initial reading executed
offline R HSYCO can't connect to the gateway
<datapoint_id> <value> R this datapoint has value <value>
W set this datapont to value <value>
<datapoint_id>.from.<source> <value> R a command with value <value> from the device with individual address <source> has been sent to the addressed datapoint. The source address has the format “x.y.z” (e.g. 1.2.87)
light.<n> 0 R the light is off
W turn off the light
1 R the light is on
W turn on the light
flip W invert the state of the light
unknown R the state of the light is unknown
dimmer.<n> off R the dimmer is off
W turn off the dimmer
on W turn on the dimmer
1% ... 100% R the dimming level is set to the reported level
0% ... 100% W set the dimming level to the specified value
unknown R the state of the dimmer is unknown
rgb.<n> off W turn off the light
on W turn on the light
<r>*<g>*<b> R the light color is set to the reported RGB value (e.g. "255*0*0" corresponds to red)
W set the light color to the specified RGB value
unknown R the state of the light is unknown
autom.<n> if use position = false up R the automation is moving upwards
down R the automation is moving downwards
offup R the automation is stopped in a open position
offdown R the automation is stopped in the closed position
if use position = true 0% ... 100% R the automation is stopped at the reported position
0%+ ... 100%+ R the automation is at the reported position and is closing
0%- ... 100%- R the automation is at the reported position and is opening
up W move the automation upwards
down W move the automation downwards
0% ... 100% W move the automation to the specified position
stop W stop the automation
unknown R the state of the automation is unknown
thermo.<n>.setpoint.temp <float_value> W set the setpoint to the specified value
up W increase the setpoint by 0.5
down W decrease the setpoint by 0.5
thermo.<n>.setpoint mode W switch to the next setpoint mode
thermo.<n>.setpoint.mode comf R the setpoint mode of the thermostat is set to "comfort"
night R the setpoint mode of the thermostat is set to "night"
stb R the setpoint mode of the thermostat is set to "stand-by"
unknown R the setpoint mode of the thermostat is unknown
gateway next W kill and restart the I/O Server and switch to the next gateway as listed in the IP settings
<n> R the I/O Server is using the gateway with index <n> with respect to the list of addresses in the IP settings, starting from 0
W kill and restart the I/O Server and switch to the gateway with index <n>


Datapoint types and values


The KNX I/O Server supports all datapoint types (DPTs) with main number ranging from 1 to 18.

The value of a datapoint is formatted with respect to its DPT main number. The actual behavior of the datapoint is anyhow dependent on its complete type (i.e. main number and sub number). Examples for the most common cases will be provided, but for a complete reference of all available datapoint types and allowed values we strongly advice to refer to chapter 3/7/2 of the KNX Standard v2.0.

The following paragraphs will show the KNX data format for each DPT as described in the protocol as well as the allowed datapoint values and the corresponding conversion.

Datapoint Type 1 (1 bit, Boolean)


KNX bit-level format:

87654321
b

b = {0, 1}

Datapoint values:

Value Converts to
0 b = 0
1 b = 1

Example:

For a datapoint with DPT 1.001 (e.g. a switch) a value of '0' corresponds to the 'off' state, while for a datapoint with DPT 1.007 (e.g. a step indicator for a dimmer) it would correspond to the state 'decrease'.

Datapoint Type 2 (2 bits, Control)


KNX bit-level format:

87654321
c v

c = {0, 1}, v = {0, 1}

Datapoint values:

Value Converts to
disabled c = 0, v = 0
0 c = 1, v = 0
1 c = 1, v = 1

Datapoint Type 3 (4 bits, Dimming, Blinds)


KNX bit-level format:

87654321
c step

c = {0, 1}, step = [000b ... 111b]

Datapoint values:

Value Converts to
-7 ≤ v < 0 c = 0, step = |v|
0 ≤ v ≤ 7 c = 1, step = v

Example:

For a datapoint with DPT 3.007 (control dimming) a value of '3' corresponds to a 3-steps light increase. The same value for a DPT 3.008 (control blinds) datapoint corresponds to a 3-steps downwards movement. In both cases a value of '0' indicates the 'break' state.

Datapoint Type 4 (8 bit, Character set)


KNX bit-level format:

87654321
char

char = [0 ... 255] (ISO 8859-1 encoding of a character)

Datapoint values:

Value Converts to
0 ≤ v ≤ 255 char = v

A DPT 4.001 datapoint will only support the values corresponding to ASCII characters (a subset of the ISO 8859-1 standard values), thus only values ranging from 0 to 127 are allowed.

Datapoint Type 5 (8 bits, Unsigned Value)


KNX bit-level format:

87654321
val

val = [0 ... 255]

Datapoint values:

Value Converts to
0 ≤ v ≤ 255 val = v

Example:

For a datapoint with DPT 5.001 (scaling) a value of '255' corresponds to '100%'. For a datapoint with DPT 5.003 (angle) the same value corresponds to '360°'.

Datapoint Type 6 (8 bits, Signed Value)


KNX bit-level format:

87654321
val

val = [-128 ... 127] (two’s complement notation)

Datapoint values:

Value Converts to
-128 ≤ v ≤ 127 val = v

Datapoint Type 7 (2 Bytes, Unsigned Value)


KNX bit-level format:

16151413121110987654321
val

val = [0 ... 65535]

Datapoint values:

Value Converts to
0 ≤ v ≤ 65535 val = v

Datapoint Type 8 (2 Bytes, Signed Value)


KNX bit-level format:

16151413121110987654321
val

val = [-32768 ... 32767] (two’s complement notation)

Datapoint values:

Value Converts to
-32768 ≤ v ≤ 32767 val = v

Datapoint Type 9 (2 Bytes, Float Value)


KNX bit-level format:

16151413121110987654321
m e m

e = [0 ... 15], m = [-2048 ... 2047] (two’s complement notation)

float value = (0.01 * m) * 2^e = [-671088.64 ... 670760.96]

Datapoint values:

Value Converts to
-671088.64 ≤ v ≤ 670760.96 float value = v

Datapoint Type 10 (3 Bytes, Time)


KNX bit-level format:

242322212019181716151413121110987654321
day hour 0 0 min 0 0 sec

day = [0 ... 7] (0 = no day, 1 = Monday, ..., 7 = Sunday)

hour = [0 ... 23]

min = [0 ... 59]

sec = [0 ... 59]

Datapoint values:

Value Converts to
<day>.<hour>.<minutes>.<seconds> day = <day>, hour = <hour>, min = <min>, sec = <sec>

Example:

A value of '2.12.46.23' corresponds to 'Tuesday 12:46:23'.

Datapoint Type 11 (3 Bytes, Date)


KNX bit-level format:

242322212019181716151413121110987654321
0 0 0 day 0 0 0 0 month 0 year

day = [1 ... 31]

month = [1 ... 12]

year = [0 ... 99] (if ≥ 90 interpret as 20th century, otherwise interpret as 21st century)

Datapoint values:

Value Converts to
<year>/<month>/<day>

(1990 ≤ <year> ≤ 2089)

year = last two digits of <year>, month = <month>, day = <day>

Example:

A value of '2011/2/8' corresponds to 'February 8th 2011'.

Datapoint Type 12 (4 Bytes, Unsigned Value)


KNX bit-level format:

3231302928272625242322212019181716151413121110987654321
val

val = [0 ... 4294967295]

Datapoint values:

Value Converts to
0 ≤ v ≤ 4294967295 val = v

Datapoint Type 13 (4 Bytes, Signed Value)


KNX bit-level format:

3231302928272625242322212019181716151413121110987654321
val

val = [-2147483648 ... 2147483647] (two’s complement notation)

Datapoint values:

Value Converts to
-2147483648 ≤ v ≤ 2147483647 val = v

Datapoint Type 14 (4 Bytes, Float Value)


KNX bit-level format:

3231302928272625242322212019181716151413121110987654321
s e f

s = {0, 1}, e = [0 .. 255], f = [0 ... 8388607]

float value = 0, [1.40129846432481707E-45, 3.40282346638528860E+38] (IEEE 754 floating point format)

Datapoint values:

Value Converts to
v = 0 | 1.40129846432481707E-45 ≤ v ≤ 3.40282346638528860E+38 float value = v

Datapoint Type 15 (4 Bytes, Access)


KNX bit-level format:

3231302928272625242322212019181716151413121110987654321
d6 d5 d4 d3 d2 d1 e p d c index

d1, d2, d3, d4, d5, d6 = [0 ... 9]

index = [0 ... 15]

e = {0, 1} (0 = no error, 1 = reading of access information was not successful)

p = {0, 1} (0 = not accepted, 1 = accepted)

d = {0, 1} (0 = left to right, 1 = right to left)

c = {0, 1} (0 = no encryption, 1 = access information encrypted)

Datapoint values:

Value Converts to
<d6>.<d5>.<d4>.<d3>.<d2>.<d1>.<e>.<p>.<d>.<c>.<index> d6 = <d6>, d5 = <d5>, d4 = <d4>, d3 = <d3>, d2 = <d2>, d1 = <d1>, e = <e>, p = <p>, d = <d>, c = <c>, index = <index>

Example:

A valid value would be: '1.2.3.4.5.7.0.1.0.0.13'

Datapoint Type 16 (14 Bytes, String)


KNX bit-level format:

112 111 110 109 108 107 106 105...87654321
char1 ... char14

These Datapoint Types are used to transmit strings of textual characters. The length is fixed to 14 octets. The contents are filled starting from the most significant octet. Each octet shall be encoded as specified for the chosen character set. If the string to be transmitted is smaller than 14 octets, unused trailing octets in the character string shall be set to NULL (00H).

Example: “KNX is OK” is encoded as follows: 4B 4E 58 20 60 73 20 4F 4B 00 00 00 00 00

Datapoint values:

Value Converts to
<string>

(max 14 bytes)

ISO 8859-1 encoded bytes padded with trailing NULL bytes

Example:

A valid value would be: 'Hello world'

Datapoint Type 17 (1 Byte, Scene Number)


KNX bit-level format:

87654321
0 0 sn

sn = [0 ... 63]

Datapoint values:

Value Converts to
0 ≤ v ≤ 63 sn = v

Datapoint Type 18 (1 Byte, Scene Control)


KNX bit-level format:

87654321
c 0 sn

c = {0, 1} (0 = activate the scene, 1 = learn the scene)

sn = [0 ... 63]

Datapoint values:

For this case the datapoint syntax is slightly different. The scene number (sn) must be suffixed to the datapoint ID as follows: <datapoint_id>.<scene_number>.

Value Converts to
record c = 1
1 c = 0

Example:

The activation of scenario 12 on a datapoint would correspond to: <datapoint_id>.12 = 1


Datapoint Type 232 (3 Bytes, RGB)


KNX bit-level format:

242322212019181716151413121110987654321
R G B

R, G, B = [0 ... 255]

Datapoint values:

Value Converts to
<r>*<g>*<b> R = <r>, G = <g>, B = <b>

Example:

A value of '0*0*255' corresponds to the color blue.

User Interface

All the DPT 1 datapoints and virtual datapoints that have been defined are automatically listed in the Project Editor. DPT 1 datapoints and lights can be directly linked to a button object, dimmers to a button or a dimmer object, RGBs to a rgb object, automations to button or 3button objects and thermostats can be controlled using a tempmini object.

KNX Project Editor Light.png KNX Project Editor Dimmer.png KNX Project Editor Automation.png KNX Project Editor Thermostat.png

Release Notes

3.5.0

  • added support for DPT 232 datapoints
  • added support for RGB virtual datapoints

3.4.0

  • fixed value encoding error for DPT 16 datapoints
  • removed framedelay option
  • improved frames confirmation handling
  • improved configuration files loading

3.3.0

  • added support for light virtual datapoints

3.2.1

  • fixed bug on auto-discovery of AUTOM datapoints
  • fixed bug on loading of datapoints’ thumbnails

3.2.0

  • initial release


KNX is a registered trademark of KNX Association.