node-red-contrib-hal2

1.15.2 • Public • Published

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.

Skärmavbild 2023-03-19 kl  11 16 03

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

Package Sidebar

Install

npm i node-red-contrib-hal2

Weekly Downloads

36

Version

1.15.2

License

ISC

Unpacked Size

338 kB

Total Files

36

Last publish

Collaborators

  • frtnbach