Fork me on GitHub

pimatic-serial by Rogier van Staveren | github | npm

pimatic-serial

Pimatic Plugin that supports sending commands to Serial devices.

Configuration

Add the plugin to the plugin section:

    {
      "plugin": "serial"
    },

Then add the device entry for your device into the devices section:

    {
      "id": "serial-device",
      "class": "SerialDevice",
      "name": "Serial Device",
      "serialport": "/dev/ttyUSB0",
      "baudRate" : 9600,
      "dataBits" : 8,
      "parity" : "none",
      "stopBits" : 1,
      "flowControl" : true
    }

Then you can add the items into the mobile frontend

pimatic-serial

Plugin Config Options

Serial
OptionDescriptionDefault
debug
boolean
Debug mode. Writes debug messages to the pimatic log, if set to true.
false

Device Config Options

pimatic-serial device config schemas

SerialDevice

Serial device config options
OptionDescriptionDefault
serialPort
string
Serialport name (e.g. /dev/ttyUSB0)
"/dev/ttyUSB0"
baudRate
integer
Baudrate to use for communicating over serialport (e.g. 9600)
9600
dataBits
integer
Number of databits to use for communication over serialport (e.g. 7)
8
parity
string
Parity to use for communication over serialport (can be 'none', 'even', 'mark', 'odd', 'space')
"none"
stopBits
integer
Number of stopBits to use for communication over serialport (can be 1 or 2)
1
flowControl
boolean
Use flowControl for communication over serialport (can be true or false)
true
replaceHex
boolean
Replace Hexadecimal values in the commands with it's binary value (can be true or false)
false

SerialSwitch

Serial Switch config options
OptionDescriptionDefault
serialPort
string
Serialport name (e.g. /dev/ttyUSB0)
"/dev/ttyUSB0"
baudRate
integer
Baudrate to use for communicating over serialport (e.g. 9600)
9600
dataBits
integer
Number of databits to use for communication over serialport (e.g. 7)
8
parity
string
Parity to use for communication over serialport (can be 'none', 'even', 'mark', 'odd', 'space')
"none"
stopBits
integer
Number of stopBits to use for communication over serialport (can be 1 or 2)
1
flowControl
boolean
Use flowControl for communication over serialport (can be true or false)
true
onCommand
string
the command to execute to switch the switch on
""
offCommand
string
the command to execute to switch the switch off
""
replaceHex
boolean
Replace Hexadecimal values in the commands with it's binary value (can be true or false)
false

SerialShutterController

Serial Shutter Controler config options
OptionDescriptionDefault
serialPort
string
Serialport name (e.g. /dev/ttyUSB0)
"/dev/ttyUSB0"
baudRate
integer
Baudrate to use for communicating over serialport (e.g. 9600)
9600
dataBits
integer
Number of databits to use for communication over serialport (e.g. 7)
8
parity
string
Parity to use for communication over serialport (can be 'none', 'even', 'mark', 'odd', 'space')
"none"
stopBits
integer
Number of stopBits to use for communication over serialport (can be 1 or 2)
1
flowControl
boolean
Use flowControl for communication over serialport (can be true or false)
true
upCommand
string
the command to execute to move the shutter up
""
downCommand
string
the command to execute to move the shutter down
""
stopCommand
string
the command to execute to stop the shutter
""
replaceHex
boolean
Replace Hexadecimal values in the commands with it's binary value (can be true or false)
false
pimatic-serial is written by Rogier van Staveren