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

signalk-automation-plugin

v0.0.9

Published

Home Assistant-like YAML automations for Signal K

Readme

signalk-automation-plugin

YAML automations for Signal K, in the spirit of Home Assistant: files you can git, helpers with restart behaviour, and a small webapp for last-run / decision records.

Not Node-RED. Not a Home Assistant YAML clone. Actions are Signal K PUTs, helper writes, notifications, delays, and optional scripts.

In

  • YAML in an automations directory (preferably a git repo). Live snapshot lives in plugin data, not plugin options.
  • Helpers (boolean / number / string / select) with on_start:
    • restore — survive reboot (save in plugin data, restore on start)
    • default — set default on every start
    • none — do nothing on start
  • Path triggers, choose, zones, cron schedule (trigger list is any; conditions are all)
  • Trigger round: quantizes numbers (and lat/lon) so 230.1 V and 230.4 V do not both fire
  • Actions: put, helper, notify, delay, run
  • run: executes a file under configured scriptsDir. stdout is the value; any stderr is fail
  • Webapp: per-automation on/off, last result, last N decision records, live YAML, activate another git commit

Out

  • Node-RED flows
  • HA templates / Jinja
  • Arbitrary shell strings (only files under scriptsDir, no ..)

Plugin config

| Option | Meaning | | --- | --- | | Automations git / YAML directory | Folder with *.yaml at the top level. Git repo (or a subdir of one) → commit list in the webapp; “make live” archives only this folder | | Allowed scripts directory | Only relative run.file paths under this dir | | Decision records to keep | Ring buffer per automation | | Script timeout | Seconds |

Do not paste automations into the admin form. Runtime state is ~/.signalk/plugin-config-data/signalk-automation-plugin/ (state.json, live/, traces/).

Example

See examples/automations.yaml (fictional sample). Live YAML is whatever directory you set as automationsDir — usually a separate git. On/off and Verbose are plugin-data switches, not YAML keys.

helpers:
  dish_manual:
    type: boolean
    default: false
    on_start: restore   # survive reboot
    latch_on_external_put: electrical.switches.dish.state

automations:
  - id: dish_standby
    trigger:
      - schedule: "0 4 * * *"
    condition:
      - zone: home_harbour
      - helper: dish_manual
        is: false
    action:
      - put: electrical.switches.dish.state
        value: true
      - delay: 15m
      - put: electrical.switches.dish.state
        value: false
- path: electrical.switches.charger.voltage
  round: 1          # nearest volt; 230.1 and 230.4 do not both fire
- run:
    file: check-harbour.py
  as: harbour_ok          # optional helper id to store stdout

Webapp

Webapps → Automations. Reads go through /signalk/v1/api/signalk-automation-plugin/ (SK 2.x). Writes (on/off, make live, helper reset) use /plugins/signalk-automation-plugin/ and need an admin session.

Auto-publish

GitHub Action .github/workflows/release.yml patch-bumps and publishes to npm at most once per UTC day when plugin/, lib/, or public/ changed. Trusted Publisher (OIDC), workflow filename must stay release.yml.

The first npm version cannot use OIDC. Publish 0.0.1 once from a logged-in machine, then add the trusted publisher for htool/signalk-automation-plugin / release.yml.