Registry / database / node-red-contrib-influxdb

node-red-contrib-influxdb

JSON →
library0.7.0jsnpmunverified

node-red-contrib-influxdb provides a collection of Node-RED nodes designed for seamless interaction with InfluxDB time series databases. It offers robust support for InfluxDB 1.x, InfluxDB 1.8 (leveraging 2.0 API compatibility with Flux queries), and native InfluxDB 2.0, allowing users to write and query data using both InfluxQL and Flux query languages. The current stable version is 0.7.0. The package maintains a steady release cadence, incorporating new features like request timeouts and addressing compatibility updates for InfluxDB versions and underlying Node.js runtimes. A key differentiator is its ability to handle multiple InfluxDB versions and query languages within a single set of nodes, adapting its internal client library based on the configuration.

npm install node-red-contrib-influxdb
INSTALL
IMPORT
SIG · NODE-RED-CONTRIB-I
N
node-red-contrib-influxdb
databasejavascriptv0.7.0
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

influxdb in
✓ This is a Node-RED node, added via the 'Manage Palette' and configured in the flow editor.
Provides input capabilities to query data from InfluxDB. It is configured visually within the Node-RED editor, not via JavaScript `import` statements.
influxdb out
✓ This is a Node-RED node, added via the 'Manage Palette' and configured in the flow editor.
Enables writing data points to InfluxDB. Configuration, including measurement, database, and tags/fields, is done graphically.
influxdb batch
✓ This is a Node-RED node, added via the 'Manage Palette' and configured in the flow editor.
A specialized output node for writing multiple data points efficiently to InfluxDB in batches.
influxdb (config)
✓ This is a Node-RED configuration node, accessed when setting up an 'influxdb in', 'out', or 'batch' node.
Manages connection details for your InfluxDB instance, including hostname, port, protocol, database name, and InfluxDB version (1.x, 1.8-flux, or 2.0).

This Node-RED flow demonstrates how to query data from an InfluxDB 1.x database. An inject node triggers an 'influxdb in' node configured with a simple InfluxQL query 'SELECT * from test'. The results are then sent to a debug node for display.

[{"id":"39aa2ca9.804da4","type":"debug","z":"6256f76b.e596d8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":530,"y":100,"wires":[]},{"id":"262a3923.e7b216","type":"influxdb in","z":"6256f76b.e596d8","influxdb":"eeb221fb.ab27f","name":"","query":"SELECT * from test","rawOutput":false,"precision":"","retentionPolicy":"","org":"my-org","x":310,"y":100,"wires":[["39aa2ca9.804da4"]]},{"id":"803d82f.ff80f8","type":"inject","z":"6256f76b.e596d8","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":100,"y":100,"wires":[["262a3923.e7b216"]]},{"id":"eeb221fb.ab27f","type":"influxdb","hostname":"127.0.0.1","port":"8086","protocol":"http","database":"test","name":"test","usetls":false,"tls":"","influxdbVersion":"1.x","url":"http://localhost:8086","rejectUnauthorized":true}]
Debug
Known issues
breakingNode.js version 8.x is explicitly not supported. Users must use Node.js 10.x or later. Node-RED versions prior to 1.0 are also not supported.
fix
Upgrade your Node.js runtime to 10.x, 12.x, 14.x LTS (or higher supported versions by Node-RED) and Node-RED to version 1.0 or later.
affects: >=0.5.4
securityA security vulnerability related to the `lodash` dependency was fixed. This may indicate potential risks in older versions if `lodash` was exploited.
fix
Upgrade to version 0.6.1 or newer to patch the `lodash` dependency and address the security vulnerability.
affects: <0.6.1
gotchaWhen writing integer values to InfluxDB 1.8-Flux or 2.0 configurations, JavaScript numbers are typically written as floats. To explicitly write an integer, you must append an 'i' suffix to the number within a string (e.g., '1234i'). This explicit integer type is not supported in 1.x configurations, where all numbers are treated as floats.
fix
For integer fields in InfluxDB 1.8-Flux or 2.0, ensure your payload sends numbers as strings with an 'i' suffix (e.g., `msg.payload = { value: '1234i' }`). For 1.x, all numbers will be floats.
affects: >=0.5.1
breakingThe default request timeout for InfluxDB 1.8 and 2.x configurations was introduced and defaults to 10 seconds. Longer-running queries or write operations might time out if this default is insufficient.
fix
If experiencing timeouts, adjust the request timeout setting in the InfluxDB configuration node for 1.8 and 2.x versions.
affects: >=0.7.0
Errors
Common errors & fixes
Error: A 401 Unauthorized error occurred: {"code":"unauthorized","message":"Unauthorized"}
Incorrect authentication token, username/password, or using InfluxQL with InfluxDB 2.x which primarily uses Flux.
fix
For InfluxDB 2.0, ensure the correct authentication token is provided in the configuration node. For InfluxDB 1.x, verify username/password. Also, ensure the query language (InfluxQL vs Flux) matches the InfluxDB version configured. InfluxDB 2.x primarily uses Flux for querying.
ECONNREFUSED errors when writing data to influxDB
The InfluxDB server is not running, is configured on a different host or port, or a firewall is blocking the connection.
fix
Verify that your InfluxDB service is running and accessible from the Node-RED host. Check the hostname, port, and protocol settings in the 'influxdb' configuration node. Also, check for any firewall rules that might be blocking the connection.
Error: "No query specified"
An 'influxdb in' (input) node was triggered without a query defined either in its configuration properties or in the incoming `msg.query` property.
fix
Ensure that the 'influxdb in' node has a valid InfluxQL or Flux query configured in its settings, or that the incoming message (`msg`) contains a `query` property with the desired query string.
Upgrade
Version history
0.7.0latest on npm
Audit
Dependencies
node-redrequiredThis package is a Node-RED contribution and requires a running Node-RED instance to function. It is not a direct npm runtime dependency but an ecosystem prerequisite.
Agent activity
14 hits · last 30 days
node
12
OpenAI (training)
2
Resources
node-red-contrib-influxdb — npm install node-red-contrib-influxdb · libregistry