Skip to main content

Python library for controlling Link2Home devices

Project description

Link2Home Protocoll implementation

This projects implements (part of) the propretiary Link2Home 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyl2h-0.1.1.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

pyl2h-0.1.1-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file pyl2h-0.1.1.tar.gz.

File metadata

  • Download URL: pyl2h-0.1.1.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.1

File hashes

Hashes for pyl2h-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a429242bde3cf2fbdc4a96fcb4330fc3eb284b81e705d2e1beb773f164d4b289
MD5 14a34e040d25821e2a6903f4681c2c60
BLAKE2b-256 8b17e0a576fc7adb69c1547e5fc07f7d39793e2c0ac873f73d17945a81d6eaf6

See more details on using hashes here.

File details

Details for the file pyl2h-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pyl2h-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.1

File hashes

Hashes for pyl2h-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 469d6ce2d9c4207c095d9da7b805ed02507bb3fc8fa3c04c3f8b0775fa14eb4f
MD5 c9518f19f77228f9808ee8f399670961
BLAKE2b-256 5e12b27b451dd32520d130d07ea3a65bc26f6af97b534fb9945ceef0972d19f9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page