Skip to main content

Converter for spreadsheets to KNX ETS group address configurations in CSV format.

Project description

PyPI version MIT License GitHub issues open GitHub Actions

KNX GroupAddress Exporter for ETS

Introduction

A simple converter for spreadsheets to KNX ETS group address configurations in CSV format.

Converter allows to use all possible features of the spreadsheet tools like Excel, LibreOffice etc to plan, duplicate and maintain your KNX group addresses. No more unhandy group address duplication or management in the KNX ETS software.

Leveraging the powerful jsonargparse library, this tool supports configuration and control via command-line parameters or a JSON configuration file.

Features

  • Parse and convert Excel sheets to KNX ETS readable CSV files containing group address configuration.
  • Different KNX ETS CSV formats supported.
  • Configurable Excel sheet layout

Changelog

Changes can be followed at CHANGELOG.md.

Requirements

For development:

Setup

With pip / pipx

pip install knx-ga-exporter
pipx install knx-ga-exporter

Setup directly from github repo / clone

git clone https://github.com/waldbaer/knx-ga-exporter.git
cd knx-ga-exporter

python -m venv .venv
source ./.venv/bin/activate
pip install .

Usage

Step1: Convert spreadsheet to ETS readable CSV file.

Create / design all needed KNX group addresses in an spreadsheet using Excel / LibreOffice XLSX document:

Export the spreadsheet contents as CSV file:

knx-ga-exporter -i docs/Examples/01-SmallExampleWithRoomBook/KNX-planning-example.xlsx -vv

2025-02-02 11:48:23 INFO: Loading XLSX input file 'docs/Examples/01-SmallExampleWithRoomBook/KNX-planning-example.xlsx'
2025-02-02 11:48:23 DEBUG: Parsed GA: 0/0/1    | Light & Power | Switch | DPST-1-1 | B0-0-L - Basement Office - Ceiling light - Light & Power Switch
2025-02-02 11:48:23 DEBUG: Parsed GA: 0/0/2    | Light & Power | Switch | DPST-1-1 | T0-0-L - Top Floor Bathroom - Ceiling light - Light & Power Switch
2025-02-02 11:48:23 DEBUG: Parsed GA: 0/0/3    | Light & Power | Switch | DPST-1-1 | T1-0-L - Top Floor Bedroom - Wall light (north) - Light & Power Switch
2025-02-02 11:48:23 DEBUG: Parsed GA: 0/0/5    | Light & Power | Switch | DPST-1-1 | B1-2-P - Basement Kitchen - Wall plug - next to bed. - Light & Power Switch
...
2025-02-02 11:48:23 INFO: Exporting group addresses into CSV file 'knx-ga-addresses.csv'. format: 1/1, separator: '[TAB]', encoding: iso-8859-1
2025-02-02 11:48:23 DEBUG: Exporting main group     0        | Light & Power |
2025-02-02 11:48:23 DEBUG: Exporting   middle group 0/0      |               | Switch |
2025-02-02 11:48:23 DEBUG: Exporting     sub group: 0/0/1    | Light & Power | Switch | DPST-1-1 | B0-0-L - Basement Office - Ceiling light - Light & Power Switch
2025-02-02 11:48:23 DEBUG: Exporting     sub group: 0/0/2    | Light & Power | Switch | DPST-1-1 | T0-0-L - Top Floor Bathroom - Ceiling light - Light & Power Switch
2025-02-02 11:48:23 DEBUG: Exporting     sub group: 0/0/3    | Light & Power | Switch | DPST-1-1 | T1-0-L - Top Floor Bedroom - Wall light (north) - Light & Power Switch
2025-02-02 11:48:23 DEBUG: Exporting     sub group: 0/0/5    | Light & Power | Switch | DPST-1-1 | B1-2-P - Basement Kitchen - Wall plug - next to bed. - Light &
...
2025-02-02 11:48:23 DEBUG: Statistics: #GA: 16
2025-02-02 11:48:23 INFO: Conversion successfully finished.

The exported CSV can be found in knx-group-addresses.csv:

"Group name"	"Address"	"Central"	"Unfiltered"	"Description"	"DatapointType"	"Security"
"Light & Power"	"0/-/-"	""	""	""	""	"Auto"
"Switch"	"0/0/-"	""	""	""	""	"Auto"
"B0-0-L - Basement Office - Ceiling light - Light & Power Switch"	"0/0/0"	""	""	"Additional comment"	"DPST-1-1"	"Auto"
"T0-0-L - Top Floor Bathroom - Ceiling light - Light & Power Switch"	"0/0/1"	""	""	"is added to ETS description field"	"DPST-1-1"	"Auto"
"T1-0-L - Top Floor Bedroom - Wall light (north) - Light & Power Switch"	"0/0/2"	""	""	""	"DPST-1-1"	"Auto"
"B1-2-P - Basement Kitchen - Wall plug - next to bed. - Light & Power Switch"	"0/0/4"	""	""	""	"DPST-1-1"	"Auto"
...

Step2: Load CSV into KNX ETS application

  • Open the KNX ETS application and the project.

  • Edit -> Import Group Addresses -> Select the generated CSV file.

  • Voila! New group addresses are added or existing addresses got renamed.

Hint: The KNX ETS application will not automatically delete group addresses not contained in the CSV file anymore. A cleanup must be done manually.

Examples

Examples including the standard spreadsheet format can be found in folder docs/Examples

