Table of Contents

MQTT

The "Central Switchboard" Model

To understand how MQTT works in the Mervis system, imagine a Central Switchboard rather than a direct phone call.

In traditional systems, devices often “call” each other directly. If one side is busy or offline, the call fails. MQTT is different. It uses a central hub (the Broker) that acts like a switchboard operator.

Connection Architectures

There are two ways to connect, but for security and simplicity, we strongly recommend the Embedded Broker.

In this mode, the Switchboard is built directly inside the Mervis Cloud.

2. External Broker (Client Mode)

In this mode, you use your own 3rd party broker. Mervis acts as just another subscriber.

Connection Workflow (Embedded)

To set up the secure Embedded connection, follow these steps:

  1. 1. Portal Registration (The DataNode):
    • Log in to the Mervis Portal at portal.mervis.info.
    • Create a DataNode for your project. This is your digital twin in the cloud.
    • Select your device type.
    • The Portal will generate your DeviceID, Username, and Password.
  1. 2. Device Configuration:
    • Open your device's web administration.
    • Broker Address: Set to ``mqtt.mervis.info``.
    • Port: Use the Secure TLS port.
    • Enter the credentials provided by the Portal.
  1. 3. Mervis Generator:
    • Once the DataNode is active, go to generator.mervis.info.
    • It will automatically scan your DataNodes and generate the SCADA project for you, linking all tags without manual typing.

Supported Embedded Drivers

The following devices have dedicated `EmbeddedBroker` drivers in Mervis.

Specialized Sensors

Data Structure & Payloads

The Train Analogy

Think of MQTT packets as a train:

While MQTT is the transport method, the “Cargo” can be anything. Common types include:

Payload Requirements

The MQTT standard strictly defines how the data is transported (the Topic and Payload), but the content inside is flexible.

Troubleshooting Common Issues

Symptom Possible Cause Solution
No Connection Firewall Blocking Ensure outbound traffic to mqtt.mervis.info is allowed on your network.
Auth Failed Credential Mismatch Ensure the ID, Username, and Password in the Device exactly match the Portal.
Offline Status Heartbeat Missing Check that your device is sending a “Keep Alive” signal every 60 seconds.
Wrong Values Missing Scaling Apply the required scaling factor (e.g., /10) in your Mervis tag settings.

Advanced Reference: JSON Structures

For developers manually integrating Wago or Weintek devices, use these reference payloads.

Supported formats

Wago compatible format

Registration of available variables

Example

{
	"FormatId": "TagConfiguration",
	"ApiVersion": 1,
	"Complete": true,
	"Collections": [{
		"Id": 1,
		"CollectionName": "Building 1",
		"SampleRate": 60000,
		"PublishInterval": 60000,
		"TagData": [{
			"Tag": "Temperature1",
			"Unit": "ºC",
			"ValueType": "real"
		},
		{
			"Tag": "Humidity",
			"Unit": "%",
			"ValueType": "word"
		}]
	},
	{
		"Id": 2,
		"CollectionName": "Building 2",
		"SampleRate": 120000,
		"PublishInterval": 240000,
		"TagData": [{
			"Tag": "Water flow",
			"Unit": "m3/h",
			"ValueType": "byte"
		},
		{
			"Tag": "Current phase L1",
			"Unit": "A",
			"ValueType": "lreal"
		}]
	}]
}

Variable values

Example

{
	"FormatId": "TagValues",
	"ApiVersion": 1,
	"CollectionId": 1,
	"TagData": [{
		"Time": "2018-03-27T17:19:23.720+02:00",
		"Values": {
			"Temperature1": 15.52,
			"Humidity": 21
		}
	}]
}

Weintek compatible format

Variable values

Example

{
    "d" : {
        "name:MyHomeTemperature, type:generic_sint64, unit:°C" : [ 0 ],
        "number C" : [ 0 ],
        "Bit" : [ false ],
        "My array" : [ 0, 10, 20 ]
    },
    "ts" : "2020-08-27T07:10:24.360316"
}

Command registration

{
    "d" : {
        "id:change_temperature, name:change temperature in house ,params:[{name: temperature, type:generic_float64, unit:°C}, {name: date, type:generic_datetime, unit:UTC}]" : false
    },
    "ts" : "2020-08-27T07:10:11.356013"
}

choose/create $deviceId/mervis/cmd_reg/ set general tab by screenshot add commands

Our supported types

Create a subcribe topic for executing command