Giter Club home page Giter Club logo

domoticz-modbus's Introduction

Modbus Read/Write Plugins for Domoticz

Author: Sebastiaan Ebeltjes / domoticx.nl

Support for:

  • RS232/RS485
  • RTU
  • ASCII
  • RTU over TCP
  • TCP/IP

Functions of the READ plugin

  • Read Coil (Function 1)
  • Read Discrete Input (Function 2)
  • Read Holding Registers (Function 3)
  • Read Input Registers (Function 4)

Supported data types:

  • No conversion (passtrough)
  • INT 8/16/32/64-Bit
  • UINT 8/16/32/64-Bit
  • FLOAT 32/64-Bit
  • STRING 2/4/6/8 Bytes

Functions of the WRITE plugin

  • Write Single Coil (Function 5)
  • Write Single Holding Register (Function 6)
  • Write Multiple Coils (Function 15)
  • Write Registers (Function 16)

RTU/ASCII/RTU over TCP: Write HEX Payloads, like: 0x0100 TCP/IP: Write INT Payloads, like: 53


Installation

Place the folders inside the domoticz plugin folder, for example like this construction:

/home/pi/domoticz/plugins/modbus-write/plugin.py

/home/pi/domoticz/plugins/modbus-read/plugin.py

Then restart domoticz with: sudo service domoticz.sh restart

Succesfully Tested on Domoticz version: 3.8153 (Stable)


Using RTU / ASCII (SERIAL HW)

  • Hardware: USB RS485-Serial Stick like This one
  • Setup: Select method "RTU" or "ASCII", Serial Port, BaudRate, PortSettings
  • Device adress is most likely: 1 to 247
  • Payload in HEX, like: 0x0100

Using RTU over TCP / TCP/IP

  • Hardware: Not required
  • Setup: Select method "RTU over TCP" or "TCP/IP"
  • Device adress is most likely an ip: xxx.xxx.xxx.xxx
  • Port is default 502
  • RTU over TCP: Write HEX Payloads, like: 0x0100
  • TCP/IP: Write INT Payloads, like: 53

Dependancies

For this plugin to work you need to install some dependancies

pymodbus AND pymodbusTCP

Install for python 3.x with: sudo pip3 install -U pymodbus pymodbusTCP

six

Six is a Python 2 and 3 compatibility library. It provides utility functions for smoothing over the differences between the Python versions with the goal of writing Python code that is compatible on both Python versions.

  1. Install for python 3.x with: sudo pip3 install -U six

(will install in /home/pi/.local/lib/python2.7/site-packages/)

  1. copy the py file to v3.x python

sudo cp six.py /usr/lib/python3.4

or

sudo cp six.py /usr/lib/python3.5


HW Tested:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.