@avantics/node-red-home-automation 2.3.0 → 3.0.1
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 +55 -8
- package/contract-examples/room-lighting.mjs +12 -7
- 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 +13 -47
- package/dist/lib/avr-controller.js +39 -90
- 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/command-echo.d.ts +22 -0
- package/dist/lib/command-echo.js +106 -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 +7 -18
- package/dist/lib/display-mode-controller.js +39 -47
- 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/room-controller.d.ts +15 -34
- package/dist/lib/room-controller.js +100 -134
- 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 +30 -35
- package/dist/lib/source-capability-controller.js +35 -36
- 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 +3 -3
- package/dist/nodes/avr-controller.js +17 -56
- package/dist/nodes/backlighting-controller.html +1 -1
- package/dist/nodes/backlighting-controller.js +25 -47
- package/dist/nodes/display-mode-controller.html +2 -2
- package/dist/nodes/display-mode-controller.js +19 -57
- 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 +85 -26
- package/dist/nodes/room-controller.js +37 -54
- 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 +4 -2
- package/dist/nodes/theatre-activity-controller.js +18 -45
- package/dist/nodes/theatre-state-contract.html +55 -22
- package/dist/nodes/theatre-state-contract.js +30 -41
- package/examples/Home theatre activity.json +13 -12
- package/examples/Home theatre equipment.json +4 -4
- package/examples/Room lighting.json +9 -9
- package/package.json +1 -1
- package/dist/lib/circadian-refresh.d.ts +0 -7
- package/dist/lib/circadian-refresh.js +0 -11
|
@@ -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,7 +106,7 @@
|
|
|
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
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\"}}}",
|
|
@@ -124,7 +125,7 @@
|
|
|
124
125
|
"id": "example-home-theatre-activity-activity-lighting-controller",
|
|
125
126
|
"type": "home-activity-lighting-controller",
|
|
126
127
|
"name": "",
|
|
127
|
-
"area": "
|
|
128
|
+
"area": "",
|
|
128
129
|
"profiles": "{\"off\":{\"targets\":[],\"values\":{}},\"tv\":{\"targets\":[\"main\"],\"values\":{\"brightness\":64,\"color_temp\":400}}}",
|
|
129
130
|
"confirmationTimeoutMs": 15000,
|
|
130
131
|
"maxAttempts": 2,
|
|
@@ -236,7 +237,7 @@
|
|
|
236
237
|
"id": "example-home-theatre-activity-display-controller",
|
|
237
238
|
"type": "home-display-mode-controller",
|
|
238
239
|
"name": "",
|
|
239
|
-
"area": "
|
|
240
|
+
"area": "",
|
|
240
241
|
"tvHost": "",
|
|
241
242
|
"screenHost": "",
|
|
242
243
|
"projectorMeterHost": "",
|
|
@@ -307,7 +308,7 @@
|
|
|
307
308
|
"id": "example-home-theatre-activity-avr-controller",
|
|
308
309
|
"type": "home-avr-controller",
|
|
309
310
|
"name": "",
|
|
310
|
-
"area": "
|
|
311
|
+
"area": "",
|
|
311
312
|
"sources": "{\"shield\":\"SAT/CBL\",\"playstation\":\"GAME\"}",
|
|
312
313
|
"retryMs": 2000,
|
|
313
314
|
"maxAttempts": 3,
|
|
@@ -365,7 +366,7 @@
|
|
|
365
366
|
"id": "example-home-theatre-activity-source-controller",
|
|
366
367
|
"type": "home-source-capability-controller",
|
|
367
368
|
"name": "",
|
|
368
|
-
"area": "
|
|
369
|
+
"area": "",
|
|
369
370
|
"sources": "{\"streamer\":{\"activation\":\"command\",\"deactivation\":\"command\",\"confirmation\":\"active\"}}",
|
|
370
371
|
"pollMs": 2000,
|
|
371
372
|
"confirmationTimeoutMs": 15000,
|
|
@@ -443,7 +444,7 @@
|
|
|
443
444
|
"id": "example-home-theatre-activity-backlighting-controller",
|
|
444
445
|
"type": "home-backlighting-controller",
|
|
445
446
|
"name": "",
|
|
446
|
-
"area": "
|
|
447
|
+
"area": "",
|
|
447
448
|
"pollMs": 2000,
|
|
448
449
|
"confirmationTimeoutMs": 15000,
|
|
449
450
|
"maxAttempts": 2,
|
|
@@ -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 wake and bed times (Node-RED host time) before deploying.",
|
|
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,8 +170,8 @@
|
|
|
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
176
|
"maxBrightnessPct": 100,
|
|
179
177
|
"maxColorTempKelvin": 6500,
|
|
@@ -191,7 +189,9 @@
|
|
|
191
189
|
]
|
|
192
190
|
],
|
|
193
191
|
"wakeTime": "07:00",
|
|
194
|
-
"bedTime": "23:00"
|
|
192
|
+
"bedTime": "23:00",
|
|
193
|
+
"publishState": false,
|
|
194
|
+
"discovery": false
|
|
195
195
|
},
|
|
196
196
|
{
|
|
197
197
|
"id": "example-room-lighting-room-commands",
|
package/package.json
CHANGED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.alreadyStyled = alreadyStyled;
|
|
4
|
-
// Whether a light already shows a style, by its own latest report. A bulb
|
|
5
|
-
// that missed a command reports something else, so it is not "styled".
|
|
6
|
-
function alreadyStyled(style, observed) {
|
|
7
|
-
return observed?.on === true &&
|
|
8
|
-
Number(observed.brightness) === style.brightness &&
|
|
9
|
-
Number(observed.color_temp) === style.color_temp;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=circadian-refresh.js.map
|