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

sk-battery-supervisor

v0.3.4

Published

SignalK Battery Supervisor for configurable charge profiles, SOC range-based charging logic, and publication of charge-control state to SignalK paths for use by external automation and charging-control systems.

Downloads

1,006

Readme

Battery Supervisor for SignalK

Battery Supervisor is a SignalK plugin that provides profile-based battery charging supervision using configurable State of Charge (SOC) thresholds.

The plugin evaluates battery SOC against user-defined charge profiles and publishes the resulting charging state to SignalK paths for use by external automation systems.

Battery Supervisor is intentionally hardware-agnostic. It does not directly control chargers, relays, MPPTs, inverters, or battery management systems. Instead, it acts as a supervisory decision engine that publishes battery management information which can then be consumed by other systems.


Features

  • Configurable battery SOC input path
  • Multiple user-defined charge profiles
  • Automatic profile identifier generation
  • Profile selection persistence across restarts
  • Profile switching through:
    • Battery Supervisor web UI
    • REST API
    • SignalK command path
  • Hysteresis-based charge enable logic
  • Published SignalK charge-control paths
  • Human-readable state and reason reporting
  • Hardware-independent architecture

Supported Charge Profiles

| Profile | Start Charging Below | Stop Charging At | |----------|----------|----------| | Storage | 50% | 60% | | Harbour | 60% | 70% | | Daily | 70% | 80% | | Cruise Prep | 80% | 90% | | Full Charge | 95% | 100% |

Users can freely add, edit, remove, or reorder profiles.

Profile identifiers are automatically generated from the display label.

| Display Label | Generated ID | |---------------|-------------| | Storage | storage | | Harbour | harbour | | Daily | daily | | Cruise Prep | cruise-prep | | Full Charge | full-charge |


How Battery Supervisor Works

Battery Supervisor continuously monitors a configured battery SOC value and compares it against the currently selected charge profile.

Each profile contains:

  • Minimum SOC threshold
  • Maximum SOC threshold

Charging is controlled using hysteresis logic.


Design Philosophy

Battery Supervisor is intended to be a reusable battery supervision layer.

It publishes charging decisions into SignalK but leaves actual hardware control to external systems.

Examples include:

  • Victron Cerbo GX
  • Home Assistant
  • Node-RED
  • MQTT consumers
  • SignalK plugins
  • Custom automation scripts
  • Future JK BMS integrations

Published SignalK Paths

Default output base path:

electrical.batteries.house.chargeControl

Published values:

| Path | Description | |--------|--------| | profile | Active profile identifier | | profileLabel | Active profile display name | | availableProfiles | Available profile identifiers | | availableProfileLabels | Available profiles with thresholds | | minSoc | Active profile minimum SOC | | maxSoc | Active profile maximum SOC | | soc | Current battery SOC | | chargeEnable | Charging permission state | | state | charging_allowed or charging_blocked | | reason | Human-readable explanation | | lastProfileChangeSource | Origin of last profile change | | lastUpdate | Timestamp of last update |


Example: Victron Cerbo GX Integration

JK BMS
   │
   ▼
SignalK
   │
   ▼
Battery Supervisor
   │
   ├── chargeEnable
   ├── profile
   ├── profileLabel
   │
   ▼
Node-RED / MQTT / Home Assistant
   │
   ▼
Cerbo GX

Battery Supervisor determines whether charging should be allowed. External systems consume the published SignalK values and apply the required hardware actions, including DVCC limits, charger control, relay control, MPPT control, and inverter control.


Configuration

Configuration

Battery Supervisor must be configured with a valid battery State of Charge (SOC) source before it can operate.

Battery SOC Input Path

Select the SignalK path that contains the battery SOC value.

Example:

electrical.batteries.house.capacity.stateOfCharge

Battery Supervisor accepts either:

0.0 - 1.0

or:

0 - 100

SOC formats and automatically normalises them to a percentage value.


Output Base Path

Default:

electrical.batteries.house.chargeControl

Battery Supervisor publishes all output values beneath this path.

Examples:

electrical.batteries.house.chargeControl.profile
electrical.batteries.house.chargeControl.profileLabel
electrical.batteries.house.chargeControl.chargeEnable
electrical.batteries.house.chargeControl.reason

Profile Command Input Path

Default:

electrical.batteries.house.chargeControl.command.profile

External systems can write a profile ID to this path to change the active charge profile.

Examples:

