A KNX library written in Python
XKNX is an Asynchronous Python library for reading and writing KNX/IP packets.
XKNX…
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
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
For questions, feature requests, bugreports wither join the XKNX chat on Discord or write an email.