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-influxdbVerified import paths — ran on the pinned version, not inferred.
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.
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.
Upgrade to version 0.6.1 or newer to patch the `lodash` dependency and address the security vulnerability.
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.If experiencing timeouts, adjust the request timeout setting in the InfluxDB configuration node for 1.8 and 2.x versions.
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.
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.
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.