XKNX

A KNX library written in Python

Introduction

Changelog

XKNX Object

Lights / Dimmer

Cover

Switches

Time

Sensors

Binary Sensors

HVAC

Configuration

Home Assistant Plugin

Asynchronous Python Library for KNX

XKNX is an Asynchronous Python library for reading and writing KNX/IP packets.

Coverage Status

Overview

XKNX…

Installation

XKNX depends on Python >= 3.5. (All prior versions of Python < 3.5 have a bug in their multicast implementation.)

You can install XKNX as Python package via pip3:

sudo pip3 install xknx

Hello World

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

async def main():
    xknx = XKNX()
    await xknx.start()
    light = Light(xknx,
                  name='HelloWorldLight',
                  group_address_switch='1/0/9')
    await light.set_on()
    await asyncio.sleep(2)
    await light.set_off()
    await xknx.stop()


# pylint: disable=invalid-name
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close()

For more examples please check out the examples page

Getting Help

For questions, feature requests, bugreports wither join the XKNX chat on Discord or write an email.