@avantics/node-red-home-automation 2.2.1 → 3.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 +76 -89
- package/contract-examples/room-lighting.mjs +12 -9
- package/dist/lib/activity-lighting-controller.d.ts +13 -25
- package/dist/lib/activity-lighting-controller.js +15 -11
- package/dist/lib/avr-controller.d.ts +17 -28
- package/dist/lib/avr-controller.js +165 -116
- package/dist/lib/backlighting-controller.d.ts +12 -25
- package/dist/lib/backlighting-controller.js +11 -18
- package/dist/lib/bounded-trace.d.ts +6 -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/command-echo.d.ts +20 -0
- package/dist/lib/command-echo.js +82 -0
- package/dist/lib/cover-controller.d.ts +15 -28
- package/dist/lib/cover-controller.js +6 -8
- package/dist/lib/denon-protocol.d.ts +29 -0
- package/dist/lib/denon-protocol.js +76 -0
- package/dist/lib/display-mode-controller.d.ts +11 -6
- package/dist/lib/display-mode-controller.js +90 -39
- package/dist/lib/light-styling.d.ts +11 -0
- package/dist/lib/light-styling.js +15 -0
- package/dist/lib/motion-policy.d.ts +12 -22
- package/dist/lib/motion-policy.js +53 -56
- package/dist/lib/occupancy-fusion.d.ts +8 -12
- package/dist/lib/occupancy-fusion.js +3 -2
- package/dist/lib/room-controller.d.ts +13 -38
- package/dist/lib/room-controller.js +85 -180
- package/dist/lib/room-lighting-discovery.d.ts +9 -0
- package/dist/lib/room-lighting-discovery.js +45 -0
- package/dist/lib/settings.d.ts +5 -0
- package/dist/lib/settings.js +68 -0
- package/dist/lib/source-capability-controller.d.ts +32 -35
- package/dist/lib/source-capability-controller.js +51 -35
- package/dist/lib/switch-policy.d.ts +2 -7
- package/dist/lib/target-state.d.ts +24 -0
- package/dist/lib/target-state.js +38 -0
- package/dist/lib/theatre-activity-controller.d.ts +6 -108
- package/dist/lib/theatre-activity-controller.js +67 -318
- package/dist/lib/theatre-ha-discovery.d.ts +14 -0
- package/dist/lib/theatre-ha-discovery.js +163 -0
- package/dist/lib/theatre-metrics.d.ts +4 -0
- package/dist/lib/theatre-metrics.js +66 -0
- package/dist/lib/theatre-profiles.d.ts +23 -0
- package/dist/lib/theatre-profiles.js +73 -0
- package/dist/lib/theatre-refresh.d.ts +20 -0
- package/dist/lib/theatre-refresh.js +46 -0
- package/dist/lib/theatre-slo.js +7 -9
- package/dist/lib/theatre-state-contract.d.ts +7 -19
- package/dist/lib/theatre-state-contract.js +33 -169
- package/dist/lib/theatre-state.d.ts +110 -0
- package/dist/lib/theatre-state.js +139 -0
- package/dist/lib/wall-input.d.ts +2 -7
- package/dist/lib/z2m-light.d.ts +16 -0
- package/dist/lib/z2m-light.js +36 -0
- package/dist/nodes/activity-lighting-controller.html +5 -3
- package/dist/nodes/activity-lighting-controller.js +21 -52
- package/dist/nodes/adapter.d.ts +15 -0
- package/dist/nodes/adapter.js +60 -0
- package/dist/nodes/avr-controller.html +13 -4
- package/dist/nodes/avr-controller.js +23 -62
- package/dist/nodes/backlighting-controller.html +1 -1
- package/dist/nodes/backlighting-controller.js +25 -47
- package/dist/nodes/display-mode-controller.html +4 -4
- package/dist/nodes/display-mode-controller.js +22 -59
- package/dist/nodes/motion-policy.html +23 -10
- package/dist/nodes/motion-policy.js +14 -135
- package/dist/nodes/occupancy-fusion.html +2 -2
- package/dist/nodes/occupancy-fusion.js +23 -29
- package/dist/nodes/room-controller.html +92 -34
- package/dist/nodes/room-controller.js +46 -64
- package/dist/nodes/source-capability-controller.html +4 -13
- package/dist/nodes/source-capability-controller.js +17 -52
- package/dist/nodes/switch-policy.html +3 -3
- package/dist/nodes/switch-policy.js +23 -42
- package/dist/nodes/theatre-activity-controller.html +5 -3
- package/dist/nodes/theatre-activity-controller.js +23 -43
- package/dist/nodes/theatre-state-contract.html +55 -22
- package/dist/nodes/theatre-state-contract.js +30 -41
- package/examples/Home theatre activity.json +307 -43
- package/examples/Home theatre equipment.json +4 -4
- package/examples/Room lighting.json +15 -17
- package/package.json +3 -7
- package/THIRD-PARTY-NOTICES.md +0 -218
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const bounded_trace_1 = require("../lib/bounded-trace");
|
|
3
2
|
const theatre_state_contract_1 = require("../lib/theatre-state-contract");
|
|
3
|
+
const adapter_1 = require("./adapter");
|
|
4
|
+
const settings_1 = require("../lib/settings");
|
|
4
5
|
const registerTheatreStateContract = (RED) => {
|
|
5
6
|
function HomeTheatreStateContract(config) {
|
|
6
7
|
RED.nodes.createNode(this, config);
|
|
7
8
|
const node = this;
|
|
8
|
-
|
|
9
|
+
// Needed for discovery and for the default base topic; the normaliser
|
|
10
|
+
// says "area is required" when it is.
|
|
11
|
+
const area = (0, adapter_1.optionalArea)(config);
|
|
9
12
|
let controllerConfig;
|
|
10
13
|
try {
|
|
11
|
-
const activities =
|
|
14
|
+
const activities = (0, settings_1.jsonSetting)(config.activities, "activities", []);
|
|
12
15
|
controllerConfig = (0, theatre_state_contract_1.normaliseStateContractConfig)({
|
|
13
|
-
area
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
area,
|
|
17
|
+
// Optional, with documented meanings: an empty display name is the
|
|
18
|
+
// area, and an empty base topic is home/<area>/theatre.
|
|
19
|
+
displayName: config.displayName || area,
|
|
20
|
+
baseTopic: config.baseTopic || "",
|
|
21
|
+
// Not set (null, or absent from a flow saved before the setting)
|
|
22
|
+
// means on, so an older flow keeps publishing discovery.
|
|
23
|
+
discovery: (0, settings_1.optionalBooleanSetting)(config.discovery, "Home Assistant discovery") ?? true,
|
|
24
|
+
discoveryPrefix: (0, settings_1.textSetting)(config.discoveryPrefix, "discovery prefix", "homeassistant"),
|
|
25
|
+
activities: (Array.isArray(activities) ? activities.map(String) : activities),
|
|
18
26
|
slo: {
|
|
19
|
-
windowSize:
|
|
20
|
-
minimumSamples:
|
|
21
|
-
latencyBudgetMs:
|
|
22
|
-
successObjectivePct:
|
|
27
|
+
windowSize: (0, settings_1.numberSetting)(config.sloWindowSize, "SLO window", 20),
|
|
28
|
+
minimumSamples: (0, settings_1.numberSetting)(config.sloMinimumSamples, "minimum samples", 5),
|
|
29
|
+
latencyBudgetMs: (0, settings_1.numberSetting)(config.sloLatencyBudgetMs, "latency budget", 60000),
|
|
30
|
+
successObjectivePct: (0, settings_1.numberSetting)(config.sloSuccessObjectivePct, "success objective", 95)
|
|
23
31
|
}
|
|
24
32
|
});
|
|
25
33
|
}
|
|
26
34
|
catch (error) {
|
|
27
|
-
|
|
28
|
-
node.error(error);
|
|
35
|
+
(0, adapter_1.invalidConfig)(node, error);
|
|
29
36
|
return;
|
|
30
37
|
}
|
|
31
38
|
function process(msg, send) {
|
|
32
|
-
const
|
|
33
|
-
const saved = context.get("state");
|
|
34
|
-
const result = (0, theatre_state_contract_1.transitionTheatreStateContract)(saved, msg, controllerConfig, now);
|
|
35
|
-
context.set("state", result.state);
|
|
36
|
-
(0, bounded_trace_1.appendTrace)(context, {
|
|
37
|
-
area: controllerConfig.area,
|
|
38
|
-
component: "theatre-state-contract"
|
|
39
|
-
}, result.traces, now);
|
|
39
|
+
const result = (0, adapter_1.runReducer)(node, { area: controllerConfig.area, component: "theatre-state-contract" }, (saved, now) => (0, theatre_state_contract_1.transitionTheatreStateContract)(saved, msg, controllerConfig, now));
|
|
40
40
|
if (result.requests.length) {
|
|
41
41
|
send([
|
|
42
42
|
result.requests.map((request) => ({ payload: undefined, ...request })),
|
|
@@ -53,25 +53,14 @@ const registerTheatreStateContract = (RED) => {
|
|
|
53
53
|
});
|
|
54
54
|
return result;
|
|
55
55
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
: undefined,
|
|
65
|
-
theatreStateContract: msg.theatreStateContract && typeof msg.theatreStateContract === "object"
|
|
66
|
-
? msg.theatreStateContract
|
|
67
|
-
: undefined
|
|
68
|
-
}, send);
|
|
69
|
-
done();
|
|
70
|
-
}
|
|
71
|
-
catch (error) {
|
|
72
|
-
node.error(error, msg);
|
|
73
|
-
done(error instanceof Error ? error : new Error(String(error)));
|
|
74
|
-
}
|
|
56
|
+
(0, adapter_1.onInput)(node, (msg, send) => {
|
|
57
|
+
process({
|
|
58
|
+
topic: typeof msg.topic === "string" ? msg.topic : undefined,
|
|
59
|
+
payload: msg.payload,
|
|
60
|
+
retain: msg.retain === true,
|
|
61
|
+
theatre: (0, adapter_1.objectField)(msg, "theatre"),
|
|
62
|
+
theatreStateContract: (0, adapter_1.objectField)(msg, "theatreStateContract")
|
|
63
|
+
}, send);
|
|
75
64
|
});
|
|
76
65
|
node.on("close", (_removed, done) => {
|
|
77
66
|
done();
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "example-home-theatre-activity-home-theatre-activity-example",
|
|
4
4
|
"type": "comment",
|
|
5
5
|
"name": "Home theatre activity example",
|
|
6
|
-
"info": "The state contract turns a request on home
|
|
6
|
+
"info": "The state contract turns a request on home/<area>/theatre/request into an activity intent. The activity controller plans each target and sends msg.theatreCommand; the switch routes each command by its target, and a change node moves it onto that controller's input. Every controller reports msg.theatre target state on output 2, wired straight back to the activity controller, which publishes a complete snapshot through the contract.\n\nName the area on the state contract before deploying: it names the MQTT topics and Home Assistant entities, and until it is set the contract shows \"invalid configuration\". Put the same area in the \"request tv activity\" inject's topic. Set the display controller's device hosts and TV pre-shared key too; until then it shows \"invalid configuration\" and the activity waits for it. Wire the controllers' output 1 to your device transports and activity lighting to your room lighting controller.",
|
|
7
7
|
"x": 190,
|
|
8
8
|
"y": 40,
|
|
9
9
|
"wires": []
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"props": [
|
|
16
16
|
{
|
|
17
17
|
"p": "topic",
|
|
18
|
-
"v": "home
|
|
18
|
+
"v": "home/<area>/theatre/request",
|
|
19
19
|
"vt": "str"
|
|
20
20
|
},
|
|
21
21
|
{
|
|
@@ -65,9 +65,9 @@
|
|
|
65
65
|
"id": "example-home-theatre-activity-theatre-state-contract",
|
|
66
66
|
"type": "home-theatre-state-contract",
|
|
67
67
|
"name": "",
|
|
68
|
-
"area": "
|
|
69
|
-
"displayName": "
|
|
70
|
-
"baseTopic": "
|
|
68
|
+
"area": "",
|
|
69
|
+
"displayName": "",
|
|
70
|
+
"baseTopic": "",
|
|
71
71
|
"discoveryPrefix": "homeassistant",
|
|
72
72
|
"activities": "[\"off\",\"tv\"]",
|
|
73
73
|
"sloWindowSize": 20,
|
|
@@ -83,7 +83,8 @@
|
|
|
83
83
|
[
|
|
84
84
|
"example-home-theatre-activity-retained-state"
|
|
85
85
|
]
|
|
86
|
-
]
|
|
86
|
+
],
|
|
87
|
+
"discovery": false
|
|
87
88
|
},
|
|
88
89
|
{
|
|
89
90
|
"id": "example-home-theatre-activity-retained-state",
|
|
@@ -105,15 +106,15 @@
|
|
|
105
106
|
"id": "example-home-theatre-activity-theatre-activity-controller",
|
|
106
107
|
"type": "home-theatre-activity-controller",
|
|
107
108
|
"name": "",
|
|
108
|
-
"area": "
|
|
109
|
+
"area": "",
|
|
109
110
|
"freshnessMs": 30000,
|
|
110
111
|
"recoveryOffActivity": "off",
|
|
111
|
-
"activityProfiles": "{\"off\":{\"display\":{\"mode\":\"off\"},\"avr\":{\"power\":\"
|
|
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\"}}}",
|
|
112
113
|
"x": 680,
|
|
113
114
|
"y": 140,
|
|
114
115
|
"wires": [
|
|
115
116
|
[
|
|
116
|
-
"example-home-theatre-activity-target
|
|
117
|
+
"example-home-theatre-activity-route-by-target"
|
|
117
118
|
],
|
|
118
119
|
[
|
|
119
120
|
"example-home-theatre-activity-theatre-state-contract"
|
|
@@ -121,9 +122,28 @@
|
|
|
121
122
|
]
|
|
122
123
|
},
|
|
123
124
|
{
|
|
124
|
-
"id": "example-home-theatre-activity-
|
|
125
|
+
"id": "example-home-theatre-activity-activity-lighting-controller",
|
|
126
|
+
"type": "home-activity-lighting-controller",
|
|
127
|
+
"name": "",
|
|
128
|
+
"area": "",
|
|
129
|
+
"profiles": "{\"off\":{\"targets\":[],\"values\":{}},\"tv\":{\"targets\":[\"main\"],\"values\":{\"brightness\":64,\"color_temp\":400}}}",
|
|
130
|
+
"confirmationTimeoutMs": 15000,
|
|
131
|
+
"maxAttempts": 2,
|
|
132
|
+
"x": 1380,
|
|
133
|
+
"y": 440,
|
|
134
|
+
"wires": [
|
|
135
|
+
[
|
|
136
|
+
"example-home-theatre-activity-room-lighting-intents"
|
|
137
|
+
],
|
|
138
|
+
[
|
|
139
|
+
"example-home-theatre-activity-theatre-activity-controller"
|
|
140
|
+
]
|
|
141
|
+
]
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"id": "example-home-theatre-activity-room-lighting-intents",
|
|
125
145
|
"type": "debug",
|
|
126
|
-
"name": "
|
|
146
|
+
"name": "room lighting intents",
|
|
127
147
|
"active": true,
|
|
128
148
|
"tosidebar": true,
|
|
129
149
|
"console": false,
|
|
@@ -132,57 +152,240 @@
|
|
|
132
152
|
"targetType": "full",
|
|
133
153
|
"statusVal": "",
|
|
134
154
|
"statusType": "auto",
|
|
155
|
+
"x": 1630,
|
|
156
|
+
"y": 440,
|
|
157
|
+
"wires": []
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"id": "example-home-theatre-activity-route-by-target",
|
|
161
|
+
"type": "switch",
|
|
162
|
+
"name": "route by target",
|
|
163
|
+
"property": "theatreCommand.target",
|
|
164
|
+
"propertyType": "msg",
|
|
165
|
+
"rules": [
|
|
166
|
+
{
|
|
167
|
+
"t": "eq",
|
|
168
|
+
"v": "display",
|
|
169
|
+
"vt": "str"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"t": "eq",
|
|
173
|
+
"v": "avr",
|
|
174
|
+
"vt": "str"
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"t": "eq",
|
|
178
|
+
"v": "source",
|
|
179
|
+
"vt": "str"
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"t": "eq",
|
|
183
|
+
"v": "lighting",
|
|
184
|
+
"vt": "str"
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"t": "eq",
|
|
188
|
+
"v": "backlighting",
|
|
189
|
+
"vt": "str"
|
|
190
|
+
}
|
|
191
|
+
],
|
|
192
|
+
"checkall": "true",
|
|
193
|
+
"repair": false,
|
|
194
|
+
"outputs": 5,
|
|
135
195
|
"x": 930,
|
|
136
|
-
"y":
|
|
196
|
+
"y": 300,
|
|
197
|
+
"wires": [
|
|
198
|
+
[
|
|
199
|
+
"example-home-theatre-activity-to-display"
|
|
200
|
+
],
|
|
201
|
+
[
|
|
202
|
+
"example-home-theatre-activity-to-avr"
|
|
203
|
+
],
|
|
204
|
+
[
|
|
205
|
+
"example-home-theatre-activity-to-source"
|
|
206
|
+
],
|
|
207
|
+
[
|
|
208
|
+
"example-home-theatre-activity-to-lighting"
|
|
209
|
+
],
|
|
210
|
+
[
|
|
211
|
+
"example-home-theatre-activity-to-backlighting"
|
|
212
|
+
]
|
|
213
|
+
]
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"id": "example-home-theatre-activity-to-display",
|
|
217
|
+
"type": "change",
|
|
218
|
+
"name": "to display",
|
|
219
|
+
"rules": [
|
|
220
|
+
{
|
|
221
|
+
"t": "move",
|
|
222
|
+
"p": "theatreCommand",
|
|
223
|
+
"pt": "msg",
|
|
224
|
+
"to": "display",
|
|
225
|
+
"tot": "msg"
|
|
226
|
+
}
|
|
227
|
+
],
|
|
228
|
+
"x": 1140,
|
|
229
|
+
"y": 200,
|
|
230
|
+
"wires": [
|
|
231
|
+
[
|
|
232
|
+
"example-home-theatre-activity-display-controller"
|
|
233
|
+
]
|
|
234
|
+
]
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"id": "example-home-theatre-activity-display-controller",
|
|
238
|
+
"type": "home-display-mode-controller",
|
|
239
|
+
"name": "",
|
|
240
|
+
"area": "",
|
|
241
|
+
"tvHost": "",
|
|
242
|
+
"screenHost": "",
|
|
243
|
+
"projectorMeterHost": "",
|
|
244
|
+
"screenOpenPosition": 82,
|
|
245
|
+
"screenTolerance": 2,
|
|
246
|
+
"pollMs": 2000,
|
|
247
|
+
"queryTimeoutMs": 5000,
|
|
248
|
+
"tvTimeoutMs": 30000,
|
|
249
|
+
"screenTimeoutMs": 65000,
|
|
250
|
+
"projectorWarmupMs": 60000,
|
|
251
|
+
"projectorMinimumWarmupMs": 15000,
|
|
252
|
+
"projectorShutdownConfirmMs": 5000,
|
|
253
|
+
"projectorCooldownMs": 120000,
|
|
254
|
+
"maxAttempts": 2,
|
|
255
|
+
"projectorOnWatts": 20,
|
|
256
|
+
"projectorOffWatts": 10,
|
|
257
|
+
"projectorPowerFallback": false,
|
|
258
|
+
"transportTimeoutMs": 5000,
|
|
259
|
+
"x": 1380,
|
|
260
|
+
"y": 200,
|
|
261
|
+
"wires": [
|
|
262
|
+
[
|
|
263
|
+
"example-home-theatre-activity-display-commands"
|
|
264
|
+
],
|
|
265
|
+
[
|
|
266
|
+
"example-home-theatre-activity-theatre-activity-controller"
|
|
267
|
+
]
|
|
268
|
+
]
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"id": "example-home-theatre-activity-display-commands",
|
|
272
|
+
"type": "debug",
|
|
273
|
+
"name": "display commands",
|
|
274
|
+
"active": true,
|
|
275
|
+
"tosidebar": true,
|
|
276
|
+
"console": false,
|
|
277
|
+
"tostatus": false,
|
|
278
|
+
"complete": "true",
|
|
279
|
+
"targetType": "full",
|
|
280
|
+
"statusVal": "",
|
|
281
|
+
"statusType": "auto",
|
|
282
|
+
"x": 1630,
|
|
283
|
+
"y": 200,
|
|
137
284
|
"wires": []
|
|
138
285
|
},
|
|
139
286
|
{
|
|
140
|
-
"id": "example-home-theatre-activity-
|
|
141
|
-
"type": "
|
|
142
|
-
"name": "
|
|
143
|
-
"
|
|
287
|
+
"id": "example-home-theatre-activity-to-avr",
|
|
288
|
+
"type": "change",
|
|
289
|
+
"name": "to avr",
|
|
290
|
+
"rules": [
|
|
144
291
|
{
|
|
145
|
-
"
|
|
146
|
-
"
|
|
147
|
-
"
|
|
292
|
+
"t": "move",
|
|
293
|
+
"p": "theatreCommand",
|
|
294
|
+
"pt": "msg",
|
|
295
|
+
"to": "avr",
|
|
296
|
+
"tot": "msg"
|
|
148
297
|
}
|
|
149
298
|
],
|
|
150
|
-
"
|
|
151
|
-
"
|
|
152
|
-
"once": false,
|
|
153
|
-
"onceDelay": 0.1,
|
|
154
|
-
"topic": "",
|
|
155
|
-
"x": 170,
|
|
156
|
-
"y": 240,
|
|
299
|
+
"x": 1140,
|
|
300
|
+
"y": 280,
|
|
157
301
|
"wires": [
|
|
158
302
|
[
|
|
159
|
-
"example-home-theatre-activity-
|
|
303
|
+
"example-home-theatre-activity-avr-controller"
|
|
160
304
|
]
|
|
161
305
|
]
|
|
162
306
|
},
|
|
163
307
|
{
|
|
164
|
-
"id": "example-home-theatre-activity-
|
|
165
|
-
"type": "home-
|
|
308
|
+
"id": "example-home-theatre-activity-avr-controller",
|
|
309
|
+
"type": "home-avr-controller",
|
|
166
310
|
"name": "",
|
|
167
|
-
"area": "
|
|
168
|
-
"
|
|
311
|
+
"area": "",
|
|
312
|
+
"sources": "{\"shield\":\"SAT/CBL\",\"playstation\":\"GAME\"}",
|
|
313
|
+
"retryMs": 2000,
|
|
314
|
+
"maxAttempts": 3,
|
|
315
|
+
"minVolume": 0,
|
|
316
|
+
"maxVolume": 60,
|
|
317
|
+
"x": 1380,
|
|
318
|
+
"y": 280,
|
|
319
|
+
"wires": [
|
|
320
|
+
[
|
|
321
|
+
"example-home-theatre-activity-avr-commands"
|
|
322
|
+
],
|
|
323
|
+
[
|
|
324
|
+
"example-home-theatre-activity-theatre-activity-controller"
|
|
325
|
+
]
|
|
326
|
+
]
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
"id": "example-home-theatre-activity-avr-commands",
|
|
330
|
+
"type": "debug",
|
|
331
|
+
"name": "avr commands",
|
|
332
|
+
"active": true,
|
|
333
|
+
"tosidebar": true,
|
|
334
|
+
"console": false,
|
|
335
|
+
"tostatus": false,
|
|
336
|
+
"complete": "true",
|
|
337
|
+
"targetType": "full",
|
|
338
|
+
"statusVal": "",
|
|
339
|
+
"statusType": "auto",
|
|
340
|
+
"x": 1630,
|
|
341
|
+
"y": 280,
|
|
342
|
+
"wires": []
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
"id": "example-home-theatre-activity-to-source",
|
|
346
|
+
"type": "change",
|
|
347
|
+
"name": "to sourceCapability",
|
|
348
|
+
"rules": [
|
|
349
|
+
{
|
|
350
|
+
"t": "move",
|
|
351
|
+
"p": "theatreCommand",
|
|
352
|
+
"pt": "msg",
|
|
353
|
+
"to": "sourceCapability",
|
|
354
|
+
"tot": "msg"
|
|
355
|
+
}
|
|
356
|
+
],
|
|
357
|
+
"x": 1140,
|
|
358
|
+
"y": 360,
|
|
359
|
+
"wires": [
|
|
360
|
+
[
|
|
361
|
+
"example-home-theatre-activity-source-controller"
|
|
362
|
+
]
|
|
363
|
+
]
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
"id": "example-home-theatre-activity-source-controller",
|
|
367
|
+
"type": "home-source-capability-controller",
|
|
368
|
+
"name": "",
|
|
369
|
+
"area": "",
|
|
370
|
+
"sources": "{\"streamer\":{\"activation\":\"command\",\"deactivation\":\"command\",\"confirmation\":\"active\"}}",
|
|
371
|
+
"pollMs": 2000,
|
|
169
372
|
"confirmationTimeoutMs": 15000,
|
|
170
373
|
"maxAttempts": 2,
|
|
171
|
-
"x":
|
|
172
|
-
"y":
|
|
374
|
+
"x": 1380,
|
|
375
|
+
"y": 360,
|
|
173
376
|
"wires": [
|
|
174
377
|
[
|
|
175
|
-
"example-home-theatre-activity-
|
|
378
|
+
"example-home-theatre-activity-source-commands"
|
|
176
379
|
],
|
|
177
380
|
[
|
|
178
|
-
"example-home-theatre-activity-
|
|
381
|
+
"example-home-theatre-activity-theatre-activity-controller"
|
|
179
382
|
]
|
|
180
383
|
]
|
|
181
384
|
},
|
|
182
385
|
{
|
|
183
|
-
"id": "example-home-theatre-activity-
|
|
386
|
+
"id": "example-home-theatre-activity-source-commands",
|
|
184
387
|
"type": "debug",
|
|
185
|
-
"name": "
|
|
388
|
+
"name": "source commands",
|
|
186
389
|
"active": true,
|
|
187
390
|
"tosidebar": true,
|
|
188
391
|
"console": false,
|
|
@@ -191,14 +394,75 @@
|
|
|
191
394
|
"targetType": "full",
|
|
192
395
|
"statusVal": "",
|
|
193
396
|
"statusType": "auto",
|
|
194
|
-
"x":
|
|
195
|
-
"y":
|
|
397
|
+
"x": 1630,
|
|
398
|
+
"y": 360,
|
|
196
399
|
"wires": []
|
|
197
400
|
},
|
|
198
401
|
{
|
|
199
|
-
"id": "example-home-theatre-activity-lighting
|
|
402
|
+
"id": "example-home-theatre-activity-to-lighting",
|
|
403
|
+
"type": "change",
|
|
404
|
+
"name": "to activityLighting",
|
|
405
|
+
"rules": [
|
|
406
|
+
{
|
|
407
|
+
"t": "move",
|
|
408
|
+
"p": "theatreCommand",
|
|
409
|
+
"pt": "msg",
|
|
410
|
+
"to": "activityLighting",
|
|
411
|
+
"tot": "msg"
|
|
412
|
+
}
|
|
413
|
+
],
|
|
414
|
+
"x": 1140,
|
|
415
|
+
"y": 440,
|
|
416
|
+
"wires": [
|
|
417
|
+
[
|
|
418
|
+
"example-home-theatre-activity-activity-lighting-controller"
|
|
419
|
+
]
|
|
420
|
+
]
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
"id": "example-home-theatre-activity-to-backlighting",
|
|
424
|
+
"type": "change",
|
|
425
|
+
"name": "to backlighting",
|
|
426
|
+
"rules": [
|
|
427
|
+
{
|
|
428
|
+
"t": "move",
|
|
429
|
+
"p": "theatreCommand",
|
|
430
|
+
"pt": "msg",
|
|
431
|
+
"to": "backlighting",
|
|
432
|
+
"tot": "msg"
|
|
433
|
+
}
|
|
434
|
+
],
|
|
435
|
+
"x": 1140,
|
|
436
|
+
"y": 520,
|
|
437
|
+
"wires": [
|
|
438
|
+
[
|
|
439
|
+
"example-home-theatre-activity-backlighting-controller"
|
|
440
|
+
]
|
|
441
|
+
]
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
"id": "example-home-theatre-activity-backlighting-controller",
|
|
445
|
+
"type": "home-backlighting-controller",
|
|
446
|
+
"name": "",
|
|
447
|
+
"area": "",
|
|
448
|
+
"pollMs": 2000,
|
|
449
|
+
"confirmationTimeoutMs": 15000,
|
|
450
|
+
"maxAttempts": 2,
|
|
451
|
+
"x": 1380,
|
|
452
|
+
"y": 520,
|
|
453
|
+
"wires": [
|
|
454
|
+
[
|
|
455
|
+
"example-home-theatre-activity-backlighting-commands"
|
|
456
|
+
],
|
|
457
|
+
[
|
|
458
|
+
"example-home-theatre-activity-theatre-activity-controller"
|
|
459
|
+
]
|
|
460
|
+
]
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
"id": "example-home-theatre-activity-backlighting-commands",
|
|
200
464
|
"type": "debug",
|
|
201
|
-
"name": "
|
|
465
|
+
"name": "backlighting commands",
|
|
202
466
|
"active": true,
|
|
203
467
|
"tosidebar": true,
|
|
204
468
|
"console": false,
|
|
@@ -207,8 +471,8 @@
|
|
|
207
471
|
"targetType": "full",
|
|
208
472
|
"statusVal": "",
|
|
209
473
|
"statusType": "auto",
|
|
210
|
-
"x":
|
|
211
|
-
"y":
|
|
474
|
+
"x": 1630,
|
|
475
|
+
"y": 520,
|
|
212
476
|
"wires": []
|
|
213
477
|
}
|
|
214
478
|
]
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"id": "example-home-theatre-equipment-avr-controller",
|
|
37
37
|
"type": "home-avr-controller",
|
|
38
38
|
"name": "",
|
|
39
|
-
"area": "
|
|
39
|
+
"area": "",
|
|
40
40
|
"sources": "{\"shield\":\"SAT/CBL\",\"playstation\":\"GAME\"}",
|
|
41
41
|
"retryMs": 2000,
|
|
42
42
|
"maxAttempts": 3,
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
"id": "example-home-theatre-equipment-display-mode-controller",
|
|
114
114
|
"type": "home-display-mode-controller",
|
|
115
115
|
"name": "",
|
|
116
|
-
"area": "
|
|
116
|
+
"area": "",
|
|
117
117
|
"tvHost": "",
|
|
118
118
|
"screenHost": "",
|
|
119
119
|
"projectorMeterHost": "",
|
|
@@ -203,7 +203,7 @@
|
|
|
203
203
|
"id": "example-home-theatre-equipment-source-capability-controller",
|
|
204
204
|
"type": "home-source-capability-controller",
|
|
205
205
|
"name": "",
|
|
206
|
-
"area": "
|
|
206
|
+
"area": "",
|
|
207
207
|
"sources": "{\"streamer\":{\"activation\":\"command\",\"deactivation\":\"command\",\"confirmation\":\"active\"}}",
|
|
208
208
|
"pollMs": 2000,
|
|
209
209
|
"confirmationTimeoutMs": 15000,
|
|
@@ -279,7 +279,7 @@
|
|
|
279
279
|
"id": "example-home-theatre-equipment-backlighting-controller",
|
|
280
280
|
"type": "home-backlighting-controller",
|
|
281
281
|
"name": "",
|
|
282
|
-
"area": "
|
|
282
|
+
"area": "",
|
|
283
283
|
"pollMs": 2000,
|
|
284
284
|
"confirmationTimeoutMs": 15000,
|
|
285
285
|
"maxAttempts": 2,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "example-room-lighting-room-lighting-example",
|
|
4
4
|
"type": "comment",
|
|
5
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
|
|
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. Give the room controller an area to publish each light's control state, its circadian switch and Home Assistant discovery; without one it still controls the lights.",
|
|
7
7
|
"x": 170,
|
|
8
8
|
"y": 40,
|
|
9
9
|
"wires": []
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
"id": "example-room-lighting-occupancy-fusion",
|
|
124
124
|
"type": "home-occupancy-fusion",
|
|
125
125
|
"name": "",
|
|
126
|
-
"area": "
|
|
126
|
+
"area": "",
|
|
127
127
|
"presenceMode": "none",
|
|
128
128
|
"x": 380,
|
|
129
129
|
"y": 100,
|
|
@@ -137,13 +137,11 @@
|
|
|
137
137
|
"id": "example-room-lighting-motion-lighting-policy",
|
|
138
138
|
"type": "home-motion-lighting-policy",
|
|
139
139
|
"name": "",
|
|
140
|
-
"area": "
|
|
140
|
+
"area": "",
|
|
141
141
|
"onTargets": "[\"main\"]",
|
|
142
142
|
"offTargets": "[\"main\"]",
|
|
143
143
|
"defaultDelaySeconds": 120,
|
|
144
144
|
"defaultIlluminanceCutoff": 10,
|
|
145
|
-
"switchWindowMs": 500,
|
|
146
|
-
"switchFreshnessSeconds": 3600,
|
|
147
145
|
"x": 620,
|
|
148
146
|
"y": 140,
|
|
149
147
|
"wires": [
|
|
@@ -156,7 +154,7 @@
|
|
|
156
154
|
"id": "example-room-lighting-switch-lighting-policy",
|
|
157
155
|
"type": "home-switch-lighting-policy",
|
|
158
156
|
"name": "",
|
|
159
|
-
"area": "
|
|
157
|
+
"area": "",
|
|
160
158
|
"targets": "[\"main\"]",
|
|
161
159
|
"switchWindowMs": 500,
|
|
162
160
|
"switchFreshnessSeconds": 3600,
|
|
@@ -172,20 +170,16 @@
|
|
|
172
170
|
"id": "example-room-lighting-room-lighting-controller",
|
|
173
171
|
"type": "home-room-lighting-controller",
|
|
174
172
|
"name": "",
|
|
175
|
-
"area": "
|
|
176
|
-
"displayName": "
|
|
173
|
+
"area": "",
|
|
174
|
+
"displayName": "",
|
|
177
175
|
"targets": "[{\"id\":\"main\",\"stateTopic\":\"room/light/main\",\"commandTopic\":\"room/light/main/set\"}]",
|
|
178
|
-
"latitude": 0,
|
|
179
|
-
"longitude": 0,
|
|
180
|
-
"minBrightnessPct": 1,
|
|
181
176
|
"maxBrightnessPct": 100,
|
|
182
|
-
"
|
|
183
|
-
"maxColorTempKelvin": 5500,
|
|
177
|
+
"maxColorTempKelvin": 6500,
|
|
184
178
|
"sleepBrightnessPct": 1,
|
|
185
|
-
"sleepColorTempKelvin":
|
|
179
|
+
"sleepColorTempKelvin": 2200,
|
|
186
180
|
"initialTransitionSeconds": 1,
|
|
187
|
-
"refreshTransitionSeconds":
|
|
188
|
-
"refreshSeconds":
|
|
181
|
+
"refreshTransitionSeconds": 60,
|
|
182
|
+
"refreshSeconds": 60,
|
|
189
183
|
"initialSleep": false,
|
|
190
184
|
"x": 880,
|
|
191
185
|
"y": 180,
|
|
@@ -193,7 +187,11 @@
|
|
|
193
187
|
[
|
|
194
188
|
"example-room-lighting-room-commands"
|
|
195
189
|
]
|
|
196
|
-
]
|
|
190
|
+
],
|
|
191
|
+
"wakeTime": "07:00",
|
|
192
|
+
"bedTime": "23:00",
|
|
193
|
+
"publishState": false,
|
|
194
|
+
"discovery": false
|
|
197
195
|
},
|
|
198
196
|
{
|
|
199
197
|
"id": "example-room-lighting-room-commands",
|