node-red-contrib-alarm-ultimate 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -0
- package/examples/README.md +93 -3
- package/examples/alarm-ultimate-basic.json +0 -1
- package/examples/alarm-ultimate-dashboard-controls.json +34 -4
- package/examples/alarm-ultimate-dashboard-v2.json +834 -0
- package/examples/alarm-ultimate-dashboard.json +34 -5
- package/examples/alarm-ultimate-home-assistant-alarm-panel.json +335 -0
- package/flowfuse-node-red-dashboard-1.30.2.tgz +0 -0
- package/nodes/AlarmSystemUltimate.html +332 -105
- package/nodes/AlarmSystemUltimate.js +158 -12
- package/nodes/AlarmUltimateInputAdapter.html +304 -0
- package/nodes/AlarmUltimateInputAdapter.js +188 -0
- package/nodes/AlarmUltimateZone.html +2 -2
- package/nodes/AlarmUltimateZone.js +6 -3
- package/nodes/presets/input-adapter/ax-pro-hikvision-ultimate.js +34 -0
- package/nodes/presets/input-adapter/boolean-from-payload.js +10 -0
- package/nodes/presets/input-adapter/ha-on-off.js +24 -0
- package/nodes/presets/input-adapter/knx-ultimate.js +29 -0
- package/nodes/presets/input-adapter/passthrough.js +7 -0
- package/package.json +4 -3
- package/test/alarm-system.spec.js +112 -0
- package/test/input-adapter.spec.js +243 -0
- package/test/output-nodes.spec.js +3 -0
- package/tools/alarm-json-mapper.html +955 -167
- package/tools/alarm-panel.html +995 -139
package/README.md
CHANGED
|
@@ -16,6 +16,7 @@ Alarm System Ultimate nodes + web panel for Node-RED.
|
|
|
16
16
|
Includes:
|
|
17
17
|
|
|
18
18
|
- `AlarmSystemUltimate` (BETA): full alarm control panel node (zones, entry/exit delays, bypass, chime, 24h/fire/tamper, siren, event log).
|
|
19
|
+
- `AlarmUltimateInputAdapter`: translates incoming messages into zone messages for `AlarmSystemUltimate` using built-in or user-defined presets.
|
|
19
20
|
- Output-only helper nodes: `AlarmUltimateState`, `AlarmUltimateZone`, `AlarmUltimateSiren`.
|
|
20
21
|
- Web tools: Zones JSON mapper + web Alarm Panel (embeddable in Node-RED Dashboard).
|
|
21
22
|
|
|
@@ -73,6 +74,13 @@ These nodes have no input and emit the current Alarm state (and changes) for one
|
|
|
73
74
|
- `Alarm Zone` (`AlarmUltimateZone`): `msg.payload = true|false` for a selected zone
|
|
74
75
|
- `Alarm Siren` (`AlarmUltimateSiren`): `msg.payload = true|false` when the siren is on/off
|
|
75
76
|
|
|
77
|
+
### Input Adapter
|
|
78
|
+
|
|
79
|
+
`AlarmUltimateInputAdapter` translates incoming messages (from arbitrary sources) into the format expected by the Alarm zones.
|
|
80
|
+
|
|
81
|
+
- Built-in presets are shipped with the package.
|
|
82
|
+
- A single user preset (custom JavaScript) can be created/edited inside the node and is stored in the node configuration.
|
|
83
|
+
|
|
76
84
|
## Web tools
|
|
77
85
|
|
|
78
86
|
These pages are served via the Node-RED admin HTTP endpoint:
|
|
@@ -84,6 +92,7 @@ The Alarm Panel supports:
|
|
|
84
92
|
|
|
85
93
|
- Preselect node: `/alarm-ultimate/alarm-panel?id=<alarmNodeId>`
|
|
86
94
|
- Embed mode (for Dashboard iframes): `/alarm-ultimate/alarm-panel?embed=1&id=<alarmNodeId>`
|
|
95
|
+
- Views: `view=keypad`, `view=zones`, `view=log` (e.g. `/alarm-ultimate/alarm-panel?embed=1&view=log&id=<alarmNodeId>`)
|
|
87
96
|
|
|
88
97
|
The Zones JSON Mapper supports:
|
|
89
98
|
|
|
@@ -95,6 +104,8 @@ The Zones JSON Mapper supports:
|
|
|
95
104
|
- `examples/alarm-ultimate-basic.json`: ready-to-import flow with `AlarmSystemUltimate`, injects and debug nodes.
|
|
96
105
|
- `examples/alarm-ultimate-dashboard.json`: Node-RED Dashboard example embedding the Alarm Panel in a `ui_template` iframe.
|
|
97
106
|
- `examples/alarm-ultimate-dashboard-controls.json`: Node-RED Dashboard example with the embedded panel plus command buttons (and a small sensor simulator).
|
|
107
|
+
- `examples/alarm-ultimate-dashboard-v2.json`: Dashboard 2.0 example for `@flowfuse/node-red-dashboard` (Alarm Panel + basic controls + status).
|
|
108
|
+
- `examples/alarm-ultimate-home-assistant-alarm-panel.json`: Home Assistant Add-on example (no MQTT) using the HA Alarm Panel card + `AlarmUltimateInputAdapter`.
|
|
98
109
|
|
|
99
110
|
See `examples/README.md`.
|
|
100
111
|
|
|
@@ -112,11 +123,14 @@ When Node-RED authentication is enabled, the admin endpoints use these permissio
|
|
|
112
123
|
|
|
113
124
|
- `AlarmSystemUltimate.read`
|
|
114
125
|
- `AlarmSystemUltimate.write`
|
|
126
|
+
- `AlarmUltimateInputAdapter.read`
|
|
115
127
|
|
|
116
128
|
HTTP admin endpoints:
|
|
117
129
|
|
|
118
130
|
- `GET /alarm-ultimate/alarm/nodes`
|
|
119
131
|
- `GET /alarm-ultimate/alarm/:id/state`
|
|
132
|
+
- `GET /alarm-ultimate/alarm/:id/log`
|
|
133
|
+
- `GET /alarm-ultimate/input-adapter/presets`
|
|
120
134
|
- `POST /alarm-ultimate/alarm/:id/command`
|
|
121
135
|
- `GET /alarm-ultimate/alarm-json-mapper`
|
|
122
136
|
- `GET /alarm-ultimate/alarm-panel`
|
package/examples/README.md
CHANGED
|
@@ -12,13 +12,18 @@ This flow includes:
|
|
|
12
12
|
- Inject nodes for arm/disarm, bypass, sensor open/close
|
|
13
13
|
- Output-only nodes (`Alarm State`, `Alarm Zone`, `Alarm Siren`) connected to debug
|
|
14
14
|
|
|
15
|
+
Notes:
|
|
16
|
+
|
|
17
|
+
- The old Alarm “Translator” option has been removed. If you need to translate incoming device messages, use the `AlarmUltimateInputAdapter` node.
|
|
18
|
+
- Zones can be edited from the Alarm node editor via the “Manage zones” button (opens the `alarm-json-mapper` tool).
|
|
19
|
+
|
|
15
20
|
## Dashboard (node-red-dashboard)
|
|
16
21
|
|
|
17
22
|
Import `examples/alarm-ultimate-dashboard.json`.
|
|
18
23
|
|
|
19
24
|
- Requires `node-red-dashboard` installed (`ui_*` nodes).
|
|
20
|
-
- The widget uses an iframe pointing to
|
|
21
|
-
-
|
|
25
|
+
- The widget uses an iframe pointing to `../alarm-ultimate/alarm-panel?embed=1&id=<alarmNodeId>` (escapes the Dashboard path like `/ui`).
|
|
26
|
+
- The embedded panel supports `view=keypad`, `view=zones`, and `view=log`.
|
|
22
27
|
|
|
23
28
|
### Dashboard + commands (panel + controls)
|
|
24
29
|
|
|
@@ -26,4 +31,89 @@ Import `examples/alarm-ultimate-dashboard-controls.json`.
|
|
|
26
31
|
|
|
27
32
|
- Includes the panel (iframe) + Dashboard buttons for `arm`, `disarm`, `status`, `list_open_zones`, `siren_on/off`, `panic`.
|
|
28
33
|
- Also includes a small “sensor simulator” (buttons that send `true/false` on `sensor/frontdoor` and `sensor/living_pir`).
|
|
29
|
-
- The iframe uses a
|
|
34
|
+
- The iframe uses a _relative_ URL that escapes the Dashboard path (`../alarm-ultimate/...`) so it works even when Node-RED is served under a path prefix (e.g. Home Assistant Ingress).
|
|
35
|
+
- The embedded panel supports `view=keypad`, `view=zones`, and `view=log` (useful to show a user-facing event log).
|
|
36
|
+
|
|
37
|
+
## Dashboard V2 (FlowFuse / @flowfuse/node-red-dashboard)
|
|
38
|
+
|
|
39
|
+
Import `examples/alarm-ultimate-dashboard-v2.json`.
|
|
40
|
+
|
|
41
|
+
- Requires `@flowfuse/node-red-dashboard` installed (`ui-*` nodes).
|
|
42
|
+
- Embeds the Alarm Panel via a Dashboard 2.0 `ui-template` (Vue SFC) iframe.
|
|
43
|
+
- Includes basic command buttons (`arm`, `disarm`, `status`), a small sensor simulator, and two status widgets (`AlarmUltimateState`, `AlarmUltimateSiren` → `ui-text`).
|
|
44
|
+
|
|
45
|
+
## Home Assistant (Alarm Panel card, no MQTT)
|
|
46
|
+
|
|
47
|
+
If you run Node-RED as the Home Assistant Add-on and you want to use the standard Home Assistant Alarm Panel card, import:
|
|
48
|
+
|
|
49
|
+
- `examples/alarm-ultimate-home-assistant-alarm-panel.json`
|
|
50
|
+
|
|
51
|
+
This example:
|
|
52
|
+
|
|
53
|
+
- Maps `binary_sensor.*` state changes (`"on"/"off"`) into Alarm zones using `AlarmUltimateInputAdapter` (built-in preset: **Home Assistant on/off**).
|
|
54
|
+
- Receives arm/disarm commands from a Home Assistant Template Alarm Control Panel via the `alarm_ultimate_command` event.
|
|
55
|
+
- Mirrors Alarm events back into Home Assistant by updating `input_select.alarm_ultimate_state`.
|
|
56
|
+
|
|
57
|
+
### Setup steps
|
|
58
|
+
|
|
59
|
+
1. **Install prerequisites**
|
|
60
|
+
- In Home Assistant, ensure the Node-RED Add-on is installed and running.
|
|
61
|
+
- In Node-RED, ensure `node-red-contrib-home-assistant-websocket` nodes are available.
|
|
62
|
+
|
|
63
|
+
2. **Create the helper entity in Home Assistant**
|
|
64
|
+
|
|
65
|
+
Add this to your `configuration.yaml` (or a `template:`/`input_select:` include), then restart Home Assistant:
|
|
66
|
+
|
|
67
|
+
```yaml
|
|
68
|
+
input_select:
|
|
69
|
+
alarm_ultimate_state:
|
|
70
|
+
name: Alarm Ultimate state
|
|
71
|
+
options:
|
|
72
|
+
- disarmed
|
|
73
|
+
- arming
|
|
74
|
+
- armed_away
|
|
75
|
+
- armed_home
|
|
76
|
+
- pending
|
|
77
|
+
- triggered
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
3. **Create the Template Alarm Control Panel**
|
|
81
|
+
|
|
82
|
+
This exposes an `alarm_control_panel` entity that the standard Home Assistant “Alarm Panel” dashboard card can use.
|
|
83
|
+
|
|
84
|
+
```yaml
|
|
85
|
+
template:
|
|
86
|
+
- alarm_control_panel:
|
|
87
|
+
- name: "Alarm Ultimate"
|
|
88
|
+
unique_id: alarm_ultimate
|
|
89
|
+
state: "{{ states('input_select.alarm_ultimate_state') }}"
|
|
90
|
+
code_format: no_code
|
|
91
|
+
arm_away:
|
|
92
|
+
- event: alarm_ultimate_command
|
|
93
|
+
event_data:
|
|
94
|
+
action: arm_away
|
|
95
|
+
arm_home:
|
|
96
|
+
- event: alarm_ultimate_command
|
|
97
|
+
event_data:
|
|
98
|
+
action: arm_home
|
|
99
|
+
disarm:
|
|
100
|
+
- event: alarm_ultimate_command
|
|
101
|
+
event_data:
|
|
102
|
+
action: disarm
|
|
103
|
+
trigger:
|
|
104
|
+
- event: alarm_ultimate_command
|
|
105
|
+
event_data:
|
|
106
|
+
action: trigger
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
4. **Import and configure the Node-RED flow**
|
|
110
|
+
- Import `examples/alarm-ultimate-home-assistant-alarm-panel.json`.
|
|
111
|
+
- Open the Home Assistant server config node in the flow and ensure it’s set for the Add-on (default in the example).
|
|
112
|
+
- Edit the `server-state-changed` node to match your real sensors (replace the example `binary_sensor.*` entity ids).
|
|
113
|
+
- In the `AlarmSystemUltimate` node, set each zone `topic` to the matching Home Assistant entity id (same strings as above).
|
|
114
|
+
|
|
115
|
+
5. **Add the Home Assistant dashboard card**
|
|
116
|
+
- Add the built-in “Alarm panel” card and select the entity `alarm_control_panel.alarm_ultimate`.
|
|
117
|
+
|
|
118
|
+
Notes:
|
|
119
|
+
- This integration uses a single Alarm “armed” state internally. The example maps `arm_home`/`arm_away` to HA states (`armed_home`/`armed_away`) for the UI by remembering the last requested arm mode.
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"type": "comment",
|
|
12
12
|
"z": "b81f9a4b2f9c1a10",
|
|
13
13
|
"name": "Requires node-red-dashboard",
|
|
14
|
-
"info": "Install `node-red-dashboard`, then import this flow.\n\nThe iframe uses a *relative* URL so it works even if Node-RED is hosted under a path prefix (eg Home Assistant Ingress).\nIf you changed `httpAdminRoot` / `httpRoot`, adjust the iframe URL accordingly.\n\nTip: Open the panel directly at `alarm-ultimate/alarm-panel?id=<alarmNodeId>` to test outside Dashboard.",
|
|
14
|
+
"info": "Install `node-red-dashboard`, then import this flow.\n\nThe iframe uses a *relative* URL that escapes the `/ui` path (`../alarm-ultimate/...`), so it works even if Node-RED is hosted under a path prefix (eg Home Assistant Ingress).\nIf you changed `httpAdminRoot` / `httpRoot`, adjust the iframe URL accordingly.\n\nTip: Open the panel directly at `alarm-ultimate/alarm-panel?id=<alarmNodeId>` to test outside Dashboard.",
|
|
15
15
|
"x": 250,
|
|
16
16
|
"y": 60,
|
|
17
17
|
"wires": []
|
|
@@ -57,6 +57,17 @@
|
|
|
57
57
|
"collapse": false,
|
|
58
58
|
"className": ""
|
|
59
59
|
},
|
|
60
|
+
{
|
|
61
|
+
"id": "d4c3c4e5f6078893",
|
|
62
|
+
"type": "ui_group",
|
|
63
|
+
"name": "Log",
|
|
64
|
+
"tab": "d9078c5d2b1a4f30",
|
|
65
|
+
"order": 4,
|
|
66
|
+
"disp": true,
|
|
67
|
+
"width": "12",
|
|
68
|
+
"collapse": false,
|
|
69
|
+
"className": ""
|
|
70
|
+
},
|
|
60
71
|
{
|
|
61
72
|
"id": "d0c1b2a3f4e50617",
|
|
62
73
|
"type": "AlarmSystemUltimate",
|
|
@@ -64,7 +75,6 @@
|
|
|
64
75
|
"name": "Home Alarm",
|
|
65
76
|
"controlTopic": "alarm",
|
|
66
77
|
"payloadPropName": "payload",
|
|
67
|
-
"translatorConfig": "",
|
|
68
78
|
"persistState": true,
|
|
69
79
|
"requireCodeForArm": false,
|
|
70
80
|
"requireCodeForDisarm": false,
|
|
@@ -116,12 +126,32 @@
|
|
|
116
126
|
"order": 1,
|
|
117
127
|
"width": "12",
|
|
118
128
|
"height": "18",
|
|
119
|
-
"format": "<iframe src=\"alarm-ultimate/alarm-panel?embed=1&id=d0c1b2a3f4e50617\" style=\"width:100%; height:720px; border:0; border-radius:10px;\"></iframe>",
|
|
129
|
+
"format": "<iframe src=\"../alarm-ultimate/alarm-panel?embed=1&id=d0c1b2a3f4e50617\" style=\"width:100%; height:720px; border:0; border-radius:10px;\"></iframe>",
|
|
120
130
|
"storeOutMessages": false,
|
|
121
131
|
"fwdInMessages": false,
|
|
122
132
|
"resendOnRefresh": true,
|
|
123
133
|
"templateScope": "local",
|
|
124
|
-
"className": ""
|
|
134
|
+
"className": "",
|
|
135
|
+
"x": 520,
|
|
136
|
+
"y": 180
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"id": "e1f2a3b4c5d60719",
|
|
140
|
+
"type": "ui_template",
|
|
141
|
+
"z": "b81f9a4b2f9c1a10",
|
|
142
|
+
"group": "d4c3c4e5f6078893",
|
|
143
|
+
"name": "Alarm Log (embed)",
|
|
144
|
+
"order": 1,
|
|
145
|
+
"width": "12",
|
|
146
|
+
"height": "10",
|
|
147
|
+
"format": "<iframe src=\"../alarm-ultimate/alarm-panel?embed=1&view=log&id=d0c1b2a3f4e50617\" style=\"width:100%; height:420px; border:0; border-radius:10px;\"></iframe>",
|
|
148
|
+
"storeOutMessages": false,
|
|
149
|
+
"fwdInMessages": false,
|
|
150
|
+
"resendOnRefresh": true,
|
|
151
|
+
"templateScope": "local",
|
|
152
|
+
"className": "",
|
|
153
|
+
"x": 520,
|
|
154
|
+
"y": 240
|
|
125
155
|
},
|
|
126
156
|
{
|
|
127
157
|
"id": "c44ac2b6af1a1e20",
|