Advanced 🌐 Networking

MQTT IoT Dashboard

Build a real-time IoT monitoring dashboard that connects to MQTT brokers via WebSocket. Subscribe to topics, receive live sensor data, and display it on beautiful Gauge, Chart, and Label controls. Perfect for monitoring Victron Energy solar systems, smart home devices, industrial sensors, and any MQTT-enabled hardware.

VB6 Python MQTT IoT Victron

What You'll Learn

1
Connect to MQTT brokers via WebSocket
2
Subscribe to MQTT topics and receive messages
3
Display live data on Gauge and Chart controls
4
Build real-time monitoring dashboards
5
Publish MQTT messages to control devices

Controls Used

Use Cases

  • Victron Energy monitoring
  • Smart home dashboards
  • Industrial IoT monitoring
  • Weather station displays

Code Preview

Here's a taste of the code. Open the full example in WebVB Studio to explore, modify, and run it.

Visual Basic 6
Dim mqtt As Object

Private Sub cmdConnect_Click()
    Set mqtt = Inet1.MqttConnect( _
        txtBroker.Text, "webvb-client")
    mqtt.Subscribe txtTopic.Text
    lblStatus.Caption = "Connected"
End Sub

Private Sub mqtt_OnMessage(topic, message)
    gaugeValue.Value = Val(message)
    lstMessages.AddItem topic & ": " & message
End Sub
Python
mqtt = None

def cmdConnect_Click():
    global mqtt
    mqtt = Inet1.MqttConnect(
        txtBroker.Text, "webvb-client")
    mqtt.Subscribe(txtTopic.Text)
    lblStatus.Caption = "Connected"

def mqtt_OnMessage(topic, message):
    gaugeValue.Value = float(message)
    lstMessages.AddItem(f"{topic}: {message}")
🌐

Try the MQTT IoT Dashboard Example

Open this example in WebVB Studio and start experimenting. Modify the code, tweak the controls, and make it your own.

Open in WebVB Studio