skillfed

xknx

An Asynchronous Library for the KNX protocol. Documentation: https://xknx.io/

xknx v3.19.0 127.7K downloads/30d#11,735 on PyPI339
Permissive license MIT Active released

What it is and what it does

XKNX is an asynchronous Python library that implements the KNX protocol for home automation. It allows developers to programmatically control and monitor KNX devices—lights, switches, thermostats, and other hardware—over a KNX/IP network. The library is built on async/await patterns, making it suitable for integration into event-driven applications like Home Assistant.

The package depends on async_timeout, typing_extensions, cryptography, and ifaddr to handle network communication, type hints, encryption, and interface discovery. It requires Python 3.10 or later and is actively maintained with a production-stable status. The library is designed to abstract away KNX protocol complexity, exposing a device-oriented API where you instantiate objects representing physical KNX devices and call methods to control them.

Use it for:

  • Integrate KNX lighting control into a Python home automation system or dashboard
  • Build scripts to automate KNX device state changes based on external triggers or schedules
  • Monitor KNX device status and log state changes to a database or analytics platform
  • Extend Home Assistant's KNX integration or develop a custom KNX management application
  • Create a bridge between KNX networks and other smart home protocols or APIs

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

XKNX is an asynchronous Python library for communicating with KNX home automation systems over KNX/IP networks, enabling control of lights, switches, and other KNX devices.

Yes. XKNX is actively maintained, has no known vulnerabilities, installs with low friction, and is the standard library for KNX automation in Python. Install it if you need to control or monitor KNX devices from Python code or if you are extending Home Assistant's KNX support.

Install

xknx on PyPI

pip

pip install xknx

uv

uv add xknx

poetry

poetry add xknx

Installing xknx

Before you install

Low friction installation with a pure-Python wheel and four lightweight runtime dependencies. Active maintenance with a recent release (4 days old) and steady repository activity.

License in practice

MIT license permits unrestricted use, modification, and distribution with minimal legal constraints.

Quickstart

pip install xknx

import asyncio
from xknx import XKNX
from xknx.devices import Light

async def main():
    async with XKNX() as xknx:
        light = Light(xknx, name="TestLight", group_address_switch="1/0/9")
        xknx.devices.async_add(light)
        await light.set_on()

asyncio.run(main())

Requires Python 3.10 or later; requires a KNX/IP gateway or tunneling interface on the network.

Verify before relying

  • Whether the library supports all KNX device types or only a subset (lights, switches, etc.)
  • Performance characteristics under high-volume device communication
  • Compatibility with specific KNX gateway hardware models

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.10.0)
Install friction low — pure-Python wheel
Runtime dependencies 4 — async_timeout, typing_extensions, cryptography, ifaddr
Maintenance actively maintained — 4 days since the last release
Last repo commit
First released
Downloads 127,690/month — #11,735 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: xknx-3.19.0-py3-none-any.whl

Keywords: KNX, EIB, Home Assistant, home automation

Development Status :: 5 - Production/StableIntended Audience :: DevelopersProgramming Language :: Python :: 3Topic :: Home AutomationTopic :: System :: Hardware :: Hardware Drivers

Tags

KNX home automation libraryKNX/IP protocol Pythonasync KNX device controlhome assistant KNX integrationEIB protocol librarysmart home KNX communication
home-automationknx-protocolasync-io

More Home Automation packages