@deroetzi/node-red-contrib-smarthome-helper 1.0.1
A collection of personal helper nodes for Node-RED
@deroetzi/node-red-contrib-smarthome-helper
A collection of Node-RED nodes for smart home automations, focused on reusable logic, robust control, and maintainable flows.
Overview
This package provides multiple node groups:
- Flow control nodes for gate, match, and status behavior
- Helper nodes for climate, lighting, notifications, and event mapping
- Logical nodes for comparisons and boolean operations
- Operator nodes for arithmetic calculations
In addition, the project generates Node-RED help text at runtime from editor definitions and existing locale files.
Installation
Install in your Node-RED user directory (typically ~/.node-red):
npm install @deroetzi/node-red-contrib-smarthome-helper
Then restart Node-RED.
Requirements:
- Node.js >= 20
- Node-RED >= 2 (tested in this package with Node-RED 4)
Included Nodes
FlowCtrl
automation-gate: Gate for automation flow and replay scenariosbase: Shared base for debounce, topic evaluation, and status reportinggate-control: Controls gates via commands (for example start, stop, pause)match-join: Matching/joining of multiple input messagesstatus: Creates and distributes status information
Helper Climate
heating-controller: Heating logic with modes and additional conditionshygro-calculator: Calculates dew point and absolute humidity
Helper Control
event-mapper: Maps events to target values/actionsmotion-controller: Motion-based switching logic
Helper Light
light-controller: Light control (switch, RGB, color temperature)
Helper Notification
moisture-alert: Alerts based on moisture thresholdsnotify-dispatcher: Distribution to broadcast and person-specific channelswaste-reminder: Reminders for waste collection eventswhitegood-reminder: Reminders for household applianceswindow-reminder: Window-related reminder logic
Logical
compare: Comparison operatorshysteresis-switch: Switching with hysteresisop: Boolean operationsswitch: Conditional routing/switchingtoggle: Toggle logic
Operator
arithmetic: Arithmetic operations on message values
Runtime Node Help
Help text in the Node-RED UI is generated dynamically when the editor loads.
Core idea:
- During registration in
src/editor.ts, help injection is triggered for each node. - The help logic in
src/nodes/flowctrl/base/help.tscombines:- Editor definition (
defaults,outputLabels,oneditprepare) - Editor metadata (
EditorMetadata) - i18n entries from locale files
- Editor definition (
- The result is a language-aware, consistent help block including description, parameters, inputs, and outputs.
Important:
- Metadata is exported directly in each node's
editor.ts. - Registry files only consume these exports.
- No separate manual help HTML is required per node.
Localization
Translations are located in src/nodes/**/locales/*.json and src/locales/**.
Typical structure per node:
{
"name": "Node Name",
"description": "Short description",
"input": {
"exampleInput": {
"name": "Input Name",
"description": "Description"
}
},
"output": {
"exampleOutput": {
"name": "Output Name",
"description": "Description"
}
},
"field": {
"exampleField": {
"label": "Field label",
"description": "Description"
}
}
}
Development
Setup
npm install
Build
npm run build
The build (Gulp) generates, among other artifacts:
dist/index.jsfor Node-RED runtimedist/index.htmlfor editor assetsdist/locales/**from merged translationsexamples/*.jsonfrom the devcontainer flow source
Linting
npm run lint
npm run lint_fix
Watch Mode
npx gulp watch
Notes:
src/version.tsand files indist/are generated and should not be edited manually.- Always register new nodes through the appropriate registry so runtime and editor registration stay in sync.
Examples
The examples/ directory contains ready-to-use example flows:
flowctrl.jsonhelper_climate.jsonhelper_lights.jsonhelper_notification.jsonlogical.jsonoperators.json
Contributing
Issues and pull requests are welcome. For larger changes, a short alignment upfront is recommended.
License
MIT
Links
- Node-RED: https://nodered.org/
- Repository: https://github.com/DerOetzi/node-red-contrib-smarthome-helper