knx
A minimalistic KNX / EIB python library.
Sending telegrams
This library can be used to send data telegrams to actuators in the bus system.
For example in order to turn on a light the following code could be used:
>>> from knx import connect
>>> with connect() as c:
... c.write('0/1/14', 1)
Where 0/1/14 is the address of the light and 1 is the payload of the data telegram which indicates that the light should be turned on.
Listening to telegrams
This KNX library can also be used to listen to telegrams that are sent onto the bus system. For example if you simply want to log an entry each time a light is turned off or on:
>>> import knx
>>> import asyncio
>>> @knx.coroutine
... def logger():
... while True:
... telegram = (yield)
... print('Telegram from {0} sent to {1} with value: {2}'.format(
... telegram.src, telegram.dst, telegram.value))
>>> loop = asyncio.get_event_loop()
>>> coro = knx.bus_monitor(logger(), host='localhost', port=6720)
>>> loop.run_until_complete(coro)
Install & Requirements
Python >= 3.6
Install using pip:
$ pip install knx
Disclaimer
I’ve only tested this with eibd 0.0.5 and the fork knxd as a gateway.
Alternatives
If you’re looking for complete home automation solutions you might want to take a look at home-assistant or smarthome.
Development
Edit knx.py in your favorite editor and run tests using python -m unittest or python tests.py.
If you want to run the examples without first installing this library you can use:
python -m examples.actor -- hostname '0/0/20'
(Replace actor with the appropriate module name and omit the arguments if the module doesn’t require them)
Metadata
Release files for knx 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| knx-0.4.0.tar.gz | 8.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| knx-0.4.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 14.5 kB
Release files / knx-0.4.0.tar.gz
| Download URL | knx-0.4.0.tar.gz |
|---|---|
| Size | 8.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
37d88b7fc78b4b54309561f25f632b66fcd7785ca2bd24b36a5eb465270dfe62
|
|
BLAKE2b-256 checksum How to use checksums |
2a2b8f2393bef6611acb3998fffdfff73221b78fa8689e7f067e67d01815541e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1
|
Release files / knx-0.4.0-py2.py3-none-any.whl
| Download URL | knx-0.4.0-py2.py3-none-any.whl |
|---|---|
| Size | 6.1 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
4d79a49d4e40f4c8f89176537b456355c060bea166646e04691f50f7d6396934
|
|
BLAKE2b-256 checksum How to use checksums |
b1c991ffb89057770a663ccb7edffb9b764d293afdc852ea30367329f582020b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1
|
Security for knx 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.