Library and CLI tools for interacting with RFlink 433MHz transceiver.
Requirements
Python 3.6 (or higher)
Description
This package is created mainly as a library for the Home assistant Rflink component implementation. A CLI has been created mainly for debugging purposes but may be extended in the future for more real-world application if needed.
The package also provides a CLI utility which allows a single RFLink hardware to be shared by multiple clients, e.g. Home assistant + Domoticz or multiple Home assistant instances.
Installation
$ pip install rflink
Usage of RFLink debug CLI
$ rflink -h
Command line interface for rflink library.
Usage:
rflink [-v | -vv] [options]
rflink [-v | -vv] [options] [--repeat <repeat>] (on | off | allon | alloff) <id>
rflink (-h | --help)
rflink --version
Options:
-p --port=<port> Serial port to connect to [default: /dev/ttyACM0],
or TCP port in TCP mode.
--baud=<baud> Serial baud rate [default: 57600].
--host=<host> TCP mode, connect to host instead of serial port.
--repeat=<repeat> How often to repeat a command [default: 1].
-m=<handling> How to handle incoming packets [default: event].
--ignore=<ignore> List of device ids to ignore, wildcards supported.
-h --help Show this screen.
-v Increase verbosity
--version Show version.
Intercept and display Rflink packets:
$ rflink
rflink Nodo RadioFrequencyLink RFLink Gateway V1.1 R45
newkaku_00000001_4 off
newkaku_00000001_3 on
alectov1_0334_temp 7.4 °C
alectov1_0334_bat low
alectov1_0334_hum 26 %
Turn a device on or off:
$ rflink on newkaku_0000_1
$ rflink off newkaku_0000_1
Use of TCP mode instead of serial port (eg: ESP8266 serial bridge):
$ rflink --host 1.2.3.4 --port 1234
Debug logging is shown in verbose mode for debugging:
$ rflink -vv
DEBUG:asyncio:Using selector: EpollSelector
DEBUG:rflink.protocol:connected
DEBUG:rflink.protocol:received data: 20;00;Nodo RadioFrequen
DEBUG:rflink.protocol:received data: cyLink - RFLink Gateway
DEBUG:rflink.protocol:received data: V1.1 - R45;
DEBUG:rflink.protocol:got packet: 20;00;Nodo RadioFrequencyLink - RFLink Gateway V1.1 - R45;
DEBUG:rflink.protocol:decoded packet: {'revision': '45', 'node': 'gateway', 'version': '1.1', 'protocol': 'unknown', 'firmware': 'RFLink Gateway', 'hardware': 'Nodo RadioFrequencyLink'}
DEBUG:rflink.protocol:got event: {'version': '1.1', 'revision': '45', 'firmware': 'RFLink Gateway', 'hardware': 'Nodo RadioFrequencyLink', 'id': 'rflink'}
rflink Nodo RadioFrequencyLink RFLink Gateway V1.1 R45
DEBUG:rflink.protocol:received data: 2
DEBUG:rflink.protocol:received data: 0;01;NewKaku;ID=00000001
DEBUG:rflink.protocol:received data: ;SWITCH=4;CMD=OFF;
DEBUG:rflink.protocol:got packet: 20;01;NewKaku;ID=00000001;SWITCH=4;CMD=OFF;
DEBUG:rflink.protocol:decoded packet: {'id': '00000001', 'protocol': 'newkaku', 'command': 'off', 'switch': '4', 'node': 'gateway'}
DEBUG:rflink.protocol:got event: {'id': 'newkaku_00000001_4', 'command': 'off'}
newkaku_00000001_4 off
Usage of RFLinkProxy CLI
$ rflinkproxy -h
Command line interface for rflink proxy.
Usage:
rflinkproxy [-v | -vv] [options]
rflinkproxy (-h | --help)
rflinkproxy --version
Options:
--listenport=<port> Port to listen on
--port=<port> Serial port to connect to [default: /dev/ttyACM0],
or TCP port in TCP mode.
--baud=<baud> Serial baud rate [default: 57600].
--host=<host> TCP mode, connect to host instead of serial port.
--repeat=<repeat> How often to repeat a command [default: 1].
-h --help Show this screen.
-v Increase verbosity
--version Show version.
Share RFLink connected to serial port /dev/ttyACM1, the proxy will listen on port 2345:
$ rflinkproxy --port /dev/ttyACM0 --listenport 2345
Share TCP mode RFLink instead of serial port (eg: ESP8266 serial bridge), the proxy will listen on port 2345:
$ rflinkproxy --host 1.2.3.4 --port 1234 --listenport 2345
Debug logging is shown in verbose mode for debugging:
$ rflinkproxy -vv --host 1.2.3.4 --port 1234 --listenport 2345
DEBUG:asyncio:Using selector: EpollSelector
INFO:rflinkproxy.__main__:Serving on ('0.0.0.0', 2345)
INFO:rflinkproxy.__main__:Initiating Rflink connection
DEBUG:rflink.protocol:connected
INFO:rflinkproxy.__main__:Connected to Rflink
INFO:rflinkproxy.__main__:Incoming connection from: ::1:63293
DEBUG:rflinkproxy.__main__:got packet: 20;00;Xiron;ID=4001;TEMP=00f1;HUM=38;BAT=LOW;
DEBUG:rflinkproxy.__main__:decoded packet: {'node': 'gateway', 'protocol': 'xiron', 'id': '4001', 'temperature': 24.1, 'temperature_unit': '°C', 'humidity': 38, 'humidity_unit': '%', 'battery': 'low'}
INFO:rflinkproxy.__main__:forwarding packet 20;00;Xiron;ID=4001;TEMP=00f1;HUM=38;BAT=LOW; to clients
DEBUG:rflinkproxy.__main__:got packet: 20;00;NewKaku;ID=013373f6;SWITCH=10;CMD=ON;
DEBUG:rflinkproxy.__main__:decoded packet: {'node': 'gateway', 'protocol': 'newkaku', 'id': '013373f6', 'switch': '10', 'command': 'on'}
INFO:rflinkproxy.__main__:forwarding packet 20;00;NewKaku;ID=013373f6;SWITCH=10;CMD=ON; to clients
DEBUG:rflinkproxy.__main__:got packet: 20;00;Auriol V2;ID=D101;TEMP=006f;BAT=OK;
DEBUG:rflinkproxy.__main__:decoded packet: {'node': 'gateway', 'protocol': 'auriol v2', 'id': 'd101', 'temperature': 11.1, 'temperature_unit': '°C', 'battery': 'ok'}
INFO:rflinkproxy.__main__:forwarding packet 20;00;Auriol V2;ID=D101;TEMP=006f;BAT=OK; to clients
Metadata
Release files for rflink 0.0.68
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 | |
|---|---|---|---|---|
| rflink-0.0.68.tar.gz | 23.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rflink-0.0.68-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 42.8 kB
Release files / rflink-0.0.68.tar.gz
| Download URL | rflink-0.0.68.tar.gz |
|---|---|
| Size | 23.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7701269d26211a778a5bd27c1e83d7671bbde9b0474f01fdc53e073a5c967c92
|
|
BLAKE2b-256 checksum How to use checksums |
834b482912689606caee07a1f1fbdd1dac2ee3e1e8bfdb687bdf31622ab2d01c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Release files / rflink-0.0.68-py3-none-any.whl
| Download URL | rflink-0.0.68-py3-none-any.whl |
|---|---|
| Size | 19.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
62dab7effe8d06034ce27610fd88a25dddf46dc7be28c4e7d1f403364f2939d6
|
|
BLAKE2b-256 checksum How to use checksums |
1ac6f58f6e2204cecb9aa62e93a18bb2ce37f71284fd5eff24fdb48cc22a30c2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Security for rflink 0.0.68
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.