xknx
An Asynchronous Library for the KNX protocol. Documentation: https://xknx.io/
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 xknxuv
uv add xknxpoetry
poetry add xknxInstalling 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
Tags
More Home Automation packages
Represents and manipulates IPv4, IPv6, MAC…
permissive · top 5,000 on PyPI
homeassistantHome Assistant is an open-source home…
permissive · top 5,000 on PyPI
python-statemachineDefines finite state machines and statecharts…
permissive · top 5,000 on PyPI
btsocketA Python library for controlling BlueZ…
permissive · top 15,000 on PyPI
aiohomematicAn async Python library for controlling and…
permissive · top 15,000 on PyPI
hass-web-proxy-libProvides base classes and utilities for Home…
permissive · top 15,000 on PyPI
knx-frontendProvides a web-based user interface panel for…
permissive · top 15,000 on PyPI
pypckpypck is an asynchronous Python library for…
permissive · top 15,000 on PyPI
xknxprojectExtracts and parses KNX project files (ETS 4,…
copyleft · top 15,000 on PyPI
pyControl4An async library for controlling Control4 smart…
permissive · top 15,000 on PyPI
aiohueAsynchronous Python library for controlling…
permissive · top 15,000 on PyPI
aioqswAsync Python library for controlling QNAP QSW…
permissive · top 15,000 on PyPI
python-ecobee-apiA Python library for communicating with Ecobee3…
permissive · top 15,000 on PyPI
aiohomekitAn asyncio-based HomeKit client library for…
permissive · top 15,000 on PyPI
elkm1-libAsynchronous Python library for communicating…
permissive · top 15,000 on PyPI