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

n8n-nodes-smarthomebrain

v0.2.1

Published

n8n node for SmartHomeBrain smart home platform

Downloads

1,265

Readme

n8n-nodes-smarthomebrain

n8n community nodes for the SmartHomeBrain smart home platform.

Nodes

SmartHomeBrain Trigger

Subscribes to the device-manager WebSocket and fires your workflow when a device changes state or a button is pressed. Filters by device, device type, and area, then narrows with a Trigger On mode:

| Trigger On | Fires when | Adaptive fields | |---|---|---| | Any Change (default) | Any capability change or button press matching the filters above | — (matches previous node behavior) | | Specific Capability Field | One field of one capability meets a condition | Capability and Field dropdowns only list what the selected device actually declares; Condition adapts to the field's type — booleans get Changed / Becomes True / Becomes False, numbers get Changed / Crosses Above / Crosses Below / Changes By At Least (with a Threshold), closed-vocabulary strings (lock state, thermostat mode, presence event) get Changed / Equals (with a Value dropdown) | | Button Press | A specific button + gesture fires | Button and Action dropdowns only list the buttons/gestures the selected device's profile declares |

"Specific Capability Field" and "Button Press" require picking one exact Device above (not "Any Device") — that's what makes the dropdowns adaptive. "Crosses Above"/"Crosses Below" are edge-triggered (fire once per crossing, not on every reading already past the threshold).

Output fields: | Field | Type | Description | |---|---|---| | id / deviceId | string | System device ID | | slug | string | Human-friendly slug, e.g. hallway-motion | | deviceName | string | Friendly name | | deviceType | string | e.g. motion, switch, light | | areaId / areaName | string | null | Area ID / display name | | capabilities | array | Full current capability state, e.g. [{ kind: 'OccupancySensing', occupancy: true }] | | events | array | undefined | Button press(es) that matched, for Button Press mode / Any Change with a remote | | availability | string | online / offline / unknown | | timestamp | string | ISO 8601 timestamp |

SmartHomeBrain

Action node with four operations:

| Operation | What it does | |---|---| | Send Command | POSTs a command. Target picks who receives it: Single Device — resolves a device slug → ID, same as before. Multiple Devices — hand-pick any set of devices from a checklist; the same command is sent to each. Each targeted device gets its own output item (deviceId/slug included), and a device that fails doesn't discard results already collected from the others — with Continue On Fail off, the first failure still aborts the run, but successes already emitted are kept. Capability narrows to what's actually usable: for a single device, its live reported state → matched code profile → device-type default. For multiple devices, the intersection across every selected device, so only commands guaranteed to work for all of them show up. | | Get Device State | Returns the current merged state of all devices | | List Devices | Returns all adopted devices (one item per device) | | List Areas | Returns all synced areas |

Installation

In n8n → SettingsCommunity NodesInstall → enter:

n8n-nodes-smarthomebrain

Or via CLI inside the n8n container:

npm install n8n-nodes-smarthomebrain

Restart n8n after installing.

Credential setup

  1. In n8n → CredentialsNew → search SmartHomeBrain API
  2. Fill in:
    • Host URL: the address of your device-manager, e.g. http://192.168.10.30:3001
    • API Key: paste a key from the dashboard → SettingsAPI Keys
  3. Click Test — you should see SmartHomeBrain is reachable and healthy

Creating your first API key

On first visit to the SmartHomeBrain dashboard, the setup wizard runs automatically. If you already have access:

  1. Open the dashboard → API Keys (key icon in sidebar)
  2. Click Generate New Key → give it a name (e.g. n8n)
  3. Copy the full key (shb_…) — it's shown only once
  4. Paste it into the n8n credential

Example workflow

[SmartHomeBrain Trigger]          [SmartHomeBrain]
  Device:      hallway-motion →     Operation:   Send Command
  Trigger On:  Specific Capability  Device:      living-room-light
  Capability:  OccupancySensing     Capability:  OnOff
  Field:       Occupancy            Command:     on
  Condition:   Becomes True

With "Becomes True" the trigger only fires on the false→true edge, so no IF node is needed to gate it — wire the trigger straight into the command.

Development

# Type-check
pnpm typecheck

# Tests
pnpm test

# Build
pnpm build

# Publish
npm publish