
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
node-red-node-tdengine
Advanced tools
Node-RED is an open-source visual programming tool developed by IBM based on Node.js. It enables users to assemble and connect various nodes via a graphical interface to create connections for IoT devices, APIs, and online services. Supporting multi-protocol and cross-platform capabilities, it has an active community and is ideal for event-driven application development in smart home, industrial automation, and other scenarios, with its main strengths being low-code and visual programming.
The deep integration between TDengine and Node-RED provides a comprehensive solution for industrial IoT scenarios. Through Node-RED's MQTT/OPC UA/Modbus protocol nodes, data from PLCs, sensors and other devices can be collected at millisecond-level speed. Real-time queries of TDengine can trigger physical control actions like relay operations and valve switching for immediate command execution.
node-red-node-tdengine is the official plugin developed by TDengine for Node-RED. Composed of two nodes:
msg.topic
to pass SQL statements.Prepare the following environment:
TDengine WebSocket connection string format:
ws://user:password@host:port
ws://host:port
See detail here.
Run the following command in your Node-RED user directory - typically ~/.node-red .
npm i node-red-node-tdengine
Pass SQL statement via topic:
msg = { topic: "SQL statement" }
Special characters and escape sequences in SQL must follow JSON string specifications.
Input node (no input).
Write Operations
The payload contains write results, and the topic passes through the SQL statement:
msg = {
topic: "insert into ...",
isQuery: false, // true for query operations
payload: {
affectRows: 2, // affect rows
totalTime: 3, // Total write time (ms)
timing: 1683311 // Server-side execution time (ns)
}
}
Query Operations
payload contains query results, topic passes through SQL:
{
topic: "select * from ...",
isQuery: true, // true for query operations
payload: [
{ ts: 1749609744000, current: 20, voltage: 200, phase: 5 },
{ ts: 1749609200001, current: 31, voltage: 210, phase: 4 },
...
]}
Query results are row data objects where properties correspond to column names. For data type mappings: TDengine NodeJS Connector Type Mapping.
payload outputs array of objects where properties correspond to column names: TDengine NodeJS Connector Type Mapping.
{
topic: Subscription topic,
database: Database name,
vgroup_id: Data partition,
precision: Database precision
payload: [{
column_name1: value1,
column_name2: value2,
...
},
...
],
}
// Example: Inserting data
msg.topic = "insert into test.d0 values ('2025-06-10 10:00:02.001', 23.5, 220, 3)";
return msg;
// Example: Querying data
msg.topic = "select * from test.d0";
return msg;
Insert Result
{
"topic": "insert into test.d0 values ('2025-06-10 10:00:02.001', 23.5, 220, 3)",
"_msgid": "8f50fe84338387d7",
"isQuery": false,
"payload":{
"affectRows": 1,
"totalTime": 2,
"timing": "961982"
}
}
Query Result
{
"topic": "select * from test.d0",
"_msgid": "0d19e9b82ae3841a",
"isQuery": true,
"payload": [
{ "ts": 1749609744000, "current": 10, "voltage": 219, "phase": 0.32 },
{ "ts": 1749609200001, "current": 31, "voltage": 210, "phase": 4 }
]
}
Subscribe Result
{
"topic": "topic_overload",
"payload": [
{
"tbname": "d1",
"ts": "1750140456777",
"current": 31,
"voltage": 217,
"phase": 2,
"groupid": 4,
"location": "California.MountainView"
}
],
"database": "test",
"vgroup_id": 4,
"precision": 0
}
FAQs
The official plugin developed by TDengine for Node-RED.
We found that node-red-node-tdengine demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.