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

node-red-contrib-sensor-consensus

v0.1.0

Published

A Node-RED sensor-fusion / consensus node: fuses latest readings from multiple sensors into a single trusted aggregate with staleness windows, quorum, disagreement detection, and a latched threshold trigger. Purpose-built 4-output event model (Trigger / R

Readme

node-red-contrib-sensor-consensus

A Node-RED sensor-fusion / consensus node. Readings from multiple sensors (keyed by msg.topic) are fused into a single trusted aggregate, and a trigger latches when that aggregate crosses a configured threshold — with freshness (staleness windows), quorum, and disagreement detection as first-class features rather than afterthoughts.

Averaging three healthy humidity sensors is easy. What existing aggregation nodes don't answer is what happens when one of them goes quiet, sticks, or drifts: a dead sensor's last reading silently skews the average forever, and nothing tells you a trigger didn't fire because trust was lost rather than because the value was fine. This node makes every one of those decisions observable.

Highlights

  • Two type modes (per node instance): Numeric — mean, median, min, max, or trimmed mean over the latest value from each source — or Boolean — vote rules (Any / Majority / All / At least N) over the fraction of sources reporting true, with configurable true/false value lists.
  • Trust built in: per-source staleness windows, fresh-source quorum, minority reports when a sensor disagrees with its peers, and a configurable Hold/Release policy for quorum loss while triggered.
  • Latched threshold trigger with direction (above/below) and hysteresis, plus runtime commands to move thresholds, adjust the staleness window, disable/enable decisions, and remove or reset sources.
  • Four purpose-built outputs — Trigger, Release, Query, Events — where outputs 1 and 2 carry only what genuinely happened, and every blocked, rejected, or suppressed action is observable on the Events output with msg.ignored = true.
  • Heartbeat snapshots for watchdogs, and optional persistence across deploys/restarts with wall-clock staleness re-evaluation on restore.

Install

From the Node-RED palette manager, or:

cd ~/.node-red
npm install node-red-contrib-sensor-consensus

Documentation

The embedded node help (in the editor sidebar) is a complete reference. Detailed documentation, examples, and troubleshooting live in the project wiki. The authoritative record of design decisions is sensor-consensus-design.md in this repository.

Sibling nodes

This node shares its event envelope (msg.ignored, msg.source), command conventions, and output-exclusivity guarantees with node-red-contrib-timer-events and node-red-contrib-timer-threshold — downstream flows can process events from all three with the same code.

Testing

npm test

runs the standalone assertion harness (no framework dependencies; 144 checks across 8 suites at the time of writing). Publishing is gated on the same harness via prepublishOnly.

License

Apache-2.0. Includes Douglas Crockford's public-domain cycle.js for persistence serialization.