Library and CLI tools for interacting with IOBL PLC gateway.
Project description
Library and CLI tools for interacting with Legrand In One PLC devices. It uses a Legrand 882 13 device to communicate with PLC devices. Based on the RFLink library (http://www.nemcon.nl/blog2/) and on the work by Michel Taverna (http://code.google.com/p/boxio/)
Requirements
Python 3.4 (or higher)
Description
This package is created as a library for the Home assistant legrandinone 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.
Installation
$ pip install iobl
Usage
$ iobl -h
Command line interface for iobl library.
Usage:
iobl [-v | -vv] [options]
iobl [-v | -vv] [options] <who=> <what=> <legrand_id=> <unit=> [<comm_mode=> <comm_media=>]
iobl (-h | --help)
iobl --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: 115200].
--host=<host> TCP mode, connect to host instead of serial port.
-m=<handling> How to handle incoming packets [default: event].
-h --help Show this screen.
-v Increase verbosity
--version Show version.
<who=> must be completed with the class of device to control. For the moment, only AUTOMATION (shutter command) and SCENARIO classes have been tested so far.
<what=> must be completed with the action requested. For AUTOMATION class, the action is either move_up, move_down or move_stop.
<legrand_id=> must be completed with the "legrand_id" of the device to control. The legrand_id is usually indicated on the back of the device.
<unit=> must be completedunit number in the device to control. Ususally, for an AUTOMATION class device, unit shall be 2.
<comm_mode=> may be completed with the communication mode to use : unicast, multicast or broadcast. Defaults to unicast.
<comm_media=> may be completed with the communication media to use : PLC, IR, RF. Only PLC has been tested so far. Defaults to PLC.
Intercept and display IOBL packets:
$ iobl
{'what': 'move_down', 'type': 'command', 'unit': '2', 'mode': 'unicast', 'who': 'automation', 'legrand_id': '123456', 'media': 'plc', 'command': ''}
{'what': 'move_up', 'type': 'command', 'unit': '2', 'mode': 'unicast', 'who': 'automation', 'legrand_id': '123456', 'media': 'plc', 'command': ''}
{'what': 'move_stop', 'type': 'command', 'unit': '2', 'mode': 'unicast', 'who': 'automation', 'legrand_id': '123456', 'media': 'plc', 'command': ''}
Move up or down a shutter device:
$ iobl who=automation what=move_up legrand_id=123456 unit=1
$ iobl who=automation what=move_down legrand_id=123456 unit=1
Use of TCP mode instead of serial port:
$ iobl --host 1.2.3.4 --port 1234
Debug logging is shown in verbose mode for debugging:
$ iobl -vv
DEBUG:asyncio:Using selector: EpollSelector
DEBUG:iobl.protocol:connected
DEBUG:iobl.protocol:received data: *2*2*#1975298##
DEBUG:iobl.protocol:got packet: *2*2*#1975298##
DEBUG:iobl.protocol:decoded packet: {'who': 'automation', 'what': 'move_up', 'media': None, 'type': 'command', 'unit': '2', 'legrand_id': '220880', 'command': '', 'mode': 'unicast'}
DEBUG:iobl.protocol:got packet: {'who': 'automation', 'what': 'move_up', 'media': None, 'type': 'command', 'unit': '2', 'legrand_id': '220880', 'command': '', 'mode': 'unicast'}
{'legrand_id': '220880', 'type': 'command', 'media': None, 'command': '', 'mode': 'unicast', 'who': 'automation', 'unit': '2', 'what': 'move_up'}
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file iobl-0.0.2.tar.gz.
File metadata
- Download URL: iobl-0.0.2.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/3.5.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
429b7b40a86d0c3e71dbd6902cc8f3840123c0f6dcd802ce406e613023bd5208
|
|
| MD5 |
cf1b99f328f8bf211810c5ed77877455
|
|
| BLAKE2b-256 |
382d653921b45b6617116fcadc6212ad09842c7137a7bf68c9a4cd9b83936b20
|
File details
Details for the file iobl-0.0.2-py3-none-any.whl.
File metadata
- Download URL: iobl-0.0.2-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/3.5.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df45432ce70090f6e1e4c6e1fc403dface352f5fec31c9ae42e46a3dc15ce0a3
|
|
| MD5 |
f222155c638840b2b6ad75140f84773c
|
|
| BLAKE2b-256 |
c78dcbdcf3fddc929a3f5ebb7d2bad13f6a4a0f48f9e8947ef6a0dc7330a0aaf
|