node-red-contrib-unifi-ultimate 0.1.0 → 0.1.2
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 +108 -68
- package/nodes/icons/readme-overview.svg +96 -0
- package/nodes/icons/unifi-ultimate-logo-minimal.svg +40 -0
- package/nodes/icons/unifi-ultimate-logo-tech.svg +57 -0
- package/nodes/icons/unifi-ultimate-logo.svg +40 -29
- package/nodes/unifi-access-device.html +21 -0
- package/nodes/unifi-network-device.html +6 -1
- package/nodes/unifi-protect-device.html +6 -1
- package/nodes/utils/unifi-access-device-registry.js +65 -5
- package/nodes/utils/unifi-network-device-registry.js +8 -0
- package/nodes/utils/unifi-protect-device-registry.js +23 -1
- package/nodes/utils/unifi-protect-field-metadata.js +5 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,29 +2,44 @@
|
|
|
2
2
|
<img src="nodes/icons/unifi-ultimate-logo.svg" alt="Unifi Ultimate" width="720">
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
<p align="center">
|
|
6
|
+
<img src="nodes/icons/readme-overview.svg" alt="Overview of Node-RED UniFi Ultimate architecture" width="980">
|
|
7
|
+
</p>
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
[![NPM version][npm-version-image]][npm-url]
|
|
10
|
+
[![Node.js version][node-version-image]][npm-url]
|
|
11
|
+
[![Node-RED Flow Library][flows-image]][flows-url]
|
|
12
|
+
[![Docs][docs-image]][docs-url]
|
|
13
|
+
[![NPM downloads per month][npm-downloads-month-image]][npm-url]
|
|
14
|
+
[![NPM downloads total][npm-downloads-total-image]][npm-url]
|
|
15
|
+
[![MIT License][license-image]][license-url]
|
|
16
|
+
[![Youtube][youtube-image]][youtube-url]
|
|
10
17
|
|
|
11
|
-
-
|
|
12
|
-
- react to live events inside your flows
|
|
13
|
-
- trigger common Protect, Access, and Network actions from a single device node
|
|
14
|
-
- start from ready-to-import example flows
|
|
18
|
+
# node-red-contrib-unifi-ultimate
|
|
15
19
|
|
|
16
|
-
|
|
20
|
+
Build UniFi automations in Node-RED without hand-writing API calls.
|
|
17
21
|
|
|
18
22
|
[View Changelog](CHANGELOG.md)
|
|
19
23
|
|
|
20
|
-
##
|
|
24
|
+
## At A Glance
|
|
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
|
|
21
31
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
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)
|
|
28
43
|
|
|
29
44
|
## Install
|
|
30
45
|
|
|
@@ -35,30 +50,31 @@ In Node-RED:
|
|
|
35
50
|
3. Search for `node-red-contrib-unifi-ultimate`
|
|
36
51
|
4. Install the package
|
|
37
52
|
|
|
38
|
-
## Quick
|
|
53
|
+
## Quick Start
|
|
39
54
|
|
|
40
|
-
1. Add
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
4. Select the device type, the specific UniFi device, and the capability you want
|
|
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
|
|
45
59
|
5. Deploy
|
|
46
|
-
6.
|
|
47
|
-
Output 1 for state
|
|
48
|
-
Output 2 for live events when
|
|
60
|
+
6. Wire outputs:
|
|
61
|
+
Output 1 for state/action responses
|
|
62
|
+
Output 2 for live events (when action is `Receive Events`)
|
|
49
63
|
|
|
50
|
-
If you want the fastest path, import one of the
|
|
64
|
+
If you want the fastest path, import one of the flows from `examples/` and replace credentials.
|
|
51
65
|
|
|
52
|
-
## Available
|
|
66
|
+
## Available Nodes
|
|
53
67
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
68
|
+
| Node | Purpose |
|
|
69
|
+
|---|---|
|
|
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 |
|
|
62
78
|
|
|
63
79
|
## UniFi Protect
|
|
64
80
|
|
|
@@ -78,7 +94,7 @@ Common capabilities:
|
|
|
78
94
|
- `Read Device State`
|
|
79
95
|
- `Send Raw Update`
|
|
80
96
|
|
|
81
|
-
Additional capabilities
|
|
97
|
+
Additional capabilities (when supported by selected device):
|
|
82
98
|
|
|
83
99
|
- `Take Snapshot`
|
|
84
100
|
- `List RTSPS Streams`
|
|
@@ -92,17 +108,17 @@ Additional capabilities available when supported by the selected device:
|
|
|
92
108
|
- `Show Doorbell Message`
|
|
93
109
|
- `Switch Live View`
|
|
94
110
|
- `Update One Property`
|
|
111
|
+
- `Read Application Info` (NVR)
|
|
95
112
|
|
|
96
|
-
|
|
113
|
+
Editor adaptation examples:
|
|
97
114
|
|
|
98
|
-
- sensor observables
|
|
99
|
-
- camera observables
|
|
100
|
-
-
|
|
101
|
-
-
|
|
102
|
-
-
|
|
103
|
-
- patchable properties discovered from the selected device
|
|
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
|
|
104
120
|
|
|
105
|
-
For supported
|
|
121
|
+
For supported observables, `msg.payload` can be normalized to `true/false`; raw context remains available in `msg.RAW`.
|
|
106
122
|
|
|
107
123
|
## UniFi Access
|
|
108
124
|
|
|
@@ -124,6 +140,11 @@ Door capabilities:
|
|
|
124
140
|
- `Read Emergency Mode`
|
|
125
141
|
- `Set Emergency Mode`
|
|
126
142
|
|
|
143
|
+
Temporary lock rule UX:
|
|
144
|
+
|
|
145
|
+
- selecting `Custom Duration` reveals minutes (`interval`)
|
|
146
|
+
- legacy unix `ended_time` fallback is still supported for compatibility
|
|
147
|
+
|
|
127
148
|
Access device capabilities:
|
|
128
149
|
|
|
129
150
|
- `Read Access Methods`
|
|
@@ -131,7 +152,7 @@ Access device capabilities:
|
|
|
131
152
|
- `Trigger Doorbell`
|
|
132
153
|
- `Cancel Doorbell`
|
|
133
154
|
|
|
134
|
-
When
|
|
155
|
+
When using `Receive Events`, the node fetches current state once and then listens to official Access notifications.
|
|
135
156
|
|
|
136
157
|
## UniFi Network
|
|
137
158
|
|
|
@@ -148,35 +169,54 @@ Common capabilities:
|
|
|
148
169
|
|
|
149
170
|
Additional capabilities:
|
|
150
171
|
|
|
151
|
-
- Site: `List Site Devices`, `List Site Clients`
|
|
172
|
+
- Site: `Read Application Info`, `List Site Devices`, `List Site Clients`
|
|
152
173
|
- UniFi Device: `Read Latest Statistics`, `Restart Device`, `Power Cycle Port`
|
|
153
174
|
- Client: `Authorize Guest Access`, `Revoke Guest Access`
|
|
154
175
|
|
|
155
|
-
|
|
176
|
+
Notes:
|
|
177
|
+
|
|
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
|
|
156
180
|
|
|
157
181
|
Dedicated utility nodes:
|
|
158
182
|
|
|
159
|
-
- `Unifi Network Presence`:
|
|
160
|
-
- `Unifi Network Control POE`:
|
|
183
|
+
- `Unifi Network Presence`: stable presence with disconnect hysteresis
|
|
184
|
+
- `Unifi Network Control POE`: enable, disable, or cycle PoE on one selected port
|
|
161
185
|
|
|
162
186
|
## Outputs
|
|
163
187
|
|
|
164
|
-
- Output 1
|
|
165
|
-
- Output 2
|
|
166
|
-
-
|
|
167
|
-
|
|
168
|
-
## Example
|
|
169
|
-
|
|
170
|
-
Import
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
- UniFi
|
|
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`)
|
|
191
|
+
|
|
192
|
+
## Example Flows
|
|
193
|
+
|
|
194
|
+
Import from `examples/`:
|
|
195
|
+
|
|
196
|
+
| Flow file | What it demonstrates |
|
|
197
|
+
|---|---|
|
|
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
|
|
209
|
+
|
|
210
|
+
[npm-version-image]: https://img.shields.io/npm/v/node-red-contrib-unifi-ultimate.svg
|
|
211
|
+
[npm-url]: https://www.npmjs.com/package/node-red-contrib-unifi-ultimate
|
|
212
|
+
[node-version-image]: https://img.shields.io/node/v/node-red-contrib-unifi-ultimate.svg
|
|
213
|
+
[flows-image]: https://img.shields.io/badge/Node--RED-Flow%20Library-red
|
|
214
|
+
[flows-url]: https://flows.nodered.org/node/node-red-contrib-unifi-ultimate
|
|
215
|
+
[docs-image]: https://img.shields.io/badge/docs-documents-blue
|
|
216
|
+
[docs-url]: https://github.com/Supergiovane/node-red-contrib-unifi-ultimate#readme
|
|
217
|
+
[npm-downloads-month-image]: https://img.shields.io/npm/dm/node-red-contrib-unifi-ultimate.svg
|
|
218
|
+
[npm-downloads-total-image]: https://img.shields.io/npm/dt/node-red-contrib-unifi-ultimate.svg
|
|
219
|
+
[license-image]: https://img.shields.io/badge/license-MIT-green.svg
|
|
220
|
+
[license-url]: https://opensource.org/licenses/MIT
|
|
221
|
+
[youtube-image]: https://img.shields.io/badge/YouTube-Subscribe-red?logo=youtube&logoColor=white
|
|
222
|
+
[youtube-url]: https://www.youtube.com/@maxsupervibe
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
<svg width="1200" height="720" viewBox="0 0 1200 720" xmlns="http://www.w3.org/2000/svg" role="img" aria-labelledby="title desc">
|
|
2
|
+
<title id="title">node-red-contrib-unifi-ultimate overview</title>
|
|
3
|
+
<desc id="desc">Node-RED flows using UniFi Protect, Access and Network nodes with unified outputs.</desc>
|
|
4
|
+
<defs>
|
|
5
|
+
<linearGradient id="bg" x1="0" y1="0" x2="1" y2="1">
|
|
6
|
+
<stop offset="0%" stop-color="#f8fafc"/>
|
|
7
|
+
<stop offset="100%" stop-color="#eef2ff"/>
|
|
8
|
+
</linearGradient>
|
|
9
|
+
<linearGradient id="nodered" x1="0" y1="0" x2="1" y2="1">
|
|
10
|
+
<stop offset="0%" stop-color="#fee2e2"/>
|
|
11
|
+
<stop offset="100%" stop-color="#fecaca"/>
|
|
12
|
+
</linearGradient>
|
|
13
|
+
<linearGradient id="protect" x1="0" y1="0" x2="1" y2="1">
|
|
14
|
+
<stop offset="0%" stop-color="#dcfce7"/>
|
|
15
|
+
<stop offset="100%" stop-color="#bbf7d0"/>
|
|
16
|
+
</linearGradient>
|
|
17
|
+
<linearGradient id="access" x1="0" y1="0" x2="1" y2="1">
|
|
18
|
+
<stop offset="0%" stop-color="#dbeafe"/>
|
|
19
|
+
<stop offset="100%" stop-color="#bfdbfe"/>
|
|
20
|
+
</linearGradient>
|
|
21
|
+
<linearGradient id="network" x1="0" y1="0" x2="1" y2="1">
|
|
22
|
+
<stop offset="0%" stop-color="#fef9c3"/>
|
|
23
|
+
<stop offset="100%" stop-color="#fde68a"/>
|
|
24
|
+
</linearGradient>
|
|
25
|
+
<linearGradient id="out" x1="0" y1="0" x2="1" y2="1">
|
|
26
|
+
<stop offset="0%" stop-color="#ede9fe"/>
|
|
27
|
+
<stop offset="100%" stop-color="#ddd6fe"/>
|
|
28
|
+
</linearGradient>
|
|
29
|
+
<style>
|
|
30
|
+
.title { font: 700 32px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; fill: #0f172a; }
|
|
31
|
+
.subtitle { font: 500 18px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; fill: #334155; }
|
|
32
|
+
.h { font: 700 22px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; fill: #0f172a; }
|
|
33
|
+
.b { font: 500 16px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; fill: #1e293b; }
|
|
34
|
+
.s { font: 500 14px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; fill: #334155; }
|
|
35
|
+
.card { stroke: #94a3b8; stroke-width: 1.2; rx: 16; }
|
|
36
|
+
.line { stroke: #475569; stroke-width: 2.4; fill: none; marker-end: url(#arrow); }
|
|
37
|
+
</style>
|
|
38
|
+
<marker id="arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="8" markerHeight="8" orient="auto-start-reverse">
|
|
39
|
+
<path d="M 0 0 L 10 5 L 0 10 z" fill="#475569"/>
|
|
40
|
+
</marker>
|
|
41
|
+
</defs>
|
|
42
|
+
|
|
43
|
+
<rect x="0" y="0" width="1200" height="720" fill="url(#bg)"/>
|
|
44
|
+
|
|
45
|
+
<text x="60" y="70" class="title">UniFi Ultimate for Node-RED</text>
|
|
46
|
+
<text x="60" y="102" class="subtitle">One palette for Protect, Access, and Network automation flows.</text>
|
|
47
|
+
|
|
48
|
+
<rect class="card" x="60" y="160" width="310" height="360" fill="url(#nodered)"/>
|
|
49
|
+
<text x="90" y="205" class="h">Node-RED</text>
|
|
50
|
+
<text x="90" y="238" class="b">Config nodes:</text>
|
|
51
|
+
<text x="90" y="265" class="s">- Unifi Protect Config</text>
|
|
52
|
+
<text x="90" y="289" class="s">- Unifi Access Config</text>
|
|
53
|
+
<text x="90" y="313" class="s">- Unifi Network Config</text>
|
|
54
|
+
<text x="90" y="355" class="b">Device nodes:</text>
|
|
55
|
+
<text x="90" y="382" class="s">- Protect Device</text>
|
|
56
|
+
<text x="90" y="406" class="s">- Access Device</text>
|
|
57
|
+
<text x="90" y="430" class="s">- Network Device</text>
|
|
58
|
+
<text x="90" y="472" class="b">Utilities:</text>
|
|
59
|
+
<text x="90" y="499" class="s">- Network Presence</text>
|
|
60
|
+
<text x="90" y="523" class="s">- Network Control POE</text>
|
|
61
|
+
|
|
62
|
+
<rect class="card" x="455" y="130" width="300" height="150" fill="url(#protect)"/>
|
|
63
|
+
<text x="485" y="175" class="h">UniFi Protect</text>
|
|
64
|
+
<text x="485" y="205" class="s">Cameras, sensors, lights, viewers</text>
|
|
65
|
+
<text x="485" y="229" class="s">events, snapshots, PTZ, talkback</text>
|
|
66
|
+
<text x="485" y="253" class="s">NVR app info and live streams</text>
|
|
67
|
+
|
|
68
|
+
<rect class="card" x="455" y="315" width="300" height="150" fill="url(#access)"/>
|
|
69
|
+
<text x="485" y="360" class="h">UniFi Access</text>
|
|
70
|
+
<text x="485" y="390" class="s">Doors and access devices</text>
|
|
71
|
+
<text x="485" y="414" class="s">unlock, lock rules, emergency mode</text>
|
|
72
|
+
<text x="485" y="438" class="s">doorbell trigger/cancel and events</text>
|
|
73
|
+
|
|
74
|
+
<rect class="card" x="455" y="500" width="300" height="150" fill="url(#network)"/>
|
|
75
|
+
<text x="485" y="545" class="h">UniFi Network</text>
|
|
76
|
+
<text x="485" y="575" class="s">Sites, devices, clients</text>
|
|
77
|
+
<text x="485" y="599" class="s">state/details, restart, guest auth</text>
|
|
78
|
+
<text x="485" y="623" class="s">POE and presence automations</text>
|
|
79
|
+
|
|
80
|
+
<rect class="card" x="840" y="250" width="300" height="250" fill="url(#out)"/>
|
|
81
|
+
<text x="870" y="295" class="h">Unified outputs</text>
|
|
82
|
+
<text x="870" y="327" class="s">Output 1: state/action response</text>
|
|
83
|
+
<text x="870" y="351" class="s">Output 2: live events (where supported)</text>
|
|
84
|
+
<text x="870" y="395" class="s">Metadata fields:</text>
|
|
85
|
+
<text x="870" y="422" class="s">- msg.unifiProtect</text>
|
|
86
|
+
<text x="870" y="446" class="s">- msg.unifiAccess</text>
|
|
87
|
+
<text x="870" y="470" class="s">- msg.unifiNetwork</text>
|
|
88
|
+
|
|
89
|
+
<path class="line" d="M 370 235 C 410 235, 420 205, 455 205"/>
|
|
90
|
+
<path class="line" d="M 370 335 C 410 335, 420 390, 455 390"/>
|
|
91
|
+
<path class="line" d="M 370 465 C 410 465, 420 575, 455 575"/>
|
|
92
|
+
|
|
93
|
+
<path class="line" d="M 755 205 C 790 205, 805 290, 840 290"/>
|
|
94
|
+
<path class="line" d="M 755 390 C 790 390, 805 390, 840 390"/>
|
|
95
|
+
<path class="line" d="M 755 575 C 790 575, 805 470, 840 470"/>
|
|
96
|
+
</svg>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 960 280" role="img" aria-labelledby="title desc">
|
|
2
|
+
<title id="title">UniFi Ultimate Minimal</title>
|
|
3
|
+
<desc id="desc">Minimal logo variant for node-red-contrib-unifi-ultimate.</desc>
|
|
4
|
+
<defs>
|
|
5
|
+
<linearGradient id="bg" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
6
|
+
<stop offset="0%" stop-color="#ffffff"/>
|
|
7
|
+
<stop offset="100%" stop-color="#f3f7ff"/>
|
|
8
|
+
</linearGradient>
|
|
9
|
+
<linearGradient id="icon" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
10
|
+
<stop offset="0%" stop-color="#0ea5e9"/>
|
|
11
|
+
<stop offset="100%" stop-color="#1d4ed8"/>
|
|
12
|
+
</linearGradient>
|
|
13
|
+
<filter id="shadow" x="-20%" y="-20%" width="140%" height="140%">
|
|
14
|
+
<feDropShadow dx="0" dy="8" stdDeviation="12" flood-color="#0f2747" flood-opacity="0.12"/>
|
|
15
|
+
</filter>
|
|
16
|
+
</defs>
|
|
17
|
+
|
|
18
|
+
<rect x="14" y="14" width="932" height="252" rx="28" fill="url(#bg)"/>
|
|
19
|
+
|
|
20
|
+
<g transform="translate(44 46)" filter="url(#shadow)">
|
|
21
|
+
<rect x="0" y="0" width="188" height="188" rx="36" fill="#ffffff"/>
|
|
22
|
+
<rect x="18" y="18" width="152" height="152" rx="30" fill="url(#icon)"/>
|
|
23
|
+
|
|
24
|
+
<g transform="translate(34 34)" fill="none" stroke="#ffffff" stroke-linecap="round" stroke-linejoin="round">
|
|
25
|
+
<path d="M24 46v34c0 22.091 17.909 40 40 40s40-17.909 40-40V46" stroke-width="12"/>
|
|
26
|
+
<path d="M64 18v18" stroke-width="6"/>
|
|
27
|
+
<path d="M24 64h16" stroke-width="5" opacity="0.78"/>
|
|
28
|
+
<path d="M88 64h16" stroke-width="5" opacity="0.78"/>
|
|
29
|
+
</g>
|
|
30
|
+
</g>
|
|
31
|
+
|
|
32
|
+
<g transform="translate(286 86)">
|
|
33
|
+
<text x="0" y="54" fill="#0d223a" font-family="'Avenir Next', 'Segoe UI', Roboto, Arial, sans-serif" font-size="58" font-weight="700" letter-spacing="0.1">
|
|
34
|
+
UniFi Ultimate
|
|
35
|
+
</text>
|
|
36
|
+
<text x="2" y="96" fill="#3b5f84" font-family="'Avenir Next', 'Segoe UI', Roboto, Arial, sans-serif" font-size="24" font-weight="500">
|
|
37
|
+
Simple. Clean. Ready for Node-RED.
|
|
38
|
+
</text>
|
|
39
|
+
</g>
|
|
40
|
+
</svg>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 960 280" role="img" aria-labelledby="title desc">
|
|
2
|
+
<title id="title">UniFi Ultimate</title>
|
|
3
|
+
<desc id="desc">Tech style logo with minimal text for node-red-contrib-unifi-ultimate.</desc>
|
|
4
|
+
<defs>
|
|
5
|
+
<linearGradient id="bg" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
6
|
+
<stop offset="0%" stop-color="#071426"/>
|
|
7
|
+
<stop offset="100%" stop-color="#112a46"/>
|
|
8
|
+
</linearGradient>
|
|
9
|
+
<linearGradient id="glow" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
10
|
+
<stop offset="0%" stop-color="#22d3ee"/>
|
|
11
|
+
<stop offset="100%" stop-color="#60a5fa"/>
|
|
12
|
+
</linearGradient>
|
|
13
|
+
<linearGradient id="chip" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
14
|
+
<stop offset="0%" stop-color="#0ea5e9"/>
|
|
15
|
+
<stop offset="100%" stop-color="#2563eb"/>
|
|
16
|
+
</linearGradient>
|
|
17
|
+
<filter id="glowSoft" x="-30%" y="-30%" width="160%" height="160%">
|
|
18
|
+
<feDropShadow dx="0" dy="0" stdDeviation="10" flood-color="#38bdf8" flood-opacity="0.5"/>
|
|
19
|
+
</filter>
|
|
20
|
+
<filter id="shadow" x="-20%" y="-20%" width="140%" height="140%">
|
|
21
|
+
<feDropShadow dx="0" dy="10" stdDeviation="16" flood-color="#020617" flood-opacity="0.35"/>
|
|
22
|
+
</filter>
|
|
23
|
+
</defs>
|
|
24
|
+
|
|
25
|
+
<rect x="12" y="12" width="936" height="256" rx="34" fill="url(#bg)"/>
|
|
26
|
+
|
|
27
|
+
<g stroke="#4cc9f0" stroke-opacity="0.35" stroke-width="1.6" fill="none">
|
|
28
|
+
<path d="M18 64H244"/>
|
|
29
|
+
<path d="M18 216H230"/>
|
|
30
|
+
<path d="M714 64H942"/>
|
|
31
|
+
<path d="M730 216H942"/>
|
|
32
|
+
</g>
|
|
33
|
+
|
|
34
|
+
<g transform="translate(40 40)" filter="url(#shadow)">
|
|
35
|
+
<rect x="0" y="0" width="200" height="200" rx="42" fill="#0a1f36" stroke="#2d4f73"/>
|
|
36
|
+
<rect x="20" y="20" width="160" height="160" rx="32" fill="url(#chip)"/>
|
|
37
|
+
|
|
38
|
+
<g transform="translate(24 22)" filter="url(#glowSoft)">
|
|
39
|
+
<circle cx="80" cy="80" r="56" fill="none" stroke="url(#glow)" stroke-width="2.5" opacity="0.7"/>
|
|
40
|
+
<g transform="translate(16 14) scale(0.66)">
|
|
41
|
+
<path d="M96 0h18v18H96z" fill="#e0f2fe"/>
|
|
42
|
+
<path d="M76 54h20v20H76z" fill="#e0f2fe"/>
|
|
43
|
+
<path d="M56 71v25c0 22.091 17.909 40 40 40s40-17.909 40-40V54h-20v42c0 11.046-8.954 20-20 20s-20-8.954-20-20V71z" fill="#e0f2fe"/>
|
|
44
|
+
<path d="M16 54h20v42c0 33.137 26.863 60 60 60s60-26.863 60-60V54h20v42c0 20.628-4.676 35.684-12.42 48.133-3.572 5.742-7.84 11.006-12.664 15.766-14.896 14.688-34.824 24.101-54.916 26.114-3.021.303-9.044.606-12 .606-2.956 0-8.979-.303-12-.606-20.092-2.013-40.02-11.426-54.916-26.114-4.824-4.76-9.092-10.024-12.664-15.766C20.676 131.684 16 116.628 16 96z" fill="#e0f2fe" opacity="0.24"/>
|
|
45
|
+
</g>
|
|
46
|
+
</g>
|
|
47
|
+
</g>
|
|
48
|
+
|
|
49
|
+
<g transform="translate(286 76)">
|
|
50
|
+
<text x="0" y="56" fill="#eff6ff" font-family="'Avenir Next', 'Segoe UI', Roboto, Arial, sans-serif" font-size="58" font-weight="700" letter-spacing="0.2">
|
|
51
|
+
UniFi Ultimate
|
|
52
|
+
</text>
|
|
53
|
+
<text x="2" y="100" fill="#bae6fd" font-family="'Avenir Next', 'Segoe UI', Roboto, Arial, sans-serif" font-size="24" font-weight="500">
|
|
54
|
+
Simple. Clean. Ready for Node-RED.
|
|
55
|
+
</text>
|
|
56
|
+
</g>
|
|
57
|
+
</svg>
|
|
@@ -1,46 +1,57 @@
|
|
|
1
1
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 960 280" role="img" aria-labelledby="title desc">
|
|
2
|
-
<title id="title">
|
|
3
|
-
<desc id="desc">
|
|
2
|
+
<title id="title">UniFi Ultimate</title>
|
|
3
|
+
<desc id="desc">Tech style logo with minimal text for node-red-contrib-unifi-ultimate.</desc>
|
|
4
4
|
<defs>
|
|
5
5
|
<linearGradient id="bg" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
6
|
-
<stop offset="0%" stop-color="#
|
|
7
|
-
<stop offset="100%" stop-color="#
|
|
6
|
+
<stop offset="0%" stop-color="#071426"/>
|
|
7
|
+
<stop offset="100%" stop-color="#112a46"/>
|
|
8
8
|
</linearGradient>
|
|
9
|
-
<linearGradient id="
|
|
10
|
-
<stop offset="0%" stop-color="#
|
|
11
|
-
<stop offset="100%" stop-color="#
|
|
9
|
+
<linearGradient id="glow" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
10
|
+
<stop offset="0%" stop-color="#22d3ee"/>
|
|
11
|
+
<stop offset="100%" stop-color="#60a5fa"/>
|
|
12
12
|
</linearGradient>
|
|
13
|
+
<linearGradient id="chip" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
14
|
+
<stop offset="0%" stop-color="#0ea5e9"/>
|
|
15
|
+
<stop offset="100%" stop-color="#2563eb"/>
|
|
16
|
+
</linearGradient>
|
|
17
|
+
<filter id="glowSoft" x="-30%" y="-30%" width="160%" height="160%">
|
|
18
|
+
<feDropShadow dx="0" dy="0" stdDeviation="10" flood-color="#38bdf8" flood-opacity="0.5"/>
|
|
19
|
+
</filter>
|
|
13
20
|
<filter id="shadow" x="-20%" y="-20%" width="140%" height="140%">
|
|
14
|
-
<feDropShadow dx="0" dy="10" stdDeviation="
|
|
21
|
+
<feDropShadow dx="0" dy="10" stdDeviation="16" flood-color="#020617" flood-opacity="0.35"/>
|
|
15
22
|
</filter>
|
|
16
23
|
</defs>
|
|
17
24
|
|
|
18
|
-
<rect x="
|
|
25
|
+
<rect x="12" y="12" width="936" height="256" rx="34" fill="url(#bg)"/>
|
|
26
|
+
|
|
27
|
+
<g stroke="#4cc9f0" stroke-opacity="0.35" stroke-width="1.6" fill="none">
|
|
28
|
+
<path d="M18 64H244"/>
|
|
29
|
+
<path d="M18 216H230"/>
|
|
30
|
+
<path d="M714 64H942"/>
|
|
31
|
+
<path d="M730 216H942"/>
|
|
32
|
+
</g>
|
|
19
33
|
|
|
20
|
-
<g transform="translate(
|
|
21
|
-
<rect x="0" y="0" width="
|
|
22
|
-
<rect x="
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
<
|
|
26
|
-
<
|
|
27
|
-
|
|
34
|
+
<g transform="translate(40 40)" filter="url(#shadow)">
|
|
35
|
+
<rect x="0" y="0" width="200" height="200" rx="42" fill="#0a1f36" stroke="#2d4f73"/>
|
|
36
|
+
<rect x="20" y="20" width="160" height="160" rx="32" fill="url(#chip)"/>
|
|
37
|
+
|
|
38
|
+
<g transform="translate(24 22)" filter="url(#glowSoft)">
|
|
39
|
+
<circle cx="80" cy="80" r="56" fill="none" stroke="url(#glow)" stroke-width="2.5" opacity="0.7"/>
|
|
40
|
+
<g transform="translate(16 14) scale(0.66)">
|
|
41
|
+
<path d="M96 0h18v18H96z" fill="#e0f2fe"/>
|
|
42
|
+
<path d="M76 54h20v20H76z" fill="#e0f2fe"/>
|
|
43
|
+
<path d="M56 71v25c0 22.091 17.909 40 40 40s40-17.909 40-40V54h-20v42c0 11.046-8.954 20-20 20s-20-8.954-20-20V71z" fill="#e0f2fe"/>
|
|
44
|
+
<path d="M16 54h20v42c0 33.137 26.863 60 60 60s60-26.863 60-60V54h20v42c0 20.628-4.676 35.684-12.42 48.133-3.572 5.742-7.84 11.006-12.664 15.766-14.896 14.688-34.824 24.101-54.916 26.114-3.021.303-9.044.606-12 .606-2.956 0-8.979-.303-12-.606-20.092-2.013-40.02-11.426-54.916-26.114-4.824-4.76-9.092-10.024-12.664-15.766C20.676 131.684 16 116.628 16 96z" fill="#e0f2fe" opacity="0.24"/>
|
|
45
|
+
</g>
|
|
28
46
|
</g>
|
|
29
47
|
</g>
|
|
30
48
|
|
|
31
|
-
<g transform="translate(
|
|
32
|
-
<text x="0" y="56" fill="#
|
|
33
|
-
|
|
49
|
+
<g transform="translate(286 76)">
|
|
50
|
+
<text x="0" y="56" fill="#eff6ff" font-family="'Avenir Next', 'Segoe UI', Roboto, Arial, sans-serif" font-size="58" font-weight="700" letter-spacing="0.2">
|
|
51
|
+
UniFi Ultimate
|
|
34
52
|
</text>
|
|
35
|
-
<text x="
|
|
36
|
-
for
|
|
53
|
+
<text x="2" y="100" fill="#bae6fd" font-family="'Avenir Next', 'Segoe UI', Roboto, Arial, sans-serif" font-size="24" font-weight="500">
|
|
54
|
+
Simple. Clean. Ready for Node-RED.
|
|
37
55
|
</text>
|
|
38
|
-
|
|
39
|
-
<g transform="translate(0 132)">
|
|
40
|
-
<rect x="0" y="0" width="156" height="40" rx="20" fill="#ffffff"/>
|
|
41
|
-
<text x="25" y="26" fill="#42556b" font-family="Helvetica, Arial, sans-serif" font-size="20" font-weight="600">
|
|
42
|
-
Beta Package
|
|
43
|
-
</text>
|
|
44
|
-
</g>
|
|
45
56
|
</g>
|
|
46
57
|
</svg>
|
|
@@ -310,6 +310,22 @@
|
|
|
310
310
|
return "Unlocking " + normalizedDeviceName + ".";
|
|
311
311
|
}
|
|
312
312
|
|
|
313
|
+
if (normalizedLabel === "Set Temporary Lock Rule") {
|
|
314
|
+
return "Configuring a temporary lock rule on " + normalizedDeviceName + ".";
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
if (normalizedLabel === "Set Emergency Mode") {
|
|
318
|
+
return "Applying emergency mode for Access doors.";
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
if (normalizedLabel === "Trigger Doorbell") {
|
|
322
|
+
return "Triggering doorbell on " + normalizedDeviceName + ".";
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
if (normalizedLabel === "Cancel Doorbell") {
|
|
326
|
+
return "Cancelling doorbell on " + normalizedDeviceName + ".";
|
|
327
|
+
}
|
|
328
|
+
|
|
313
329
|
return normalizedLabel + " on " + normalizedDeviceName + ".";
|
|
314
330
|
}
|
|
315
331
|
|
|
@@ -589,6 +605,10 @@
|
|
|
589
605
|
}
|
|
590
606
|
|
|
591
607
|
writeCapabilityConfig();
|
|
608
|
+
|
|
609
|
+
if (field.reloadOnChange) {
|
|
610
|
+
loadCapabilityOptions();
|
|
611
|
+
}
|
|
592
612
|
});
|
|
593
613
|
|
|
594
614
|
if (isHiddenField) {
|
|
@@ -908,6 +928,7 @@
|
|
|
908
928
|
<p><b>Connection</b> selects the shared UniFi Access config node.</p>
|
|
909
929
|
<p><b>Control</b> chooses the Access category. <b>Device</b> chooses the specific door or Access device. <b>Action</b> only shows actions supported by that item.</p>
|
|
910
930
|
<p><b>Action options</b> appears only when the selected action needs extra input, such as a temporary lock rule or a room name for doorbell actions.</p>
|
|
931
|
+
<p>For <code>Set Temporary Lock Rule</code>, choose <code>Custom Duration</code> to reveal the minutes field. Legacy <code>ended_time</code> is still available only as fallback compatibility.</p>
|
|
911
932
|
<p><code>Receive Events</code> fetches the current state once and then listens to the official UniFi Access notifications WebSocket.</p>
|
|
912
933
|
<p><code>Trigger Doorbell</code> and <code>Cancel Doorbell</code> use a manual <code>Room Name</code> field when needed. The node does not currently discover Intercom directory names automatically.</p>
|
|
913
934
|
<p><code>Cancel Doorbell</code> uses a shared safe-cancel guard in the UniFi Access config node. A cancel request is sent only if an active ring is still tracked there, using a 3 minute tracking window.</p>
|
|
@@ -315,6 +315,10 @@
|
|
|
315
315
|
return "Loading clients from " + normalizedDeviceName + ".";
|
|
316
316
|
}
|
|
317
317
|
|
|
318
|
+
if (normalizedLabel === "Read Application Info") {
|
|
319
|
+
return "Reading UniFi Network application information.";
|
|
320
|
+
}
|
|
321
|
+
|
|
318
322
|
if (normalizedLabel === "Restart Device") {
|
|
319
323
|
return "Restarting " + normalizedDeviceName + ".";
|
|
320
324
|
}
|
|
@@ -934,7 +938,8 @@
|
|
|
934
938
|
<p><b>Resource</b> chooses what you want to work with: Site, UniFi Device, or Client.</p>
|
|
935
939
|
<p><b>Item</b> chooses the specific site/device/client. <b>Action</b> only shows actions supported by that selection.</p>
|
|
936
940
|
<p><b>Action options</b> appears only when the selected action needs extra input.</p>
|
|
937
|
-
<p>Action highlights: <code>Authorize Guest Access</code>, <code>Revoke Guest Access</code>, <code>Restart Device</code>, and <code>Power Cycle Port</code>.</p>
|
|
941
|
+
<p>Action highlights: <code>Read Application Info</code>, <code>Authorize Guest Access</code>, <code>Revoke Guest Access</code>, <code>Restart Device</code>, and <code>Power Cycle Port</code>.</p>
|
|
942
|
+
<p><code>Read Application Info</code> is available on the <code>Site</code> resource type and returns Network application metadata.</p>
|
|
938
943
|
<p><b>Label</b> is optional and only changes how the node is shown in the editor. <b>Timeout</b> controls the request timeout in milliseconds for direct API calls.</p>
|
|
939
944
|
|
|
940
945
|
<h3>Input</h3>
|
|
@@ -311,6 +311,10 @@
|
|
|
311
311
|
return "Taking a snapshot from " + normalizedDeviceName + ".";
|
|
312
312
|
}
|
|
313
313
|
|
|
314
|
+
if (normalizedLabel === "Read Application Info") {
|
|
315
|
+
return "Reading Protect application information.";
|
|
316
|
+
}
|
|
317
|
+
|
|
314
318
|
return normalizedLabel + " on " + normalizedDeviceName + ".";
|
|
315
319
|
}
|
|
316
320
|
|
|
@@ -932,8 +936,9 @@
|
|
|
932
936
|
<p><b>Connection</b> selects the shared UniFi Protect config node.</p>
|
|
933
937
|
<p><b>Control</b> chooses the Protect device category. <b>Device</b> chooses the specific item. <b>Action</b> only shows actions supported by that device.</p>
|
|
934
938
|
<p><b>Action options</b> appears only when the selected action needs extra input. For example, observables, PTZ presets, live views, or discovered properties.</p>
|
|
939
|
+
<p>Action highlights: <code>Receive Events</code>, <code>Read Device State</code>, <code>Take Snapshot</code>, <code>Show Doorbell Message</code>, and <code>Read Application Info</code> on <code>NVR</code>.</p>
|
|
935
940
|
<p><code>Receive Events</code> performs an initial fetch and then stays connected to the Protect streams.</p>
|
|
936
|
-
<p>For <code>Sensor</code>, <code>Camera</code>, and <code>Light</code> observables, the node can normalize the main output to <code>true</code> or <code>false</code> and keep the original context in <code>msg.RAW</code>.</p>
|
|
941
|
+
<p>For <code>Sensor</code>, <code>Camera</code>, and <code>Light</code> observables, the node can normalize the main output to <code>true</code> or <code>false</code> and keep the original context in <code>msg.RAW</code>. Sensor observables include <code>Extreme Values</code>.</p>
|
|
937
942
|
<p><b>Label</b> is optional and only changes how the node is shown in the editor. <b>Timeout</b> controls the request timeout in milliseconds for direct API calls.</p>
|
|
938
943
|
|
|
939
944
|
<h3>Input</h3>
|
|
@@ -66,19 +66,28 @@ const TYPE_CAPABILITIES = {
|
|
|
66
66
|
id: "type",
|
|
67
67
|
label: "Rule",
|
|
68
68
|
type: "select",
|
|
69
|
+
reloadOnChange: true,
|
|
69
70
|
options: [
|
|
70
71
|
{ value: "keep_lock", label: "Keep Locked" },
|
|
71
72
|
{ value: "keep_unlock", label: "Keep Unlocked" },
|
|
72
73
|
{ value: "custom", label: "Custom Duration" },
|
|
74
|
+
{ value: "reset", label: "Reset Temporary Rule" },
|
|
75
|
+
{ value: "lock_now", label: "Lock Now" },
|
|
73
76
|
{ value: "lock_early", label: "End Unlock Early" },
|
|
74
|
-
{ value: "schedule", label: "Schedule" }
|
|
77
|
+
{ value: "schedule", label: "Schedule (Legacy)" }
|
|
75
78
|
]
|
|
76
79
|
},
|
|
80
|
+
{
|
|
81
|
+
id: "interval",
|
|
82
|
+
label: "Duration (minutes)",
|
|
83
|
+
type: "number",
|
|
84
|
+
placeholder: "Used for custom, example: 10"
|
|
85
|
+
},
|
|
77
86
|
{
|
|
78
87
|
id: "ended_time",
|
|
79
|
-
label: "End Time",
|
|
88
|
+
label: "Legacy End Time (Unix)",
|
|
80
89
|
type: "text",
|
|
81
|
-
placeholder: "
|
|
90
|
+
placeholder: "Optional legacy custom mode value"
|
|
82
91
|
}
|
|
83
92
|
]
|
|
84
93
|
},
|
|
@@ -87,9 +96,15 @@ const TYPE_CAPABILITIES = {
|
|
|
87
96
|
type: String(capabilityConfig.type || "keep_lock").trim() || "keep_lock"
|
|
88
97
|
};
|
|
89
98
|
|
|
99
|
+
const interval = Number(capabilityConfig.interval);
|
|
90
100
|
const endedTime = Number(capabilityConfig.ended_time);
|
|
91
|
-
if (payload.type === "custom"
|
|
92
|
-
|
|
101
|
+
if (payload.type === "custom") {
|
|
102
|
+
if (Number.isFinite(interval) && interval > 0) {
|
|
103
|
+
payload.interval = Math.trunc(interval);
|
|
104
|
+
} else if (Number.isFinite(endedTime)) {
|
|
105
|
+
// Keep backward compatibility with older Access payloads.
|
|
106
|
+
payload.ended_time = endedTime;
|
|
107
|
+
}
|
|
93
108
|
}
|
|
94
109
|
|
|
95
110
|
return { payload };
|
|
@@ -257,12 +272,57 @@ async function getCapabilityOptions(deviceType, capabilityId, context) {
|
|
|
257
272
|
};
|
|
258
273
|
}
|
|
259
274
|
|
|
275
|
+
if (capability.id === "setTemporaryLockRule") {
|
|
276
|
+
return buildTemporaryLockRuleFields(capabilityId, capability, context && context.capabilityConfig);
|
|
277
|
+
}
|
|
278
|
+
|
|
260
279
|
return {
|
|
261
280
|
capabilityId,
|
|
262
281
|
fields: capability.editor.fields.map((field) => ({ ...field }))
|
|
263
282
|
};
|
|
264
283
|
}
|
|
265
284
|
|
|
285
|
+
function buildTemporaryLockRuleFields(capabilityId, capability, capabilityConfig) {
|
|
286
|
+
// Keep the editor simple: only show duration inputs when the user picks
|
|
287
|
+
// the custom temporary rule type.
|
|
288
|
+
const config = normalizeObject(capabilityConfig);
|
|
289
|
+
const selectedType = String(config.type || "keep_lock").trim() || "keep_lock";
|
|
290
|
+
const typeField = capability.editor.fields[0];
|
|
291
|
+
const intervalField = capability.editor.fields[1];
|
|
292
|
+
const endedTimeField = capability.editor.fields[2];
|
|
293
|
+
const fields = [
|
|
294
|
+
{
|
|
295
|
+
...typeField,
|
|
296
|
+
defaultValue: selectedType,
|
|
297
|
+
helpText: "Choose the lock behavior. Select Custom Duration to set a temporary unlock window."
|
|
298
|
+
}
|
|
299
|
+
];
|
|
300
|
+
|
|
301
|
+
if (selectedType === "custom") {
|
|
302
|
+
fields.push(
|
|
303
|
+
{
|
|
304
|
+
...intervalField,
|
|
305
|
+
defaultValue: config.interval !== undefined && config.interval !== null
|
|
306
|
+
? String(config.interval)
|
|
307
|
+
: "",
|
|
308
|
+
helpText: "Recommended: duration in minutes for the temporary custom rule."
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
...endedTimeField,
|
|
312
|
+
defaultValue: config.ended_time !== undefined && config.ended_time !== null
|
|
313
|
+
? String(config.ended_time)
|
|
314
|
+
: "",
|
|
315
|
+
helpText: "Legacy fallback only. Leave empty unless your controller requires ended_time."
|
|
316
|
+
}
|
|
317
|
+
);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
return {
|
|
321
|
+
capabilityId,
|
|
322
|
+
fields
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
|
|
266
326
|
function buildPathFromTemplate(path, deviceId) {
|
|
267
327
|
// Access uses simple ":id" path templates, so replacement stays minimal.
|
|
268
328
|
return String(path || "").replace(":id", encodeURIComponent(String(deviceId || "").trim()));
|
|
@@ -44,6 +44,14 @@ const COMMON_CAPABILITIES = [
|
|
|
44
44
|
// requestComposer that turns editor/runtime values into a concrete API request.
|
|
45
45
|
const TYPE_CAPABILITIES = {
|
|
46
46
|
site: [
|
|
47
|
+
{
|
|
48
|
+
id: "getApplicationInfo",
|
|
49
|
+
label: "Read Application Info",
|
|
50
|
+
description: "Fetch UniFi Network application metadata.",
|
|
51
|
+
method: "GET",
|
|
52
|
+
path: "/v1/info",
|
|
53
|
+
mode: "request"
|
|
54
|
+
},
|
|
47
55
|
{
|
|
48
56
|
id: "listSiteDevices",
|
|
49
57
|
label: "List Site Devices",
|
|
@@ -132,6 +132,11 @@ const SENSOR_OBSERVABLE_DEFINITIONS = [
|
|
|
132
132
|
id: "smokeTest",
|
|
133
133
|
label: "Smoke test",
|
|
134
134
|
eventTypes: ["sensorSmokeTest"]
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
id: "extremeValues",
|
|
138
|
+
label: "Extreme values",
|
|
139
|
+
eventTypes: ["sensorExtremeValues"]
|
|
135
140
|
}
|
|
136
141
|
];
|
|
137
142
|
|
|
@@ -453,7 +458,16 @@ const TYPE_CAPABILITIES = {
|
|
|
453
458
|
},
|
|
454
459
|
createSetPropertyCapability()
|
|
455
460
|
],
|
|
456
|
-
nvr: [
|
|
461
|
+
nvr: [
|
|
462
|
+
{
|
|
463
|
+
id: "getApplicationInfo",
|
|
464
|
+
label: "Read Application Info",
|
|
465
|
+
description: "Fetch Protect application metadata from /v1/meta/info.",
|
|
466
|
+
method: "GET",
|
|
467
|
+
path: "/v1/meta/info",
|
|
468
|
+
mode: "request"
|
|
469
|
+
}
|
|
470
|
+
]
|
|
457
471
|
};
|
|
458
472
|
|
|
459
473
|
function getDeviceTypes() {
|
|
@@ -1390,6 +1404,14 @@ function resolveSensorObservableState(sensor, observable, fallbackValue) {
|
|
|
1390
1404
|
"isSmokeTestRunning",
|
|
1391
1405
|
"smokeTestRunning",
|
|
1392
1406
|
"status.smokeTestRunning"
|
|
1407
|
+
]),
|
|
1408
|
+
extremeValues: () => firstDefinedValue(sensor, [
|
|
1409
|
+
"isExtremeValuesDetected",
|
|
1410
|
+
"extremeValuesDetected",
|
|
1411
|
+
"status.extremeValuesDetected",
|
|
1412
|
+
"isExtremeValueDetected",
|
|
1413
|
+
"extremeValueDetected",
|
|
1414
|
+
"status.extremeValueDetected"
|
|
1393
1415
|
])
|
|
1394
1416
|
};
|
|
1395
1417
|
|
|
@@ -237,6 +237,11 @@ const OBSERVABLE_METADATA = {
|
|
|
237
237
|
label: "Smoke Test",
|
|
238
238
|
description: "True while a smoke test is active.",
|
|
239
239
|
source: "inferred"
|
|
240
|
+
},
|
|
241
|
+
extremeValues: {
|
|
242
|
+
label: "Extreme Values",
|
|
243
|
+
description: "True while the sensor is reporting an active extreme-values event.",
|
|
244
|
+
source: "official"
|
|
240
245
|
}
|
|
241
246
|
},
|
|
242
247
|
light: {
|
package/package.json
CHANGED