{"id":28639461,"url":"https://github.com/taosdata/node-red-node-tdengine","last_synced_at":"2026-01-20T16:52:13.873Z","repository":{"id":296210674,"uuid":"992336435","full_name":"taosdata/node-red-node-tdengine","owner":"taosdata","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-14T08:25:05.000Z","size":111,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-14T08:33:31.076Z","etag":null,"topics":["node-red"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/taosdata.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-29T01:56:09.000Z","updated_at":"2025-05-29T01:56:36.000Z","dependencies_parsed_at":"2025-06-14T08:25:28.749Z","dependency_job_id":"c1bd22ca-d4c6-4546-accc-9d9f715c0dba","html_url":"https://github.com/taosdata/node-red-node-tdengine","commit_stats":null,"previous_names":["taosdata/node-red-node-tdengine"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/taosdata/node-red-node-tdengine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taosdata%2Fnode-red-node-tdengine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taosdata%2Fnode-red-node-tdengine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taosdata%2Fnode-red-node-tdengine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taosdata%2Fnode-red-node-tdengine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taosdata","download_url":"https://codeload.github.com/taosdata/node-red-node-tdengine/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taosdata%2Fnode-red-node-tdengine/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266922848,"owners_count":24006984,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["node-red"],"created_at":"2025-06-12T19:40:26.585Z","updated_at":"2025-07-24T23:34:24.423Z","avatar_url":"https://github.com/taosdata.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# TDengine Integration with Node-RED\n\n- [TDengine Integration with Node-RED](#tdengine-integration-with-node-red)\n  - [Overview](#overview)\n  - [Features](#features)\n    - [tdengine-operator](#tdengine-operator)\n    - [tdengine-consumer](#tdengine-consumer)\n  - [Prerequisites](#prerequisites)\n  - [Configure Data Source](#configure-data-source)\n  - [Installation](#installation)\n  - [Node Status](#node-status)\n  - [Input Format](#input-format)\n    - [tdengine-operator](#tdengine-operator-1)\n    - [tdengine-consumer](#tdengine-consumer-1)\n  - [Output Format](#output-format)\n    - [tdengine-operator](#tdengine-operator-2)\n    - [tdengine-consumer](#tdengine-consumer-2)\n  - [Quick Start](#quick-start)\n    - [Input](#input)\n    - [Output](#output)\n  - [Documents](#documents)\n  - [Resources](#resources)\n\n\n## Overview\n[Node-RED](https://nodered.org/) 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.\n\nThe 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.\n\nnode-red-node-tdengine is the official plugin developed by TDengine for Node-RED. Composed of two nodes:  \n- **tdengine-operator**: Provides SQL execution capabilities for data writing/querying and metadata management.  \n- **tdengine-consumer**: Offers data subscription and consumption capabilities from specified subscription servers and topics.\n\n\n## Features\n\n### tdengine-operator\n- Supports TDengine local deployment or cloud service data sources. \n- Full coverage of all TDengine SQL operations (SELECT/INSERT/CREATE/ALTER/SHOW, etc.).\n- Unified interface for handling both read and write operations using `msg.topic` to pass SQL statements.\n\n### tdengine-consumer\n- Support TDengine local deployment or cloud service data sources. \n- Flexible configuration of subscription properties. \n- Support subscribing to multiple topics simultaneously.\n- Automatically submit and save consumption progress. \n- Automatically reconnect after server disconnection. \n\n\n## Prerequisites\n\nPrepare the following environment:\n- TDengine \u003e= 3.3.2.0  (Enterprise/Community/Cloud Edition are available).\n- taosAdapter is running, refer to [taosAdapter](https://docs.tdengine.com/tdengine-reference/components/taosadapter/).\n- Node-RED \u003e= 3.0.0, [Node-RED installation](https://nodered.org/docs/getting-started/).\n- Node.js Connector for TDengine \u003e= 3.1.8, get from [npmjs.com](https://www.npmjs.com/package/@tdengine/websocket).\n\n\n## Configure Data Source\n  TDengine WebSocket connection string format:\n   - tdengine-operator: `ws://user:password@host:port`\n   - tdengine-consumer: `ws://host:port`\n\n  See detail [here](https://docs.tdengine.com/tdengine-reference/client-libraries/node/#url-specification).\n\n ## Installation\nRun the following command in your Node-RED user directory - typically ~/.node-red .\n ``` bash\n   npm i node-red-node-tdengine\n ```\n\n## Node Status\n- Grey: Connecting.\n- Green: Operational.\n- Red: Malfunction.\n\n\n## Input Format\n\n\n### tdengine-operator\nPass SQL statement via topic:\n\n``` javascript\nmsg = { topic: \"SQL statement\" }\n```\n\nSpecial characters and escape sequences in SQL must follow JSON string specifications.\n\n### tdengine-consumer\nInput node (no input).\n\n\n## Output Format\n\n\n### tdengine-operator\n- Write Operations   \nThe payload contains write results, and the topic passes through the SQL statement:\n\n    ``` javascript\n    msg = {\n    topic: \"insert into ...\",\n    isQuery: false, // true for query operations\n    payload: {\n    affectRows: 2,  // affect rows\n    totalTime: 3,   // Total write time (ms)\n    timing: 1683311 // Server-side execution time (ns)\n    }\n    }\n    ```\n\n- Query Operations  \npayload contains query results, topic passes through SQL:\n\n    ``` javascript\n    {\n    topic: \"select * from ...\",\n    isQuery: true, // true for query operations\n    payload: [\n    { ts: 1749609744000, current: 20, voltage: 200, phase: 5 },\n    { ts: 1749609200001, current: 31, voltage: 210, phase: 4 },\n        ...\n    ]}\n    ```\n\n\nQuery results are row data objects where properties correspond to column names. For data type mappings:\n[TDengine NodeJS Connector Type Mapping](https://docs.tdengine.com/tdengine-reference/client-libraries/node/#data-type-mapping).\n\n### tdengine-consumer\n\npayload outputs array of objects where properties correspond to column names:\n[TDengine NodeJS Connector Type Mapping](https://docs.tdengine.com/tdengine-reference/client-libraries/node/#data-type-mapping).\n\n``` javascript\n{\n  topic: Subscription topic,\n  database: Database name,\n  vgroup_id: Data partition,\n  precision: Database precision\n  payload: [{ \n    column_name1: value1,\n    column_name2: value2,\n    ...\n  },\n  ...\n  ],\n}\n```\n\n\n## Quick Start\n\n### Input\n\n``` javascript\n// Example: Inserting data\nmsg.topic = \"insert into test.d0 values ('2025-06-10 10:00:02.001', 23.5, 220, 3)\";\nreturn msg;\n\n// Example: Querying data\nmsg.topic = \"select * from test.d0\";\nreturn msg;\n```\n\n ### Output\n\n- Insert Result\n    ``` json\n    {\n    \"topic\":  \"insert into test.d0 values ('2025-06-10 10:00:02.001', 23.5, 220, 3)\",\n    \"_msgid\": \"8f50fe84338387d7\",\n    \"isQuery\": false,\n    \"payload\":{\n        \"affectRows\": 1,\n        \"totalTime\":  2,\n        \"timing\":     \"961982\"\n    }\n    }\n    ```\n\n- Query Result\n    ``` json\n    {\n    \"topic\":  \"select * from test.d0\",\n    \"_msgid\": \"0d19e9b82ae3841a\",\n    \"isQuery\":  true,\n    \"payload\": [\n      { \"ts\": 1749609744000, \"current\": 10, \"voltage\": 219, \"phase\": 0.32 },\n      { \"ts\": 1749609200001, \"current\": 31, \"voltage\": 210, \"phase\": 4 }\n    ]\n    }\n    ```\n\n- Subscribe Result\n    ``` json\n    {\n    \"topic\": \"topic_overload\",\n    \"payload\": [\n        {\n        \"tbname\":   \"d1\",\n        \"ts\":       \"1750140456777\",\n        \"current\":  31,\n        \"voltage\":  217,\n        \"phase\":    2,\n        \"groupid\":  4,\n        \"location\": \"California.MountainView\"\n        }\n    ],\n    \"database\":  \"test\",\n    \"vgroup_id\": 4,\n    \"precision\": 0\n    }\n    ```\n\n## Documents\n\n- Full documentation is available in Node-RED's in-editor help system (click the book icon).\n- [Introduce usage scenarios with Node-RED Plugin for TDengine](https://docs.tdengine.com/third-party/collection/Node-RED/).\n\n## Resources\n- [TDengine Official Website](http://www.tdengine.com).\n- [Node.js Connector for TDengine](https://docs.tdengine.com/tdengine-reference/client-libraries/node/).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaosdata%2Fnode-red-node-tdengine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaosdata%2Fnode-red-node-tdengine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaosdata%2Fnode-red-node-tdengine/lists"}