pyl2h


Namepyl2h JSON
Version 0.2.1 PyPI version JSON
download
home_page
SummaryPython library for controlling Link2Home devices
upload_time2024-01-21 09:33:57
maintainer
docs_urlNone
authoroxygen0211
requires_python>=3.7
license
keywords iot smarthome link2home l2h
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Link2Home Protocoll implementation

This projects implements (part of) the propretiary [Link2Home](https://www.l2h-rev.de/) communication protocol for monitoring and controlling devices from third party projects.

:warning: This is under development and in very early stage!
:warning: This project is based on reverse engineering and is neither associated nor supported by the offical product. This is mere a workaround to the missing of an official open API or third party integrations

# Basics
The Link2Home protocol is relying on two major parts:
1. Authenticated HTTP Calls to a backend hosted by the vendor. This is mainly for user profile portability, storing device metadata and discovery
2. Unauthenticated UDP Broad- and Unicasts for changing device state and announcing changes

This project currently relies solely on 2. and is operating solely within the local network.

# Usage

With importing the `UDPServer` class, you've are able to access the data stream of device change updates, the current directory of known devices and sending command messages

```
from l2h import UDPServer

server = UDPServer()

def deviceCallback(deviceStatus):
    print("New Device Update: {}".format(deviceStatus))

devices = server.getDevices()
server.setStatus("192.168.1.3", 1, True)

server.listen(deviceCallback)
```

Devices will be auto-discovered with their first state switch (i.e. when they are sending their first status update after the program has started), only after that, the library will be able to successfully communicate with the device. It is recommended that you trigger the devices manually (either by their physical buttons or via the official app) after having the server up to make autodiscovery work faster. Please Note: Apps currently also show up as devices.

`main.py` is also offering a CLI mode that will log status updates of devices and allow to alternate states of a device by it's IP supplied as an argument:

```
python main.py --ip 192.168.1.3
```

# Development

As of now, this library has been developed and tested solely with a EMQ303WF-1 smart socket

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "pyl2h",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "iot,smarthome,link2home,l2h",
    "author": "oxygen0211",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/36/04/07065958205b8e69d5698f65e0efaf2ab87a40f7190a6e8dc4da70c8c0a6/pyl2h-0.2.1.tar.gz",
    "platform": null,
    "description": "# Link2Home Protocoll implementation\n\nThis projects implements (part of) the propretiary [Link2Home](https://www.l2h-rev.de/) communication protocol for monitoring and controlling devices from third party projects.\n\n:warning: This is under development and in very early stage!\n:warning: This project is based on reverse engineering and is neither associated nor supported by the offical product. This is mere a workaround to the missing of an official open API or third party integrations\n\n# Basics\nThe Link2Home protocol is relying on two major parts:\n1. Authenticated HTTP Calls to a backend hosted by the vendor. This is mainly for user profile portability, storing device metadata and discovery\n2. Unauthenticated UDP Broad- and Unicasts for changing device state and announcing changes\n\nThis project currently relies solely on 2. and is operating solely within the local network.\n\n# Usage\n\nWith importing the `UDPServer` class, you've are able to access the data stream of device change updates, the current directory of known devices and sending command messages\n\n```\nfrom l2h import UDPServer\n\nserver = UDPServer()\n\ndef deviceCallback(deviceStatus):\n    print(\"New Device Update: {}\".format(deviceStatus))\n\ndevices = server.getDevices()\nserver.setStatus(\"192.168.1.3\", 1, True)\n\nserver.listen(deviceCallback)\n```\n\nDevices will be auto-discovered with their first state switch (i.e. when they are sending their first status update after the program has started), only after that, the library will be able to successfully communicate with the device. It is recommended that you trigger the devices manually (either by their physical buttons or via the official app) after having the server up to make autodiscovery work faster. Please Note: Apps currently also show up as devices.\n\n`main.py` is also offering a CLI mode that will log status updates of devices and allow to alternate states of a device by it's IP supplied as an argument:\n\n```\npython main.py --ip 192.168.1.3\n```\n\n# Development\n\nAs of now, this library has been developed and tested solely with a EMQ303WF-1 smart socket\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Python library for controlling Link2Home devices",
    "version": "0.2.1",
    "project_urls": {
        "Homepage": "https://github.com/oxygen0211/pyl2h"
    },
    "split_keywords": [
        "iot",
        "smarthome",
        "link2home",
        "l2h"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0651ab49b9f769476b0c5f06de56d1447b5ee76a27fb428e40184ebe530436b1",
                "md5": "3efed50e60f85d306b2dfa510dedd4e8",
                "sha256": "ac89f8c63ad5f39677204a475f9f1d0329070aac0ab1d3ac38f007d2e9982892"
            },
            "downloads": -1,
            "filename": "pyl2h-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3efed50e60f85d306b2dfa510dedd4e8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 7494,
            "upload_time": "2024-01-21T09:33:56",
            "upload_time_iso_8601": "2024-01-21T09:33:56.203399Z",
            "url": "https://files.pythonhosted.org/packages/06/51/ab49b9f769476b0c5f06de56d1447b5ee76a27fb428e40184ebe530436b1/pyl2h-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "360407065958205b8e69d5698f65e0efaf2ab87a40f7190a6e8dc4da70c8c0a6",
                "md5": "3e95be6b2109600a705fde60d68eceab",
                "sha256": "0e3ebb0e3db98f2135d541ceb310ba6c6ebd13f72348c23ed4b1fd6be8cb4baf"
            },
            "downloads": -1,
            "filename": "pyl2h-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "3e95be6b2109600a705fde60d68eceab",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 6426,
            "upload_time": "2024-01-21T09:33:57",
            "upload_time_iso_8601": "2024-01-21T09:33:57.121746Z",
            "url": "https://files.pythonhosted.org/packages/36/04/07065958205b8e69d5698f65e0efaf2ab87a40f7190a6e8dc4da70c8c0a6/pyl2h-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-21 09:33:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "oxygen0211",
    "github_project": "pyl2h",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "pyl2h"
}
        
Elapsed time: 4.77098s