node-red-contrib-unifi-ultimate 0.1.4 → 0.1.5

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 CHANGED
@@ -17,177 +17,152 @@
17
17
 
18
18
  # node-red-contrib-unifi-ultimate
19
19
 
20
- Build UniFi automations in Node-RED without hand-writing API calls.
20
+ Control and monitor `UniFi Network`, `UniFi Protect`, and `UniFi Access` from Node-RED without building API requests by hand.
21
21
 
22
22
  [View Changelog](CHANGELOG.md)
23
23
 
24
- ## At A Glance
24
+ ## Why Use It
25
25
 
26
- - one package for `UniFi Protect`, `UniFi Access`, and `UniFi Network`
27
- - device-first UX: pick item, then only compatible actions are shown
28
- - built-in live events for Protect and Access
29
- - utility nodes for Network presence and PoE control
30
- - import-ready example flows included
31
-
32
- ## Quick Navigation
33
-
34
- - [Install](#install)
35
- - [Quick Start](#quick-start)
36
- - [Available Nodes](#available-nodes)
37
- - [UniFi Protect](#unifi-protect)
38
- - [UniFi Access](#unifi-access)
39
- - [UniFi Network](#unifi-network)
40
- - [Outputs](#outputs)
41
- - [Example Flows](#example-flows)
42
- - [Project Status](#project-status)
26
+ - Manage UniFi cameras, sensors, doors, clients, switches, and PoE ports from Node-RED.
27
+ - Pick devices and clients from searchable lists instead of copying IDs manually.
28
+ - Trigger configured actions with any incoming message.
29
+ - Receive live events from Protect and Access.
30
+ - Build presence, door, camera, and PoE automations with less custom code.
31
+ - Use one package for the main UniFi applications.
43
32
 
44
33
  ## Install
45
34
 
46
35
  In Node-RED:
47
36
 
48
- 1. Open `Manage palette`
49
- 2. Select `Install`
50
- 3. Search for `node-red-contrib-unifi-ultimate`
51
- 4. Install the package
37
+ 1. Open `Manage palette`.
38
+ 2. Select `Install`.
39
+ 3. Search for `node-red-contrib-unifi-ultimate`.
40
+ 4. Install the package.
52
41
 
53
42
  ## Quick Start
54
43
 
55
- 1. Add a config node: `Unifi Protect Config`, `Unifi Access Config`, or `Unifi Network Config`
56
- 2. Enter host and credentials
57
- 3. Add a corresponding device node
58
- 4. Choose type, item, and action
59
- 5. Deploy
60
- 6. Wire outputs:
61
- Output 1 for state/action responses
62
- Output 2 for live events (when action is `Receive Events`)
44
+ 1. Add the config node for your UniFi application: `Unifi Network Config`, `Unifi Protect Config`, or `Unifi Access Config`.
45
+ 2. Enter the UniFi host/IP and API credentials.
46
+ 3. Add the matching device or utility node.
47
+ 4. Select the item to control or monitor.
48
+ 5. Select the action.
49
+ 6. Deploy.
50
+ 7. Send any message into the node to run the configured action.
63
51
 
64
- If you want the fastest path, import one of the flows from `examples/` and replace credentials.
52
+ The incoming message is only a trigger. The node uses the item and action configured in the editor.
65
53
 
66
54
  ## Available Nodes
67
55
 
68
- | Node | Purpose |
56
+ | Node | What it does |
69
57
  |---|---|
70
- | `Unifi Protect Config` | stores UniFi Protect connection settings |
71
- | `Unifi Protect Device` | reads state, receives events, and executes Protect actions |
72
- | `Unifi Access Config` | stores UniFi Access connection settings |
73
- | `Unifi Access Device` | reads state, receives events, and executes Access actions |
74
- | `Unifi Network Config` | stores UniFi Network connection settings |
75
- | `Unifi Network Device` | reads state/details and executes supported Network actions |
76
- | `Unifi Network Presence` | emits stable `true/false` presence for one client |
77
- | `Unifi Network Control POE` | enables/disables/cycles PoE on one switch port |
78
-
79
- ## UniFi Protect
80
-
81
- Supported device types:
82
-
83
- - `Camera`
84
- - `Sensor`
85
- - `Light`
86
- - `Chime`
87
- - `Viewer`
88
- - `Live View`
89
- - `NVR`
90
-
91
- Common capabilities:
58
+ | `Unifi Network Config` | Connection settings for UniFi Network |
59
+ | `Unifi Network Device` | Read sites, devices, clients, and run supported Network actions |
60
+ | `Unifi Network Presence` | Track whether a selected client is present |
61
+ | `Unifi Network Control POE` | Enable, disable, or power-cycle PoE on a switch port |
62
+ | `Unifi Protect Config` | Connection settings for UniFi Protect |
63
+ | `Unifi Protect Device` | Read cameras/sensors/devices, receive events, and run Protect actions |
64
+ | `Unifi Access Config` | Connection settings for UniFi Access |
65
+ | `Unifi Access Device` | Read doors/devices, receive events, and run Access actions |
92
66
 
93
- - `Receive Events`
94
- - `Read Device State`
95
- - `Send Raw Update`
96
-
97
- Additional capabilities (when supported by selected device):
98
-
99
- - `Take Snapshot`
100
- - `List RTSPS Streams`
101
- - `Create RTSPS Stream`
102
- - `Delete RTSPS Stream`
103
- - `Start Talkback Session`
104
- - `Disable Microphone Permanently`
105
- - `Start PTZ Patrol`
106
- - `Stop PTZ Patrol`
107
- - `Recall PTZ Preset`
108
- - `Show Doorbell Message`
109
- - `Switch Live View`
110
- - `Update One Property`
111
- - `Read Application Info` (NVR)
112
-
113
- Editor adaptation examples:
114
-
115
- - sensor observables: contact, motion, alarm, water leak, tamper, battery low, extreme values
116
- - camera observables: ring, motion, smart detections
117
- - PTZ preset selector only on PTZ-capable cameras
118
- - live view selector for viewers
119
- - patchable property discovery from selected device
120
-
121
- For supported observables, `msg.payload` can be normalized to `true/false`; raw context remains available in `msg.RAW`.
67
+ ## UniFi Network
122
68
 
123
- ## UniFi Access
69
+ <p align="center">
70
+ <a href="https://ui.com/switching">
71
+ <img src="nodes/readme-assets/unifi-network-switching.jpg" alt="UniFi Network switching" width="860">
72
+ </a>
73
+ </p>
124
74
 
125
- Supported device types:
75
+ Use Network nodes to work with:
126
76
 
127
- - `Door`
128
- - `Access Device`
77
+ - sites
78
+ - UniFi devices such as switches and access points
79
+ - clients such as phones, computers, and IoT devices
80
+ - switch ports
81
+ - PoE control
82
+ - client presence
129
83
 
130
- Common capabilities:
84
+ Common uses:
131
85
 
132
- - `Receive Events`
133
- - `Read State`
86
+ - Check whether a client is online.
87
+ - Restart a UniFi device.
88
+ - Power-cycle a PoE port.
89
+ - Turn PoE on or off for a selected switch port.
90
+ - Select a client and let the PoE node find the connected switch and port when the information is available.
134
91
 
135
- Door capabilities:
92
+ Editor conveniences:
136
93
 
137
- - `Unlock Door`
138
- - `Read Lock Rule`
139
- - `Set Temporary Lock Rule`
140
- - `Read Emergency Mode`
141
- - `Set Emergency Mode`
94
+ - Device and client fields are searchable.
95
+ - Port lists show port status and connected clients when UniFi exposes that information.
96
+ - Selecting an item updates the node `Name` automatically.
142
97
 
143
- Temporary lock rule UX:
98
+ ## UniFi Protect
144
99
 
145
- - selecting `Custom Duration` reveals minutes (`interval`)
146
- - legacy unix `ended_time` fallback is still supported for compatibility
100
+ <p align="center">
101
+ <a href="https://store.ui.com/us/en/products/uvc-g5-pro">
102
+ <img src="nodes/readme-assets/unifi-protect-camera.png" alt="UniFi Protect camera" width="520">
103
+ </a>
104
+ </p>
147
105
 
148
- Access device capabilities:
106
+ Use Protect nodes to work with:
149
107
 
150
- - `Read Access Methods`
151
- - `Update Access Methods`
152
- - `Trigger Doorbell`
153
- - `Cancel Doorbell`
108
+ - cameras
109
+ - sensors
110
+ - lights
111
+ - chimes
112
+ - viewers
113
+ - live views
114
+ - NVR information
154
115
 
155
- When using `Receive Events`, the node fetches current state once and then listens to official Access notifications.
116
+ Common uses:
156
117
 
157
- ## UniFi Network
118
+ - Receive motion, ring, contact, tamper, leak, and battery events.
119
+ - Read the current state of a camera or sensor.
120
+ - Take camera snapshots.
121
+ - Control PTZ cameras.
122
+ - Show doorbell messages.
123
+ - Switch viewer live views.
124
+ - Update supported device properties.
158
125
 
159
- Supported resource types:
126
+ For supported observables, the node can output simple `true/false` values while still keeping the raw UniFi event details available.
160
127
 
161
- - `Site`
162
- - `UniFi Device`
163
- - `Client`
128
+ ## UniFi Access
164
129
 
165
- Common capabilities:
130
+ <p align="center">
131
+ <a href="https://ui.com/door-access">
132
+ <img src="nodes/readme-assets/unifi-access-door-access.jpg" alt="UniFi Access door access" width="860">
133
+ </a>
134
+ </p>
166
135
 
167
- - `Read State`
168
- - `Read Details`
136
+ Use Access nodes to work with:
169
137
 
170
- Additional capabilities:
138
+ - doors
139
+ - Access devices
140
+ - door events
141
+ - lock rules
142
+ - emergency mode
143
+ - doorbell actions
171
144
 
172
- - Site: `Read Application Info`, `List Site Devices`, `List Site Clients`
173
- - UniFi Device: `Read Latest Statistics`, `Restart Device`, `Power Cycle Port`
174
- - Client: `Authorize Guest Access`, `Revoke Guest Access`
145
+ Common uses:
175
146
 
176
- Notes:
147
+ - Unlock a door.
148
+ - Read or set a temporary lock rule.
149
+ - Enable lockdown or evacuation mode.
150
+ - Receive Access events.
151
+ - Trigger or cancel an intercom doorbell action.
177
152
 
178
- - for device/client resources, site context is handled automatically behind the scenes
179
- - `Read Application Info` is available on `Site` and returns Network application metadata
153
+ ## Outputs
180
154
 
181
- Dedicated utility nodes:
155
+ Most nodes send the result on output 1.
182
156
 
183
- - `Unifi Network Presence`: stable presence with disconnect hysteresis
184
- - `Unifi Network Control POE`: enable, disable, or cycle PoE on one selected port
157
+ Protect and Access device nodes can also send live events on output 2 when `Receive Events` is selected.
185
158
 
186
- ## Outputs
159
+ Useful metadata is attached to the output message, for example:
187
160
 
188
- - Output 1: current state or action response
189
- - Output 2: live events when capability is `Receive Events` (Protect and Access)
190
- - Metadata is attached via product-specific fields (`msg.unifiProtect`, `msg.unifiAccess`, `msg.unifiNetwork`)
161
+ - `msg.unifiNetwork`
162
+ - `msg.unifiNetworkPresence`
163
+ - `msg.unifiNetworkPoe`
164
+ - `msg.unifiProtect`
165
+ - `msg.unifiAccess`
191
166
 
192
167
  ## Example Flows
193
168
 
@@ -195,17 +170,18 @@ Import from `examples/`:
195
170
 
196
171
  | Flow file | What it demonstrates |
197
172
  |---|---|
198
- | [examples/unifi-protect-info.json](examples/unifi-protect-info.json) | read Protect camera state |
199
- | [examples/unifi-protect-sensor-observe.json](examples/unifi-protect-sensor-observe.json) | boolean sensor observable stream |
200
- | [examples/unifi-protect-camera-actions.json](examples/unifi-protect-camera-actions.json) | snapshot, PTZ presets, doorbell messages |
201
- | [examples/unifi-access-door-control.json](examples/unifi-access-door-control.json) | door observe, unlock, temporary lock rule |
202
- | [examples/unifi-access-intercom-doorbell.json](examples/unifi-access-intercom-doorbell.json) | intercom observe, trigger/cancel doorbell safely |
203
-
204
- ## Project Status
205
-
206
- - UniFi Protect is currently the most complete surface
207
- - UniFi Access is stable but may evolve quickly in upcoming releases
208
- - UniFi Network currently focuses on read-first flows plus selected action utilities
173
+ | [examples/unifi-protect-info.json](examples/unifi-protect-info.json) | Read Protect camera state |
174
+ | [examples/unifi-protect-sensor-observe.json](examples/unifi-protect-sensor-observe.json) | Receive boolean sensor events |
175
+ | [examples/unifi-protect-camera-actions.json](examples/unifi-protect-camera-actions.json) | Snapshot, PTZ presets, and doorbell messages |
176
+ | [examples/unifi-access-door-control.json](examples/unifi-access-door-control.json) | Door state, unlock, and temporary lock rule |
177
+ | [examples/unifi-access-intercom-doorbell.json](examples/unifi-access-intercom-doorbell.json) | Intercom observe, trigger, and cancel doorbell |
178
+
179
+ ## Notes
180
+
181
+ - You need valid API credentials for the UniFi application you want to use.
182
+ - Some actions depend on what the selected UniFi device supports.
183
+ - UniFi API behavior can vary between application versions.
184
+ - For safety, actions exposed by the nodes are intentionally limited to known supported operations.
209
185
 
210
186
  [npm-version-image]: https://img.shields.io/npm/v/node-red-contrib-unifi-ultimate.svg
211
187
  [npm-url]: https://www.npmjs.com/package/node-red-contrib-unifi-ultimate
@@ -1,11 +1,57 @@
1
1
  <style>
2
+ .unifi-ultimate-hero {
3
+ margin: 0 0 14px 0;
4
+ }
5
+
6
+ .unifi-ultimate-hero-panel {
7
+ padding: 14px 16px;
8
+ border: 1px solid #d9e7f5;
9
+ border-radius: 14px;
10
+ background: linear-gradient(135deg, #eef7ff 0%, #f8fbff 58%, #f7fafc 100%);
11
+ box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
12
+ color: #334155;
13
+ }
14
+
15
+ .unifi-ultimate-eyebrow {
16
+ margin-bottom: 4px;
17
+ color: #2563eb;
18
+ font-size: 11px;
19
+ font-weight: 700;
20
+ letter-spacing: 0.08em;
21
+ text-transform: uppercase;
22
+ }
23
+
24
+ .unifi-ultimate-hero-panel strong {
25
+ display: block;
26
+ color: #0f172a;
27
+ font-size: 15px;
28
+ line-height: 1.35;
29
+ }
30
+
31
+ .unifi-ultimate-hero-panel span {
32
+ display: block;
33
+ margin-top: 4px;
34
+ line-height: 1.45;
35
+ }
36
+
37
+ .unifi-ultimate-section-title {
38
+ margin: 14px 0 8px 150px;
39
+ color: #64748b;
40
+ font-size: 11px;
41
+ font-weight: 700;
42
+ letter-spacing: 0.08em;
43
+ text-transform: uppercase;
44
+ }
45
+
2
46
  .unifi-ultimate-card {
3
47
  margin-left: 150px;
4
- padding: 12px 14px;
5
- border-radius: 12px;
6
- background: #f5f7fa;
48
+ padding: 13px 15px;
49
+ border: 1px solid #e2e8f0;
50
+ border-radius: 14px;
51
+ background: #f8fafc;
7
52
  color: #334155;
8
53
  line-height: 1.45;
54
+ box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
9
55
  }
10
56
 
11
57
  .unifi-ultimate-card strong {
@@ -16,8 +62,8 @@
16
62
  }
17
63
 
18
64
  .unifi-ultimate-advanced {
19
- margin-top: 4px;
20
- padding-top: 4px;
65
+ margin-top: 14px;
66
+ padding-top: 10px;
21
67
  border-top: 1px solid #e5e7eb;
22
68
  }
23
69
 
@@ -89,6 +135,14 @@
89
135
  </script>
90
136
 
91
137
  <script type="text/html" data-template-name="unifi-access-config">
138
+ <div class="form-row unifi-ultimate-hero">
139
+ <div class="unifi-ultimate-hero-panel">
140
+ <div class="unifi-ultimate-eyebrow">UniFi Access Connection</div>
141
+ <strong>Connect Node-RED to your UniFi Access application.</strong>
142
+ <span>Use the Access host or IP address and an Access API token.</span>
143
+ </div>
144
+ </div>
145
+ <div class="unifi-ultimate-section-title">Connection</div>
92
146
  <div class="form-row">
93
147
  <label for="node-config-input-host"><i class="fa fa-globe"></i> Controller</label>
94
148
  <input type="text" id="node-config-input-host" placeholder="192.168.1.10 or access.local:12445">
@@ -107,16 +161,21 @@
107
161
  </div>
108
162
  <div id="node-config-row-advanced" class="unifi-ultimate-advanced">
109
163
  <div class="form-row">
110
- <label for="node-config-input-name"><i class="fa fa-tag"></i> Label</label>
111
- <input type="text" id="node-config-input-name" placeholder="Optional custom label">
164
+ <label for="node-config-input-name"><i class="fa fa-tag"></i> Name</label>
165
+ <input type="text" id="node-config-input-name" placeholder="Node name">
112
166
  </div>
113
167
  </div>
114
168
  </script>
115
169
 
116
170
  <script type="text/html" data-help-name="unifi-access-config">
117
- <p>Connects the node to your UniFi Access controller.</p>
171
+ <p>Shared connection for UniFi Access nodes.</p>
172
+
173
+ <h3>Configuration</h3>
118
174
  <p><b>Controller</b> accepts the UniFi Access host or <code>host:port</code>. If you omit the port, the node uses the default UniFi Access port automatically.</p>
119
175
  <p><b>API Token</b> is the bearer token used for authentication.</p>
120
176
  <p><b>Security</b> controls certificate verification. Disable it only when your controller uses a self-signed certificate.</p>
121
- <p><b>Label</b> is optional and only changes how the config node is shown in the editor.</p>
177
+ <p><b>Name</b> is the config node name shown in the editor.</p>
178
+
179
+ <h3>Usage</h3>
180
+ <p>This config node is used by UniFi Access Device nodes for API requests and live notification events.</p>
122
181
  </script>