Skip to main content

LonHand client library

LonHand protocol implementation for USR-WP1 smart socket (one-channel relay) by USR IOT.

Product link

Usage:

from lonhand import device

# create switch
switch = WifiRelay('192.168.1.23')

# turn on
switch.turn_on()

# get state
state = switch.is_on()

# turn off
switch.turn_off()

Protocol

Command:

55 AA - distinguishes a command, unlike for example the password which
        should be sent as is (with suffix 0D 0A)
00 03 - represents the length in bytes of the command (real) that follows,
        including the byte 00 (see below)
00    - fixed, reserved and not usable. However, it contributes to forming 
        the length in bytes of the command, for example in case of a device
        renaming command (which will contain the new name assigned): the
        length byte (and the checksum) will be recalculated also according
        to the length of the new name
02    - the actual command (ON)
01    - command parameter; in this case we are giving the ON command (02)
        and as a parameter the channel number to be switched on (01).
06    - checksum, and represents the sum (in HEX) of the parts: 
        (0x00 + 0x03 + 0x00 + 0x02 + 0x01) = 0x06

Response:

AA 55 - marks the message as a response
00 04 - response length
00    - reserved
82 01 - is the confirmation response to the ON command
01    - channel/port that was affected
88    - checksum: (0x00 + 0x04 + 0x00 + 0x82 + 0x01 + 0x01) = 0x88

Metadata

Release files for lonhand 0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lonhand 0.4
File Size Uploaded
lonhand-0.4.tar.gz 2.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lonhand 0.4
File Interpreter ABI Platform
lonhand-0.4-py3-none-any.whl Python 3 none any Details

Total release size: 7.0 kB

Release files / lonhand-0.4.tar.gz

Download URL lonhand-0.4.tar.gz
Size 2.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e4768b79cb20e59f9dff1ac2600c3e629c764016e1e0fc66bfa0c3c51aa79366
BLAKE2b-256 checksum
How to use checksums
65b40a4d2e32de5e186f666c67e44fcd9f3790a0d0db2eccac102c20bb134226
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.7

Release files / lonhand-0.4-py3-none-any.whl

Download URL lonhand-0.4-py3-none-any.whl
Size 4.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
af9b19d506cc791e17bf59d979dafc66c9cec40f1fc8642da027a7e58c15239a
BLAKE2b-256 checksum
How to use checksums
61cdbf4248399d2a341fb211aff8f3c757d9fd04b977870757246d428abbd722
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.7

Release history Release notifications | RSS feed

This release

0.4 This release

2 release files

0.3

2 release files

0.2

2 release files

0.1.2

2 release files

0.1.1

1 release file

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page