node-red-contrib-unifi-ultimate 0.1.0-beta.3 → 0.1.0-beta.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 +8 -80
- package/examples/unifi-access-door-control.json +205 -0
- package/examples/unifi-access-intercom-doorbell.json +205 -0
- package/examples/unifi-protect-camera-actions.json +189 -0
- package/examples/unifi-protect-sensor-observe.json +98 -0
- package/nodes/icons/unifi-ultimate-logo.svg.png +0 -0
- package/nodes/unifi-access-config.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,12 +2,8 @@
|
|
|
2
2
|
<img src="nodes/icons/unifi-ultimate-logo.svg" alt="Unifi Ultimate" width="720">
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
|
-
# node-red-contrib-unifi-ultimate
|
|
6
|
-
|
|
7
5
|
Node-RED nodes for Ubiquiti UniFi integrations, currently covering UniFi Protect and a first UniFi Access beta.
|
|
8
6
|
|
|
9
|
-
Current release status: `0.1.0-beta.2`
|
|
10
|
-
|
|
11
7
|
## Included in this first version
|
|
12
8
|
|
|
13
9
|
- `Unifi Protect Device`: generic Protect object node with discovery of device types, instances, and device-specific capabilities
|
|
@@ -15,6 +11,14 @@ Current release status: `0.1.0-beta.2`
|
|
|
15
11
|
- `Unifi Access Device`: first generic Access node focused on doors, Access devices, notification events, and safe doorbell control
|
|
16
12
|
- `Unifi Access Config`: shared configuration node for host, bearer token, and TLS behavior
|
|
17
13
|
|
|
14
|
+
## Example flows
|
|
15
|
+
|
|
16
|
+
- [examples/unifi-protect-info.json](examples/unifi-protect-info.json): basic Protect camera observe example
|
|
17
|
+
- [examples/unifi-protect-sensor-observe.json](examples/unifi-protect-sensor-observe.json): Protect sensor boolean observe example
|
|
18
|
+
- [examples/unifi-protect-camera-actions.json](examples/unifi-protect-camera-actions.json): Protect snapshot, PTZ preset, and doorbell message examples
|
|
19
|
+
- [examples/unifi-access-door-control.json](examples/unifi-access-door-control.json): Access door observe, unlock, and temporary lock rule examples
|
|
20
|
+
- [examples/unifi-access-intercom-doorbell.json](examples/unifi-access-intercom-doorbell.json): Access intercom observe, trigger doorbell, and safe cancel example
|
|
21
|
+
|
|
18
22
|
## Supported Access device types
|
|
19
23
|
|
|
20
24
|
- `Door`
|
|
@@ -42,82 +46,6 @@ Access device-specific capabilities:
|
|
|
42
46
|
- `Trigger Doorbell`
|
|
43
47
|
- `Cancel Doorbell`
|
|
44
48
|
|
|
45
|
-
Notes:
|
|
46
|
-
|
|
47
|
-
- the capability list is filtered using the selected Access device
|
|
48
|
-
- `Trigger Doorbell` and `Cancel Doorbell` use a manual `Room Name` when needed
|
|
49
|
-
- `Cancel Doorbell` uses controller-level safe tracking in the shared Access config node, with a `60s` ring timeout
|
|
50
|
-
|
|
51
|
-
## Supported Protect device types
|
|
52
|
-
|
|
53
|
-
- `Camera`
|
|
54
|
-
- `Sensor`
|
|
55
|
-
- `Light`
|
|
56
|
-
- `Chime`
|
|
57
|
-
- `Viewer`
|
|
58
|
-
- `Live View`
|
|
59
|
-
- `NVR`
|
|
60
|
-
|
|
61
|
-
## Supported capabilities
|
|
62
|
-
|
|
63
|
-
Common capabilities:
|
|
64
|
-
|
|
65
|
-
- `Receive Events`
|
|
66
|
-
- `Read Device State`
|
|
67
|
-
- `Send Raw Update`
|
|
68
|
-
|
|
69
|
-
Camera-specific capabilities:
|
|
70
|
-
|
|
71
|
-
- `Take Snapshot`
|
|
72
|
-
- `Take Snapshot` with `High quality` option
|
|
73
|
-
- `List RTSPS Streams`
|
|
74
|
-
- `Create RTSPS Stream`
|
|
75
|
-
- `Delete RTSPS Stream`
|
|
76
|
-
- `Start Talkback Session`
|
|
77
|
-
- `Disable Microphone Permanently`
|
|
78
|
-
- `Start PTZ Patrol`
|
|
79
|
-
- `Stop PTZ Patrol`
|
|
80
|
-
- `Recall PTZ Preset`
|
|
81
|
-
- `Show Doorbell Message`
|
|
82
|
-
- `Update One Property`
|
|
83
|
-
|
|
84
|
-
Patchable object capabilities:
|
|
85
|
-
|
|
86
|
-
- `Update One Property` for `Camera`, `Sensor`, `Light`, `Chime`, `Viewer`, and `Live View`
|
|
87
|
-
|
|
88
|
-
Viewer-specific capabilities:
|
|
89
|
-
|
|
90
|
-
- `Switch Live View`
|
|
91
|
-
|
|
92
|
-
Notes:
|
|
93
|
-
|
|
94
|
-
- the capability list is filtered using the selected Protect device
|
|
95
|
-
- PTZ actions appear only for cameras that look PTZ-capable
|
|
96
|
-
- doorbell actions appear only for doorbell-capable cameras
|
|
97
|
-
- microphone actions appear only for cameras that expose mic-related fields
|
|
98
|
-
|
|
99
|
-
## Configuration model
|
|
100
|
-
|
|
101
|
-
The config node asks only for the UniFi OS controller IP or `host[:port]`.
|
|
102
|
-
|
|
103
|
-
The package builds the Protect base URL automatically as:
|
|
104
|
-
|
|
105
|
-
- `https://<IP>/proxy/protect/integration`
|
|
106
|
-
|
|
107
|
-
The nodes append the operation path automatically, for example `/v1/meta/info`, `/v1/cameras`, or `/v1/sensors/:id`.
|
|
108
|
-
|
|
109
|
-
The API key header is configurable. The default is `X-API-Key`.
|
|
110
|
-
|
|
111
|
-
For UniFi Access, the config node asks for the Access host or `host[:port]`.
|
|
112
|
-
|
|
113
|
-
The package builds the Access base URL automatically as:
|
|
114
|
-
|
|
115
|
-
- `https://<HOST>:12445` when no port is specified
|
|
116
|
-
|
|
117
|
-
Authentication follows the official Access documentation and sends:
|
|
118
|
-
|
|
119
|
-
- `Authorization: Bearer <token>`
|
|
120
|
-
|
|
121
49
|
## Runtime behavior
|
|
122
50
|
|
|
123
51
|
The `Device` node supports runtime overrides via `msg`:
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "tab-access-door-control",
|
|
4
|
+
"type": "tab",
|
|
5
|
+
"label": "UniFi Access Door Control",
|
|
6
|
+
"disabled": false,
|
|
7
|
+
"info": ""
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"id": "comment-access-door-control",
|
|
11
|
+
"type": "comment",
|
|
12
|
+
"z": "tab-access-door-control",
|
|
13
|
+
"name": "Setup",
|
|
14
|
+
"info": "Replace the Access host, API token, and door id before deploying.\nThis flow shows Observe, Unlock Door, and a temporary lock rule example.",
|
|
15
|
+
"x": 270,
|
|
16
|
+
"y": 60,
|
|
17
|
+
"wires": []
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"id": "inject-access-door-observe",
|
|
21
|
+
"type": "inject",
|
|
22
|
+
"z": "tab-access-door-control",
|
|
23
|
+
"name": "Start Observe",
|
|
24
|
+
"props": [],
|
|
25
|
+
"repeat": "",
|
|
26
|
+
"crontab": "",
|
|
27
|
+
"once": false,
|
|
28
|
+
"onceDelay": 0.1,
|
|
29
|
+
"topic": "",
|
|
30
|
+
"x": 150,
|
|
31
|
+
"y": 140,
|
|
32
|
+
"wires": [
|
|
33
|
+
[
|
|
34
|
+
"node-access-door-observe"
|
|
35
|
+
]
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"id": "node-access-door-observe",
|
|
40
|
+
"type": "unifi-access-device",
|
|
41
|
+
"z": "tab-access-door-control",
|
|
42
|
+
"name": "Observe Door",
|
|
43
|
+
"server": "config-access-door-control",
|
|
44
|
+
"deviceType": "door",
|
|
45
|
+
"deviceId": "replace-with-door-id",
|
|
46
|
+
"capability": "observe",
|
|
47
|
+
"capabilityConfig": "{}",
|
|
48
|
+
"timeout": "15000",
|
|
49
|
+
"x": 420,
|
|
50
|
+
"y": 140,
|
|
51
|
+
"wires": [
|
|
52
|
+
[
|
|
53
|
+
"debug-access-door-state"
|
|
54
|
+
],
|
|
55
|
+
[
|
|
56
|
+
"debug-access-door-events"
|
|
57
|
+
]
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"id": "debug-access-door-state",
|
|
62
|
+
"type": "debug",
|
|
63
|
+
"z": "tab-access-door-control",
|
|
64
|
+
"name": "Door State",
|
|
65
|
+
"active": true,
|
|
66
|
+
"tosidebar": true,
|
|
67
|
+
"console": false,
|
|
68
|
+
"tostatus": false,
|
|
69
|
+
"complete": "true",
|
|
70
|
+
"targetType": "full",
|
|
71
|
+
"x": 700,
|
|
72
|
+
"y": 120,
|
|
73
|
+
"wires": []
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"id": "debug-access-door-events",
|
|
77
|
+
"type": "debug",
|
|
78
|
+
"z": "tab-access-door-control",
|
|
79
|
+
"name": "Door Events",
|
|
80
|
+
"active": true,
|
|
81
|
+
"tosidebar": true,
|
|
82
|
+
"console": false,
|
|
83
|
+
"tostatus": false,
|
|
84
|
+
"complete": "true",
|
|
85
|
+
"targetType": "full",
|
|
86
|
+
"x": 700,
|
|
87
|
+
"y": 160,
|
|
88
|
+
"wires": []
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"id": "inject-access-door-unlock",
|
|
92
|
+
"type": "inject",
|
|
93
|
+
"z": "tab-access-door-control",
|
|
94
|
+
"name": "Unlock Door",
|
|
95
|
+
"props": [],
|
|
96
|
+
"repeat": "",
|
|
97
|
+
"crontab": "",
|
|
98
|
+
"once": false,
|
|
99
|
+
"onceDelay": 0.1,
|
|
100
|
+
"topic": "",
|
|
101
|
+
"x": 140,
|
|
102
|
+
"y": 240,
|
|
103
|
+
"wires": [
|
|
104
|
+
[
|
|
105
|
+
"node-access-door-unlock"
|
|
106
|
+
]
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"id": "node-access-door-unlock",
|
|
111
|
+
"type": "unifi-access-device",
|
|
112
|
+
"z": "tab-access-door-control",
|
|
113
|
+
"name": "Unlock Door",
|
|
114
|
+
"server": "config-access-door-control",
|
|
115
|
+
"deviceType": "door",
|
|
116
|
+
"deviceId": "replace-with-door-id",
|
|
117
|
+
"capability": "unlockDoor",
|
|
118
|
+
"capabilityConfig": "{}",
|
|
119
|
+
"timeout": "15000",
|
|
120
|
+
"x": 410,
|
|
121
|
+
"y": 240,
|
|
122
|
+
"wires": [
|
|
123
|
+
[
|
|
124
|
+
"debug-access-door-unlock"
|
|
125
|
+
],
|
|
126
|
+
[]
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"id": "debug-access-door-unlock",
|
|
131
|
+
"type": "debug",
|
|
132
|
+
"z": "tab-access-door-control",
|
|
133
|
+
"name": "Unlock Response",
|
|
134
|
+
"active": true,
|
|
135
|
+
"tosidebar": true,
|
|
136
|
+
"console": false,
|
|
137
|
+
"tostatus": false,
|
|
138
|
+
"complete": "true",
|
|
139
|
+
"targetType": "full",
|
|
140
|
+
"x": 700,
|
|
141
|
+
"y": 240,
|
|
142
|
+
"wires": []
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"id": "inject-access-door-lock-rule",
|
|
146
|
+
"type": "inject",
|
|
147
|
+
"z": "tab-access-door-control",
|
|
148
|
+
"name": "Set Temporary Lock Rule",
|
|
149
|
+
"props": [],
|
|
150
|
+
"repeat": "",
|
|
151
|
+
"crontab": "",
|
|
152
|
+
"once": false,
|
|
153
|
+
"onceDelay": 0.1,
|
|
154
|
+
"topic": "",
|
|
155
|
+
"x": 180,
|
|
156
|
+
"y": 320,
|
|
157
|
+
"wires": [
|
|
158
|
+
[
|
|
159
|
+
"node-access-door-lock-rule"
|
|
160
|
+
]
|
|
161
|
+
]
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"id": "node-access-door-lock-rule",
|
|
165
|
+
"type": "unifi-access-device",
|
|
166
|
+
"z": "tab-access-door-control",
|
|
167
|
+
"name": "Keep Unlocked Until Timestamp",
|
|
168
|
+
"server": "config-access-door-control",
|
|
169
|
+
"deviceType": "door",
|
|
170
|
+
"deviceId": "replace-with-door-id",
|
|
171
|
+
"capability": "setTemporaryLockRule",
|
|
172
|
+
"capabilityConfig": "{\"type\":\"custom\",\"ended_time\":\"1775200000\"}",
|
|
173
|
+
"timeout": "15000",
|
|
174
|
+
"x": 460,
|
|
175
|
+
"y": 320,
|
|
176
|
+
"wires": [
|
|
177
|
+
[
|
|
178
|
+
"debug-access-door-lock-rule"
|
|
179
|
+
],
|
|
180
|
+
[]
|
|
181
|
+
]
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"id": "debug-access-door-lock-rule",
|
|
185
|
+
"type": "debug",
|
|
186
|
+
"z": "tab-access-door-control",
|
|
187
|
+
"name": "Lock Rule Response",
|
|
188
|
+
"active": true,
|
|
189
|
+
"tosidebar": true,
|
|
190
|
+
"console": false,
|
|
191
|
+
"tostatus": false,
|
|
192
|
+
"complete": "true",
|
|
193
|
+
"targetType": "full",
|
|
194
|
+
"x": 740,
|
|
195
|
+
"y": 320,
|
|
196
|
+
"wires": []
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"id": "config-access-door-control",
|
|
200
|
+
"type": "unifi-access-config",
|
|
201
|
+
"name": "My Access",
|
|
202
|
+
"host": "192.168.1.20",
|
|
203
|
+
"rejectUnauthorized": false
|
|
204
|
+
}
|
|
205
|
+
]
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "tab-access-intercom-doorbell",
|
|
4
|
+
"type": "tab",
|
|
5
|
+
"label": "UniFi Access Intercom Doorbell",
|
|
6
|
+
"disabled": false,
|
|
7
|
+
"info": ""
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"id": "comment-access-intercom-doorbell",
|
|
11
|
+
"type": "comment",
|
|
12
|
+
"z": "tab-access-intercom-doorbell",
|
|
13
|
+
"name": "Setup",
|
|
14
|
+
"info": "Replace the Access host, API token, and intercom id before deploying.\nRoom Name is manual. Cancel Doorbell uses the shared safe-cancel tracking from the Access config node.",
|
|
15
|
+
"x": 300,
|
|
16
|
+
"y": 60,
|
|
17
|
+
"wires": []
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"id": "inject-access-intercom-observe",
|
|
21
|
+
"type": "inject",
|
|
22
|
+
"z": "tab-access-intercom-doorbell",
|
|
23
|
+
"name": "Start Observe",
|
|
24
|
+
"props": [],
|
|
25
|
+
"repeat": "",
|
|
26
|
+
"crontab": "",
|
|
27
|
+
"once": false,
|
|
28
|
+
"onceDelay": 0.1,
|
|
29
|
+
"topic": "",
|
|
30
|
+
"x": 150,
|
|
31
|
+
"y": 140,
|
|
32
|
+
"wires": [
|
|
33
|
+
[
|
|
34
|
+
"node-access-intercom-observe"
|
|
35
|
+
]
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"id": "node-access-intercom-observe",
|
|
40
|
+
"type": "unifi-access-device",
|
|
41
|
+
"z": "tab-access-intercom-doorbell",
|
|
42
|
+
"name": "Observe Intercom",
|
|
43
|
+
"server": "config-access-intercom-doorbell",
|
|
44
|
+
"deviceType": "device",
|
|
45
|
+
"deviceId": "replace-with-intercom-id",
|
|
46
|
+
"capability": "observe",
|
|
47
|
+
"capabilityConfig": "{}",
|
|
48
|
+
"timeout": "15000",
|
|
49
|
+
"x": 430,
|
|
50
|
+
"y": 140,
|
|
51
|
+
"wires": [
|
|
52
|
+
[
|
|
53
|
+
"debug-access-intercom-state"
|
|
54
|
+
],
|
|
55
|
+
[
|
|
56
|
+
"debug-access-intercom-events"
|
|
57
|
+
]
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"id": "debug-access-intercom-state",
|
|
62
|
+
"type": "debug",
|
|
63
|
+
"z": "tab-access-intercom-doorbell",
|
|
64
|
+
"name": "Intercom State",
|
|
65
|
+
"active": true,
|
|
66
|
+
"tosidebar": true,
|
|
67
|
+
"console": false,
|
|
68
|
+
"tostatus": false,
|
|
69
|
+
"complete": "true",
|
|
70
|
+
"targetType": "full",
|
|
71
|
+
"x": 720,
|
|
72
|
+
"y": 120,
|
|
73
|
+
"wires": []
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"id": "debug-access-intercom-events",
|
|
77
|
+
"type": "debug",
|
|
78
|
+
"z": "tab-access-intercom-doorbell",
|
|
79
|
+
"name": "Intercom Events",
|
|
80
|
+
"active": true,
|
|
81
|
+
"tosidebar": true,
|
|
82
|
+
"console": false,
|
|
83
|
+
"tostatus": false,
|
|
84
|
+
"complete": "true",
|
|
85
|
+
"targetType": "full",
|
|
86
|
+
"x": 720,
|
|
87
|
+
"y": 160,
|
|
88
|
+
"wires": []
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"id": "inject-access-trigger-doorbell",
|
|
92
|
+
"type": "inject",
|
|
93
|
+
"z": "tab-access-intercom-doorbell",
|
|
94
|
+
"name": "Trigger Doorbell",
|
|
95
|
+
"props": [],
|
|
96
|
+
"repeat": "",
|
|
97
|
+
"crontab": "",
|
|
98
|
+
"once": false,
|
|
99
|
+
"onceDelay": 0.1,
|
|
100
|
+
"topic": "",
|
|
101
|
+
"x": 150,
|
|
102
|
+
"y": 240,
|
|
103
|
+
"wires": [
|
|
104
|
+
[
|
|
105
|
+
"node-access-trigger-doorbell"
|
|
106
|
+
]
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"id": "node-access-trigger-doorbell",
|
|
111
|
+
"type": "unifi-access-device",
|
|
112
|
+
"z": "tab-access-intercom-doorbell",
|
|
113
|
+
"name": "Trigger Doorbell",
|
|
114
|
+
"server": "config-access-intercom-doorbell",
|
|
115
|
+
"deviceType": "device",
|
|
116
|
+
"deviceId": "replace-with-intercom-id",
|
|
117
|
+
"capability": "triggerDoorbell",
|
|
118
|
+
"capabilityConfig": "{\"room_name\":\"\"}",
|
|
119
|
+
"timeout": "15000",
|
|
120
|
+
"x": 430,
|
|
121
|
+
"y": 240,
|
|
122
|
+
"wires": [
|
|
123
|
+
[
|
|
124
|
+
"debug-access-trigger-doorbell"
|
|
125
|
+
],
|
|
126
|
+
[]
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"id": "debug-access-trigger-doorbell",
|
|
131
|
+
"type": "debug",
|
|
132
|
+
"z": "tab-access-intercom-doorbell",
|
|
133
|
+
"name": "Trigger Response",
|
|
134
|
+
"active": true,
|
|
135
|
+
"tosidebar": true,
|
|
136
|
+
"console": false,
|
|
137
|
+
"tostatus": false,
|
|
138
|
+
"complete": "true",
|
|
139
|
+
"targetType": "full",
|
|
140
|
+
"x": 720,
|
|
141
|
+
"y": 240,
|
|
142
|
+
"wires": []
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"id": "inject-access-cancel-doorbell",
|
|
146
|
+
"type": "inject",
|
|
147
|
+
"z": "tab-access-intercom-doorbell",
|
|
148
|
+
"name": "Cancel Doorbell",
|
|
149
|
+
"props": [],
|
|
150
|
+
"repeat": "",
|
|
151
|
+
"crontab": "",
|
|
152
|
+
"once": false,
|
|
153
|
+
"onceDelay": 0.1,
|
|
154
|
+
"topic": "",
|
|
155
|
+
"x": 150,
|
|
156
|
+
"y": 320,
|
|
157
|
+
"wires": [
|
|
158
|
+
[
|
|
159
|
+
"node-access-cancel-doorbell"
|
|
160
|
+
]
|
|
161
|
+
]
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"id": "node-access-cancel-doorbell",
|
|
165
|
+
"type": "unifi-access-device",
|
|
166
|
+
"z": "tab-access-intercom-doorbell",
|
|
167
|
+
"name": "Cancel Doorbell",
|
|
168
|
+
"server": "config-access-intercom-doorbell",
|
|
169
|
+
"deviceType": "device",
|
|
170
|
+
"deviceId": "replace-with-intercom-id",
|
|
171
|
+
"capability": "cancelDoorbell",
|
|
172
|
+
"capabilityConfig": "{\"room_name\":\"\"}",
|
|
173
|
+
"timeout": "15000",
|
|
174
|
+
"x": 430,
|
|
175
|
+
"y": 320,
|
|
176
|
+
"wires": [
|
|
177
|
+
[
|
|
178
|
+
"debug-access-cancel-doorbell"
|
|
179
|
+
],
|
|
180
|
+
[]
|
|
181
|
+
]
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"id": "debug-access-cancel-doorbell",
|
|
185
|
+
"type": "debug",
|
|
186
|
+
"z": "tab-access-intercom-doorbell",
|
|
187
|
+
"name": "Cancel Response",
|
|
188
|
+
"active": true,
|
|
189
|
+
"tosidebar": true,
|
|
190
|
+
"console": false,
|
|
191
|
+
"tostatus": false,
|
|
192
|
+
"complete": "true",
|
|
193
|
+
"targetType": "full",
|
|
194
|
+
"x": 720,
|
|
195
|
+
"y": 320,
|
|
196
|
+
"wires": []
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"id": "config-access-intercom-doorbell",
|
|
200
|
+
"type": "unifi-access-config",
|
|
201
|
+
"name": "My Access",
|
|
202
|
+
"host": "192.168.1.20",
|
|
203
|
+
"rejectUnauthorized": false
|
|
204
|
+
}
|
|
205
|
+
]
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "tab-protect-camera-actions",
|
|
4
|
+
"type": "tab",
|
|
5
|
+
"label": "UniFi Protect Camera Actions",
|
|
6
|
+
"disabled": false,
|
|
7
|
+
"info": ""
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"id": "comment-protect-camera-actions",
|
|
11
|
+
"type": "comment",
|
|
12
|
+
"z": "tab-protect-camera-actions",
|
|
13
|
+
"name": "Setup",
|
|
14
|
+
"info": "Replace the controller IP, API key, and camera ids before deploying.\nUse a PTZ camera for the PTZ example and a doorbell camera for the doorbell message example.",
|
|
15
|
+
"x": 290,
|
|
16
|
+
"y": 60,
|
|
17
|
+
"wires": []
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"id": "inject-protect-snapshot",
|
|
21
|
+
"type": "inject",
|
|
22
|
+
"z": "tab-protect-camera-actions",
|
|
23
|
+
"name": "Take Snapshot",
|
|
24
|
+
"props": [],
|
|
25
|
+
"repeat": "",
|
|
26
|
+
"crontab": "",
|
|
27
|
+
"once": false,
|
|
28
|
+
"onceDelay": 0.1,
|
|
29
|
+
"topic": "",
|
|
30
|
+
"x": 150,
|
|
31
|
+
"y": 140,
|
|
32
|
+
"wires": [
|
|
33
|
+
[
|
|
34
|
+
"node-protect-snapshot"
|
|
35
|
+
]
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"id": "node-protect-snapshot",
|
|
40
|
+
"type": "unifi-protect-device",
|
|
41
|
+
"z": "tab-protect-camera-actions",
|
|
42
|
+
"name": "Front Camera Snapshot",
|
|
43
|
+
"server": "config-protect-camera-actions",
|
|
44
|
+
"deviceType": "camera",
|
|
45
|
+
"deviceId": "replace-with-camera-id",
|
|
46
|
+
"capability": "getSnapshot",
|
|
47
|
+
"capabilityConfig": "{\"forceHighQuality\":\"true\"}",
|
|
48
|
+
"timeout": "15000",
|
|
49
|
+
"x": 440,
|
|
50
|
+
"y": 140,
|
|
51
|
+
"wires": [
|
|
52
|
+
[
|
|
53
|
+
"debug-protect-snapshot"
|
|
54
|
+
],
|
|
55
|
+
[]
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"id": "debug-protect-snapshot",
|
|
60
|
+
"type": "debug",
|
|
61
|
+
"z": "tab-protect-camera-actions",
|
|
62
|
+
"name": "Snapshot Response",
|
|
63
|
+
"active": true,
|
|
64
|
+
"tosidebar": true,
|
|
65
|
+
"console": false,
|
|
66
|
+
"tostatus": false,
|
|
67
|
+
"complete": "payload",
|
|
68
|
+
"targetType": "msg",
|
|
69
|
+
"x": 730,
|
|
70
|
+
"y": 140,
|
|
71
|
+
"wires": []
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"id": "inject-protect-ptz-preset",
|
|
75
|
+
"type": "inject",
|
|
76
|
+
"z": "tab-protect-camera-actions",
|
|
77
|
+
"name": "Recall PTZ Preset",
|
|
78
|
+
"props": [],
|
|
79
|
+
"repeat": "",
|
|
80
|
+
"crontab": "",
|
|
81
|
+
"once": false,
|
|
82
|
+
"onceDelay": 0.1,
|
|
83
|
+
"topic": "",
|
|
84
|
+
"x": 160,
|
|
85
|
+
"y": 220,
|
|
86
|
+
"wires": [
|
|
87
|
+
[
|
|
88
|
+
"node-protect-ptz-preset"
|
|
89
|
+
]
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"id": "node-protect-ptz-preset",
|
|
94
|
+
"type": "unifi-protect-device",
|
|
95
|
+
"z": "tab-protect-camera-actions",
|
|
96
|
+
"name": "PTZ Camera Preset 1",
|
|
97
|
+
"server": "config-protect-camera-actions",
|
|
98
|
+
"deviceType": "camera",
|
|
99
|
+
"deviceId": "replace-with-ptz-camera-id",
|
|
100
|
+
"capability": "gotoPtzPreset",
|
|
101
|
+
"capabilityConfig": "{\"slot\":\"1\"}",
|
|
102
|
+
"timeout": "15000",
|
|
103
|
+
"x": 450,
|
|
104
|
+
"y": 220,
|
|
105
|
+
"wires": [
|
|
106
|
+
[
|
|
107
|
+
"debug-protect-ptz"
|
|
108
|
+
],
|
|
109
|
+
[]
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"id": "debug-protect-ptz",
|
|
114
|
+
"type": "debug",
|
|
115
|
+
"z": "tab-protect-camera-actions",
|
|
116
|
+
"name": "PTZ Response",
|
|
117
|
+
"active": true,
|
|
118
|
+
"tosidebar": true,
|
|
119
|
+
"console": false,
|
|
120
|
+
"tostatus": false,
|
|
121
|
+
"complete": "true",
|
|
122
|
+
"targetType": "full",
|
|
123
|
+
"x": 730,
|
|
124
|
+
"y": 220,
|
|
125
|
+
"wires": []
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"id": "inject-protect-doorbell-message",
|
|
129
|
+
"type": "inject",
|
|
130
|
+
"z": "tab-protect-camera-actions",
|
|
131
|
+
"name": "Show Doorbell Message",
|
|
132
|
+
"props": [],
|
|
133
|
+
"repeat": "",
|
|
134
|
+
"crontab": "",
|
|
135
|
+
"once": false,
|
|
136
|
+
"onceDelay": 0.1,
|
|
137
|
+
"topic": "",
|
|
138
|
+
"x": 170,
|
|
139
|
+
"y": 300,
|
|
140
|
+
"wires": [
|
|
141
|
+
[
|
|
142
|
+
"node-protect-doorbell-message"
|
|
143
|
+
]
|
|
144
|
+
]
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"id": "node-protect-doorbell-message",
|
|
148
|
+
"type": "unifi-protect-device",
|
|
149
|
+
"z": "tab-protect-camera-actions",
|
|
150
|
+
"name": "Doorbell Message",
|
|
151
|
+
"server": "config-protect-camera-actions",
|
|
152
|
+
"deviceType": "camera",
|
|
153
|
+
"deviceId": "replace-with-doorbell-camera-id",
|
|
154
|
+
"capability": "setDoorbellMessage",
|
|
155
|
+
"capabilityConfig": "{\"messageType\":\"DO_NOT_DISTURB\",\"resetAt\":\"\"}",
|
|
156
|
+
"timeout": "15000",
|
|
157
|
+
"x": 450,
|
|
158
|
+
"y": 300,
|
|
159
|
+
"wires": [
|
|
160
|
+
[
|
|
161
|
+
"debug-protect-doorbell"
|
|
162
|
+
],
|
|
163
|
+
[]
|
|
164
|
+
]
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"id": "debug-protect-doorbell",
|
|
168
|
+
"type": "debug",
|
|
169
|
+
"z": "tab-protect-camera-actions",
|
|
170
|
+
"name": "Doorbell Response",
|
|
171
|
+
"active": true,
|
|
172
|
+
"tosidebar": true,
|
|
173
|
+
"console": false,
|
|
174
|
+
"tostatus": false,
|
|
175
|
+
"complete": "true",
|
|
176
|
+
"targetType": "full",
|
|
177
|
+
"x": 740,
|
|
178
|
+
"y": 300,
|
|
179
|
+
"wires": []
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"id": "config-protect-camera-actions",
|
|
183
|
+
"type": "unifi-protect-config",
|
|
184
|
+
"name": "My Protect",
|
|
185
|
+
"host": "192.168.1.10",
|
|
186
|
+
"authHeader": "X-API-Key",
|
|
187
|
+
"rejectUnauthorized": false
|
|
188
|
+
}
|
|
189
|
+
]
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "tab-protect-sensor-observe",
|
|
4
|
+
"type": "tab",
|
|
5
|
+
"label": "UniFi Protect Sensor Observe",
|
|
6
|
+
"disabled": false,
|
|
7
|
+
"info": ""
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"id": "comment-protect-sensor-observe",
|
|
11
|
+
"type": "comment",
|
|
12
|
+
"z": "tab-protect-sensor-observe",
|
|
13
|
+
"name": "Setup",
|
|
14
|
+
"info": "Replace the controller IP, API key, and sensor id before deploying.\nThis example emits true/false on output 1 using the selected sensor observable.",
|
|
15
|
+
"x": 220,
|
|
16
|
+
"y": 60,
|
|
17
|
+
"wires": []
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"id": "inject-protect-sensor-observe",
|
|
21
|
+
"type": "inject",
|
|
22
|
+
"z": "tab-protect-sensor-observe",
|
|
23
|
+
"name": "Start Observe",
|
|
24
|
+
"props": [],
|
|
25
|
+
"repeat": "",
|
|
26
|
+
"crontab": "",
|
|
27
|
+
"once": false,
|
|
28
|
+
"onceDelay": 0.1,
|
|
29
|
+
"topic": "",
|
|
30
|
+
"x": 170,
|
|
31
|
+
"y": 140,
|
|
32
|
+
"wires": [
|
|
33
|
+
[
|
|
34
|
+
"node-protect-sensor-observe"
|
|
35
|
+
]
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"id": "node-protect-sensor-observe",
|
|
40
|
+
"type": "unifi-protect-device",
|
|
41
|
+
"z": "tab-protect-sensor-observe",
|
|
42
|
+
"name": "Door Sensor Contact",
|
|
43
|
+
"server": "config-protect-sensor-observe",
|
|
44
|
+
"deviceType": "sensor",
|
|
45
|
+
"deviceId": "replace-with-sensor-id",
|
|
46
|
+
"capability": "observe",
|
|
47
|
+
"capabilityConfig": "{\"observable\":\"contact\"}",
|
|
48
|
+
"timeout": "15000",
|
|
49
|
+
"x": 450,
|
|
50
|
+
"y": 140,
|
|
51
|
+
"wires": [
|
|
52
|
+
[
|
|
53
|
+
"debug-protect-sensor-state"
|
|
54
|
+
],
|
|
55
|
+
[
|
|
56
|
+
"debug-protect-sensor-events"
|
|
57
|
+
]
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"id": "debug-protect-sensor-state",
|
|
62
|
+
"type": "debug",
|
|
63
|
+
"z": "tab-protect-sensor-observe",
|
|
64
|
+
"name": "Sensor Boolean State",
|
|
65
|
+
"active": true,
|
|
66
|
+
"tosidebar": true,
|
|
67
|
+
"console": false,
|
|
68
|
+
"tostatus": false,
|
|
69
|
+
"complete": "true",
|
|
70
|
+
"targetType": "full",
|
|
71
|
+
"x": 760,
|
|
72
|
+
"y": 120,
|
|
73
|
+
"wires": []
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"id": "debug-protect-sensor-events",
|
|
77
|
+
"type": "debug",
|
|
78
|
+
"z": "tab-protect-sensor-observe",
|
|
79
|
+
"name": "Sensor Raw Events",
|
|
80
|
+
"active": true,
|
|
81
|
+
"tosidebar": true,
|
|
82
|
+
"console": false,
|
|
83
|
+
"tostatus": false,
|
|
84
|
+
"complete": "true",
|
|
85
|
+
"targetType": "full",
|
|
86
|
+
"x": 750,
|
|
87
|
+
"y": 160,
|
|
88
|
+
"wires": []
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"id": "config-protect-sensor-observe",
|
|
92
|
+
"type": "unifi-protect-config",
|
|
93
|
+
"name": "My Protect",
|
|
94
|
+
"host": "192.168.1.10",
|
|
95
|
+
"authHeader": "X-API-Key",
|
|
96
|
+
"rejectUnauthorized": false
|
|
97
|
+
}
|
|
98
|
+
]
|
|
Binary file
|
|
@@ -18,7 +18,7 @@ const {
|
|
|
18
18
|
} = require("./utils/unifi-access-device-registry");
|
|
19
19
|
|
|
20
20
|
module.exports = function(RED) {
|
|
21
|
-
const ACTIVE_DOORBELL_TTL_MS =
|
|
21
|
+
const ACTIVE_DOORBELL_TTL_MS = 180000;
|
|
22
22
|
|
|
23
23
|
function UnifiAccessConfigNode(config) {
|
|
24
24
|
RED.nodes.createNode(this, config);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-red-contrib-unifi-ultimate",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.5",
|
|
4
4
|
"description": "Node-RED nodes for Ubiquiti UniFi integrations, including UniFi Protect and UniFi Access.",
|
|
5
5
|
"files": [
|
|
6
6
|
"nodes/",
|
|
@@ -41,4 +41,4 @@
|
|
|
41
41
|
"scripts": {
|
|
42
42
|
"test": "node --check nodes/unifi-access-config.js && node --check nodes/unifi-access-device.js && node --check nodes/unifi-protect-config.js && node --check nodes/unifi-protect-device.js && node --check nodes/utils/unifi-access-utils.js && node --check nodes/utils/unifi-access-device-registry.js && node --check nodes/utils/unifi-protect-utils.js && node --check nodes/utils/unifi-protect-field-metadata.js && node --check nodes/utils/unifi-protect-device-registry.js"
|
|
43
43
|
}
|
|
44
|
-
}
|
|
44
|
+
}
|