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

@jmaza_itix/ton-alarm

v1.1.4

Published

Alarm monitoring with timer logic

Readme

ton-alarm for Node-RED

Overview

ton-Alarm is a Node-RED node designed to monitor numerical values and trigger alarms when values cross configurable thresholds. It supports:

  • Delayed alarm activation via timeout
  • Repeat alarm notifications while the condition remains active
  • Reset and disable controls
  • Dual outputs for synchronous and asynchronous use cases

This node is ideal for use cases like sensor montioring, process condition alarms, and alert systems in industrial or IoT environments.

Features

  • Configurable minimum and maximum thresholds
  • Timeout before triggering the alarm (debounce/filter)
  • Optional repeat interval for alarm reminders
  • Synchronous (on every message) and asynchronous (on status change) outputs
  • Reset and disable capabilities for smarter control logic

Node Configuration (via editor)

When adding the node in Node-RED, you can configure

  • minValue (optional): Minimum threshold
  • maxValue (optional): Maximum threshold
  • timeout (optional): Delay (in seconds) before alarm activates. Defaults to 60 seconds if not provided
  • repeat (optional): interval (in seconds) to repeat alarm notifications while active

These settings can be overridden via incoming config messages (see below)

Dynamic Configuration via Message

You can dynamically override node settings by sending a configuration message. This only needs to be sent once, and will persist. You can send it again to modify configuration.

Message properties (all optional):

|Property|Type|Description| |-----------|-----------|-----------| |msg.minValue|number|Minimum threshold| |msg.maxValue|number|Maximum threshold| |msg.timeout|number|Time (sec) before alarm is triggered| |msg.repeat|number|Interval (sec) for repeated alarm notifications|

⚠️ If a property is omitted, it is excluded from alarm calculations (except timeout, which defaults to 60 seconds).

To delete a config value, just assign it a null like msg.MinValue = null

Input Messages

Payload handling:

  • msg.payload: A number or boolean
    • Booleans are converted to 1 (true) or 0 (false).
  • msg.payload = "reset": Resets alarm state and timers
  • msg.disable = true: Disables the alarm logic and forces both outputs to emit a "false" state
  • msg.disable = false: Re-enables the alarm based on the last received value.

Disabling the alarm will set lastValue to null. Alarm condition won't be calculated when msg.disable=false unless a new msg.payload is received

Output Messages

The node emits messages on two outputs:

  1. First output (synchronous):
    • Emitted on every received message
    • Useful when periodic or frequent updates are expected
  2. Second output (asynchronous):
    • Emitted only on alarm state change or repeat interval
    • Useful for flows that only react to changes (e.g. Telegram, email alerts)

Output message structure:

{
    "payload": true,
    "idDisabled": false,
    "isCondition": true,
    "isAlarmL": false,
    "isAlarmH": true,
    "isSyncMsg": false,
    "isRepeating": true,
    "lastValue": 105.3,
    "minValue": 50,
    "maxValue": 100,
    "timeout": 10,
    "repeat": 30
}

|Field|Description| |------|------| |payload |true or false, indicating whether alarm condition is active| |isDisabled |Indicates whether the alarm is currently disabled| |isCondition |Indicates current condition is outside threshold (before timeout applies)| |isAlarmL |True if value is below minValue| |isAlarmH |True if value is above maxValue| |isSyncMsg |True if the message was from the synchronous output| |isRepeating |True if this message is part of the repeating alarm| |lastValue |The last received value| |minValue |Current min threshold| |maxValue |Current max threshold| |timeout |Configured timeout in seconds| |repeat |Configured repeat interval in seconds|

Alarm Disabling Use Case

In some cases, the alarm should be conditionaly disabled. For example, when a device like a cooling chamber is powered off the temperature may rise, but no alarm should be triggered.

  • Send msg.disable = true to temporarily disable the alarm Both outputs will emit a message with payload = false and isDisabled = true
  • Send msg.disable = false to re-enable alarm checks

License

This project is licensed under the MIT License. See the full license in the source code.