@avantics/node-red-home-automation 4.0.2 → 5.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.
Files changed (60) hide show
  1. package/README.md +126 -4
  2. package/contract-examples/switch-gestures.mjs +1 -1
  3. package/contract-examples/volume-ownership.mjs +6 -5
  4. package/dist/lib/activity-lighting-controller.d.ts +2 -0
  5. package/dist/lib/activity-lighting-controller.js +46 -7
  6. package/dist/lib/adopted-request.d.ts +17 -0
  7. package/dist/lib/adopted-request.js +61 -7
  8. package/dist/lib/avr-controller.d.ts +9 -3
  9. package/dist/lib/avr-controller.js +76 -24
  10. package/dist/lib/avr-publishing.d.ts +3 -3
  11. package/dist/lib/avr-publishing.js +11 -5
  12. package/dist/lib/backlighting-controller.d.ts +2 -0
  13. package/dist/lib/backlighting-controller.js +37 -8
  14. package/dist/lib/cover-publishing.js +1 -1
  15. package/dist/lib/denon-protocol.d.ts +5 -1
  16. package/dist/lib/denon-protocol.js +26 -11
  17. package/dist/lib/display-mode-controller.d.ts +12 -5
  18. package/dist/lib/display-mode-controller.js +181 -87
  19. package/dist/lib/house-schedule-publishing.js +1 -1
  20. package/dist/lib/light-styling.d.ts +2 -2
  21. package/dist/lib/light-styling.js +5 -4
  22. package/dist/lib/motion-publishing.js +1 -1
  23. package/dist/lib/occupancy-publishing.js +1 -1
  24. package/dist/lib/power-reading.d.ts +5 -0
  25. package/dist/lib/power-reading.js +13 -0
  26. package/dist/lib/room-controller.d.ts +2 -3
  27. package/dist/lib/room-controller.js +18 -2
  28. package/dist/lib/room-lighting-discovery.js +1 -1
  29. package/dist/lib/room-publishing.d.ts +3 -0
  30. package/dist/lib/shelly-cover.d.ts +46 -0
  31. package/dist/lib/shelly-cover.js +193 -0
  32. package/dist/lib/source-capability-controller.d.ts +2 -0
  33. package/dist/lib/source-capability-controller.js +27 -6
  34. package/dist/lib/switch-policy.d.ts +1 -1
  35. package/dist/lib/switch-policy.js +1 -1
  36. package/dist/lib/theatre-requests.d.ts +29 -0
  37. package/dist/lib/theatre-requests.js +89 -0
  38. package/dist/lib/theatre-state-contract.d.ts +5 -22
  39. package/dist/lib/theatre-state-contract.js +18 -73
  40. package/dist/lib/toggle-power.d.ts +41 -0
  41. package/dist/lib/toggle-power.js +74 -0
  42. package/dist/lib/topic-names.d.ts +1 -0
  43. package/dist/lib/topic-names.js +7 -0
  44. package/dist/lib/{display-transport.d.ts → transports/display-transport.d.ts} +1 -1
  45. package/dist/lib/{display-transport.js → transports/display-transport.js} +32 -7
  46. package/dist/lib/z2m-light.d.ts +8 -0
  47. package/dist/lib/z2m-light.js +64 -3
  48. package/dist/nodes/activity-lighting-controller.html +8 -0
  49. package/dist/nodes/avr-controller.html +28 -6
  50. package/dist/nodes/avr-controller.js +16 -6
  51. package/dist/nodes/display-mode-controller.html +61 -11
  52. package/dist/nodes/display-mode-controller.js +16 -6
  53. package/dist/nodes/room-controller.js +14 -0
  54. package/dist/nodes/shelly-cover.d.ts +3 -0
  55. package/dist/nodes/shelly-cover.html +65 -0
  56. package/dist/nodes/shelly-cover.js +34 -0
  57. package/examples/Home theatre activity.json +5 -5
  58. package/examples/Home theatre equipment.json +4 -4
  59. package/examples/Shelly cover.json +252 -0
  60. package/package.json +3 -2
