{"id":13799265,"url":"https://github.com/stackhero-io/node-red-contrib-stackhero-influxdb-v2","last_synced_at":"2025-05-13T06:32:46.317Z","repository":{"id":54106247,"uuid":"262975986","full_name":"stackhero-io/node-red-contrib-stackhero-influxdb-v2","owner":"stackhero-io","description":"Node-RED node to read and write to an InfluxDB v2 database.","archived":false,"fork":false,"pushed_at":"2023-03-02T19:38:54.000Z","size":169,"stargazers_count":31,"open_issues_count":17,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-29T20:29:24.170Z","etag":null,"topics":["influxdb2","node-red","node-red-contrib","stackhero"],"latest_commit_sha":null,"homepage":null,"language":"HTML","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/stackhero-io.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2020-05-11T07:53:40.000Z","updated_at":"2024-03-14T22:43:03.000Z","dependencies_parsed_at":"2024-01-29T09:18:37.268Z","dependency_job_id":"212df626-1905-4bff-9cd8-36df56ec8c57","html_url":"https://github.com/stackhero-io/node-red-contrib-stackhero-influxdb-v2","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"2b73d529c6b5fd6ddece3c85cbef752de15ac211"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackhero-io%2Fnode-red-contrib-stackhero-influxdb-v2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackhero-io%2Fnode-red-contrib-stackhero-influxdb-v2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackhero-io%2Fnode-red-contrib-stackhero-influxdb-v2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackhero-io%2Fnode-red-contrib-stackhero-influxdb-v2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackhero-io","download_url":"https://codeload.github.com/stackhero-io/node-red-contrib-stackhero-influxdb-v2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225183839,"owners_count":17434196,"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","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":["influxdb2","node-red","node-red-contrib","stackhero"],"created_at":"2024-08-04T00:01:00.485Z","updated_at":"2024-11-18T13:32:07.032Z","avatar_url":"https://github.com/stackhero-io.png","language":"HTML","funding_links":[],"categories":["Nodes"],"sub_categories":["Database"],"readme":"# node-red-contrib-stackhero-influxdb-v2\n\n[Node-RED](https://nodered.org) node to read and write to an InfluxDB v2 database.\n\n**Remember: if you like it, please star it! 🥰**\n\nOfficial repository: [https://github.com/stackhero-io/node-red-contrib-stackhero-influxdb-v2](https://github.com/stackhero-io/node-red-contrib-stackhero-influxdb-v2)\n\n\n## Sponsors\n\n`node-red-contrib-stackhero-influxdb-v2` is developed by [Stackhero](https://www.stackhero.io/).\nIf you are looking for powerful managed services, like InfluxDB, you should seriously consider Stackhero 🤓\n\n\n## Usage\n\nWe have 2 nodes here. A `write` node, to send data to InfluxDB and a `query` node, to retrieve data using the Flux language.\n\n\n### Write data\n\nThe write node requires a payload object like this one:\n```javascript\nmsg.payload = {\n  // You bucket\n  // Optional (it can be defined in the node credentials settings)\n  bucket: 'myBucket',\n\n  // Precision of timestamp\n  // Optional\n  // Can be `ns` (nanoseconds),\n  //        `us` (microseconds),\n  //        `ms` (milliseconds),\n  //        `s` (seconds).\n  // The default is `ns`\n  // Note: if you set the `timestamp` field to `Date.now()`, you have to set the `precision` to `ms`\n  precision: 'ms',\n\n  // Data to send to InfluxDB\n  // Can be an array of objects or only one object\n  data: [\n    {\n      measurement: 'machinerySensor',\n\n      tags: {\n        deviceId: 'gyh43',\n        hardwareVersion: '1.0.2',\n        softwareVersion: '2.5.1',\n        location: 'factory-1'\n      },\n\n      fields: {\n        temperature: 12,\n        humidity: 46,\n        vibrations: 18,\n        batteryVoltage: 3.6\n      },\n\n      timestamp: Date.now()\n    },\n\n    // More data can be send here, simply re add an object\n    // { ... },\n  ]\n};\n\nreturn msg;\n```\n\n![Example of the write node](https://raw.githubusercontent.com/stackhero-io/node-red-contrib-stackhero-influxdb-v2/master/assets/screenshotWrite.png)\n\n\n### Query data\n\nThe query node requires a topic string containing a Flux query.\n```javascript\nmsg.topic = 'from(bucket: \"myBucket\") |\u003e range(start: -1h)';\nreturn msg;\n```\n\nYou can write multiple lines queries like this:\n```javascript\nmsg.topic = [\n  'from(bucket: \"myBucket\")',\n  '  |\u003e range(start: -1d, stop: now)',\n  '  |\u003e filter(fn: (r) =\u003e r._measurement == \"machinerySensor\")',\n  '  |\u003e filter(fn: (r) =\u003e r._field == \"vibrations\")',\n  '  |\u003e aggregateWindow(every: 1h, fn: mean)',\n  '  |\u003e yield(name: \"mean\")',\n\n  'from(bucket: \"myBucket\")',\n  '  |\u003e range(start: -1d, stop: now)',\n  '  |\u003e filter(fn: (r) =\u003e r._measurement == \"machinerySensor\")',\n  '  |\u003e filter(fn: (r) =\u003e r._field == \"vibrations\")',\n  '  |\u003e aggregateWindow(every: 1h, fn: max)',\n  '  |\u003e yield(name: \"max\")',\n].join('\\n');\n\nreturn msg;\n```\n\n![Example of the query node](https://raw.githubusercontent.com/stackhero-io/node-red-contrib-stackhero-influxdb-v2/master/assets/screenshotQuery.png)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackhero-io%2Fnode-red-contrib-stackhero-influxdb-v2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackhero-io%2Fnode-red-contrib-stackhero-influxdb-v2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackhero-io%2Fnode-red-contrib-stackhero-influxdb-v2/lists"}