All Available Parameters and Configuration Options

Details about all available options:

Usage: knx-ga-exporter [-h] [--version] [-c CONFIG] [-v] [-i FILE] [-o FILE] [--output.encoding ENCODING] [--output.format {1/1,3/3}]
                       [--output.separator {tabulator,comma,semicolon}] [--layout.sheet-name SHEET_NAME]
                       [--layout.first-row FIRST_ROW] [--layout.last-column LAST_COLUMN] [--layout.main-ID-column MAIN_ID_COLUMN]
                       [--layout.middle-ID-column MIDDLE_ID_COLUMN] [--layout.sub-ID-column SUB_ID_COLUMN]
                       [--layout.main-name-column MAIN_NAME_COLUMN] [--layout.middle-name-column MIDDLE_NAME_COLUMN]
                       [--layout.sub-name-column SUB_NAME_COLUMN] [--layout.dpt-column DPT_COLUMN]
                       [--layout.target-ID-column TARGET_ID_COLUMN] [--layout.comment-column COMMENT_COLUMN]

Converter for spreadsheets to KNX ETS group address configurations in CSV format. | Version 2.0.3 | Copyright 2019-2025

Default Config File Locations:
  ['./config.json'], Note: no existing default config file found.

Options:
  -h, --help            Show this help message and exit.
  --version             Print version and exit.
  -c, --config CONFIG   Path to JSON configuration file.
  -v, --verbose         Increase log-level. -v: INFO, -vv DEBUG. Default: WARN/ERROR (default: 0)
  -i, --input.file FILE
                        Path to XSLX file to be parsed. (required)
  -o, --output.file FILE
                        Path of exported CSV file. (default: knx-ga-addresses.csv)
  --output.encoding ENCODING
                        Output file encoding (default: iso-8859-1)
  --output.format {1/1,3/3}
                        CSV output format.

                        Possible formats:
                        1/1: Name / Address
                        3/3: Main- Middle- Sub- Name/Main- Middle- Sub-Address
                         (default: 1/1)
  --output.separator {tabulator,comma,semicolon}
                        CSV separator.

                        Possible separators:
                        tabulator: [TAB]
                        comma:     ,
                        semicolon: ;
                         (type: None, default: tabulator)
  --layout.sheet-name SHEET_NAME
                        Name of XLSX sheet containing the KNX group addresses (default: KNX Group Addresses)
  --layout.first-row FIRST_ROW
                        First row containing GAs (default: 8)
  --layout.last-column LAST_COLUMN
                        Last column (default: 10)
  --layout.main-ID-column MAIN_ID_COLUMN
                        Column containing main ID of KNX GA (default: 0)
  --layout.middle-ID-column MIDDLE_ID_COLUMN
                        Column containing middle ID of KNX GA (default: 2)
  --layout.sub-ID-column SUB_ID_COLUMN
                        Column containing sub ID of KNX GA (default: 4)
  --layout.main-name-column MAIN_NAME_COLUMN
                        Column containing main name of KNX GA (default: 1)
  --layout.middle-name-column MIDDLE_NAME_COLUMN
                        Column containing middle name of KNX GA (default: 3)
  --layout.sub-name-column SUB_NAME_COLUMN
                        Column containing sub name of KNX GA (default: 8)
  --layout.dpt-column DPT_COLUMN
                        Column containing datapoint type of KNX GA (default: 5)
  --layout.target-ID-column TARGET_ID_COLUMN
                        Column containing target ID KNX GA (default: 6)
  --layout.comment-column COMMENT_COLUMN
                        Column containing GA comment (default: 9)

Development

Setup environment

pdm install --dev

Format / Linter / Tests

# Check code style
pdm run format

# Check linter
pdm run lint

# Run tests
pdm run tests

Publish

# API token will be requested interactively as password
pdm publish -u __token__

# or to test.pypi.org
pdm publish --repository testpypi -u __token__

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

knx_ga_exporter-2.0.3.tar.gz (61.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

knx_ga_exporter-2.0.3-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file knx_ga_exporter-2.0.3.tar.gz.

File metadata

  • Download URL: knx_ga_exporter-2.0.3.tar.gz
  • Upload date:
  • Size: 61.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for knx_ga_exporter-2.0.3.tar.gz
Algorithm Hash digest
SHA256 1b3f8142a7e0b6ecf34dc1fba84dc0f1769729a6ac5dff9a9718d5c1eda254aa
MD5 f95bf424812f3e2bc4fb0aa6e9f735ea
BLAKE2b-256 7229f8ecdfc88a4f9f6e730c8e1c6a2cff86c455570c455c1b8be06cb24d924c

See more details on using hashes here.

Provenance

The following attestation bundles were made for knx_ga_exporter-2.0.3.tar.gz:

Publisher: release.yml on waldbaer/knx-ga-exporter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file knx_ga_exporter-2.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for knx_ga_exporter-2.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 13b29b6c5b71ab69ec5db16f4dc2372d0cf7eaaec526fb1f53908726a5907bbe
MD5 afb62e82bcf49dac3ff3da7d5f79925b
BLAKE2b-256 741bf41ef9e83eeb81ae287de89f108762ec2d1f2b419d286a5e97384b52b6a1

See more details on using hashes here.

Provenance

The following attestation bundles were made for knx_ga_exporter-2.0.3-py3-none-any.whl:

Publisher: release.yml on waldbaer/knx-ga-exporter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page