rflink


Namerflink JSON
Version 0.0.66 PyPI version JSON
download
home_pagehttps://github.com/aequitas/python-rflink
SummaryLibrary and CLI tools for interacting with RFlink 433MHz transceiver.
upload_time2024-02-08 11:01:04
maintainer
docs_urlNone
authorJohan Bloemberg
requires_python
licenseMIT
keywords rflink 433mhz domotica
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Python RFlink library
=====================

.. image:: https://github.com/aequitas/python-rflink/workflows/Push/badge.svg
    :target: https://github.com/aequitas/python-rflink/actions?query=workflow%3APush

.. image:: https://img.shields.io/pypi/v/rflink.svg
    :target: https://pypi.python.org/pypi/rflink

.. image:: https://img.shields.io/pypi/pyversions/rflink.svg
    :target: https://pypi.python.org/pypi/rflink

.. image:: https://api.codeclimate.com/v1/badges/a99a88d28ad37a79dbf6/maintainability
    :target: https://codeclimate.com/github/codeclimate/codeclimate/maintainability
    :alt: Maintainability

.. image:: https://api.codeclimate.com/v1/badges/a99a88d28ad37a79dbf6/test_coverage
   :target: https://codeclimate.com/github/codeclimate/codeclimate/test_coverage
   :alt: Test Coverage

.. image:: https://img.shields.io/requires/github/aequitas/python-rflink.svg
    :target: https://requires.io/github/aequitas/python-rflink/requirements/

.. image:: https://img.shields.io/badge/Cyberveiligheid-97%25-yellow.svg
    :target: https://eurocyber.nl

Library and CLI tools for interacting with RFlink 433MHz transceiver.

https://www.rflink.nl/

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
------------

.. code-block:: bash

    $ pip install rflink

Usage of RFLink debug CLI
-------------------------

.. code-block::

    $ 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:

.. code-block::

    $ 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:

.. code-block::

    $ rflink on newkaku_0000_1
    $ rflink off newkaku_0000_1

Use of TCP mode instead of serial port (eg: ESP8266 serial bridge):

.. code-block::

    $ rflink --host 1.2.3.4 --port 1234

Debug logging is shown in verbose mode for debugging:

.. code-block::

    $ 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
------------------------

.. code-block::

    $ 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:

.. code-block::

    $ rflink --port /dev/ttyACM0 --listenport 2345

Share TCP mode RFLink instead of serial port (eg: ESP8266 serial bridge),
the proxy will listen on port 2345:

.. code-block::

    $ rflink --host 1.2.3.4 --port 1234 --listenport 2345

Debug logging is shown in verbose mode for debugging:

