{"id":23503173,"url":"https://github.com/kpfleming/esphome-influxdb_v2_oss","last_synced_at":"2026-02-14T15:32:27.357Z","repository":{"id":192448505,"uuid":"686737897","full_name":"kpfleming/esphome-influxdb_v2_oss","owner":"kpfleming","description":"An ESPHome component for publishing measurements to InfluxDB OSS (version 2 or later).","archived":false,"fork":false,"pushed_at":"2025-09-08T09:56:50.000Z","size":104,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-11T15:55:14.640Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kpfleming.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"kpfleming","liberapay":"kpfleming"}},"created_at":"2023-09-03T19:23:41.000Z","updated_at":"2025-09-08T09:56:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"588b9ad4-8a03-4dd0-a1ac-8146ac4ca9a3","html_url":"https://github.com/kpfleming/esphome-influxdb_v2_oss","commit_stats":null,"previous_names":["kpfleming/esphome-influxdb_oss_v2"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kpfleming/esphome-influxdb_v2_oss","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kpfleming%2Fesphome-influxdb_v2_oss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kpfleming%2Fesphome-influxdb_v2_oss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kpfleming%2Fesphome-influxdb_v2_oss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kpfleming%2Fesphome-influxdb_v2_oss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kpfleming","download_url":"https://codeload.github.com/kpfleming/esphome-influxdb_v2_oss/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kpfleming%2Fesphome-influxdb_v2_oss/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29447998,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T14:10:32.461Z","status":"ssl_error","status_checked_at":"2026-02-14T14:09:49.945Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-12-25T08:15:53.005Z","updated_at":"2026-02-14T15:32:27.339Z","avatar_url":"https://github.com/kpfleming.png","language":"C++","funding_links":["https://github.com/sponsors/kpfleming","https://liberapay.com/kpfleming"],"categories":[],"sub_categories":[],"readme":"# esphome-influxdb_v2_oss\n\n\u003ca href=\"https://opensource.org\"\u003e\u003cimg height=\"150\" align=\"left\" src=\"https://opensource.org/files/OSIApprovedCropped.png\" alt=\"Open Source Initiative Approved License logo\"\u003e\u003c/a\u003e\n[![License - GNU GPL v3.0+](https://img.shields.io/badge/License-GNU%20GPL%203.0%2b-9400d3.svg)](https://spdx.org/licenses/GPL-3.0-or-later.html)\n\nThis repo contains an ESPHome component for publishing data to\nInfluxDB V2 (OSS version, not Cloud).\n\nOpen Source software: [GNU General Public License v3.0 or later](https://spdx.org/licenses/GPL-3.0-or-later.html)\n\n## \u0026nbsp;\n\n## Features\n\n### Measurement Composition\n\nThis component allows composition of\n[measurements](#influxdb-data-structure) from any number of sensors\n(numeric, text, and binary). Organizing sensors in this way ensures\nthat all of their values are recorded with the same timestamp, which\nenables summarization and comparison in a reliable fashion.\n\n### Batch Timestamps\n\nMultiple `measurements` can be published in a batch, ensuring that\nthey all have the same timestamp if timestamping is enabled in the\ncomponent. This permits summarizaton and comparison across\nmeasurements without having to manipulate the timestamps\n(e.g. truncation) in the database query or reporting tool.\n\n### Backlog Queueing\n\nIf a time server is available, local timestamping of `measurements` is\npermitted, and the component can queue `measurements` if the InfluxDB\nserver is unreachable or unavailable. Each time the `publish`\noperation is invoked, an attempt will be made to connect to the\nserver, and if it is successful then that `measurement` will be\npublished along with some (or all) of the queued `measurements`.\n\n### Field Naming and Type Overrides\n\nWhen sensors are added to a `measurement` as `fields`, the component\nwill use the sensor's ID as the field name by default; the\nconfiguration can provide an alternative name to be used instead.\n\nNumeric sensors default to 'float' format when published, but the\nconfiguration can override the type to 'integer' or 'unsigned integer'\nif desired.\n\n### Raw or Filtered Sensor Values\n\nWhen a `field` is published, its value can be either the raw sensor\nvalue, or the filtered value if the sensor configuration includes\nfilters. This allows the Home Assistant dashboards to include values\nthat have been transformed for display, but InfluxDB to receive the\nraw values, without having to use the `copy` component to make both\nvalues available.\n\n## Comparison to Home Assistant's InfluxDB integration\n\nHome Assistant includes an [InfluxDB\nintegration](https://www.home-assistant.io/integrations/influxdb/)\nwhich can publish state changes (from all Home Assistant entities) and\nalso import data to make it available for use in automations.\n\nThe integration does not have the composition flexibility offered by\nthis component, and does not offer any form of batching or\ntimestamping; as a result, controlling the organization of the\npublished data is difficult, which makes the creation of database\nqueries and external dashboards more complex.\n\nIn addition, dependence on Home Assistant for data recording means\nthat any time the Home Assistant installation is upgraded or otherwise\nunavailable the data publication will be disrupted, and data could be\nlost. In applications where the data is being used for long-term\nreporting, elimination of the 'middle step' (passing the data through\nHome Assistant) reduces the chances of data loss.\n\n## Requirements\n\n* An InfluxDB V2 (OSS, not Cloud) server, with an API token that\n  grants (at least) 'write' permission to the buckets where the\n  measurements will be written.\n\n* A time server (Home Assistant or SNTP) if the measurements will be\n  locally timestamped before publication (also necessary for backlog\n  support).\n\n## InfluxDB Data Structure\n\nInfluxDB stores data as `measurements`; they have names, contain\n`fields` (named values), and optionally contain `tags` (named\ndiscriminators). `Measurements` also have `timestamps`, which can\neither be generated by InfluxDB when the `measurement` is received, or\nincluded in the `measurement` by its sender.\n\n`Measurements` are stored in `buckets`, and `buckets` belong to\n`organizations`.\n\nWhen configuring this component you will need to know the\n`organization` and `bucket` names that exist on the server (which will\nreceive the `measurements`), but you will decide how to name the\n`measurements` and `fields`, and which `tags` to include.\n\n## Configuration\n\nThe ESPHome 'logger' defaults to `debug` level; while this can be\nuseful for troubleshooting ESPHome configurations, it can also cause\nwarnings to be generated which don't correspond to actual problems. If\nyou have the level set to `debug`, you may see a warning for the\n`http_request` component, since it will block ESPHome activities for\nsome time while it waits for a response from the InfluxDB server. The\nwarning will indicate that component `http_request` took *too much\ntime* to do its work.\n\n### Minimal Example\n\nThis section is a walkthrough of [minimal.yml](examples/minimal.yml)\nfrom the `examples` directory. It is the most basic configuration\nneeded to support the reporting device information (uptime and\nWiFi RSSI) to InfluxDB.\n\n```yaml\nesphome:\n  name: influxdb-minimal\n  friendly_name: Minimal InfluxDB Example\n\nesp32:\n  board: esp32dev\n  framework:\n    type: esp-idf\n\nwifi:\n  networks:\n    - ssid: example-network\n      password: network-password\n\napi:\n```\n\nThis section fulfills basic ESPHome requirements: node information,\nboard selection, and WiFi/API connectivity.\n\n```yaml\nexternal_components:\n  - source: github://kpfleming/esphome-influxdb_v2_oss\n```\n\nThis configuration requires one external component,\nesphome-influxdb_v2_oss.\n\n```yaml\ntime:\n  - platform: homeassistant\n    timezone: EST5EDT,M3.2.0,M11.1.0\n```\n\nThis section configures time synchronization with a Home Assistant\ninstallation (time sync will be achieved once Home Assistant connects\nto the ESPHome API on this device).\n\n```yaml\nsensor:\n  - id: _uptime\n    platform: uptime\n    name: ${node_name} Uptime\n    on_value:\n      then:\n        - if:\n            condition:\n              time.has_time:\n            then:\n              - influxdb.publish: _device_info\n\n  - id: _wifi_rssi\n    platform: wifi_signal\n    name: ${node_name} WiFi Signal\n```\n\nThis section configures two sensors, device uptime and the WiFi RSSI\n(signal strength).\n\nIn addition, the configuration triggers publication to InfluxDB each\ntime the 'uptime' sensor has a new value (once per second), but only\nif the 'time' component has achieved time synchronization. As noted\nbelow, this is required for the InfluxDB component to be able to\ngenerate timestamps, and also for the ability to queue measurements\nfor later publication if connectivity to the InfluxDB server is\ninterrupted.\n\n```yaml\nhttp_request:\n  useragent: esphome/influxdb\n  timeout: 15s\n  watchdog_timeout: 15s\n```\n\nThis section configures the `http_request` component, which is used by\nthe InfluxDB component to publish measurements to the server.\n\n```yaml\ninfluxdb_v2_oss:\n  url: http://influxdb.example.com:8086\n  organization: example\n  token: influxdb-token\n  backlog_max_depth: 60\n  backlog_drain_batch: 10\n  tags:\n    device: ${node_name}\n  measurements:\n    - id: _device_info\n      bucket: iot_devices\n      name: info\n      sensors:\n        - sensor_id: _uptime\n          name: uptime\n        - sensor_id: _wifi_rssi\n          name: rssi\n```\n\nThis final section configures the InfluxDB component itself.\n\nFirst, the basic details required to connect to the InfluxDB server:\nURL, organization, and token.\n\nThe `backlog_max_depth` and `backlog_drain_batch` items control the\nmaximum number of measurements which can be stored in memory while\nwaiting for the InfluxDB server to be reachable, and the maximum\nnumber of queued measurements which can be submitted in a single\nbatch. It is important to keep that number relatively low so that the\nESPHome device won't appear to 'lock up' when draining a large number\nof queued measurements when the InfluxDB server becomes reachable\nafter a period of unreachability.\n\nThe 'tags' section configures tags (keys and values) which will be\nadded to all measurements published by the component. In this case a\ntag named `device` will be sent containing the ESPHome `node_name`.\n\nFinally a single measurement is configured. It has an ID which can be\nsupplied to the `influxdb.publish` action to trigger publication, a\nbucket name to receive the measurement, and a name ('info'). The\nmeasurement will contain values from two sensors (specified by their\nIDs), with names supplied to override the default names ('uptime'\ninstead of '_uptime' and 'rssi' instead of '_wifi_rssi').\n\n### Full Featured\n\nSee [FULL_CONFIGURATION](FULL_CONFIGURATION.md).\n\n## Issues, Feature Requests, Discussions\n\nIf you need to report an issue, or suggest a new feature, please do so\nin the\n['Issues'](https://github.com/kpfleming/esphome-influxdb_v2_oss/issues)\narea of this repository.\n\nIf you'd like to discuss usage of these components, or ask for help\nwith them (but not with ESPHome itself or InfluxDB), please do so in\nthe\n['Discussions'](https://github.com/kpfleming/esphome-influxdb_v2_oss/discussions)\narea of this repository.\n\n## Chat\n\nIf you'd like to chat with the esphome-influxdb_v2_oss community, join\nus on [Matrix](https://matrix.to/#/#esphome-influxdb:km6g.us)!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkpfleming%2Fesphome-influxdb_v2_oss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkpfleming%2Fesphome-influxdb_v2_oss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkpfleming%2Fesphome-influxdb_v2_oss/lists"}