Quick Start · Node-RED · ~10 minutes

Your first flow — Node-RED

Connect Node-RED to Virtuino Cloud with the MQTT nodes that come with Node-RED — nothing to install. Import a ready flow, enter your key and password, and send and receive live values.

Create free account Jump to the flow

Create your account & sign in

Register for a free account and log in to the console.

Get your MQTT credentials

From the console copy your Sub-account Key (e.g. vr-ab12cd34) and your MQTT password. You'll enter both once, inside Node-RED.

Create your fields

Add two fields from the console, named exactly esp32/temperature and esp32/relay1. A field's name is its MQTT topic — Node-RED publishes to and subscribes to exactly these names. Make esp32/temperature historical if you want a chart.

Import the ready flow

In Node-RED open the menu (☰, top-right) → Import, paste the flow below and press Import. It adds a tab with an inject → mqtt out pair that sends a value, and an mqtt in → debug pair that receives one. The second tab lists the same settings, if you prefer to set up the nodes by hand.

[
    {"id":"vc_tab","type":"tab","label":"Virtuino Cloud"},
    {"id":"vc_inject","type":"inject","z":"vc_tab","name":"send 23.5","props":[{"p":"payload"}],"repeat":"","once":false,"topic":"","payload":"23.5","payloadType":"num","x":140,"y":80,"wires":[["vc_out"]]},
    {"id":"vc_out","type":"mqtt out","z":"vc_tab","name":"esp32/temperature","topic":"esp32/temperature","qos":"0","retain":"false","broker":"vc_broker","x":380,"y":80,"wires":[]},
    {"id":"vc_in","type":"mqtt in","z":"vc_tab","name":"esp32/relay1","topic":"esp32/relay1","qos":"0","datatype":"auto-detect","broker":"vc_broker","nl":false,"rap":true,"rh":0,"inputs":0,"x":140,"y":160,"wires":[["vc_debug"]]},
    {"id":"vc_debug","type":"debug","z":"vc_tab","name":"relay1","active":true,"tosidebar":true,"complete":"payload","x":380,"y":160,"wires":[]},
    {"id":"vc_broker","type":"mqtt-broker","name":"Virtuino Cloud","broker":"cloud.virtuino.com","port":"8883","tls":"","clientid":"nodered-home","autoConnect":true,"usetls":true,"protocolVersion":"4","keepalive":"60","cleansession":true,"autoUnsubscribe":true,"birthTopic":"","closeTopic":"","willTopic":""}
]
mqtt-broker (Server) — Connection tab
  Server      cloud.virtuino.com
  Port        8883
  Use TLS     ✓  (no TLS configuration needed)
  Protocol    MQTT V3.1.1   (V5 also works)
  Client ID   nodered-home  (unique on your account)
  Keep Alive  60

mqtt-broker (Server) — Security tab
  Username    your Sub-account Key, e.g. vr-ab12cd34
  Password    your MQTT password

mqtt out   Topic  esp32/temperature    QoS 0   Retain false
mqtt in    Topic  esp32/relay1         QoS 0   Output auto-detect

Enter your key and password

Double-click the mqtt out node and click the ✏️ pencil next to Server (Virtuino Cloud). The Connection tab is already filled in — cloud.virtuino.com, port 8883, TLS on. Change the Client ID if another connection on your account already uses nodered-home. On the Security tab enter your Sub-account Key as Username and your MQTT password, then Update, Done and Deploy.

→Both MQTT nodes now show a green connected status.

Send a value

Click the button on the left of the send 23.5 inject node. The value goes to esp32/temperature. Change the inject payload, or wire any other node — a sensor, a Modbus reading, a calculation — into mqtt out.

→Open the console's Data Monitor, or a dashboard widget bound to that field — it updates live.

Receive commands from your dashboard

Add a switch or button widget bound to esp32/relay1, with Publish via MQTT on (the default). Toggle it: the value appears in the Node-RED debug panel, delivered by the mqtt in node. Values written to that field by a rule, a script or a scheduler arrive the same way, when they are published via MQTT.

This is the same connection you'd use to bridge a Modbus device into Virtuino Cloud — read the register with node-red-contrib-modbus, then hand the value to an mqtt out node. See the Modbus Gateway Guide.

Build your dashboard

Create a dashboard, add a widget (gauge, chart, value display…) and bind it to your field. Your Node-RED data appears instantly.

Prefer picking fields from a list? The Virtuino nodes

Instead of the MQTT nodes you can install node-red-contrib-virtuino. It adds a virtuino out and a virtuino in node, and a Fetch from Cloud button that lists your fields, so you pick a field instead of typing its topic.

cd ~/.node-red
npm install node-red-contrib-virtuino
# then restart Node-RED
  • Or in the editor: menu (☰) → Manage palette → Install → search node-red-contrib-virtuino.
  • Drag a virtuino out node, click the ✏️ pencil next to Account and enter your Sub-account Key, MQTT password and a Client ID (e.g. nodered-home — leave it empty and one is made for you; it stays the same across restarts). Deploy.
  • Reopen the node, press Fetch from Cloud and pick a field. The virtuino in node works the same way for receiving.

Good to know

  • Topic = field name. Each mqtt out or mqtt in node uses the full name of a field. A message to a topic with no field is rejected — the console's Debug Monitor shows it and the reason.
  • Plain values are best. A number or a text is stored as it is. If you send an object, Node-RED sends it as JSON text; use a standard field for it and a JSON Splitter to put each value into its own field.
  • You also receive what you publish. A flow that publishes to a topic and also subscribes to it gets its own messages back, like every other subscriber.
  • One client ID per connection. Two connections with the same client ID keep kicking each other off the broker. All nodes that share one Server config use a single connection.
  • All connection details, and what each setting means: MQTT Connection Guide.
Start now — it's free