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 🙏

© 2024 – Pkg Stats / Ryan Hefner

zwave-prometheus-exporter

v0.0.10

Published

![stability-stable](https://img.shields.io/badge/stability-stable-green.svg)

Downloads

10

Readme

⚡ zwave-prometheus-exporter

stability-stable

npm version Known Vulnerabilities dependency status devdependency status Code Climate downloads

NPM

dockeri.co

Listens to Z-Wave nodes and exports Prometheus metrics.

⚡ Installation

Using Docker

docker run \
  -p 9850:9850 \
  -v $(pwd)/metrics.json:/home/app/metrics.json \
  -v $(pwd)/keys.json:/home/app/keys.json \
  --device=/dev/ttyUSB0:/dev/ttyUSB0 \
  --name zwave-prometheus-exporter \
  --rm \
  ilshidur/zwave-prometheus-exporter

As a global npm module

Node.js required.

npm i -g zwave-prometheus-exporter
zwave-prometheus-exporter

By cloning the git project

Node.js required.

git clone https://github.com/Ilshidur/zwave-prometheus-exporter.git
npm ci
node cli.js

⚡ Usage

Usage: zwave-prometheus-exporter [options]

Options:
  -V, --version                 output the version number
  -k, --keys <keys path>        the keys file path (default: "keys.json")
  -m, --metrics <metrics path>  the metrics file path (default: "metrics.json")
  -i, --input <input path>      the serial port file path (default: "/dev/ttyUSB0")
  -p --port <port>              the port where the prometheus metrics will be exposed (default: 9850)
  -h, --help                    display help for command

⚡ Configuration files

The CLI needs 2 files to run : metrics.json and keys.json. If no path is provided, the CLI will try to load zwave-prometheus-exporter/metrics.json and zwave-prometheus-exporter/keys.json.

Those 2 files are required for the CLI to run.

metrics.json

This file contains the Z-Wave values to monitor and export as Prometheus metrics.

Each field being :

  • name : the name with which this Z-Wave value will be exposed as a Prometheus metric.
  • commandClass : the Command Class of the value to export.
  • property : the Command Class property of the value to export.
  • propertyKey : the Command Class property key of the value to export.
[
  {
    "name": "power_consumption_watts",
    "commandClass": "0x32",
    "property": "value",
    "propertyKey": 66049
  },
  {
    "name": "power_consumption_volts",
    "commandClass": "0x32",
    "property": "value",
    "propertyKey": 66561
  },
  {
    "name": "power_consumption_amperes",
    "commandClass": "0x32",
    "property": "value",
    "propertyKey": 66817
  }
]

keys.json

This file contains the Z-Wave keys used to communicate securely with the Z-Wave nodes. Each key is a 32 hex caracters length with different content. Sharing keys between multiple security classes is a security risk!

You can find more details on the Z-Wave JS docs.

{
  "s2": {
    "accessControl": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
    "authenticated": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
    "unauthenticated": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  },
  "s0": {
    "legacy": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  }
}

⚡ TODO

  • Process to securely add a node into the Z-Wave network.