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

v0.2.2

Published

Node-RED node for G100/2 export and import limitation compliance (UK)

Downloads

712

Readme

node-red-contrib-g100

Node-RED node for UK ENA EREC G100 Issue 2 (Customer Limitation Scheme) compliance. Tracks export and import excursions and enforces Stage 2 / Stage 3 lockout per the G100/2 specification.

What is G100/2?

G100/2 is short for ENA Engineering Recommendation G100 Issue 2"Technical Requirements for Customer Export and Import Limitation Schemes" — published by the Energy Networks Association (ENA), the UK body representing the electricity Distribution Network Operators (DNOs).

DNOs use it as a connection condition: when a site's generation (e.g. solar) or import capacity exceeds what the local network can absorb without reinforcement, the DNO can offer a connection anyway, on the condition that the site runs a Customer Limitation Scheme (CLS) — a control system that keeps the site's net import/export within agreed limits, and fails safe (disconnects) if that control breaks down. G100/2 defines exactly how that control system must behave, including the two limits it enforces:

  • MEL — Maximum Export Limit (W): the most the site may export to the grid.
  • MIL — Maximum Import Limit (W): the most the site may import from the grid.

Depending on how long and how often a limit is exceeded ("excursion"), a compliant CLS progresses through three stages:

| Stage | Meaning | |-------|---------| | 1 | Normal — within limits | | 2 | Excursion tracking — threshold breaches counted; persists between excursions until counters are cleared or a reset is performed | | 3 | Lockout — system must stop exporting/importing until reset |

An excursion escalates from Stage 2 to Stage 3 lockout when it is sustained for 1 minute, or repeats often enough (2+ excursions within any 10-minute window, or more than 3 within 24 hours) — see g100-state-machine.ts for the exact thresholds this node implements.

The regulation distinguishes domestic and commercial sites for how Stage 3 is cleared:

  • Domestic: user can self-reset; limited to 3 resets in any 30-day period, after which an installer password is required.
  • Commercial: installer-only reset (password required), or a 4-hour automatic timeout.

How this node fits in

This node is the CLS decision engine, not the actuator. It consumes a grid power reading (e.g. from a Victron Grid Meter node), runs the G100/2 stage/timer/counter logic described above, and emits a lockout boolean plus a detailed status object. It does not itself open contactors, curtail an inverter, or throttle a charger — wiring that response (e.g. driving a Victron ESS/inverter setpoint or a relay) into your flow when lockout is true is up to you. This separation keeps the compliance logic testable and auditable independently of whatever hardware happens to be enforcing it.

For the authoritative specification text and exact timing/counter values, refer to the official document: ENA EREC G100 Issue 2 Amendment 2 — Technical Requirements for Customer Export and Import Limitation Schemes (Energy Networks Association).

Installation

In the palette manager, search for the node-red-contrib-g100 package and install it from there.

The node will appear in the Victron Energy category once the install completes — no manual restart needed.

Node: g100

Inputs

| Topic | Payload | Description | |-------|---------|-------------| | (default) | number | Grid power in Watts. Positive = import, negative = export. | | acSource | 1 / other | 1 = grid is the active AC source. Other values (generator, shore) suspend enforcement. | | reset | { password?: number } | Attempt a reset. Domestic: no password needed. Commercial: installer password required. |

Outputs

| # | Payload | Description | |---|---------|-------------| | 1 | boolean | Lockout state — only emitted when the value changes. | | 2 | G100Output object | Full status on every input message (stage, counts, timestamps, resetEligible). |

Configuration

| Field | Default | Description | |-------|---------|-------------| | MEL (W) | -3500 | Maximum Export Limit in Watts (negative). Set to the agreed export limit. | | Enable MIL | off | Enable import limiting as well. | | MIL (W) | 12500 | Maximum Import Limit in Watts (positive). | | Mode | domestic | domestic or commercial. Controls reset policy. | | Allow end-user reset | on | Domestic only: show a reset button to end users. | | Installer password | 0 | Commercial only: 4-digit password for installer resets. | | Debug | off | Attaches full internal state to output 2 messages (msg.state). |

Persistence

State (excursion counters, lockout status, Stage 3 timestamps) is stored in Node-RED file context so it survives restarts. The node warns on deploy if context storage is not configured for file persistence.

To enable file context in Node-RED's settings-user.js:

module.exports = {
    contextStorage: {
        default: {
            module: 'localfilesystem',
            config: {
                flushInterval: 30  // seconds — write state to disk every 30 s
            }
        }
    }
}

flushInterval controls how often Node-RED writes context to disk. Lower values reduce the window in which a crash could lose Stage 3 lockout state (a compliance risk); higher values reduce write frequency (useful on SD-card based systems such as Raspberry Pi). 30 seconds is a reasonable default; 300 seconds (5 minutes) is acceptable if SD-card wear is a concern.

Requirements

  • Node.js ≥ 18
  • Node-RED ≥ 2.0

License

MIT — see LICENSE.