.. code-block::

    $ rflink -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

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/aequitas/python-rflink",
    "name": "rflink",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "rflink 433mhz domotica",
    "author": "Johan Bloemberg",
    "author_email": "github@ijohan.nl",
    "download_url": "https://files.pythonhosted.org/packages/bb/6e/488479f649d1ddb8c40f31edea5b0d7f1341ae427eda0a832950b4924a20/rflink-0.0.66.tar.gz",
    "platform": null,
    "description": "Python RFlink library\n=====================\n\n.. image:: https://github.com/aequitas/python-rflink/workflows/Push/badge.svg\n    :target: https://github.com/aequitas/python-rflink/actions?query=workflow%3APush\n\n.. image:: https://img.shields.io/pypi/v/rflink.svg\n    :target: https://pypi.python.org/pypi/rflink\n\n.. image:: https://img.shields.io/pypi/pyversions/rflink.svg\n    :target: https://pypi.python.org/pypi/rflink\n\n.. image:: https://api.codeclimate.com/v1/badges/a99a88d28ad37a79dbf6/maintainability\n    :target: https://codeclimate.com/github/codeclimate/codeclimate/maintainability\n    :alt: Maintainability\n\n.. image:: https://api.codeclimate.com/v1/badges/a99a88d28ad37a79dbf6/test_coverage\n   :target: https://codeclimate.com/github/codeclimate/codeclimate/test_coverage\n   :alt: Test Coverage\n\n.. image:: https://img.shields.io/requires/github/aequitas/python-rflink.svg\n    :target: https://requires.io/github/aequitas/python-rflink/requirements/\n\n.. image:: https://img.shields.io/badge/Cyberveiligheid-97%25-yellow.svg\n    :target: https://eurocyber.nl\n\nLibrary and CLI tools for interacting with RFlink 433MHz transceiver.\n\nhttps://www.rflink.nl/\n\nRequirements\n------------\n\n- Python 3.6 (or higher)\n\nDescription\n-----------\n\nThis 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.\n\nThe 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.\n\nInstallation\n------------\n\n.. code-block:: bash\n\n    $ pip install rflink\n\nUsage of RFLink debug CLI\n-------------------------\n\n.. code-block::\n\n    $ rflink -h\n    Command line interface for rflink library.\n\n    Usage:\n      rflink [-v | -vv] [options]\n      rflink [-v | -vv] [options] [--repeat <repeat>] (on | off | allon | alloff) <id>\n      rflink (-h | --help)\n      rflink --version\n\n    Options:\n      -p --port=<port>   Serial port to connect to [default: /dev/ttyACM0],\n                           or TCP port in TCP mode.\n      --baud=<baud>      Serial baud rate [default: 57600].\n      --host=<host>      TCP mode, connect to host instead of serial port.\n      --repeat=<repeat>  How often to repeat a command [default: 1].\n      -m=<handling>      How to handle incoming packets [default: event].\n      --ignore=<ignore>  List of device ids to ignore, wildcards supported.\n      -h --help          Show this screen.\n      -v                 Increase verbosity\n      --version          Show version.\n\nIntercept and display Rflink packets:\n\n.. code-block::\n\n    $ rflink\n    rflink                           Nodo RadioFrequencyLink RFLink Gateway V1.1 R45\n    newkaku_00000001_4               off\n    newkaku_00000001_3               on\n    alectov1_0334_temp               7.4 \u00b0C\n    alectov1_0334_bat                low\n    alectov1_0334_hum                26 %\n\nTurn a device on or off:\n\n.. code-block::\n\n    $ rflink on newkaku_0000_1\n    $ rflink off newkaku_0000_1\n\nUse of TCP mode instead of serial port (eg: ESP8266 serial bridge):\n\n.. code-block::\n\n    $ rflink --host 1.2.3.4 --port 1234\n\nDebug logging is shown in verbose mode for debugging:\n\n.. code-block::\n\n    $ rflink -vv\n    DEBUG:asyncio:Using selector: EpollSelector\n    DEBUG:rflink.protocol:connected\n    DEBUG:rflink.protocol:received data: 20;00;Nodo RadioFrequen\n    DEBUG:rflink.protocol:received data: cyLink - RFLink Gateway\n    DEBUG:rflink.protocol:received data: V1.1 - R45;\n    DEBUG:rflink.protocol:got packet: 20;00;Nodo RadioFrequencyLink - RFLink Gateway V1.1 - R45;\n    DEBUG:rflink.protocol:decoded packet: {'revision': '45', 'node': 'gateway', 'version': '1.1', 'protocol': 'unknown', 'firmware': 'RFLink Gateway', 'hardware': 'Nodo RadioFrequencyLink'}\n    DEBUG:rflink.protocol:got event: {'version': '1.1', 'revision': '45', 'firmware': 'RFLink Gateway', 'hardware': 'Nodo RadioFrequencyLink', 'id': 'rflink'}\n    rflink                           Nodo RadioFrequencyLink RFLink Gateway V1.1 R45\n    DEBUG:rflink.protocol:received data: 2\n    DEBUG:rflink.protocol:received data: 0;01;NewKaku;ID=00000001\n    DEBUG:rflink.protocol:received data: ;SWITCH=4;CMD=OFF;\n    DEBUG:rflink.protocol:got packet: 20;01;NewKaku;ID=00000001;SWITCH=4;CMD=OFF;\n    DEBUG:rflink.protocol:decoded packet: {'id': '00000001', 'protocol': 'newkaku', 'command': 'off', 'switch': '4', 'node': 'gateway'}\n    DEBUG:rflink.protocol:got event: {'id': 'newkaku_00000001_4', 'command': 'off'}\n    newkaku_00000001_4               off\n\nUsage of RFLinkProxy CLI\n------------------------\n\n.. code-block::\n\n    $ rflinkproxy -h\n    Command line interface for rflink proxy.\n\n    Usage:\n      rflinkproxy [-v | -vv] [options]\n      rflinkproxy (-h | --help)\n      rflinkproxy --version\n\n    Options:\n      --listenport=<port>  Port to listen on\n      --port=<port>        Serial port to connect to [default: /dev/ttyACM0],\n                             or TCP port in TCP mode.\n      --baud=<baud>        Serial baud rate [default: 57600].\n      --host=<host>        TCP mode, connect to host instead of serial port.\n      --repeat=<repeat>    How often to repeat a command [default: 1].\n      -h --help            Show this screen.\n      -v                   Increase verbosity\n      --version            Show version.\n\nShare RFLink connected to serial port /dev/ttyACM1,\nthe proxy will listen on port 2345:\n\n.. code-block::\n\n    $ rflink --port /dev/ttyACM0 --listenport 2345\n\nShare TCP mode RFLink instead of serial port (eg: ESP8266 serial bridge),\nthe proxy will listen on port 2345:\n\n.. code-block::\n\n    $ rflink --host 1.2.3.4 --port 1234 --listenport 2345\n\nDebug logging is shown in verbose mode for debugging:\n\n.. code-block::\n\n    $ rflink -vv --host 1.2.3.4 --port 1234 --listenport 2345\n    DEBUG:asyncio:Using selector: EpollSelector\n    INFO:rflinkproxy.__main__:Serving on ('0.0.0.0', 2345)\n    INFO:rflinkproxy.__main__:Initiating Rflink connection\n    DEBUG:rflink.protocol:connected\n    INFO:rflinkproxy.__main__:Connected to Rflink\n    INFO:rflinkproxy.__main__:Incoming connection from: ::1:63293\n    DEBUG:rflinkproxy.__main__:got packet: 20;00;Xiron;ID=4001;TEMP=00f1;HUM=38;BAT=LOW;\n    DEBUG:rflinkproxy.__main__:decoded packet: {'node': 'gateway', 'protocol': 'xiron', 'id': '4001', 'temperature': 24.1, 'temperature_unit': '\u00b0C', 'humidity': 38, 'humidity_unit': '%', 'battery': 'low'}\n    INFO:rflinkproxy.__main__:forwarding packet 20;00;Xiron;ID=4001;TEMP=00f1;HUM=38;BAT=LOW; to clients\n    DEBUG:rflinkproxy.__main__:got packet: 20;00;NewKaku;ID=013373f6;SWITCH=10;CMD=ON;\n    DEBUG:rflinkproxy.__main__:decoded packet: {'node': 'gateway', 'protocol': 'newkaku', 'id': '013373f6', 'switch': '10', 'command': 'on'}\n    INFO:rflinkproxy.__main__:forwarding packet 20;00;NewKaku;ID=013373f6;SWITCH=10;CMD=ON; to clients\n    DEBUG:rflinkproxy.__main__:got packet: 20;00;Auriol V2;ID=D101;TEMP=006f;BAT=OK;\n    DEBUG:rflinkproxy.__main__:decoded packet: {'node': 'gateway', 'protocol': 'auriol v2', 'id': 'd101', 'temperature': 11.1, 'temperature_unit': '\u00b0C', 'battery': 'ok'}\n    INFO:rflinkproxy.__main__:forwarding packet 20;00;Auriol V2;ID=D101;TEMP=006f;BAT=OK; to clients\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Library and CLI tools for interacting with RFlink 433MHz transceiver.",
    "version": "0.0.66",
    "project_urls": {
        "Homepage": "https://github.com/aequitas/python-rflink",
        "Release notes": "https://github.com/aequitas/python-rflink/releases"
    },
    "split_keywords": [
        "rflink",
        "433mhz",
        "domotica"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "75afceef35974b2a7ad803ae69f6934c442d80f6a7784faa89dada8ac9ec651c",
                "md5": "6f7f26457e0c73b0c2b78bbd86f593eb",
                "sha256": "ad668448756f5ddb04b410138520f26422a4f93ff2c5c0b3c5529b8c614cc6b7"
            },
            "downloads": -1,
            "filename": "rflink-0.0.66-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6f7f26457e0c73b0c2b78bbd86f593eb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 18867,
            "upload_time": "2024-02-08T11:01:01",
            "upload_time_iso_8601": "2024-02-08T11:01:01.914086Z",
            "url": "https://files.pythonhosted.org/packages/75/af/ceef35974b2a7ad803ae69f6934c442d80f6a7784faa89dada8ac9ec651c/rflink-0.0.66-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bb6e488479f649d1ddb8c40f31edea5b0d7f1341ae427eda0a832950b4924a20",
                "md5": "d4499a2516974d02b390d00fd5cc1b39",
                "sha256": "d5a7dda4a36d9f4f91422778b389f9d9fbbfb2cf29ff062813226392a8cff8b9"
            },
            "downloads": -1,
            "filename": "rflink-0.0.66.tar.gz",
            "has_sig": false,
            "md5_digest": "d4499a2516974d02b390d00fd5cc1b39",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 22967,
            "upload_time": "2024-02-08T11:01:04",
            "upload_time_iso_8601": "2024-02-08T11:01:04.218024Z",
            "url": "https://files.pythonhosted.org/packages/bb/6e/488479f649d1ddb8c40f31edea5b0d7f1341ae427eda0a832950b4924a20/rflink-0.0.66.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-08 11:01:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "aequitas",
    "github_project": "python-rflink",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "rflink"
}
        
Elapsed time: 0.17653s