npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

homebridge-metric-exporter

v1.0.3

Published

Homebridge plugin to export accessory data (temperature, humidity) to time-series databases (InfluxDB, Graphite, PostgreSQL).

Readme

Homebridge Metric Exporter

A Homebridge plugin that exports accessory data (temperature, humidity, and more) to time-series databases. Perfect for visualizing your thermostat and sensor data in Grafana or other dashboard tools.

Supported Data Sources

| Data Source | Protocol | Dependencies | |-------------|----------|--------------| | InfluxDB v2 | HTTP API (line protocol) | None (fetch) | | Graphite | Plaintext TCP | None (net) | | PostgreSQL | Native wire protocol | pg |

Features

  • Export temperature, humidity, and other numeric characteristics from any Homebridge accessory
  • Config-based allow list — choose exactly which accessories to export (or leave empty to export all)
  • Stable accessory ID tag — data continuity preserved even if accessory names change
  • Automatic characteristic detection — reads any numeric characteristic available on the accessory
  • Supports InfluxDB v2, Graphite, and PostgreSQL as data sources
  • Configurable poll interval
  • Runs as a dynamic platform plugin (no accessories created)

Installation

Via Homebridge UI (Recommended)

  1. Search for homebridge-metric-exporter in the Homebridge UI plugin search
  2. Click Install
  3. Configure your data source and accessory list

Via Command Line

npm install -g homebridge-metric-exporter

Configuration

Add the platform to your Homebridge config.json:

InfluxDB v2

{
  "platforms": [
    {
      "platform": "MetricExporter",
      "name": "Metric Exporter",
      "datasourceType": "influxdb",
      "influxdb": {
        "url": "http://localhost:8086",
        "token": "your-api-token",
        "org": "homebridge",
        "bucket": "homebridge",
        "measurement": "homebridge"
      },
      "accessories": ["Living Room Thermostat", "Bedroom Sensor"],
      "pollInterval": 10
    }
  ]
}

Graphite

{
  "platforms": [
    {
      "platform": "MetricExporter",
      "name": "Metric Exporter",
      "datasourceType": "graphite",
      "graphite": {
        "host": "localhost",
        "port": 2003,
        "prefix": "homebridge"
      },
      "accessories": ["Living Room Thermostat"],
      "pollInterval": 10
    }
  ]
}

PostgreSQL

{
  "platforms": [
    {
      "platform": "MetricExporter",
      "name": "Metric Exporter",
      "datasourceType": "postgresql",
      "postgresql": {
        "host": "localhost",
        "port": 5432,
        "database": "homebridge",
        "user": "homebridge",
        "password": "your-password",
        "table": "homebridge_metrics"
      },
      "accessories": ["Living Room Thermostat"],
      "pollInterval": 10
    }
  ]
}

Configuration Options

| Option | Required | Default | Description | |--------|----------|---------|-------------| | datasourceType | Yes | "influxdb" | Data source: "influxdb", "graphite", or "postgresql" | | accessories | No | [] | Array of accessory display names to export. Leave empty to export all. | | name | No | "Metric Exporter" | Platform name shown in logs | | pin | No | "031-45-154" | Homebridge PIN for HAP discovery | | pollInterval | No | 10 | How often to read and export values (seconds) | | debugmode | No | false | Enable debug logging |

Data Source Options

InfluxDB

| Option | Required | Default | Description | |--------|----------|---------|-------------| | url | Yes | http://localhost:8086 | InfluxDB v2 API URL | | token | Yes | - | API token with write access | | org | Yes | "homebridge" | Organization name | | bucket | Yes | "homebridge" | Bucket to write to | | measurement | No | "homebridge" | Measurement name |

Graphite

| Option | Required | Default | Description | |--------|----------|---------|-------------| | host | Yes | "localhost" | Graphite server hostname | | port | Yes | 2003 | Plaintext protocol port | | prefix | No | "homebridge" | Metric path prefix |

PostgreSQL

| Option | Required | Default | Description | |--------|----------|---------|-------------| | host | Yes | "localhost" | PostgreSQL server hostname | | port | No | 5432 | PostgreSQL server port | | database | Yes | "homebridge" | Database name | | user | Yes | - | Username with INSERT permissions | | password | Yes | - | User password | | table | No | "homebridge_metrics" | Table name (auto-created) |

Exported Metrics

The plugin automatically reads numeric and boolean characteristics from matched accessories. Common exported fields:

| Characteristic | Field Name | Type | |---------------|------------|------| | Current Temperature | temperature | Number (Celsius) | | Current Relative Humidity | humidity | Number (%) | | Current Heating/Cooling State | heating_cooling_state | Number (0=off, 1=heat, 2=cool, 3=auto) | | Target Temperature | target_temperature | Number (Celsius) | | Battery Level | battery_level | Number (%) | | Air Quality | air_quality | Number | | Current Ambient Light Level | light_level | Number (lux) | | Motion Detected | motion_detected | Number (0/1) | | On (switches/outlets) | on | Number (0/1) |

Each data point is tagged with the accessory name and a stable accessory_id (bridge MAC + accessory ID) for easy filtering and data continuity.

Running as a Child Bridge

It is recommended to run this plugin as a child bridge for better stability and isolation.

License

Apache-2.0

Feedback & Issues

Please submit any issues or feature requests to the GitHub Issues page.