@@ -0,0 +1,252 @@
1
+ [
2
+ {
3
+ "id": "example-shelly-cover-comment",
4
+ "type": "comment",
5
+ "name": "Shelly cover example",
6
+ "info": "A Shelly Gen2 device in cover mode, owned by the cover controller, with no function nodes. In your flow, replace the injects marked 'from the device' with an MQTT in node subscribed to <prefix>/# (output: auto-detect), and the debug node with an MQTT out node, both on your broker. Set the adapter's MQTT topic prefix to your device's (its device ID unless you set one). The controller's device commands go to the adapter, which sends them to the device as its MQTT control commands; the device's status, change notifications and online state come back through the adapter as the controller's readings.",
7
+ "x": 150,
8
+ "y": 40,
9
+ "wires": []
10
+ },
11
+ {
12
+ "id": "example-shelly-cover-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-shelly-cover-cover"
32
+ ]
33
+ ]
34
+ },
35
+ {
36
+ "id": "example-shelly-cover-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-shelly-cover-cover"
56
+ ]
57
+ ]
58
+ },
59
+ {
60
+ "id": "example-shelly-cover-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-shelly-cover-cover"
80
+ ]
81
+ ]
82
+ },
83
+ {
84
+ "id": "example-shelly-cover-position",
85
+ "type": "inject",
86
+ "name": "set position 60",
87
+ "props": [
88
+ {
89
+ "p": "payload",
90
+ "v": "60",
91
+ "vt": "num"
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-shelly-cover-cover"
104
+ ]
105
+ ]
106
+ },
107
+ {
108
+ "id": "example-shelly-cover-cover",
109
+ "type": "home-cover-controller",
110
+ "name": "",
111
+ "area": "",
112
+ "presets": "{}",
113
+ "positionTolerance": 2,
114
+ "invert": false,
115
+ "travelTimeoutMs": 90000,
116
+ "maxAttempts": 2,
117
+ "pollMs": 5000,
118
+ "settleMs": 5000,
119
+ "x": 380,
120
+ "y": 160,
121
+ "wires": [
122
+ [
123
+ "example-shelly-cover-adapter"
124
+ ],
125
+ [
126
+ "example-shelly-cover-state"
127
+ ],
128
+ []
129
+ ]
130
+ },
131
+ {
132
+ "id": "example-shelly-cover-adapter",
133
+ "type": "home-shelly-cover",
134
+ "name": "",
135
+ "topicPrefix": "shellyplus2pm-a8032ab12345",
136
+ "channel": 0,
137
+ "x": 640,
138
+ "y": 160,
139
+ "wires": [
140
+ [
141
+ "example-shelly-cover-to-device"
142
+ ],
143
+ [
144
+ "example-shelly-cover-cover"
145
+ ]
146
+ ]
147
+ },
148
+ {
149
+ "id": "example-shelly-cover-to-device",
150
+ "type": "debug",
151
+ "name": "to the MQTT out node",
152
+ "active": true,
153
+ "tosidebar": true,
154
+ "console": false,
155
+ "tostatus": false,
156
+ "complete": "true",
157
+ "targetType": "full",
158
+ "statusVal": "",
159
+ "statusType": "auto",
160
+ "x": 880,
161
+ "y": 140,
162
+ "wires": []
163
+ },
164
+ {
165
+ "id": "example-shelly-cover-state",
166
+ "type": "debug",
167
+ "name": "state and results",
168
+ "active": true,
169
+ "tosidebar": true,
170
+ "console": false,
171
+ "tostatus": false,
172
+ "complete": "true",
173
+ "targetType": "full",
174
+ "statusVal": "",
175
+ "statusType": "auto",
176
+ "x": 640,
177
+ "y": 240,
178
+ "wires": []
179
+ },
180
+ {
181
+ "id": "example-shelly-cover-online",
182
+ "type": "inject",
183
+ "name": "online, from the device",
184
+ "props": [
185
+ {
186
+ "p": "payload",
187
+ "v": "true",
188
+ "vt": "str"
189
+ }
190
+ ],
191
+ "repeat": "",
192
+ "crontab": "",
193
+ "once": false,
194
+ "onceDelay": 0.1,
195
+ "topic": "shellyplus2pm-a8032ab12345/online",
196
+ "x": 180,
197
+ "y": 300,
198
+ "wires": [
199
+ [
200
+ "example-shelly-cover-adapter"
201
+ ]
202
+ ]
203
+ },
204
+ {
205
+ "id": "example-shelly-cover-status",
206
+ "type": "inject",
207
+ "name": "cover status, from the device",
208
+ "props": [
209
+ {
210
+ "p": "payload",
211
+ "v": "{\"id\":0,\"state\":\"stopped\",\"current_pos\":40,\"pos_control\":true}",
212
+ "vt": "json"
213
+ }
214
+ ],
215
+ "repeat": "",
216
+ "crontab": "",
217
+ "once": false,
218
+ "onceDelay": 0.1,
219
+ "topic": "shellyplus2pm-a8032ab12345/status/cover:0",
220
+ "x": 190,
221
+ "y": 340,
222
+ "wires": [
223
+ [
224
+ "example-shelly-cover-adapter"
225
+ ]
226
+ ]
227
+ },
228
+ {
229
+ "id": "example-shelly-cover-notify",
230
+ "type": "inject",
231
+ "name": "change notification, from the device",
232
+ "props": [
233
+ {
234
+ "p": "payload",
235
+ "v": "{\"src\":\"shellyplus2pm-a8032ab12345\",\"dst\":\"shellyplus2pm-a8032ab12345/events\",\"method\":\"NotifyStatus\",\"params\":{\"ts\":1764151200,\"cover:0\":{\"id\":0,\"state\":\"open\",\"current_pos\":100}}}",
236
+ "vt": "json"
237
+ }
238
+ ],
239
+ "repeat": "",
240
+ "crontab": "",
241
+ "once": false,
242
+ "onceDelay": 0.1,
243
+ "topic": "shellyplus2pm-a8032ab12345/events/rpc",
244
+ "x": 210,
245
+ "y": 380,
246
+ "wires": [
247
+ [
248
+ "example-shelly-cover-adapter"
249
+ ]
250
+ ]
251
+ }
252
+ ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@avantics/node-red-home-automation",
3
- "version": "4.0.2",
3
+ "version": "5.0.0",
4
4
  "description": "Deterministic home automation components for Node-RED",
5
5
  "keywords": [
6
6
  "node-red",
@@ -57,7 +57,8 @@
57
57
  "home-house-schedule": "dist/nodes/house-schedule.js",
58
58
  "home-cover-controller": "dist/nodes/cover-controller.js",
59
59
  "home-cover-group": "dist/nodes/cover-group.js",
60
- "home-house-schedule-mqtt": "dist/nodes/house-schedule-mqtt.js"
60
+ "home-house-schedule-mqtt": "dist/nodes/house-schedule-mqtt.js",
61
+ "home-shelly-cover": "dist/nodes/shelly-cover.js"
61
62
  }
62
63
  },
63
64
  "devDependencies": {