MQTT RPC
Rules, MQTT RPCs tabs redirect to this page.

The maximum configurable MQTT RPC number is 10.
Users can define MQTT RPCs to read or write tags from the MQTT broker by clicking the Add MQTT RPC button.

- Index: The index value of the MQTT RPC. Automatically assigned by the device, cannot be changed.
- QoS: The Quality of Service value of the MQTT publisher. Options:
- 0
- 1
- 2
- Listen To: Topic to listen for messages coming from the MQTT Broker (Maximum length 128).
- To: Topic to send the requested tag values (Maximum length 128).
- Replace This: Value to be replaced in the incoming message topic. If this option is not empty, the given value must be found in the topic name (Maximum length 128).
- With That: Value to replace the Replace This value in the incoming message topic (Maximum length 128).
- Type: RPC type. Options:
- ASCII
- Binary
- JSON
- Tags: Tags to be read or written from the MQTT Broker. Multiple tag selections can be made.
RPC Payload Examples (Gateway Mode Disabled)
Set Value
Request:
{
"method": "setValue",
"params": {
"Out1Lock":"1"
}
}
Response:
{
"method": "setValue",
"params": {
"Out1Lock":"1"
}
}
Get Value
Request:
{
"method": "getOut1Lock"
}
Response:
{
"tag": "Out1Lock",
"raw": "1",
"cal": "1",
"last": "0"
}
RPC Payload Examples (Gateway Mode Enabled)
When the node slave ID is different from the device's slave ID.
Set Value
Request:
{
"device": "testNode",
"data": {
"id": 1,
"method": "setValue",
"params": {
"testTag": "1"
}
}
}
Response:
{
"device": "testNode",
"id": 1,
"data": {
"success": true
}
}
Get Value
Request:
{
"device": "testNode",
"data": {
"id": 1,
"method": "gettestTag"
}
}
Response:
{
"device": "testNode",
"id": 1,
"data": {
"tag": "testTag",
"raw": "1",
"cal": "1",
"last": "0",
}
}