@avantics/node-red-home-automation 0.0.0-stage → 2.3.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/LICENSE +21 -0
- package/README.md +292 -2
- package/contract-examples/README.md +28 -0
- package/contract-examples/_shared.mjs +11 -0
- package/contract-examples/motion-lighting.mjs +42 -0
- package/contract-examples/occupancy-fusion.mjs +35 -0
- package/contract-examples/room-lighting.mjs +58 -0
- package/contract-examples/run.mjs +16 -0
- package/contract-examples/source-readiness.mjs +64 -0
- package/contract-examples/switch-gestures.mjs +34 -0
- package/contract-examples/theatre-activity.mjs +62 -0
- package/contract-examples/volume-ownership.mjs +59 -0
- package/dist/lib/activity-lighting-controller.d.ts +129 -0
- package/dist/lib/activity-lighting-controller.js +372 -0
- package/dist/lib/avr-controller.d.ts +169 -0
- package/dist/lib/avr-controller.js +948 -0
- package/dist/lib/backlighting-controller.d.ts +108 -0
- package/dist/lib/backlighting-controller.js +269 -0
- package/dist/lib/bounded-trace.d.ts +30 -0
- package/dist/lib/bounded-trace.js +36 -0
- package/dist/lib/circadian-refresh.d.ts +7 -0
- package/dist/lib/circadian-refresh.js +11 -0
- package/dist/lib/circadian-schedule.d.ts +11 -0
- package/dist/lib/circadian-schedule.js +63 -0
- package/dist/lib/circadian.d.ts +6 -0
- package/dist/lib/circadian.js +15 -0
- package/dist/lib/cover-controller.d.ts +130 -0
- package/dist/lib/cover-controller.js +336 -0
- package/dist/lib/display-mode-controller.d.ts +148 -0
- package/dist/lib/display-mode-controller.js +587 -0
- package/dist/lib/display-transport.d.ts +41 -0
- package/dist/lib/display-transport.js +177 -0
- package/dist/lib/light-styling.d.ts +11 -0
- package/dist/lib/light-styling.js +15 -0
- package/dist/lib/motion-policy.d.ts +72 -0
- package/dist/lib/motion-policy.js +251 -0
- package/dist/lib/observation-time.d.ts +10 -0
- package/dist/lib/observation-time.js +40 -0
- package/dist/lib/occupancy-fusion.d.ts +53 -0
- package/dist/lib/occupancy-fusion.js +131 -0
- package/dist/lib/room-controller.d.ts +113 -0
- package/dist/lib/room-controller.js +431 -0
- package/dist/lib/source-capability-controller.d.ts +144 -0
- package/dist/lib/source-capability-controller.js +494 -0
- package/dist/lib/switch-policy.d.ts +53 -0
- package/dist/lib/switch-policy.js +110 -0
- package/dist/lib/theatre-activity-controller.d.ts +165 -0
- package/dist/lib/theatre-activity-controller.js +846 -0
- package/dist/lib/theatre-slo.d.ts +49 -0
- package/dist/lib/theatre-slo.js +156 -0
- package/dist/lib/theatre-state-contract.d.ts +77 -0
- package/dist/lib/theatre-state-contract.js +391 -0
- package/dist/lib/wall-input.d.ts +62 -0
- package/dist/lib/wall-input.js +198 -0
- package/dist/nodes/activity-lighting-controller.d.ts +3 -0
- package/dist/nodes/activity-lighting-controller.html +38 -0
- package/dist/nodes/activity-lighting-controller.js +116 -0
- package/dist/nodes/avr-controller.d.ts +3 -0
- package/dist/nodes/avr-controller.html +47 -0
- package/dist/nodes/avr-controller.js +130 -0
- package/dist/nodes/backlighting-controller.d.ts +3 -0
- package/dist/nodes/backlighting-controller.html +31 -0
- package/dist/nodes/backlighting-controller.js +103 -0
- package/dist/nodes/display-mode-controller.d.ts +3 -0
- package/dist/nodes/display-mode-controller.html +66 -0
- package/dist/nodes/display-mode-controller.js +132 -0
- package/dist/nodes/motion-policy.d.ts +3 -0
- package/dist/nodes/motion-policy.html +35 -0
- package/dist/nodes/motion-policy.js +194 -0
- package/dist/nodes/occupancy-fusion.d.ts +3 -0
- package/dist/nodes/occupancy-fusion.html +32 -0
- package/dist/nodes/occupancy-fusion.js +53 -0
- package/dist/nodes/room-controller.d.ts +3 -0
- package/dist/nodes/room-controller.html +82 -0
- package/dist/nodes/room-controller.js +123 -0
- package/dist/nodes/source-capability-controller.d.ts +3 -0
- package/dist/nodes/source-capability-controller.html +46 -0
- package/dist/nodes/source-capability-controller.js +114 -0
- package/dist/nodes/switch-policy.d.ts +3 -0
- package/dist/nodes/switch-policy.html +29 -0
- package/dist/nodes/switch-policy.js +129 -0
- package/dist/nodes/theatre-activity-controller.d.ts +3 -0
- package/dist/nodes/theatre-activity-controller.html +32 -0
- package/dist/nodes/theatre-activity-controller.js +105 -0
- package/dist/nodes/theatre-state-contract.d.ts +3 -0
- package/dist/nodes/theatre-state-contract.html +41 -0
- package/dist/nodes/theatre-state-contract.js +83 -0
- package/examples/Home theatre activity.json +477 -0
- package/examples/Home theatre equipment.json +329 -0
- package/examples/Room lighting.json +212 -0
- package/package.json +62 -4
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "example-home-theatre-equipment-home-theatre-equipment-example",
|
|
4
|
+
"type": "comment",
|
|
5
|
+
"name": "Home theatre equipment example",
|
|
6
|
+
"info": "Each equipment controller accepts a generation-scoped intent and reports target state. Output 1 carries commands for your device transport; output 2 carries theatre target state.\n\nThe display controller talks to the TV, screen and projector relay directly: set their hosts and the TV pre-shared key before deploying. Until then it shows \"invalid configuration\".",
|
|
7
|
+
"x": 190,
|
|
8
|
+
"y": 40,
|
|
9
|
+
"wires": []
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"id": "example-home-theatre-equipment-receiver-on-streamer",
|
|
13
|
+
"type": "inject",
|
|
14
|
+
"name": "receiver on, streamer",
|
|
15
|
+
"props": [
|
|
16
|
+
{
|
|
17
|
+
"p": "avr",
|
|
18
|
+
"v": "{\"kind\":\"intent\",\"requestId\":\"example-avr-1\",\"generation\":1,\"power\":\"on\",\"source\":\"shield\"}",
|
|
19
|
+
"vt": "json"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"repeat": "",
|
|
23
|
+
"crontab": "",
|
|
24
|
+
"once": false,
|
|
25
|
+
"onceDelay": 0.1,
|
|
26
|
+
"topic": "",
|
|
27
|
+
"x": 170,
|
|
28
|
+
"y": 100,
|
|
29
|
+
"wires": [
|
|
30
|
+
[
|
|
31
|
+
"example-home-theatre-equipment-avr-controller"
|
|
32
|
+
]
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"id": "example-home-theatre-equipment-avr-controller",
|
|
37
|
+
"type": "home-avr-controller",
|
|
38
|
+
"name": "",
|
|
39
|
+
"area": "room",
|
|
40
|
+
"sources": "{\"shield\":\"SAT/CBL\",\"playstation\":\"GAME\"}",
|
|
41
|
+
"retryMs": 2000,
|
|
42
|
+
"maxAttempts": 3,
|
|
43
|
+
"minVolume": 0,
|
|
44
|
+
"maxVolume": 60,
|
|
45
|
+
"x": 420,
|
|
46
|
+
"y": 100,
|
|
47
|
+
"wires": [
|
|
48
|
+
[
|
|
49
|
+
"example-home-theatre-equipment-receiver-commands"
|
|
50
|
+
],
|
|
51
|
+
[
|
|
52
|
+
"example-home-theatre-equipment-receiver-state"
|
|
53
|
+
]
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"id": "example-home-theatre-equipment-receiver-commands",
|
|
58
|
+
"type": "debug",
|
|
59
|
+
"name": "receiver commands",
|
|
60
|
+
"active": true,
|
|
61
|
+
"tosidebar": true,
|
|
62
|
+
"console": false,
|
|
63
|
+
"tostatus": false,
|
|
64
|
+
"complete": "true",
|
|
65
|
+
"targetType": "full",
|
|
66
|
+
"statusVal": "",
|
|
67
|
+
"statusType": "auto",
|
|
68
|
+
"x": 660,
|
|
69
|
+
"y": 80,
|
|
70
|
+
"wires": []
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"id": "example-home-theatre-equipment-receiver-state",
|
|
74
|
+
"type": "debug",
|
|
75
|
+
"name": "receiver state",
|
|
76
|
+
"active": true,
|
|
77
|
+
"tosidebar": true,
|
|
78
|
+
"console": false,
|
|
79
|
+
"tostatus": false,
|
|
80
|
+
"complete": "true",
|
|
81
|
+
"targetType": "full",
|
|
82
|
+
"statusVal": "",
|
|
83
|
+
"statusType": "auto",
|
|
84
|
+
"x": 660,
|
|
85
|
+
"y": 120,
|
|
86
|
+
"wires": []
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"id": "example-home-theatre-equipment-display-tv-mode",
|
|
90
|
+
"type": "inject",
|
|
91
|
+
"name": "display TV mode",
|
|
92
|
+
"props": [
|
|
93
|
+
{
|
|
94
|
+
"p": "display",
|
|
95
|
+
"v": "{\"kind\":\"intent\",\"requestId\":\"example-display-1\",\"generation\":1,\"mode\":\"tv\"}",
|
|
96
|
+
"vt": "json"
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
"repeat": "",
|
|
100
|
+
"crontab": "",
|
|
101
|
+
"once": false,
|
|
102
|
+
"onceDelay": 0.1,
|
|
103
|
+
"topic": "",
|
|
104
|
+
"x": 170,
|
|
105
|
+
"y": 200,
|
|
106
|
+
"wires": [
|
|
107
|
+
[
|
|
108
|
+
"example-home-theatre-equipment-display-mode-controller"
|
|
109
|
+
]
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"id": "example-home-theatre-equipment-display-mode-controller",
|
|
114
|
+
"type": "home-display-mode-controller",
|
|
115
|
+
"name": "",
|
|
116
|
+
"area": "room",
|
|
117
|
+
"tvHost": "",
|
|
118
|
+
"screenHost": "",
|
|
119
|
+
"projectorMeterHost": "",
|
|
120
|
+
"screenOpenPosition": 82,
|
|
121
|
+
"screenTolerance": 2,
|
|
122
|
+
"pollMs": 2000,
|
|
123
|
+
"queryTimeoutMs": 5000,
|
|
124
|
+
"tvTimeoutMs": 30000,
|
|
125
|
+
"screenTimeoutMs": 65000,
|
|
126
|
+
"projectorWarmupMs": 60000,
|
|
127
|
+
"projectorMinimumWarmupMs": 15000,
|
|
128
|
+
"projectorShutdownConfirmMs": 5000,
|
|
129
|
+
"projectorCooldownMs": 120000,
|
|
130
|
+
"maxAttempts": 2,
|
|
131
|
+
"projectorOnWatts": 20,
|
|
132
|
+
"projectorOffWatts": 10,
|
|
133
|
+
"projectorPowerFallback": false,
|
|
134
|
+
"transportTimeoutMs": 5000,
|
|
135
|
+
"x": 420,
|
|
136
|
+
"y": 200,
|
|
137
|
+
"wires": [
|
|
138
|
+
[
|
|
139
|
+
"example-home-theatre-equipment-display-commands"
|
|
140
|
+
],
|
|
141
|
+
[
|
|
142
|
+
"example-home-theatre-equipment-display-state"
|
|
143
|
+
]
|
|
144
|
+
]
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"id": "example-home-theatre-equipment-display-commands",
|
|
148
|
+
"type": "debug",
|
|
149
|
+
"name": "display commands",
|
|
150
|
+
"active": true,
|
|
151
|
+
"tosidebar": true,
|
|
152
|
+
"console": false,
|
|
153
|
+
"tostatus": false,
|
|
154
|
+
"complete": "true",
|
|
155
|
+
"targetType": "full",
|
|
156
|
+
"statusVal": "",
|
|
157
|
+
"statusType": "auto",
|
|
158
|
+
"x": 660,
|
|
159
|
+
"y": 180,
|
|
160
|
+
"wires": []
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"id": "example-home-theatre-equipment-display-state",
|
|
164
|
+
"type": "debug",
|
|
165
|
+
"name": "display state",
|
|
166
|
+
"active": true,
|
|
167
|
+
"tosidebar": true,
|
|
168
|
+
"console": false,
|
|
169
|
+
"tostatus": false,
|
|
170
|
+
"complete": "true",
|
|
171
|
+
"targetType": "full",
|
|
172
|
+
"statusVal": "",
|
|
173
|
+
"statusType": "auto",
|
|
174
|
+
"x": 660,
|
|
175
|
+
"y": 220,
|
|
176
|
+
"wires": []
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"id": "example-home-theatre-equipment-activate-streamer",
|
|
180
|
+
"type": "inject",
|
|
181
|
+
"name": "activate streamer",
|
|
182
|
+
"props": [
|
|
183
|
+
{
|
|
184
|
+
"p": "sourceCapability",
|
|
185
|
+
"v": "{\"kind\":\"intent\",\"requestId\":\"example-source-1\",\"generation\":1,\"sourceId\":\"streamer\",\"action\":\"activate\"}",
|
|
186
|
+
"vt": "json"
|
|
187
|
+
}
|
|
188
|
+
],
|
|
189
|
+
"repeat": "",
|
|
190
|
+
"crontab": "",
|
|
191
|
+
"once": false,
|
|
192
|
+
"onceDelay": 0.1,
|
|
193
|
+
"topic": "",
|
|
194
|
+
"x": 170,
|
|
195
|
+
"y": 300,
|
|
196
|
+
"wires": [
|
|
197
|
+
[
|
|
198
|
+
"example-home-theatre-equipment-source-capability-controller"
|
|
199
|
+
]
|
|
200
|
+
]
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"id": "example-home-theatre-equipment-source-capability-controller",
|
|
204
|
+
"type": "home-source-capability-controller",
|
|
205
|
+
"name": "",
|
|
206
|
+
"area": "room",
|
|
207
|
+
"sources": "{\"streamer\":{\"activation\":\"command\",\"deactivation\":\"command\",\"confirmation\":\"active\"}}",
|
|
208
|
+
"pollMs": 2000,
|
|
209
|
+
"confirmationTimeoutMs": 15000,
|
|
210
|
+
"maxAttempts": 2,
|
|
211
|
+
"x": 440,
|
|
212
|
+
"y": 300,
|
|
213
|
+
"wires": [
|
|
214
|
+
[
|
|
215
|
+
"example-home-theatre-equipment-source-commands"
|
|
216
|
+
],
|
|
217
|
+
[
|
|
218
|
+
"example-home-theatre-equipment-source-state"
|
|
219
|
+
]
|
|
220
|
+
]
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"id": "example-home-theatre-equipment-source-commands",
|
|
224
|
+
"type": "debug",
|
|
225
|
+
"name": "source commands",
|
|
226
|
+
"active": true,
|
|
227
|
+
"tosidebar": true,
|
|
228
|
+
"console": false,
|
|
229
|
+
"tostatus": false,
|
|
230
|
+
"complete": "true",
|
|
231
|
+
"targetType": "full",
|
|
232
|
+
"statusVal": "",
|
|
233
|
+
"statusType": "auto",
|
|
234
|
+
"x": 660,
|
|
235
|
+
"y": 280,
|
|
236
|
+
"wires": []
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"id": "example-home-theatre-equipment-source-state",
|
|
240
|
+
"type": "debug",
|
|
241
|
+
"name": "source state",
|
|
242
|
+
"active": true,
|
|
243
|
+
"tosidebar": true,
|
|
244
|
+
"console": false,
|
|
245
|
+
"tostatus": false,
|
|
246
|
+
"complete": "true",
|
|
247
|
+
"targetType": "full",
|
|
248
|
+
"statusVal": "",
|
|
249
|
+
"statusType": "auto",
|
|
250
|
+
"x": 660,
|
|
251
|
+
"y": 320,
|
|
252
|
+
"wires": []
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"id": "example-home-theatre-equipment-backlighting-on",
|
|
256
|
+
"type": "inject",
|
|
257
|
+
"name": "backlighting on",
|
|
258
|
+
"props": [
|
|
259
|
+
{
|
|
260
|
+
"p": "backlighting",
|
|
261
|
+
"v": "{\"kind\":\"intent\",\"requestId\":\"example-backlighting-1\",\"generation\":1,\"power\":\"on\"}",
|
|
262
|
+
"vt": "json"
|
|
263
|
+
}
|
|
264
|
+
],
|
|
265
|
+
"repeat": "",
|
|
266
|
+
"crontab": "",
|
|
267
|
+
"once": false,
|
|
268
|
+
"onceDelay": 0.1,
|
|
269
|
+
"topic": "",
|
|
270
|
+
"x": 170,
|
|
271
|
+
"y": 400,
|
|
272
|
+
"wires": [
|
|
273
|
+
[
|
|
274
|
+
"example-home-theatre-equipment-backlighting-controller"
|
|
275
|
+
]
|
|
276
|
+
]
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
"id": "example-home-theatre-equipment-backlighting-controller",
|
|
280
|
+
"type": "home-backlighting-controller",
|
|
281
|
+
"name": "",
|
|
282
|
+
"area": "room",
|
|
283
|
+
"pollMs": 2000,
|
|
284
|
+
"confirmationTimeoutMs": 15000,
|
|
285
|
+
"maxAttempts": 2,
|
|
286
|
+
"x": 430,
|
|
287
|
+
"y": 400,
|
|
288
|
+
"wires": [
|
|
289
|
+
[
|
|
290
|
+
"example-home-theatre-equipment-backlighting-commands"
|
|
291
|
+
],
|
|
292
|
+
[
|
|
293
|
+
"example-home-theatre-equipment-backlighting-state"
|
|
294
|
+
]
|
|
295
|
+
]
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
"id": "example-home-theatre-equipment-backlighting-commands",
|
|
299
|
+
"type": "debug",
|
|
300
|
+
"name": "backlighting commands",
|
|
301
|
+
"active": true,
|
|
302
|
+
"tosidebar": true,
|
|
303
|
+
"console": false,
|
|
304
|
+
"tostatus": false,
|
|
305
|
+
"complete": "true",
|
|
306
|
+
"targetType": "full",
|
|
307
|
+
"statusVal": "",
|
|
308
|
+
"statusType": "auto",
|
|
309
|
+
"x": 660,
|
|
310
|
+
"y": 380,
|
|
311
|
+
"wires": []
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
"id": "example-home-theatre-equipment-backlighting-state",
|
|
315
|
+
"type": "debug",
|
|
316
|
+
"name": "backlighting state",
|
|
317
|
+
"active": true,
|
|
318
|
+
"tosidebar": true,
|
|
319
|
+
"console": false,
|
|
320
|
+
"tostatus": false,
|
|
321
|
+
"complete": "true",
|
|
322
|
+
"targetType": "full",
|
|
323
|
+
"statusVal": "",
|
|
324
|
+
"statusType": "auto",
|
|
325
|
+
"x": 660,
|
|
326
|
+
"y": 420,
|
|
327
|
+
"wires": []
|
|
328
|
+
}
|
|
329
|
+
]
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "example-room-lighting-room-lighting-example",
|
|
4
|
+
"type": "comment",
|
|
5
|
+
"name": "Room lighting example",
|
|
6
|
+
"info": "Motion and illuminance feed occupancy fusion and the motion policy; a wall switch feeds the switch policy. Both send lighting intents to the room controller, which owns the light's commands.\n\nReplace the inject nodes with your sensors and wire the room controller's output to your MQTT broker. Set the room's wake and bed times (Node-RED host time) before deploying.",
|
|
7
|
+
"x": 170,
|
|
8
|
+
"y": 40,
|
|
9
|
+
"wires": []
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"id": "example-room-lighting-motion-detected",
|
|
13
|
+
"type": "inject",
|
|
14
|
+
"name": "motion detected",
|
|
15
|
+
"props": [
|
|
16
|
+
{
|
|
17
|
+
"p": "payload",
|
|
18
|
+
"v": "{\"motion\":true}",
|
|
19
|
+
"vt": "json"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"p": "source",
|
|
23
|
+
"v": "motion",
|
|
24
|
+
"vt": "str"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"repeat": "",
|
|
28
|
+
"crontab": "",
|
|
29
|
+
"once": false,
|
|
30
|
+
"onceDelay": 0.1,
|
|
31
|
+
"topic": "",
|
|
32
|
+
"x": 150,
|
|
33
|
+
"y": 100,
|
|
34
|
+
"wires": [
|
|
35
|
+
[
|
|
36
|
+
"example-room-lighting-occupancy-fusion"
|
|
37
|
+
]
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"id": "example-room-lighting-illuminance-5-lx",
|
|
42
|
+
"type": "inject",
|
|
43
|
+
"name": "illuminance 5 lx",
|
|
44
|
+
"props": [
|
|
45
|
+
{
|
|
46
|
+
"p": "payload",
|
|
47
|
+
"v": "5",
|
|
48
|
+
"vt": "num"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"p": "source",
|
|
52
|
+
"v": "illuminance",
|
|
53
|
+
"vt": "str"
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"repeat": "",
|
|
57
|
+
"crontab": "",
|
|
58
|
+
"once": false,
|
|
59
|
+
"onceDelay": 0.1,
|
|
60
|
+
"topic": "",
|
|
61
|
+
"x": 150,
|
|
62
|
+
"y": 160,
|
|
63
|
+
"wires": [
|
|
64
|
+
[
|
|
65
|
+
"example-room-lighting-motion-lighting-policy"
|
|
66
|
+
]
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"id": "example-room-lighting-wall-switch-edge",
|
|
71
|
+
"type": "inject",
|
|
72
|
+
"name": "wall switch edge",
|
|
73
|
+
"props": [
|
|
74
|
+
{
|
|
75
|
+
"p": "payload",
|
|
76
|
+
"v": "{\"state\":true}",
|
|
77
|
+
"vt": "json"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"p": "source",
|
|
81
|
+
"v": "switch",
|
|
82
|
+
"vt": "str"
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
"repeat": "",
|
|
86
|
+
"crontab": "",
|
|
87
|
+
"once": false,
|
|
88
|
+
"onceDelay": 0.1,
|
|
89
|
+
"topic": "",
|
|
90
|
+
"x": 150,
|
|
91
|
+
"y": 220,
|
|
92
|
+
"wires": [
|
|
93
|
+
[
|
|
94
|
+
"example-room-lighting-switch-lighting-policy"
|
|
95
|
+
]
|
|
96
|
+
]
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"id": "example-room-lighting-room-startup",
|
|
100
|
+
"type": "inject",
|
|
101
|
+
"name": "room startup",
|
|
102
|
+
"props": [
|
|
103
|
+
{
|
|
104
|
+
"p": "lighting",
|
|
105
|
+
"v": "{\"kind\":\"startup\"}",
|
|
106
|
+
"vt": "json"
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
"repeat": "",
|
|
110
|
+
"crontab": "",
|
|
111
|
+
"once": false,
|
|
112
|
+
"onceDelay": 0.1,
|
|
113
|
+
"topic": "",
|
|
114
|
+
"x": 150,
|
|
115
|
+
"y": 280,
|
|
116
|
+
"wires": [
|
|
117
|
+
[
|
|
118
|
+
"example-room-lighting-room-lighting-controller"
|
|
119
|
+
]
|
|
120
|
+
]
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"id": "example-room-lighting-occupancy-fusion",
|
|
124
|
+
"type": "home-occupancy-fusion",
|
|
125
|
+
"name": "",
|
|
126
|
+
"area": "room",
|
|
127
|
+
"presenceMode": "none",
|
|
128
|
+
"x": 380,
|
|
129
|
+
"y": 100,
|
|
130
|
+
"wires": [
|
|
131
|
+
[
|
|
132
|
+
"example-room-lighting-motion-lighting-policy"
|
|
133
|
+
]
|
|
134
|
+
]
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"id": "example-room-lighting-motion-lighting-policy",
|
|
138
|
+
"type": "home-motion-lighting-policy",
|
|
139
|
+
"name": "",
|
|
140
|
+
"area": "room",
|
|
141
|
+
"onTargets": "[\"main\"]",
|
|
142
|
+
"offTargets": "[\"main\"]",
|
|
143
|
+
"defaultDelaySeconds": 120,
|
|
144
|
+
"defaultIlluminanceCutoff": 10,
|
|
145
|
+
"switchWindowMs": 500,
|
|
146
|
+
"switchFreshnessSeconds": 3600,
|
|
147
|
+
"x": 620,
|
|
148
|
+
"y": 140,
|
|
149
|
+
"wires": [
|
|
150
|
+
[
|
|
151
|
+
"example-room-lighting-room-lighting-controller"
|
|
152
|
+
]
|
|
153
|
+
]
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"id": "example-room-lighting-switch-lighting-policy",
|
|
157
|
+
"type": "home-switch-lighting-policy",
|
|
158
|
+
"name": "",
|
|
159
|
+
"area": "room",
|
|
160
|
+
"targets": "[\"main\"]",
|
|
161
|
+
"switchWindowMs": 500,
|
|
162
|
+
"switchFreshnessSeconds": 3600,
|
|
163
|
+
"x": 380,
|
|
164
|
+
"y": 220,
|
|
165
|
+
"wires": [
|
|
166
|
+
[
|
|
167
|
+
"example-room-lighting-room-lighting-controller"
|
|
168
|
+
]
|
|
169
|
+
]
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"id": "example-room-lighting-room-lighting-controller",
|
|
173
|
+
"type": "home-room-lighting-controller",
|
|
174
|
+
"name": "",
|
|
175
|
+
"area": "room",
|
|
176
|
+
"displayName": "Room",
|
|
177
|
+
"targets": "[{\"id\":\"main\",\"stateTopic\":\"room/light/main\",\"commandTopic\":\"room/light/main/set\"}]",
|
|
178
|
+
"maxBrightnessPct": 100,
|
|
179
|
+
"maxColorTempKelvin": 6500,
|
|
180
|
+
"sleepBrightnessPct": 1,
|
|
181
|
+
"sleepColorTempKelvin": 2200,
|
|
182
|
+
"initialTransitionSeconds": 1,
|
|
183
|
+
"refreshTransitionSeconds": 60,
|
|
184
|
+
"refreshSeconds": 60,
|
|
185
|
+
"initialSleep": false,
|
|
186
|
+
"x": 880,
|
|
187
|
+
"y": 180,
|
|
188
|
+
"wires": [
|
|
189
|
+
[
|
|
190
|
+
"example-room-lighting-room-commands"
|
|
191
|
+
]
|
|
192
|
+
],
|
|
193
|
+
"wakeTime": "07:00",
|
|
194
|
+
"bedTime": "23:00"
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"id": "example-room-lighting-room-commands",
|
|
198
|
+
"type": "debug",
|
|
199
|
+
"name": "room commands",
|
|
200
|
+
"active": true,
|
|
201
|
+
"tosidebar": true,
|
|
202
|
+
"console": false,
|
|
203
|
+
"tostatus": false,
|
|
204
|
+
"complete": "true",
|
|
205
|
+
"targetType": "full",
|
|
206
|
+
"statusVal": "",
|
|
207
|
+
"statusType": "auto",
|
|
208
|
+
"x": 1100,
|
|
209
|
+
"y": 180,
|
|
210
|
+
"wires": []
|
|
211
|
+
}
|
|
212
|
+
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,64 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avantics/node-red-home-automation",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "2.3.0",
|
|
4
|
+
"description": "Deterministic home automation components for Node-RED",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"node-red",
|
|
7
|
+
"home-automation",
|
|
8
|
+
"typescript",
|
|
9
|
+
"lighting",
|
|
10
|
+
"home-theatre",
|
|
11
|
+
"mqtt"
|
|
12
|
+
],
|
|
13
|
+
"funding": "https://ko-fi.com/avantics",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/avantics-hq/node-red-home-automation.git"
|
|
17
|
+
},
|
|
18
|
+
"homepage": "https://github.com/avantics-hq/node-red-home-automation#readme",
|
|
19
|
+
"bugs": {
|
|
20
|
+
"url": "https://github.com/avantics-hq/node-red-home-automation/issues"
|
|
21
|
+
},
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"files": [
|
|
24
|
+
"dist/lib",
|
|
25
|
+
"dist/nodes",
|
|
26
|
+
"examples",
|
|
27
|
+
"contract-examples",
|
|
28
|
+
"!dist/**/*.js.map"
|
|
29
|
+
],
|
|
30
|
+
"scripts": {
|
|
31
|
+
"clean": "node scripts/clean.mjs",
|
|
32
|
+
"build": "npm run clean && tsc && node scripts/copy-node-html.mjs",
|
|
33
|
+
"test": "npm run build && node --test dist/test/*.test.js && node contract-examples/run.mjs --verify",
|
|
34
|
+
"examples": "npm run build && node contract-examples/run.mjs",
|
|
35
|
+
"scan:public": "node scripts/check-public.mjs",
|
|
36
|
+
"hooks:install": "git config core.hooksPath .githooks",
|
|
37
|
+
"prepack": "npm run build",
|
|
38
|
+
"diagrams": "node scripts/render-diagrams.mjs"
|
|
39
|
+
},
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": ">=22.9"
|
|
42
|
+
},
|
|
43
|
+
"node-red": {
|
|
44
|
+
"version": ">=5.0.0",
|
|
45
|
+
"nodes": {
|
|
46
|
+
"home-occupancy-fusion": "dist/nodes/occupancy-fusion.js",
|
|
47
|
+
"home-motion-lighting-policy": "dist/nodes/motion-policy.js",
|
|
48
|
+
"home-switch-lighting-policy": "dist/nodes/switch-policy.js",
|
|
49
|
+
"home-room-lighting-controller": "dist/nodes/room-controller.js",
|
|
50
|
+
"home-avr-controller": "dist/nodes/avr-controller.js",
|
|
51
|
+
"home-display-mode-controller": "dist/nodes/display-mode-controller.js",
|
|
52
|
+
"home-source-capability-controller": "dist/nodes/source-capability-controller.js",
|
|
53
|
+
"home-activity-lighting-controller": "dist/nodes/activity-lighting-controller.js",
|
|
54
|
+
"home-backlighting-controller": "dist/nodes/backlighting-controller.js",
|
|
55
|
+
"home-theatre-activity-controller": "dist/nodes/theatre-activity-controller.js",
|
|
56
|
+
"home-theatre-state-contract": "dist/nodes/theatre-state-contract.js"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"@types/node": "24.19.2",
|
|
61
|
+
"@types/node-red": "1.3.5",
|
|
62
|
+
"typescript": "7.0.2"
|
|
63
|
+
}
|
|
64
|
+
}
|