# EKBPRO KNX Terminal Python – an open-source KNX SCADA in the terminal, with an OPC UA bridge to CODESYS on WAGO PFC

**URL:** <https://www.wago.community/t/ekbpro-knx-terminal-python-an-open-source-knx-scada-in-the-terminal-with-an-opc-ua-bridge-to-codesys-on-wago-pfc/2929>\
**Category:** Python\
**Created:** [October 25, 2026, 9:04pm UTC](https://www.wago.community/t/ekbpro-knx-terminal-python-an-open-source-knx-scada-in-the-terminal-with-an-opc-ua-bridge-to-codesys-on-wago-pfc/2929 "2026-10-25T21:04:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![espenbo](https://avatars.discourse-cdn.com/v4/letter/e/c57346/32.png) [@espenbo](https://www.wago.community/u/espenbo)\
**Post date:** [October 25, 2026, 9:04pm UTC](https://www.wago.community/t/ekbpro-knx-terminal-python-an-open-source-knx-scada-in-the-terminal-with-an-opc-ua-bridge-to-codesys-on-wago-pfc/2929/1 "2026-10-25T21:04:36Z")

</div>

Hi all,

I’d like to share an open-source project I’ve been building: \*\*EKBPRO KNX Terminal Python\*\*, a SCADA and visualisation for KNX that runs in the terminal and is used over SSH. It runs in Docker on a WAGO PFC200/PFC300, and it has an OPC UA bridge so a C  
ODESYS program can read and write KNX group addresses.

\*\*GitHub:\*\* [GitHub - espenbo/ekbpro-knx-terminal-python: KNX visu for the terminal · GitHub](https://github.com/espenbo/ekbpro-knx-terminal-python) (GPL-2.0, Python 3.11+)

 ![Oversikt](https://us1.discourse-cdn.com/flex016/uploads/wago/original/2X/8/8e3c8640a28a37b952f4eabb59bb3f4ec40eb628.png)

### Why a terminal?

I wanted an old-school operator station: green text, function keys, no browser, no per-tag licence. Everything is built automatically from the \*\*ETS project file\*\* (`.knxproj` / `.knxprojarchive`): floors, rooms, cards with switches, dimmers, setpoints  
and operating modes, the DPTs and the read/write flags. Point it at your ETS export and your KNX IP interface, and you have a working visualisation in a few minutes.

It’s built on [xknx]([GitHub - XKNX/xknx: XKNX - A KNX library written in Python · GitHub](https://github.com/XKNX/xknx)) / xknxproject for KNX and [Textual]([https://textual.textualize.io/](https://textual.textualize.io/)) for the UI.

### What it does

- \*\*Rooms and floors\*\* with live status and operation (F2), a \*\*floor plan\*\* with live room status (F8, exportable to DXF)
- \*\*Group address browser\*\* with live values, read and write (F3)
- \*\*Bus monitor\*\* with filter and pause (F4)
- \*\*Alarms\*\* from simple rules in the config, with acknowledgement and history (F5)
- \*\*Event log\*\*: who operated what, and when, also over SSH (F6)
- \*\*Trends\*\* from the built-in SQLite log, 1 hour to 30 days (F7)
- \*\*One server, many clients\*\*: one KNX tunnel no matter how many SSH sessions are open, logging around the clock
- KNX IP \*\*tunnelling\*\* (UDP/TCP), \*\*routing\*\* and \*\*KNX IP Secure\*\* with a keyring from ETS
- \*\*Several KNX IP interfaces\*\* at once (one per line or building part, with routing and de-duplication), and \*\*several ETS projects\*\* in one site
- English and Norwegian UI, five colour themes (including green and amber phosphor)

### Running it on a WAGO PFC

The PFC300 (750-8302) has Docker but no Python, so the program ships as a container. Enable Docker in the web-based management (\*Configuration → Docker\*). I’ve tested it on firmware 04.08.09 (aarch64, Docker 25). All dependencies install as prebuilt wh  
eels, so no compiler is needed on the PLC.

```sh  
cd /home  
curl -L [https://github.com/espenbo/ekbpro-knx-terminal-python/archive/refs/heads/main.tar.gz](https://github.com/espenbo/ekbpro-knx-terminal-python/archive/refs/heads/main.tar.gz) | tar xz  
cd ekbpro-knx-terminal-python-main  
docker build -t ekbpro-knx .

# create config.yaml from your ETS project (the project and data live in /home/knx on the PLC)

docker run --rm -v /home/knx:/data ekbpro-knx init /data/MyHouse.knxproj --gateway 192.168.1.50

# –cpus/–memory: CODESYS must always get enough CPU – the server needs far less

docker run -d --name knx --restart unless-stopped --network host \  
–cpus 1 --memory 512m -v /home/knx:/data ekbpro-knx

# open the visualisation from an SSH session on the PFC

docker exec -it knx knx  
```

Full guide: [docs/09-docker.md]([ekbpro-knx-terminal-python/docs/09-docker.md at main · espenbo/ekbpro-knx-terminal-python · GitHub](https://github.com/espenbo/ekbpro-knx-terminal-python/blob/main/docs/09-docker.md))

### KNX ↔ CODESYS over OPC UA

This is probably the most interesting part for this forum. The server is an \*\*OPC UA client of the PLC’s own CODESYS OPC UA server\*\*. You don’t need an OPC UA client licence or an extra port on the PLC, and the PLC program needs no KNX library or KNX terminal. It just reads and writes variables in a GVL:

```  
KNX bus ── KNX IP interface ── KNX Terminal Python ── OPC UA ── CODESYS (GVL\_KNX)  
```

1. `./scada plc-map` creates a mapping file from the ETS project, with one line per group address. You pick the addresses the PLC needs (`use: true`), or all of them, and the direction for each: `to_plc` (temperatures, feedback), `to_knx` or `both` (se  
tpoints, lights).

2. It also \*\*generates the CODESYS GVL\*\* (`GVL_KNX.st`) with the right IEC types from the DPTs: BOOL, REAL, USINT for HVAC mode, and so on. It includes `{attribute ‘linkalways’}` and `{attribute ‘symbol’ := ‘readwrite’}`, so the GVL shows up in the Sym  
bol Configuration even before any code uses it:

3. Paste the GVL into your project, tick it in the Symbol Configuration, download, and set `plc.enabled: true`. The bridge finds the GVL by browsing, so you don’t need to type any node IDs.

\*\*Safety rules, because this writes to a real bus:\*\*

- \*\*No telegrams at start-up.\*\* When the bridge connects, it writes the last known KNX values \*to the PLC\*. The PLC’s current values are only noted, and only real \*changes\* made by the PLC program go to KNX.
- \*\*No telegrams when the PLC restarts.\*\* A download or reset sets the GVL back to FALSE/0 while the OPC UA session may stay up. The bridge recognises this in three ways and sends nothing: values reported without Good status, many variables changing at  
once, and a quiet period after a restart. When the quiet period is over, it re-syncs the PLC from KNX. (I learned this one the hard way: one download switched off every light in my house.)
- \*\*No echoes, and a rate limit\*\* per address towards KNX.
- \*\*Security:\*\* user name/password and signed or encrypted connections (Basic256Sha256, Aes128Sha256RsaOaep, Aes256Sha256RsaPss), with a client certificate that is created automatically. Every PLC write to KNX appears in the event log as user `plc`.

Details: [docs/10-plc-opcua.md]([ekbpro-knx-terminal-python/docs/10-plc-opcua.md at main · espenbo/ekbpro-knx-terminal-python · GitHub](https://github.com/espenbo/ekbpro-knx-terminal-python/blob/main/docs/10-plc-opcua.md))

### Try it without a KNX installation

```sh  
git clone [GitHub - espenbo/ekbpro-knx-terminal-python: KNX visu for the terminal · GitHub](https://github.com/espenbo/ekbpro-knx-terminal-python.git)  
cd ekbpro-knx-terminal-python  
./setup.sh  
./scada init ~/MyHouse.knxproj # any ETS export  
./scada server --demo & # simulated bus  
./scada  
```

### Feedback welcome

It runs in my own house (one KNX IP interface, a PFC300 with CODESYS) and in an office building with two IP routers. I’d love to hear from anyone who tries it with other WAGO controllers or CODESYS versions. Issues and pull requests are welcome on GitHub.

A tip for iPhone users: use a terminal app with full xterm support, such as Blink Shell or Termius. Very basic terminal apps can’t show full-screen terminal programs.

Thanks to the xknx, Textual and asyncua projects, which do the heavy lifting.

---

<div class="post-metadata">

**Author:** ![MAD2026](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@MAD2026](https://www.wago.community/u/MAD2026)\
**Post date:** [November 7, 2026, 8:48am UTC](https://www.wago.community/t/ekbpro-knx-terminal-python-an-open-source-knx-scada-in-the-terminal-with-an-opc-ua-bridge-to-codesys-on-wago-pfc/2929/2 "2026-11-07T08:48:35Z")

</div>

Hi Espen,

this is an interesting project, and I have a question about it:

I would like to use Codesys as **Control for Raspberry Pi SL** on a Raspi 4 and then also access KNX data (via the USB interface for KNX Powerline) (i.e., read/write).

Could this work, or can only the KNX IP interface be used?

Currently, I am using the KNX daemon from knxd-tools on the Raspi.

Regards,

Mattes

---

<div class="post-metadata">

**Author:** ![espenbo](https://avatars.discourse-cdn.com/v4/letter/e/c57346/32.png) [@espenbo](https://www.wago.community/u/espenbo)\
**Post date:** [November 7, 2026, 2:17pm UTC](https://www.wago.community/t/ekbpro-knx-terminal-python-an-open-source-knx-scada-in-the-terminal-with-an-opc-ua-bridge-to-codesys-on-wago-pfc/2929/3 "2026-11-07T14:17:00Z")

</div>

Hi Mattes,

Thanks for asking! Short answer: yes for the Raspberry Pi and CODESYS. KNX USB support is new, and Powerline is not tested yet.

**\*\*Raspberry Pi 4 + CODESYS Control for Raspberry Pi SL\*\***

The program is plain Python 3 on Linux, so it runs fine on a Pi 4 next to the CODESYS runtime. The PLC bridge only needs the runtime’s OPC UA server:

1. `./scada plc-map` writes a GVL with one variable per group address.

2. Import it into the CODESYS project and add it to the **\*\*Symbol Configuration\*\*** (read/write).

3. Point `plc.endpoint` at `opc.tcp://127.0.0.1:4840`.

Nothing in the bridge is WAGO-specific. That said, I have only tested it against a WAGO PFC200, so please tell me how it goes on the Pi. One thing to know: the bridge has guards that stop the reset values from a CODESYS download from being sent to KNX. A download should never switch your lights.

**\*\*KNX over USB\*\***

The program now supports KNX USB interfaces natively (`knx: connection: usb`); it is on GitHub now (`git pull`). It talks to the stick directly through `/dev/hidraw`, with no knxd needed. It works with interfaces that speak **\*\*cEMI\*\*** , which covers practically every current TP interface. `/dev/hidraw` is root-only by default, so install the udev rule from the repo first (`deploy/99-knx-usb.rules`, see docs/en/04-configuration.md, “KNX USB interface”).

I’ve tested it on a real installation with a Weinzierl KNX USB Interface 312, side by side with the KNX/IP interface on the same bus: both saw exactly the same 53 telegrams in 40 seconds. A detail that may interest knxd users: the 312 starts with its cEMI server in “no layer” mode and passes nothing up until it is switched to the data link layer. The program now does that at start-up. Like the switch to cEMI, it is a setting in the interface itself, so nothing is sent on the bus. Sending through the stick hasn’t been tested yet.

**\*\*Powerline (PL110)\*\***

I haven’t been able to test a Powerline USB interface. Many of them only offer EMI1/EMI2, and PL110 frames carry a domain address that TP frames don’t. My USB driver will refuse an interface without cEMI, with a clear message. So for a PL stick I would not promise anything yet.

**\*\*What works today with your setup\*\***

Keep knxd. It already handles your PL USB interface. Let knxd also act as a KNXnet/IP server (e.g. `-e -E -D -T -R -S` plus your `-b usb:` line). Then point knx-scada at it:

```yaml

knx:

connection: tunneling

gateway\_ip: 127.0.0.1

```

knx-scada then sees knxd like any IP interface. Logging, alarms, the TUI and the OPC UA bridge to CODESYS work as usual.

If you tell me which Powerline interface you have (make/model, or the `lsusb` ID), I’ll look into whether native support is realistic. I’d also be glad if you could try `./scada knx-usb` with it after a `git pull`: it lists the KNX USB interfaces it finds, and `./scada knx-usb --listen 30` shows the telegrams for 30 seconds. It only listens and never sends.

Espen
