RFXCOM
A Python library for working with your RFXTrx for automation projects.
This library is designed to work with Python 3.3+ [1] and asyncio (but other transports can be implemented). Currently it is primarily used by the home project, a dashboard for managing and visualising your home automation devices.
This library is relatively new and thus the number of devices are limited to those that @d0ugal owns. This means, that the current list of fully supported protocols are:
Status Packets from the RFXTrx itself.
Energy usage sensors (such as the Owl CM119/160 and Owl CM180)
Temperature and humidity sensors (such as the Oregon THGN132)
Lighting and power control devices from LightwaveRF
If you want to use a device and you don’t think its supported or you are unsure then please open an issue.
Installation
It is recommended that you get the latest version from PyPI with pip:
pip install rfxcom
However, if you want to grab the latest development version you can download the repository directly from github and run python setup.py install in the root of the repository.
Documentation
Quick Example
The following example shows some basic usage of this library, it sets up the asyncio event loop, points the library to the serial device path and attaches a simple handler function which prints out information about all the packets it receives. For example, see what it will output for energy usage sensors.:
from asyncio import get_event_loop
from rfxcom.transport import AsyncioTransport
dev_name = '/dev/serial/by-id/usb-RFXCOM_RFXtrx433_A1WYT9NA-if00-port0'
loop = get_event_loop()
def handler(packet):
# Print out the packet - the string representation will show us the type.
print(packet)
# Each packet will have a dictionary which contains parsed data.
print(packet.data)
# You can access the raw bytes from the packet too.
print(packet.raw)
try:
rfxcom = AsyncioTransport(dev_name, loop, callback=handler)
loop.run_forever()
finally:
loop.close()
You can also use a coroutine as callback for AsyncioTransport:
from asyncio import get_event_loop, coroutine
from rfxcom.transport import AsyncioTransport
dev_name = '/dev/serial/by-id/usb-RFXCOM_RFXtrx433_A1WYT9NA-if00-port0'
loop = get_event_loop()
@coroutine
def handler(packet):
print(packet)
yield from some_io(packet)
try:
rfxcom = AsyncioTransport(dev_name, loop, callback=handler)
loop.run_forever()
finally:
loop.close()
Contributing
If you would like to contribute to python-rfxcom, you will need to use tox to run the tests. This will test against Python 3.3, Python 3.4, pyflakes for code linting and build the documentation. To do this, you simply need to install tox and then call tox from the root of the python-rfxcom git repository.
pip install tox tox
Don’t worry if you can’t test against Python 3.3 and Python 3.4 locally, many people will only have one installed. We use the brilliant Travis CI to verify all pull requests.
Metadata
Release files for rfxcom 0.5.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 | Actions |
|---|---|---|---|---|
| rfxcom-0.5.0.tar.gz | 14.5 kB | Without provenance | Details for rfxcom-0.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rfxcom-0.5.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for rfxcom-0.5.0-py2.py3-none-any.whl |
Total release size: 32.5 kB
Release files / rfxcom-0.5.0.tar.gz
| Download URL | rfxcom-0.5.0.tar.gz |
|---|---|
| Size | 14.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5f5081053fe9b86b459983afb927c5aac0f4fca0650e837dae0229685ee9d480
|
|
BLAKE2b-256 checksum How to use checksums |
e14188076dc4e04620442e005af11c108ad5556704f843f00d25aaeab5a97c15
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / rfxcom-0.5.0-py2.py3-none-any.whl
| Download URL | rfxcom-0.5.0-py2.py3-none-any.whl |
|---|---|
| Size | 18.0 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
2635fe269a77e5e6c81b7e50f697fd50cdbe4db9e241269a239dce8220703a2c
|
|
BLAKE2b-256 checksum How to use checksums |
92556762d10b866a32b2e679b9ec77d24cb28bd32965995fb6240897340c2617
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for rfxcom 0.5.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.