storage
harbour
daily
cruise-prep
full-charge

This allows profile changes from:

  • Home Assistant
  • Node-RED
  • MQTT automation
  • Custom SignalK applications

Republish Interval

Default:

30 seconds

Battery Supervisor republishes its current state at the configured interval, even when no SOC changes occur.

This ensures external systems remain synchronised with the current battery-management state.


Charge Profiles

Profiles define the SOC operating window used by Battery Supervisor.

Each profile contains:

Profile Name
Start Charging Below (%)
Stop Charging At (%)

Example:

| Profile | Start Charging Below | Stop Charging At | |----------|----------|----------| | Daily | 70% | 80% | | Cruise Prep | 80% | 90% |

Users may freely:

  • Add profiles
  • Remove profiles
  • Rename profiles
  • Reorder profiles

Profile identifiers are generated automatically from the display label.

Examples:

| Display Label | Generated ID | |---------------|-------------| | Storage | storage | | Harbour | harbour | | Daily | daily | | Cruise Prep | cruise-prep | | Full Charge | full-charge |


Example Configuration

| Setting | Example | |----------|----------| | Battery SOC Input Path | electrical.batteries.house.capacity.stateOfCharge | | Output Base Path | electrical.batteries.house.chargeControl | | Profile Command Input Path | electrical.batteries.house.chargeControl.command.profile | | Republish Interval | 30 | | Active Profile | Daily |


SignalK Plugin Configuration

SignalK Configuration


Profile Selection

Profiles may be selected using:

  • Battery Supervisor Web UI
  • REST API
  • SignalK command path

Default command path:

electrical.batteries.house.chargeControl.command.profile

Examples:

storage
harbour
daily
cruise-prep
full-charge

Battery Supervisor Web Interface

SignalK Web Interface


Proven Cerbo GX Integration

Battery Supervisor has been successfully validated with a Victron Cerbo GX using Node-RED.

Example flow:

Battery Supervisor → chargeEnable → MQTT → Node-RED → Cerbo GX Relay 2

When charging is permitted, Relay 2 is closed. When charging is blocked, Relay 2 is opened.

This demonstrates the intended architecture where Battery Supervisor acts as a supervisory decision engine while external systems remain responsible for hardware control.

Cerbo GX Relay Integration (Node-RED)

SignalK Node-red Relay flow


Future Roadmap

  • JK BMS RS485 integration
  • Cell voltage monitoring
  • Dynamic charge current limiting
  • Dynamic discharge current limiting
  • Cell balancing awareness
  • Victron DVCC integration
  • Relay control outputs
  • MPPT supervisory control
  • Advanced battery protection logic

Future Roadmap

  • JK BMS RS485 integration
  • Cell voltage monitoring
  • Dynamic charge current limiting
  • Dynamic discharge current limiting
  • Cell balancing awareness
  • Victron DVCC integration
  • Relay control outputs
  • MPPT supervisory control
  • Advanced battery protection logic

Changelog

v0.3.3

Documentation

  • Corrected README screenshot references.
  • Fixed image paths to ensure screenshots render properly on GitHub and npm.
  • Improved visual documentation layout and presentation.

No Functional Changes

This release contains documentation-only updates and does not modify plugin functionality.


v0.3.2

Documentation

  • Added detailed configuration guide.
  • Added Battery SOC input path documentation.
  • Added Output Base Path documentation.
  • Added Profile Command Path documentation.
  • Added Republish Interval documentation.
  • Added charge profile configuration examples.
  • Added example SignalK configuration.
  • Added screenshots section to the README.
  • Expanded Cerbo GX integration documentation.
  • Improved onboarding and setup guidance for new users.

No Functional Changes

This release contains documentation-only updates and does not modify plugin functionality.

v0.3.1

Added

  • Automated plugin test suite using Node.js built-in test runner
  • Selected profile display in SignalK configuration

Changed

  • Replaced hardcoded profile fallback logic with first-profile fallback
  • Added persistent profile selection across restarts
  • Separated internal profile identifiers from user-facing profile labels
  • Improved profile management and startup behavior
  • Expanded documentation and architecture guidance
  • Added Victron Cerbo GX integration example

Quality

  • Verified plugin loading
  • Verified schema generation
  • Verified plugin initialization

v0.2.0

Added

  • Initial Battery Supervisor implementation
  • Configurable charge profiles
  • SOC hysteresis charge control
  • REST API support
  • SignalK command path support

License

MIT License.