node-red-contrib-escape-arc 0.4.4
Node-RED nodes for ARC: subscribe to state/timer/objective events and send actions over Socket.IO.
# node-red-contrib-escape-arc
Custom Node-RED nodes for Automation Room Control (ARC). They connect to ARC's Socket.IO gateway, stream live room events (state, timer, objectives, displays) and let flows trigger ARC actions.
Requirements
- Node-RED 2.0 or newer
- ARC server 0.3+ (Socket.IO endpoint at
/ws) - Access to the ARC host (default
http://127.0.0.1:3000in development)
Installation
# Palette Manager (recommended)
node-red-contrib-escape-arc
# CLI
cd ~/.node-red
npm install node-red-contrib-escape-arc
Restart Node-RED after installing.
Quick start
- Drop an ARC Config node and set:
- Host:
127.0.0.1 - Port:
3000 - Path:
/ws
- Host:
- Add an ARC Timer, ARC State, or ARC Objective node. Pick the config created above and choose the room from the dropdown (or type the room id). Each node now stores its own room selection.
- Add an ARC Output node for actions. Choose the same config and room, then wire in a
changeorfunctionnode that populatesmsg.action. - Deploy. You should immediately see
timer.updated,story.state, etc. flowing into Node-RED. Send an action with:msg.action = { type: "send_message", targets: ["display-main"], format: "text", text: "Welcome team!", durationMs: 12000 }; return msg;
Nodes
| Node | Description |
|---|---|
| ARC-config | Socket.IO host/port/path shared by the other nodes. Fetches the room list for dropdowns. |
| ARC-input | Streams all ARC events (optionally filter by prefix such as timer or objective). |
| ARC-state | Emits room state transitions; choose which states to forward and whether to output RAW payloads. |
| ARC-timer | Emits either every N seconds (default 1s) or at configured thresholds. RAW mode forwards the original timer payload. |
| ARC-objective | Emits objective events (activate/complete/reset/fail) with optional objective id filter and RAW mode. |
| ARC-output | Sends ARC actions by room, or emits custom Socket.IO events. |
| ARC-boolean | Simple state filter with optional JSONata/JS expressions; choose between a single boolean output or match/no-match routing. |
All inbound nodes emit a normalized message similar to:
{
"event": "timer.updated",
"data": { "remainingSec": 1200, "elapsedSec": 600 },
"roomId": "ar",
"sessionId": "2024-09-23T17:05:00Z",
"ts": 1727111234000,
"roomTime": 1200,
"payload": { ... }
}
Output modes
- ARC action (default) – emit
arc.actionautomatically. Usemsg.action(ormsg.payload) with the ARC action schema. The node’s Room field is used unless you overridemsg.roomId. - Custom event – set
msg.eventandmsg.payloadto emit any Socket.IO event if you need lower-level control.
Testing
A lightweight Socket.IO test harness is included under test/test-ws-server.js:
cd node-red-contrib-escape-arc
node test/test-ws-server.js
It broadcasts timer.updated events and echoes actions so you can verify flows without a full ARC instance.
Changelog
- 0.4.2 - fix state outputs, restore 1s timer updates, persist state/boolean selections, add clearer node help/options, refresh the palette color (#189cd9), and make the Socket.IO path optional.
- 0.4.0 – per-node room selection, RAW toggles, dedicated timer/state/objective nodes, simplified output and boolean nodes.
- 0.3.0 – migrate to Socket.IO, new defaults (
/ws, port3000), simplified configuration, improved action sending. - 0.2.x – legacy WebSocket client.