Data type functions

knxdatatype object provides data encoding and decoding between Lua and KNX data formats.

knxdatatype.decode(value, datatype)

Converts hex-encoded data to Lua variable based on given data type. Data type is specified either as KNX primary data type (integer between 1 and 16) or a secondary data type (integer between 1000 and 16000).

Return values:

Data types

The following data types can be used for encoding and decoding of KNX data. Data representation on Lua level and predefined constants (in bold) is given below: