Skip to main content

VM6 relay controller over Ethernet

Project description

pyv6m Package

Package to control a V6M ethernet relay boards using Python. I can't read Chinese on the controller, but the unit operates nicely and can be configured using HTTP and controlled on port 1234. It theoretically supports MQTT protocol, but I haven't received that documentation yet.

The underlying command structure sent to the board is simple. The following example would turn on relay 1, and turn off relay 3. The remaining relays are left unchanged: setr=1x0xxxxxx

The board supports other controls:

  • '0' - off
  • '1' - on
  • '2' - pulse (on, delay, off)
  • '3' - toggle
  • '4' - group 2 relays adjacent relays. On if '4x', off if 'x4'.

This package only supports turning relays on and off through the V6M.set_relay method.

The board also supports 8 inputs. As a default from the factory, the inputs directly control the relays. This can be disabled through the web interface. The state of the inputs can be read using the V6M.get_sensor interface, or by setting the sensor_callback.

The board will not send immediate feedback when input levels changed, so the board is polled every second.

Example:

from time import sleep
from pyv6m import V6M

hub = V6M( 'host.test.com', 1234 )

# Turn the first relay on
hub.set_relay( 0, True )

# Pause for a second
sleep(1.)

# Turn the first relay off
hub.set_relay( 0, False )

# Close the interface
hub.close()

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

pyvm6-0.0.1.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

pyvm6-0.0.1-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file pyvm6-0.0.1.tar.gz.

File metadata

  • Download URL: pyvm6-0.0.1.tar.gz
  • Upload date:
  • Size: 4.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.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5

File hashes

Hashes for pyvm6-0.0.1.tar.gz
Algorithm Hash digest
SHA256 643a6353dea303a82ba022ece9ffc77a233f7ccee317a819da7820fd62d9bcba
MD5 3f1f90f39d81c4b81133999cf25c18ce
BLAKE2b-256 e0297fcb9705ce2478447ea1e2392da71f66d8f416488696b684becd5a2db752

See more details on using hashes here.

File details

Details for the file pyvm6-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: pyvm6-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.9 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.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5

File hashes

Hashes for pyvm6-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e03db9d2d87cf018934f4cb10833818e6f0a7d412bbca11afae54fd7f82d9793
MD5 cc7362238687035a8c59f54cf7a2f79b
BLAKE2b-256 e34725415e2bce467a78f8489099f3f6a9b67a09797c41839121aecb993f4868

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