Skip to main content

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

iobl-0.0.4.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iobl-0.0.4-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file iobl-0.0.4.tar.gz.

File metadata

  • Download URL: iobl-0.0.4.tar.gz
  • Upload date:
  • Size: 10.3 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

Hashes for iobl-0.0.4.tar.gz
Algorithm Hash digest
SHA256 01d0446f857ece0b3f6d6109ca4bf891a3c252a3a1cc52c1a2dd88e660e01b69
MD5 18c859fef39abd6bd2a68d82424db4de
BLAKE2b-256 d3a02fef914013f92d4f60620865404e16bb05d8cdcf0521c2e522285bec77d4

See more details on using hashes here.

File details

Details for the file iobl-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: iobl-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 11.8 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

Hashes for iobl-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 32c81b030e610a5eb2dc3e25baa5df64f029d8b5eb23ee1571d0c19874122147
MD5 0ec518302f6c0b2ff3710bde0d6c28c7
BLAKE2b-256 00082132c6619c910f0eb42dbf98ea827e8b7f67a8997ff2c456ca69b2493c44

See more details on using hashes here.

Supported by

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