@avantics/node-red-home-automation 3.0.1 → 4.0.0
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 +262 -13
- package/dist/lib/activity-lighting-controller.d.ts +7 -1
- package/dist/lib/activity-lighting-controller.js +37 -3
- package/dist/lib/adopted-request.d.ts +26 -0
- package/dist/lib/adopted-request.js +44 -0
- package/dist/lib/avr-controller.d.ts +8 -1
- package/dist/lib/avr-controller.js +27 -3
- package/dist/lib/avr-publishing.d.ts +24 -0
- package/dist/lib/avr-publishing.js +80 -0
- package/dist/lib/backlighting-controller.d.ts +7 -1
- package/dist/lib/backlighting-controller.js +26 -3
- package/dist/lib/circadian.d.ts +1 -0
- package/dist/lib/circadian.js +3 -0
- package/dist/lib/cover-availability.d.ts +7 -0
- package/dist/lib/cover-availability.js +24 -0
- package/dist/lib/cover-controller.d.ts +13 -1
- package/dist/lib/cover-controller.js +113 -30
- package/dist/lib/cover-group.d.ts +62 -0
- package/dist/lib/cover-group.js +125 -0
- package/dist/lib/cover-models.d.ts +37 -0
- package/dist/lib/cover-models.js +83 -0
- package/dist/lib/cover-publishing.d.ts +40 -0
- package/dist/lib/cover-publishing.js +102 -0
- package/dist/lib/cover-requests.d.ts +21 -0
- package/dist/lib/cover-requests.js +49 -0
- package/dist/lib/display-mode-controller.d.ts +4 -0
- package/dist/lib/display-mode-controller.js +26 -2
- package/dist/lib/ha-discovery.d.ts +27 -0
- package/dist/lib/ha-discovery.js +91 -0
- package/dist/lib/house-schedule-publishing.d.ts +23 -0
- package/dist/lib/house-schedule-publishing.js +71 -0
- package/dist/lib/house-schedule.d.ts +23 -0
- package/dist/lib/house-schedule.js +29 -0
- package/dist/lib/motion-policy.d.ts +9 -0
- package/dist/lib/motion-policy.js +45 -11
- package/dist/lib/motion-publishing.d.ts +28 -0
- package/dist/lib/motion-publishing.js +92 -0
- package/dist/lib/occupancy-publishing.d.ts +10 -0
- package/dist/lib/occupancy-publishing.js +45 -0
- package/dist/lib/open-close-cover.d.ts +92 -0
- package/dist/lib/open-close-cover.js +287 -0
- package/dist/lib/publishing-node.d.ts +39 -0
- package/dist/lib/publishing-node.js +72 -0
- package/dist/lib/retained-topics.d.ts +10 -0
- package/dist/lib/retained-topics.js +19 -0
- package/dist/lib/room-controller.d.ts +9 -0
- package/dist/lib/room-controller.js +47 -56
- package/dist/lib/room-lighting-discovery.d.ts +20 -1
- package/dist/lib/room-lighting-discovery.js +135 -13
- package/dist/lib/room-publishing.d.ts +42 -0
- package/dist/lib/room-publishing.js +182 -0
- package/dist/lib/room-schedule.d.ts +8 -0
- package/dist/lib/room-schedule.js +41 -0
- package/dist/lib/settings.d.ts +2 -0
- package/dist/lib/settings.js +20 -0
- package/dist/lib/source-capability-controller.d.ts +8 -1
- package/dist/lib/source-capability-controller.js +29 -3
- package/dist/lib/theatre-activity-controller.d.ts +0 -1
- package/dist/lib/theatre-activity-controller.js +27 -24
- package/dist/lib/theatre-ha-discovery.d.ts +3 -4
- package/dist/lib/theatre-ha-discovery.js +46 -36
- package/dist/lib/theatre-state-contract.d.ts +6 -0
- package/dist/lib/theatre-state-contract.js +83 -47
- package/dist/lib/theatre-state.d.ts +1 -1
- package/dist/lib/theatre-state.js +1 -1
- package/dist/lib/topic-names.d.ts +4 -0
- package/dist/lib/topic-names.js +31 -0
- package/dist/nodes/activity-lighting-controller.js +5 -3
- package/dist/nodes/adapter.d.ts +6 -1
- package/dist/nodes/adapter.js +65 -1
- package/dist/nodes/avr-controller.html +59 -5
- package/dist/nodes/avr-controller.js +74 -4
- package/dist/nodes/backlighting-controller.js +5 -3
- package/dist/nodes/cover-controller.d.ts +3 -0
- package/dist/nodes/cover-controller.html +177 -0
- package/dist/nodes/cover-controller.js +178 -0
- package/dist/nodes/cover-group.d.ts +3 -0
- package/dist/nodes/cover-group.html +89 -0
- package/dist/nodes/cover-group.js +84 -0
- package/dist/nodes/flows-started.d.ts +4 -0
- package/dist/nodes/flows-started.js +39 -0
- package/dist/nodes/house-schedule-mqtt.d.ts +3 -0
- package/dist/nodes/house-schedule-mqtt.html +61 -0
- package/dist/nodes/house-schedule-mqtt.js +80 -0
- package/dist/nodes/house-schedule.d.ts +3 -0
- package/dist/nodes/house-schedule.html +31 -0
- package/dist/nodes/house-schedule.js +51 -0
- package/dist/nodes/motion-policy.html +81 -5
- package/dist/nodes/motion-policy.js +69 -8
- package/dist/nodes/occupancy-fusion.html +69 -14
- package/dist/nodes/occupancy-fusion.js +46 -4
- package/dist/nodes/publishing-lifecycle.d.ts +25 -0
- package/dist/nodes/publishing-lifecycle.js +38 -0
- package/dist/nodes/room-controller.html +49 -5
- package/dist/nodes/room-controller.js +67 -8
- package/dist/nodes/shared-schedule.d.ts +6 -0
- package/dist/nodes/shared-schedule.js +15 -0
- package/dist/nodes/source-capability-controller.js +5 -3
- package/dist/nodes/theatre-activity-controller.html +1 -3
- package/dist/nodes/theatre-activity-controller.js +1 -2
- package/dist/nodes/theatre-state-contract.html +28 -5
- package/dist/nodes/theatre-state-contract.js +22 -4
- package/examples/Cover control.json +380 -0
- package/examples/Cover pair.json +230 -0
- package/examples/Home theatre activity.json +4 -4
- package/examples/House schedule.json +164 -0
- package/examples/Room lighting.json +4 -3
- package/package.json +6 -2
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "example-cover-control-cover-control-example",
|
|
4
|
+
"type": "comment",
|
|
5
|
+
"name": "Cover control example",
|
|
6
|
+
"info": "A position cover (blind, shutter or curtain motor) owned by the cover controller. Requests go in as \"open\", \"close\", \"stop\", a position from 0 to 100, or a preset name; an automatic target sets respectManual so a person's move holds. The function nodes show the mapping to and from a Zigbee2MQTT cover: wire them to MQTT out and in nodes on your cover's topic. A button can stop the cover if it is moving and open it otherwise, and the cover's availability report keeps requests from going to an offline device. Output 3 says whether the cover is moving, for other policies to react to. Here it pauses motion lighting while the cover moves, through the motion policy's pause input, which never touches the user's own enable.",
|
|
7
|
+
"x": 170,
|
|
8
|
+
"y": 40,
|
|
9
|
+
"wires": []
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"id": "example-cover-control-startup",
|
|
13
|
+
"type": "inject",
|
|
14
|
+
"name": "startup",
|
|
15
|
+
"props": [
|
|
16
|
+
{
|
|
17
|
+
"p": "cover",
|
|
18
|
+
"v": "{\"kind\":\"startup\"}",
|
|
19
|
+
"vt": "json"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"repeat": "",
|
|
23
|
+
"crontab": "",
|
|
24
|
+
"once": true,
|
|
25
|
+
"onceDelay": 3,
|
|
26
|
+
"topic": "",
|
|
27
|
+
"x": 130,
|
|
28
|
+
"y": 100,
|
|
29
|
+
"wires": [
|
|
30
|
+
[
|
|
31
|
+
"example-cover-control-cover"
|
|
32
|
+
]
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"id": "example-cover-control-open",
|
|
37
|
+
"type": "inject",
|
|
38
|
+
"name": "open",
|
|
39
|
+
"props": [
|
|
40
|
+
{
|
|
41
|
+
"p": "payload",
|
|
42
|
+
"v": "open",
|
|
43
|
+
"vt": "str"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"repeat": "",
|
|
47
|
+
"crontab": "",
|
|
48
|
+
"once": false,
|
|
49
|
+
"onceDelay": 0.1,
|
|
50
|
+
"topic": "",
|
|
51
|
+
"x": 120,
|
|
52
|
+
"y": 140,
|
|
53
|
+
"wires": [
|
|
54
|
+
[
|
|
55
|
+
"example-cover-control-cover"
|
|
56
|
+
]
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"id": "example-cover-control-close",
|
|
61
|
+
"type": "inject",
|
|
62
|
+
"name": "close",
|
|
63
|
+
"props": [
|
|
64
|
+
{
|
|
65
|
+
"p": "payload",
|
|
66
|
+
"v": "close",
|
|
67
|
+
"vt": "str"
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
"repeat": "",
|
|
71
|
+
"crontab": "",
|
|
72
|
+
"once": false,
|
|
73
|
+
"onceDelay": 0.1,
|
|
74
|
+
"topic": "",
|
|
75
|
+
"x": 120,
|
|
76
|
+
"y": 180,
|
|
77
|
+
"wires": [
|
|
78
|
+
[
|
|
79
|
+
"example-cover-control-cover"
|
|
80
|
+
]
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"id": "example-cover-control-partial",
|
|
85
|
+
"type": "inject",
|
|
86
|
+
"name": "partial preset",
|
|
87
|
+
"props": [
|
|
88
|
+
{
|
|
89
|
+
"p": "payload",
|
|
90
|
+
"v": "partial",
|
|
91
|
+
"vt": "str"
|
|
92
|
+
}
|
|
93
|
+
],
|
|
94
|
+
"repeat": "",
|
|
95
|
+
"crontab": "",
|
|
96
|
+
"once": false,
|
|
97
|
+
"onceDelay": 0.1,
|
|
98
|
+
"topic": "",
|
|
99
|
+
"x": 140,
|
|
100
|
+
"y": 220,
|
|
101
|
+
"wires": [
|
|
102
|
+
[
|
|
103
|
+
"example-cover-control-cover"
|
|
104
|
+
]
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"id": "example-cover-control-computed",
|
|
109
|
+
"type": "inject",
|
|
110
|
+
"name": "computed target 40",
|
|
111
|
+
"props": [
|
|
112
|
+
{
|
|
113
|
+
"p": "payload",
|
|
114
|
+
"v": "40",
|
|
115
|
+
"vt": "num"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"p": "respectManual",
|
|
119
|
+
"v": "true",
|
|
120
|
+
"vt": "bool"
|
|
121
|
+
}
|
|
122
|
+
],
|
|
123
|
+
"repeat": "",
|
|
124
|
+
"crontab": "",
|
|
125
|
+
"once": false,
|
|
126
|
+
"onceDelay": 0.1,
|
|
127
|
+
"topic": "",
|
|
128
|
+
"x": 160,
|
|
129
|
+
"y": 260,
|
|
130
|
+
"wires": [
|
|
131
|
+
[
|
|
132
|
+
"example-cover-control-cover"
|
|
133
|
+
]
|
|
134
|
+
]
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"id": "example-cover-control-report",
|
|
138
|
+
"type": "inject",
|
|
139
|
+
"name": "state report from the cover",
|
|
140
|
+
"props": [
|
|
141
|
+
{
|
|
142
|
+
"p": "payload",
|
|
143
|
+
"v": "{\"position\":60,\"motor_state\":\"stopped\",\"battery\":87,\"charging_status\":\"false\"}",
|
|
144
|
+
"vt": "json"
|
|
145
|
+
}
|
|
146
|
+
],
|
|
147
|
+
"repeat": "",
|
|
148
|
+
"crontab": "",
|
|
149
|
+
"once": false,
|
|
150
|
+
"onceDelay": 0.1,
|
|
151
|
+
"topic": "",
|
|
152
|
+
"x": 180,
|
|
153
|
+
"y": 320,
|
|
154
|
+
"wires": [
|
|
155
|
+
[
|
|
156
|
+
"example-cover-control-from-device"
|
|
157
|
+
]
|
|
158
|
+
]
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"id": "example-cover-control-from-device",
|
|
162
|
+
"type": "function",
|
|
163
|
+
"name": "from Zigbee2MQTT",
|
|
164
|
+
"func": "// A Zigbee2MQTT cover's state report (from an MQTT in node on its topic)\n// as what the cover controller reads. Position 100 is open.\nconst report = typeof msg.payload === \"string\" ? JSON.parse(msg.payload) : msg.payload;\nif (!report || typeof report.position !== \"number\") return null;\nconst motion = [\"opening\", \"closing\", \"stopped\"].includes(report.motor_state) ? report.motor_state : undefined;\nreturn {cover: {\n kind: \"observed\",\n position: report.position,\n motion,\n observedAt: new Date().toISOString(),\n battery: typeof report.battery === \"number\" ? report.battery : undefined,\n charging: typeof report.charging_status === \"string\" ? report.charging_status : undefined\n}};",
|
|
165
|
+
"outputs": 1,
|
|
166
|
+
"timeout": 0,
|
|
167
|
+
"noerr": 0,
|
|
168
|
+
"initialize": "",
|
|
169
|
+
"finalize": "",
|
|
170
|
+
"libs": [],
|
|
171
|
+
"x": 420,
|
|
172
|
+
"y": 320,
|
|
173
|
+
"wires": [
|
|
174
|
+
[
|
|
175
|
+
"example-cover-control-cover"
|
|
176
|
+
]
|
|
177
|
+
]
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"id": "example-cover-control-cover",
|
|
181
|
+
"type": "home-cover-controller",
|
|
182
|
+
"name": "",
|
|
183
|
+
"area": "",
|
|
184
|
+
"presets": "{\"partial\":60}",
|
|
185
|
+
"positionTolerance": 2,
|
|
186
|
+
"invert": false,
|
|
187
|
+
"travelTimeoutMs": 90000,
|
|
188
|
+
"maxAttempts": 2,
|
|
189
|
+
"pollMs": 5000,
|
|
190
|
+
"settleMs": 5000,
|
|
191
|
+
"x": 640,
|
|
192
|
+
"y": 200,
|
|
193
|
+
"wires": [
|
|
194
|
+
[
|
|
195
|
+
"example-cover-control-to-device"
|
|
196
|
+
],
|
|
197
|
+
[
|
|
198
|
+
"example-cover-control-state"
|
|
199
|
+
],
|
|
200
|
+
[
|
|
201
|
+
"example-cover-control-moving",
|
|
202
|
+
"example-cover-control-pause-motion"
|
|
203
|
+
]
|
|
204
|
+
]
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"id": "example-cover-control-to-device",
|
|
208
|
+
"type": "function",
|
|
209
|
+
"name": "to Zigbee2MQTT",
|
|
210
|
+
"func": "// Neutral cover commands to a Zigbee2MQTT cover. Put your cover's name in\n// the topic; wire the result to an MQTT out node.\nconst topic = \"zigbee2mqtt/<your cover>\";\nconst command = msg.cover_command;\nif (command.operation === \"observe\") return {topic: topic + \"/get\", payload: {position: \"\"}};\nif (command.operation === \"stop\") return {topic: topic + \"/set\", payload: \"STOP\"};\nreturn {topic: topic + \"/set\", payload: {position: command.position}};",
|
|
211
|
+
"outputs": 1,
|
|
212
|
+
"timeout": 0,
|
|
213
|
+
"noerr": 0,
|
|
214
|
+
"initialize": "",
|
|
215
|
+
"finalize": "",
|
|
216
|
+
"libs": [],
|
|
217
|
+
"x": 880,
|
|
218
|
+
"y": 140,
|
|
219
|
+
"wires": [
|
|
220
|
+
[
|
|
221
|
+
"example-cover-control-device-commands"
|
|
222
|
+
]
|
|
223
|
+
]
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"id": "example-cover-control-device-commands",
|
|
227
|
+
"type": "debug",
|
|
228
|
+
"name": "to the MQTT out node",
|
|
229
|
+
"active": true,
|
|
230
|
+
"tosidebar": true,
|
|
231
|
+
"console": false,
|
|
232
|
+
"tostatus": false,
|
|
233
|
+
"complete": "true",
|
|
234
|
+
"targetType": "full",
|
|
235
|
+
"statusVal": "",
|
|
236
|
+
"statusType": "auto",
|
|
237
|
+
"x": 1110,
|
|
238
|
+
"y": 140,
|
|
239
|
+
"wires": []
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"id": "example-cover-control-state",
|
|
243
|
+
"type": "debug",
|
|
244
|
+
"name": "state and results",
|
|
245
|
+
"active": true,
|
|
246
|
+
"tosidebar": true,
|
|
247
|
+
"console": false,
|
|
248
|
+
"tostatus": false,
|
|
249
|
+
"complete": "true",
|
|
250
|
+
"targetType": "full",
|
|
251
|
+
"statusVal": "",
|
|
252
|
+
"statusType": "auto",
|
|
253
|
+
"x": 870,
|
|
254
|
+
"y": 200,
|
|
255
|
+
"wires": []
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"id": "example-cover-control-button",
|
|
259
|
+
"type": "inject",
|
|
260
|
+
"name": "button: open, or stop if moving",
|
|
261
|
+
"props": [
|
|
262
|
+
{
|
|
263
|
+
"p": "payload",
|
|
264
|
+
"v": "open",
|
|
265
|
+
"vt": "str"
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"p": "stopIfMoving",
|
|
269
|
+
"v": "true",
|
|
270
|
+
"vt": "bool"
|
|
271
|
+
}
|
|
272
|
+
],
|
|
273
|
+
"repeat": "",
|
|
274
|
+
"crontab": "",
|
|
275
|
+
"once": false,
|
|
276
|
+
"onceDelay": 0.1,
|
|
277
|
+
"topic": "",
|
|
278
|
+
"x": 190,
|
|
279
|
+
"y": 400,
|
|
280
|
+
"wires": [
|
|
281
|
+
[
|
|
282
|
+
"example-cover-control-cover"
|
|
283
|
+
]
|
|
284
|
+
]
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
"id": "example-cover-control-availability-report",
|
|
288
|
+
"type": "inject",
|
|
289
|
+
"name": "availability report from the cover",
|
|
290
|
+
"props": [
|
|
291
|
+
{
|
|
292
|
+
"p": "payload",
|
|
293
|
+
"v": "{\"state\":\"online\"}",
|
|
294
|
+
"vt": "json"
|
|
295
|
+
}
|
|
296
|
+
],
|
|
297
|
+
"repeat": "",
|
|
298
|
+
"crontab": "",
|
|
299
|
+
"once": false,
|
|
300
|
+
"onceDelay": 0.1,
|
|
301
|
+
"topic": "",
|
|
302
|
+
"x": 200,
|
|
303
|
+
"y": 360,
|
|
304
|
+
"wires": [
|
|
305
|
+
[
|
|
306
|
+
"example-cover-control-from-availability"
|
|
307
|
+
]
|
|
308
|
+
]
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
"id": "example-cover-control-from-availability",
|
|
312
|
+
"type": "function",
|
|
313
|
+
"name": "availability from Zigbee2MQTT",
|
|
314
|
+
"func": "// A Zigbee2MQTT availability report (retained, from an MQTT in node on\n// <your cover>/availability) as the cover controller reads it.\nconst report = typeof msg.payload === \"string\" ? JSON.parse(msg.payload) : msg.payload;\nif (!report || (report.state !== \"online\" && report.state !== \"offline\")) return null;\nreturn {cover: {kind: \"availability\", online: report.state === \"online\"}};",
|
|
315
|
+
"outputs": 1,
|
|
316
|
+
"timeout": 0,
|
|
317
|
+
"noerr": 0,
|
|
318
|
+
"initialize": "",
|
|
319
|
+
"finalize": "",
|
|
320
|
+
"libs": [],
|
|
321
|
+
"x": 460,
|
|
322
|
+
"y": 360,
|
|
323
|
+
"wires": [
|
|
324
|
+
[
|
|
325
|
+
"example-cover-control-cover"
|
|
326
|
+
]
|
|
327
|
+
]
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
"id": "example-cover-control-moving",
|
|
331
|
+
"type": "debug",
|
|
332
|
+
"name": "moving",
|
|
333
|
+
"active": true,
|
|
334
|
+
"tosidebar": true,
|
|
335
|
+
"console": false,
|
|
336
|
+
"tostatus": false,
|
|
337
|
+
"complete": "true",
|
|
338
|
+
"targetType": "full",
|
|
339
|
+
"statusVal": "",
|
|
340
|
+
"statusType": "auto",
|
|
341
|
+
"x": 870,
|
|
342
|
+
"y": 260,
|
|
343
|
+
"wires": []
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
"id": "example-cover-control-pause-motion",
|
|
347
|
+
"type": "function",
|
|
348
|
+
"name": "pause motion while moving",
|
|
349
|
+
"func": "// While the cover moves, pause this room's motion lighting, and release\n// the pause when it stops: wire to the motion lighting policy. A pause\n// never touches the motion policy's enable, which is the user's own.\nreturn {source: \"pause\", owner: \"cover\", payload: msg.payload === true};",
|
|
350
|
+
"outputs": 1,
|
|
351
|
+
"timeout": 0,
|
|
352
|
+
"noerr": 0,
|
|
353
|
+
"initialize": "",
|
|
354
|
+
"finalize": "",
|
|
355
|
+
"libs": [],
|
|
356
|
+
"x": 900,
|
|
357
|
+
"y": 300,
|
|
358
|
+
"wires": [
|
|
359
|
+
[
|
|
360
|
+
"example-cover-control-motion-pause"
|
|
361
|
+
]
|
|
362
|
+
]
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
"id": "example-cover-control-motion-pause",
|
|
366
|
+
"type": "debug",
|
|
367
|
+
"name": "to the motion lighting policy",
|
|
368
|
+
"active": true,
|
|
369
|
+
"tosidebar": true,
|
|
370
|
+
"console": false,
|
|
371
|
+
"tostatus": false,
|
|
372
|
+
"complete": "true",
|
|
373
|
+
"targetType": "full",
|
|
374
|
+
"statusVal": "",
|
|
375
|
+
"statusType": "auto",
|
|
376
|
+
"x": 1150,
|
|
377
|
+
"y": 300,
|
|
378
|
+
"wires": []
|
|
379
|
+
}
|
|
380
|
+
]
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "example-cover-pair-cover-pair-example",
|
|
4
|
+
"type": "comment",
|
|
5
|
+
"name": "Cover pair example",
|
|
6
|
+
"info": "Two covers moved as one, such as the left and right of a curtain. The group sends each member the request, with its own request ID, on that member's own output (after the group's result on output 1); each member's second output comes back to the group, which reports ready only when both confirm, and otherwise which did what. Map each member's commands and reports to its device as in the Cover control example.",
|
|
7
|
+
"x": 160,
|
|
8
|
+
"y": 40,
|
|
9
|
+
"wires": []
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"id": "example-cover-pair-open",
|
|
13
|
+
"type": "inject",
|
|
14
|
+
"name": "open both",
|
|
15
|
+
"props": [
|
|
16
|
+
{
|
|
17
|
+
"p": "payload",
|
|
18
|
+
"v": "open",
|
|
19
|
+
"vt": "str"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"repeat": "",
|
|
23
|
+
"crontab": "",
|
|
24
|
+
"once": false,
|
|
25
|
+
"onceDelay": 0.1,
|
|
26
|
+
"topic": "",
|
|
27
|
+
"x": 130,
|
|
28
|
+
"y": 100,
|
|
29
|
+
"wires": [
|
|
30
|
+
[
|
|
31
|
+
"example-cover-pair-group"
|
|
32
|
+
]
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"id": "example-cover-pair-partial",
|
|
37
|
+
"type": "inject",
|
|
38
|
+
"name": "partial preset",
|
|
39
|
+
"props": [
|
|
40
|
+
{
|
|
41
|
+
"p": "payload",
|
|
42
|
+
"v": "partial",
|
|
43
|
+
"vt": "str"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"repeat": "",
|
|
47
|
+
"crontab": "",
|
|
48
|
+
"once": false,
|
|
49
|
+
"onceDelay": 0.1,
|
|
50
|
+
"topic": "",
|
|
51
|
+
"x": 140,
|
|
52
|
+
"y": 140,
|
|
53
|
+
"wires": [
|
|
54
|
+
[
|
|
55
|
+
"example-cover-pair-group"
|
|
56
|
+
]
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"id": "example-cover-pair-group",
|
|
61
|
+
"type": "home-cover-group",
|
|
62
|
+
"name": "",
|
|
63
|
+
"area": "",
|
|
64
|
+
"members": "[\"left\",\"right\"]",
|
|
65
|
+
"x": 350,
|
|
66
|
+
"y": 120,
|
|
67
|
+
"wires": [
|
|
68
|
+
[
|
|
69
|
+
"example-cover-pair-pair-result"
|
|
70
|
+
],
|
|
71
|
+
[
|
|
72
|
+
"example-cover-pair-left"
|
|
73
|
+
],
|
|
74
|
+
[
|
|
75
|
+
"example-cover-pair-right"
|
|
76
|
+
]
|
|
77
|
+
],
|
|
78
|
+
"outputs": 3
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"id": "example-cover-pair-pair-result",
|
|
82
|
+
"type": "debug",
|
|
83
|
+
"name": "pair result",
|
|
84
|
+
"active": true,
|
|
85
|
+
"tosidebar": true,
|
|
86
|
+
"console": false,
|
|
87
|
+
"tostatus": false,
|
|
88
|
+
"complete": "true",
|
|
89
|
+
"targetType": "full",
|
|
90
|
+
"statusVal": "",
|
|
91
|
+
"statusType": "auto",
|
|
92
|
+
"x": 570,
|
|
93
|
+
"y": 180,
|
|
94
|
+
"wires": []
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"id": "example-cover-pair-left",
|
|
98
|
+
"type": "home-cover-controller",
|
|
99
|
+
"name": "left curtain",
|
|
100
|
+
"area": "",
|
|
101
|
+
"coverType": "position",
|
|
102
|
+
"presets": "{\"partial\":60}",
|
|
103
|
+
"positionTolerance": 2,
|
|
104
|
+
"invert": false,
|
|
105
|
+
"travelTimeoutMs": 90000,
|
|
106
|
+
"maxAttempts": 2,
|
|
107
|
+
"pollMs": 5000,
|
|
108
|
+
"settleMs": 5000,
|
|
109
|
+
"travelMs": 30000,
|
|
110
|
+
"marginMs": 10000,
|
|
111
|
+
"x": 780,
|
|
112
|
+
"y": 80,
|
|
113
|
+
"wires": [
|
|
114
|
+
[
|
|
115
|
+
"example-cover-pair-left-commands"
|
|
116
|
+
],
|
|
117
|
+
[
|
|
118
|
+
"example-cover-pair-group"
|
|
119
|
+
],
|
|
120
|
+
[]
|
|
121
|
+
]
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"id": "example-cover-pair-right",
|
|
125
|
+
"type": "home-cover-controller",
|
|
126
|
+
"name": "right curtain",
|
|
127
|
+
"area": "",
|
|
128
|
+
"coverType": "position",
|
|
129
|
+
"presets": "{\"partial\":60}",
|
|
130
|
+
"positionTolerance": 2,
|
|
131
|
+
"invert": false,
|
|
132
|
+
"travelTimeoutMs": 90000,
|
|
133
|
+
"maxAttempts": 2,
|
|
134
|
+
"pollMs": 5000,
|
|
135
|
+
"settleMs": 5000,
|
|
136
|
+
"travelMs": 30000,
|
|
137
|
+
"marginMs": 10000,
|
|
138
|
+
"x": 780,
|
|
139
|
+
"y": 160,
|
|
140
|
+
"wires": [
|
|
141
|
+
[
|
|
142
|
+
"example-cover-pair-right-commands"
|
|
143
|
+
],
|
|
144
|
+
[
|
|
145
|
+
"example-cover-pair-group"
|
|
146
|
+
],
|
|
147
|
+
[]
|
|
148
|
+
]
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"id": "example-cover-pair-left-commands",
|
|
152
|
+
"type": "debug",
|
|
153
|
+
"name": "left curtain commands",
|
|
154
|
+
"active": true,
|
|
155
|
+
"tosidebar": true,
|
|
156
|
+
"console": false,
|
|
157
|
+
"tostatus": false,
|
|
158
|
+
"complete": "true",
|
|
159
|
+
"targetType": "full",
|
|
160
|
+
"statusVal": "",
|
|
161
|
+
"statusType": "auto",
|
|
162
|
+
"x": 1020,
|
|
163
|
+
"y": 80,
|
|
164
|
+
"wires": []
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"id": "example-cover-pair-right-commands",
|
|
168
|
+
"type": "debug",
|
|
169
|
+
"name": "right curtain commands",
|
|
170
|
+
"active": true,
|
|
171
|
+
"tosidebar": true,
|
|
172
|
+
"console": false,
|
|
173
|
+
"tostatus": false,
|
|
174
|
+
"complete": "true",
|
|
175
|
+
"targetType": "full",
|
|
176
|
+
"statusVal": "",
|
|
177
|
+
"statusType": "auto",
|
|
178
|
+
"x": 1020,
|
|
179
|
+
"y": 160,
|
|
180
|
+
"wires": []
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"id": "example-cover-pair-left-report",
|
|
184
|
+
"type": "inject",
|
|
185
|
+
"name": "left curtain reports open",
|
|
186
|
+
"props": [
|
|
187
|
+
{
|
|
188
|
+
"p": "cover",
|
|
189
|
+
"v": "{\"kind\": \"observed\", \"position\": 100, \"motion\": \"stopped\", \"observedAt\": $now()}",
|
|
190
|
+
"vt": "jsonata"
|
|
191
|
+
}
|
|
192
|
+
],
|
|
193
|
+
"repeat": "",
|
|
194
|
+
"crontab": "",
|
|
195
|
+
"once": false,
|
|
196
|
+
"onceDelay": 0.1,
|
|
197
|
+
"topic": "",
|
|
198
|
+
"x": 170,
|
|
199
|
+
"y": 260,
|
|
200
|
+
"wires": [
|
|
201
|
+
[
|
|
202
|
+
"example-cover-pair-left"
|
|
203
|
+
]
|
|
204
|
+
]
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"id": "example-cover-pair-right-report",
|
|
208
|
+
"type": "inject",
|
|
209
|
+
"name": "right curtain reports open",
|
|
210
|
+
"props": [
|
|
211
|
+
{
|
|
212
|
+
"p": "cover",
|
|
213
|
+
"v": "{\"kind\": \"observed\", \"position\": 100, \"motion\": \"stopped\", \"observedAt\": $now()}",
|
|
214
|
+
"vt": "jsonata"
|
|
215
|
+
}
|
|
216
|
+
],
|
|
217
|
+
"repeat": "",
|
|
218
|
+
"crontab": "",
|
|
219
|
+
"once": false,
|
|
220
|
+
"onceDelay": 0.1,
|
|
221
|
+
"topic": "",
|
|
222
|
+
"x": 180,
|
|
223
|
+
"y": 300,
|
|
224
|
+
"wires": [
|
|
225
|
+
[
|
|
226
|
+
"example-cover-pair-right"
|
|
227
|
+
]
|
|
228
|
+
]
|
|
229
|
+
}
|
|
230
|
+
]
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
],
|
|
51
51
|
"repeat": "",
|
|
52
52
|
"crontab": "",
|
|
53
|
-
"once":
|
|
54
|
-
"onceDelay":
|
|
53
|
+
"once": true,
|
|
54
|
+
"onceDelay": 3,
|
|
55
55
|
"topic": "",
|
|
56
56
|
"x": 170,
|
|
57
57
|
"y": 140,
|
|
@@ -84,7 +84,8 @@
|
|
|
84
84
|
"example-home-theatre-activity-retained-state"
|
|
85
85
|
]
|
|
86
86
|
],
|
|
87
|
-
"discovery": false
|
|
87
|
+
"discovery": false,
|
|
88
|
+
"idScheme": "node"
|
|
88
89
|
},
|
|
89
90
|
{
|
|
90
91
|
"id": "example-home-theatre-activity-retained-state",
|
|
@@ -108,7 +109,6 @@
|
|
|
108
109
|
"name": "",
|
|
109
110
|
"area": "",
|
|
110
111
|
"freshnessMs": 30000,
|
|
111
|
-
"recoveryOffActivity": "off",
|
|
112
112
|
"activityProfiles": "{\"off\":{\"display\":{\"mode\":\"off\"},\"avr\":{\"power\":\"standby\"},\"source\":{\"action\":\"deactivate\",\"readiness\":\"optional\"},\"lighting\":{\"profile\":\"off\"},\"backlighting\":{\"power\":\"off\"}},\"tv\":{\"display\":{\"mode\":\"tv\"},\"avr\":{\"power\":\"on\",\"source\":\"shield\"},\"source\":{\"action\":\"activate\",\"sourceId\":\"streamer\",\"readiness\":\"required\"},\"lighting\":{\"profile\":\"tv\"},\"backlighting\":{\"power\":\"on\"}}}",
|
|
113
113
|
"x": 680,
|
|
114
114
|
"y": 140,
|