The Relay Manager plugin provides control over any number of relay boards, each with any number of banks, where each bank holds any number of relays. Boards, banks, and relays can all be semantically named and then ordered into named sections for access on the user interface. Initial states can be configured for each relay to be set on launch.
The Relay Manager Interface shows the defined sections, their relays, and current states. Relays can be manually controlled and each section provides global on/off controls for all relays.
The Relay Manager supports the control messages noted below. Control messages can be sent using the State Machine plugin or by sending TCP message to the TCP Server plugin. In all cases, specify the instance name you supplied for your Relay Manager plugin instance as the “target”.
This control message updates one or more relays specified in an array of relay states to update. The example below shows the complete structure of the message for a Relay Manager plugin instance named My Relay Manager
with a relay section named MyRelaySection
and a relay in that section named MyRelayName
. Valid values for state
are true
(meaning the relay is allowing voltage and current through) and false
(meaning the relay is not allowing voltage and current through). Notably, spaces are indeed allowed in relay section names and relay names if desired.
{
"target": "My Relay Manager",
"message": {
"operation": "Update Relays",
"data": {
"relayStates": [
{
"relay": "MyRelaySection.MyRelayName",
"state": true
}
]
}
}
}
Plugin Defaults
[]
[]
{
"Board1": {
"serialPortConfiguration": {
"SimulationMode": true,
"Address": "COM3",
"Timeout": 2000,
"TerminationEnable": false,
"TerminationCharacter": "\n",
"TrimResponseWhiteSpace": false,
"BytesToRead": 1000,
"ReadToFileEnable": false,
"ReadToFilePath": "",
"BaudRate": 115200,
"DataBits": 8,
"StopBits": "1.0",
"Parity": "None",
"FlowControl": "None"
},
"banks": {
"Bank1": {
"relays": {
"R1": {
"commands": {
"off": {
"command": "BytesToString([170,3,254,100,1,16])",
"response": "BytesToString([170,1,85,0])"
},
"on": {
"command": "BytesToString([170,3,254,108,1,24])",
"response": "BytesToString([170,1,85,0])"
}
}
},
"R2": {
"commands": {
"off": {
"command": "BytesToString([170,3,254,101,1,17])",
"response": "BytesToString([170,1,85,0])"
},
"on": {
"command": "BytesToString([170,3,254,109,1,25])",
"response": "BytesToString([170,1,85,0])"
}
}
}
}
},
"Bank2": {
"relays": {
"R1": {
"commands": {
"off": {
"command": "BytesToString([170,3,254,100,2,17])",
"response": "BytesToString([170,1,85,0])"
},
"on": {
"command": "BytesToString([170,3,254,108,2,25])",
"response": "BytesToString([170,1,85,0])"
}
}
},
"R2": {
"commands": {
"off": {
"command": "BytesToString([170,3,254,101,2,18])",
"response": "BytesToString([170,1,85,0])"
},
"on": {
"command": "BytesToString([170,3,254,109,2,26])",
"response": "BytesToString([170,1,85,0])"
}
}
}
}
}
}
}
}