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

@stefa168/node-red-hysteresis

v0.5.0

Published

Adds hysteresis function to node-red

Downloads

41

Readme

node-red-hysteresis

npm version GitHub npm

Provides a hysteresis or deadband function.

Note: this fork is currently being re-written, so the documentation below may not be accurate.
Currently, only the fixed threshold mode is supported.

The main new feature is the ability to specify the payload path to use for the hysteresis value.

Details

This node implements a hysteresis or deadband function, effectively managing signal fluctuations within a defined range.

Key Functionalities

Upon receiving a message, the node compares the value of the specified property path with the defined thresholds. Depending on the value, the node may emit the received message.

The following cases are possible:

  • The value is above the upper threshold: the node will emit the received message.
  • The value is below the lower threshold: the node will emit the received message.
  • The value is between the upper and lower threshold: the node will not emit the received message.

Some exceptions to the above cases are possible, depending on the node settings:

  • If the Send initial message option is enabled, the node will emit the received message regardless of the value, but only once, when the flow is started.
  • If the Re-send message if still in High-Band option is enabled, the node will emit the received message if the value is still above the upper threshold.
  • If the Re-send message if still in Low-Band option is enabled, the node will emit the received message if the value is still below the lower threshold.

Notes

  • When the flow is first started, the node won't have any previous value to compare with, so the node will emit the received message regardless of the value. This behaviour can be disabled by unchecking the Send initial message option.

Use Cases

  • The node can only handle numerical values. If the value of the specified property path is not numerical, the node will throw an error.
  • In control systems, hysteresis can be used to filter signals so that the output reacts less rapidly than it otherwise would, by taking recent history into account. For example, a thermostat controlling a heater may switch the heater on when the temperature drops below A, but not turn it off until the temperature rises above B. For instance, if one wishes to maintain a temperature of 20 °C then one might set the thermostat to turn the heater on when the temperature drops to below 18 °C and off when the temperature exceeds 22 °C. Similarly, a pressure switch can be designed to exhibit hysteresis, with pressure set-points substituted for temperature thresholds.