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-hal2

v1.15.2

Published

A set of nodes to help with basic home automation logic

Readme

node-red-contrib-hal2 npm version

A set of nodes to help with basic home automation logic.

Note: Even more new examples added

Install

cd ~/.node-red
npm install node-red-contrib-hal2

What is it?

node-red-contrib-hal2 is a set of Node-RED nodes useful for creating home automation flows. The basic component is the Thing node, a virtual representation of a (usually) physical IoT device. This can then be used to trigger events, route traffic based on rules and more.

Example Items

  1. Store a device state in a Thing node
  2. Fire an event when the value changes using an Event node
  3. One or more rules will compare the value and that of other Items in a Gate node
  4. Output the value to another flow with a Value node
  5. Send device commands to multiple Things using an Action node
  6. Log changes using the Log node

Example automation flows

node-red-contrib-hal2 uses the Node-RED built-in context store to save device state. If you'd like for state to survive a Node-RED restart you'll need to save context data to the file system (default is memory-only). You can choose to save all Node-RED context data to disk or to create a separate context store just for your IoT devices. I would recommend a separate context store for this use. node-red-contrib-hal2 lets you select which context store to use per thing type. Please take a look at the Node-RED documentation for instructions on how to configure the context stores.

Take a look at the example flows and Thing definitions in the https://github.com/flic/node-red-contrib-hal2/tree/main/examples folder for more information.

Example logging

History

1.15 Info button in Thing node shows all the places it's used. New option in Action node to only send command if it differs from state.

1.14 Event node status text (last trigger event, delay/rate limit status) Event node option to reset Delay if trigger no longer true New config options for Event handler

1.13 Event node Delay and Rate Limit. Dynamic msg.thing.id in Gate node. New examples (Delay, Rate limit and Time Since Changed).

1.12 Ingress and egress functions can use item and attribute objects. It's now possible to base Alive on a last seen timestamp, great for zigbee2mqtt.

1.11 New options for Gate rules: Time Since Update and Time Since Change. It's now possible to use a function to create dynamic status text strings for Items. Value and Item node output includes last_update and last_change epoch date. New examples.

1.10 Export and import Thingtypes using the Node-RED Library function. Minimum node version bumped to >=14, minimum Node-RED version bumped to >= 2.2.0.

1.9 It's now possible to configure multiple outputs on the Thing node and use a specific output per command.

1.8 Value node can update Item values

1.7 Command loopback for virtual Things

1.6 Thing attributes & filter function added. Thing Cmnd topic parameter changed to a general topic parameter, some changes to Item topic filter and command topic.

1.5 Item notes added

1.4 Item filter applied to all node types

1.3 Dynamically set thing.id at runtime

1.2 Copy functions from other types

1.1 Item filter on gate node

1.0 Initial release