node-red-contrib-homekit-bridged 2.0.0-dev.5 → 2.0.0-dev.7

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 (128) hide show
  1. package/build/lib/HAPHostNode.js +183 -141
  2. package/build/lib/HAPServiceNode.js +199 -172
  3. package/build/lib/HAPServiceNode2.js +207 -172
  4. package/build/lib/NRCHKBError.js +23 -2
  5. package/build/lib/PairingQRCode.js +62 -0
  6. package/build/lib/Storage.js +157 -92
  7. package/build/lib/api.js +654 -288
  8. package/build/lib/camera/CameraControl.js +119 -84
  9. package/build/lib/camera/CameraDelegate.js +481 -404
  10. package/build/lib/camera/MP4StreamingServer.js +148 -139
  11. package/build/lib/hap/HAPCharacteristic.js +25 -4
  12. package/build/lib/hap/HAPService.js +25 -4
  13. package/build/lib/hap/eve-app/EveCharacteristics.js +124 -81
  14. package/build/lib/hap/eve-app/EveServices.js +50 -17
  15. package/build/lib/hap/hap-nodejs.js +32 -0
  16. package/build/lib/migration/HomeKitService2Migration.js +34 -0
  17. package/build/lib/migration/NodeMigration.js +75 -0
  18. package/build/lib/types/AccessoryInformationType.js +15 -1
  19. package/build/lib/types/CameraConfigType.js +15 -1
  20. package/build/lib/types/CustomCharacteristicType.js +15 -1
  21. package/build/lib/types/HAPHostConfigType.js +15 -1
  22. package/build/lib/types/HAPHostNodeType.js +15 -1
  23. package/build/lib/types/HAPService2ConfigType.js +15 -1
  24. package/build/lib/types/HAPService2NodeType.js +15 -1
  25. package/build/lib/types/HAPServiceConfigType.js +15 -1
  26. package/build/lib/types/HAPServiceNodeType.js +15 -1
  27. package/build/lib/types/HAPStatusConfigType.js +15 -1
  28. package/build/lib/types/HAPStatusNodeType.js +15 -1
  29. package/build/lib/types/HostType.js +28 -7
  30. package/build/lib/types/NodeType.js +15 -1
  31. package/build/lib/types/PublishTimersType.js +15 -1
  32. package/build/lib/types/UniFiControllerConfigType.js +16 -0
  33. package/build/lib/types/hap-nodejs/HapAdaptiveLightingControllerMode.js +28 -7
  34. package/build/lib/types/hap-nodejs/HapCategories.js +64 -43
  35. package/build/lib/types/storage/SerializedHostType.js +15 -1
  36. package/build/lib/types/storage/StorageType.js +34 -10
  37. package/build/lib/unifi/ProtectDiscovery.js +80 -0
  38. package/build/lib/utils/AccessoryUtils.js +152 -110
  39. package/build/lib/utils/BridgeUtils.js +82 -39
  40. package/build/lib/utils/CharacteristicUtils.js +5 -49
  41. package/build/lib/utils/CharacteristicUtils2.js +5 -49
  42. package/build/lib/utils/CharacteristicUtilsBase.js +81 -0
  43. package/build/lib/utils/NodeStatusUtils.js +89 -40
  44. package/build/lib/utils/ServiceUtils.js +434 -375
  45. package/build/lib/utils/ServiceUtils2.js +514 -309
  46. package/build/lib/utils/index.js +10 -11
  47. package/build/nodes/bridge.html +184 -166
  48. package/build/nodes/bridge.js +27 -9
  49. package/build/nodes/locales/en-US/node-red-contrib-homekit-bridged.json +22 -0
  50. package/build/nodes/nrchkb.html +1601 -88
  51. package/build/nodes/nrchkb.js +66 -88
  52. package/build/nodes/plugin-instance.html +499 -0
  53. package/build/nodes/plugin-instance.js +46 -0
  54. package/build/nodes/service.html +517 -299
  55. package/build/nodes/service.js +5 -6
  56. package/build/nodes/service2.html +1683 -460
  57. package/build/nodes/service2.js +5 -8
  58. package/build/nodes/standalone.html +187 -174
  59. package/build/nodes/standalone.js +27 -9
  60. package/build/nodes/status.html +51 -18
  61. package/build/nodes/status.js +47 -40
  62. package/build/nodes/unifi-controller.html +92 -0
  63. package/build/nodes/unifi-controller.js +20 -0
  64. package/build/plugins/embedded/homebridge-camera-ffmpeg/index.js +479 -0
  65. package/build/plugins/embedded/homebridge-unifi-protect/index.js +521 -0
  66. package/build/plugins/embedded/index.js +58 -0
  67. package/build/plugins/nrchkb-homekit-plugins.js +17 -0
  68. package/build/plugins/registry/index.js +203 -0
  69. package/build/plugins/registry/types.js +16 -0
  70. package/build/scripts/migrate-homekit-service-flows.js +47 -0
  71. package/examples/demo/01 - ALL Demos single import.json +1885 -1885
  72. package/examples/demo/02 - Air Purifier.json +279 -279
  73. package/examples/demo/03 - Air Quality sensor with Battery.json +254 -254
  74. package/examples/demo/04 - Dimmable Bulb.json +172 -172
  75. package/examples/demo/05 - Color Bulb (HSV).json +195 -195
  76. package/examples/demo/06 - Fan (simple, 3 speeds).json +240 -240
  77. package/examples/demo/07 - Fan (with speed, oscillate, rotation direction).json +175 -175
  78. package/examples/demo/08 - CO2 detector.json +224 -224
  79. package/examples/demo/09 - CO (carbon monoxide) example.json +255 -255
  80. package/examples/demo/10 - Door window contact sensor.json +234 -234
  81. package/examples/demos (advanced)/01 - Television with inputs and speaker.json +541 -541
  82. package/examples/switch/01 - Plain Switch.json +178 -178
  83. package/package.json +95 -84
  84. package/build/lib/HAPHostNode.d.ts +0 -1
  85. package/build/lib/HAPServiceNode.d.ts +0 -1
  86. package/build/lib/HAPServiceNode2.d.ts +0 -1
  87. package/build/lib/NRCHKBError.d.ts +0 -3
  88. package/build/lib/Storage.d.ts +0 -30
  89. package/build/lib/api.d.ts +0 -1
  90. package/build/lib/camera/CameraControl.d.ts +0 -3
  91. package/build/lib/camera/CameraDelegate.d.ts +0 -38
  92. package/build/lib/camera/MP4StreamingServer.d.ts +0 -26
  93. package/build/lib/hap/HAPCharacteristic.d.ts +0 -9
  94. package/build/lib/hap/HAPService.d.ts +0 -6
  95. package/build/lib/hap/eve-app/EveCharacteristics.d.ts +0 -20
  96. package/build/lib/hap/eve-app/EveServices.d.ts +0 -5
  97. package/build/lib/types/AccessoryInformationType.d.ts +0 -11
  98. package/build/lib/types/CameraConfigType.d.ts +0 -24
  99. package/build/lib/types/CustomCharacteristicType.d.ts +0 -6
  100. package/build/lib/types/HAPHostConfigType.d.ts +0 -22
  101. package/build/lib/types/HAPHostNodeType.d.ts +0 -14
  102. package/build/lib/types/HAPService2ConfigType.d.ts +0 -6
  103. package/build/lib/types/HAPService2NodeType.d.ts +0 -7
  104. package/build/lib/types/HAPServiceConfigType.d.ts +0 -26
  105. package/build/lib/types/HAPServiceNodeType.d.ts +0 -38
  106. package/build/lib/types/HAPStatusConfigType.d.ts +0 -5
  107. package/build/lib/types/HAPStatusNodeType.d.ts +0 -12
  108. package/build/lib/types/HostType.d.ts +0 -5
  109. package/build/lib/types/NodeType.d.ts +0 -3
  110. package/build/lib/types/PublishTimersType.d.ts +0 -4
  111. package/build/lib/types/hap-nodejs/HapAdaptiveLightingControllerMode.d.ts +0 -5
  112. package/build/lib/types/hap-nodejs/HapCategories.d.ts +0 -41
  113. package/build/lib/types/storage/SerializedHostType.d.ts +0 -5
  114. package/build/lib/types/storage/StorageType.d.ts +0 -8
  115. package/build/lib/utils/AccessoryUtils.d.ts +0 -1
  116. package/build/lib/utils/BridgeUtils.d.ts +0 -1
  117. package/build/lib/utils/CharacteristicUtils.d.ts +0 -1
  118. package/build/lib/utils/CharacteristicUtils2.d.ts +0 -1
  119. package/build/lib/utils/NodeStatusUtils.d.ts +0 -17
  120. package/build/lib/utils/ServiceUtils.d.ts +0 -1
  121. package/build/lib/utils/ServiceUtils2.d.ts +0 -1
  122. package/build/lib/utils/index.d.ts +0 -1
  123. package/build/nodes/bridge.d.ts +0 -1
  124. package/build/nodes/nrchkb.d.ts +0 -1
  125. package/build/nodes/service.d.ts +0 -1
  126. package/build/nodes/service2.d.ts +0 -1
  127. package/build/nodes/standalone.d.ts +0 -1
  128. package/build/nodes/status.d.ts +0 -1
@@ -1,1887 +1,1887 @@
1
1
  [
2
- {
3
- "id": "2c464315.51c50c",
4
- "type": "group",
5
- "z": "eeb8b00c.2c18c",
6
- "name": "Fan Full Example: input from device, output to device",
7
- "style": {
8
- "stroke": "#999999",
9
- "fill": "none",
10
- "label": true,
11
- "label-position": "nw",
12
- "color": "#a4a4a4"
13
- },
14
- "nodes": [
15
- "b7778e52.220a5",
16
- "fd8aff55.91d41",
17
- "c717b796.0735b8",
18
- "f56a2f96.509c1",
19
- "d945ba75.897998"
20
- ],
21
- "x": 94,
22
- "y": 1559,
23
- "w": 752,
24
- "h": 182,
25
- "info": "# Fan V2\n\nThis example shows a fan. The inputs from node red are to turn the fan on, off, or set \"No Response\".\n\nThe outputs going to \"Fan output\" will show:\n\nOn / off state <br/>\nRotation speed<br/>\nSwing mode on / off (oscillate) <br/>\nRotation direction (clockwise/counterclockwise)"
26
- },
27
- {
28
- "id": "b7778e52.220a5",
29
- "type": "debug",
30
- "z": "eeb8b00c.2c18c",
31
- "g": "2c464315.51c50c",
32
- "name": "Fan output",
33
- "active": true,
34
- "tosidebar": true,
35
- "console": false,
36
- "tostatus": false,
37
- "complete": "payload",
38
- "targetType": "msg",
39
- "x": 730,
40
- "y": 1600,
41
- "wires": []
42
- },
43
- {
44
- "id": "fd8aff55.91d41",
45
- "type": "homekit-service",
46
- "z": "eeb8b00c.2c18c",
47
- "g": "2c464315.51c50c",
48
- "isParent": true,
49
- "bridge": "409001a1.3e7a78",
50
- "parentService": "",
51
- "name": "Fan V2",
52
- "serviceName": "Fanv2",
53
- "topic": "",
54
- "filter": false,
55
- "manufacturer": "Default Manufacturer",
56
- "model": "Default Model",
57
- "serialNo": "Default Serial Number",
58
- "firmwareRev": "1.0.0",
59
- "hardwareRev": "1.0.0",
60
- "softwareRev": "1.0.0",
61
- "cameraConfigVideoProcessor": "ffmpeg",
62
- "cameraConfigSource": "",
63
- "cameraConfigStillImageSource": "",
64
- "cameraConfigMaxStreams": 2,
65
- "cameraConfigMaxWidth": 1280,
66
- "cameraConfigMaxHeight": 720,
67
- "cameraConfigMaxFPS": 10,
68
- "cameraConfigMaxBitrate": 300,
69
- "cameraConfigVideoCodec": "libx264",
70
- "cameraConfigAudioCodec": "libfdk_aac",
71
- "cameraConfigAudio": false,
72
- "cameraConfigPacketSize": 1316,
73
- "cameraConfigVerticalFlip": false,
74
- "cameraConfigHorizontalFlip": false,
75
- "cameraConfigMapVideo": "0:0",
76
- "cameraConfigMapAudio": "0:1",
77
- "cameraConfigVideoFilter": "scale=1280:720",
78
- "cameraConfigAdditionalCommandLine": "-tune zerolatency",
79
- "cameraConfigDebug": false,
80
- "cameraConfigSnapshotOutput": "disabled",
81
- "cameraConfigInterfaceName": "",
82
- "characteristicProperties": "{\n \"RotationSpeed\":true,\n \"RotationDirection\":true,\n \"SwingMode\":true\n}",
83
- "outputs": 2,
84
- "x": 500,
85
- "y": 1600,
86
- "wires": [["b7778e52.220a5"], []]
87
- },
88
- {
89
- "id": "c717b796.0735b8",
90
- "type": "inject",
91
- "z": "eeb8b00c.2c18c",
92
- "g": "2c464315.51c50c",
93
- "name": "NO RESPONSE",
94
- "repeat": "",
95
- "crontab": "",
96
- "once": false,
97
- "onceDelay": 0.1,
98
- "topic": "",
99
- "payload": "{\"Active\":\"NO_RESPONSE\"}",
100
- "payloadType": "json",
101
- "x": 220,
102
- "y": 1700,
103
- "wires": [["fd8aff55.91d41"]]
104
- },
105
- {
106
- "id": "f56a2f96.509c1",
107
- "type": "inject",
108
- "z": "eeb8b00c.2c18c",
109
- "g": "2c464315.51c50c",
110
- "name": "ON",
111
- "props": [
112
- {
113
- "p": "payload"
114
- },
115
- {
116
- "p": "topic",
117
- "vt": "str"
118
- }
119
- ],
120
- "repeat": "",
121
- "crontab": "",
122
- "once": false,
123
- "onceDelay": 0.1,
124
- "topic": "",
125
- "payload": "{\"Active\":true}",
126
- "payloadType": "json",
127
- "x": 200,
128
- "y": 1600,
129
- "wires": [["fd8aff55.91d41"]]
130
- },
131
- {
132
- "id": "d945ba75.897998",
133
- "type": "inject",
134
- "z": "eeb8b00c.2c18c",
135
- "g": "2c464315.51c50c",
136
- "name": "OFF",
137
- "props": [
138
- {
139
- "p": "payload"
140
- },
141
- {
142
- "p": "topic",
143
- "vt": "str"
144
- }
145
- ],
146
- "repeat": "",
147
- "crontab": "",
148
- "once": false,
149
- "onceDelay": 0.1,
150
- "topic": "",
151
- "payload": "{\"Active\":false}",
152
- "payloadType": "json",
153
- "x": 200,
154
- "y": 1640,
155
- "wires": [["fd8aff55.91d41"]]
156
- },
157
- {
158
- "id": "409001a1.3e7a78",
159
- "type": "homekit-bridge",
160
- "bridgeName": "Demo 1",
161
- "pinCode": "153-10-538",
162
- "port": "",
163
- "allowInsecureRequest": false,
164
- "manufacturer": "NRCHKB",
165
- "model": "Demo",
166
- "serialNo": "1.1.2",
167
- "customMdnsConfig": false,
168
- "mdnsMulticast": true,
169
- "mdnsInterface": "",
170
- "mdnsPort": "",
171
- "mdnsIp": "",
172
- "mdnsTtl": "",
173
- "mdnsLoopback": true,
174
- "mdnsReuseAddr": true,
175
- "allowMessagePassthrough": true
176
- },
177
- {
178
- "id": "384e0889.1fdae",
179
- "type": "group",
180
- "z": "eeb8b00c.2c18c",
181
- "name": "Color Bulb: input from device, output to device",
182
- "style": {
183
- "stroke": "#999999",
184
- "fill": "none",
185
- "label": true,
186
- "label-position": "nw",
187
- "color": "#a4a4a4"
188
- },
189
- "nodes": [
190
- "d838176b.dbaf7",
191
- "7bf880d4.3cd4d",
192
- "ee1452a5.08edd",
193
- "c6ed2a2a.90a01",
194
- "8cdfae2b.2f2ce8",
195
- "1758401b.6c62e8"
196
- ],
197
- "x": 94,
198
- "y": 599,
199
- "w": 752,
200
- "h": 162,
201
- "info": "# Color Bulb\n\nThis is a color bulb. It accepts and sends out Hue, Saturation, Value, and On/off state.\n\nHue is the color\n\nSaturation is how deep the color is\n\nValue is brightness\n\nOn is power state"
202
- },
203
- {
204
- "id": "d838176b.dbaf7",
205
- "type": "debug",
206
- "z": "eeb8b00c.2c18c",
207
- "g": "384e0889.1fdae",
208
- "name": "Color light output",
209
- "active": true,
210
- "tosidebar": true,
211
- "console": false,
212
- "tostatus": false,
213
- "complete": "payload",
214
- "targetType": "msg",
215
- "x": 710,
216
- "y": 720,
217
- "wires": []
218
- },
219
- {
220
- "id": "7bf880d4.3cd4d",
221
- "type": "homekit-service",
222
- "z": "eeb8b00c.2c18c",
223
- "g": "384e0889.1fdae",
224
- "isParent": true,
225
- "hostType": "0",
226
- "bridge": "409001a1.3e7a78",
227
- "accessoryId": "",
228
- "parentService": "",
229
- "name": "Color",
230
- "serviceName": "Lightbulb",
231
- "topic": "",
232
- "filter": false,
233
- "manufacturer": "Garrett",
234
- "model": "Color",
235
- "serialNo": "42",
236
- "firmwareRev": "1.2",
237
- "hardwareRev": "1.0.0",
238
- "softwareRev": "1.0.0",
239
- "cameraConfigVideoProcessor": "ffmpeg",
240
- "cameraConfigSource": "",
241
- "cameraConfigStillImageSource": "",
242
- "cameraConfigMaxStreams": 2,
243
- "cameraConfigMaxWidth": 1280,
244
- "cameraConfigMaxHeight": 720,
245
- "cameraConfigMaxFPS": 10,
246
- "cameraConfigMaxBitrate": 300,
247
- "cameraConfigVideoCodec": "libx264",
248
- "cameraConfigAudioCodec": "libfdk_aac",
249
- "cameraConfigAudio": false,
250
- "cameraConfigPacketSize": 1316,
251
- "cameraConfigVerticalFlip": false,
252
- "cameraConfigHorizontalFlip": false,
253
- "cameraConfigMapVideo": "0:0",
254
- "cameraConfigMapAudio": "0:1",
255
- "cameraConfigVideoFilter": "scale=1280:720",
256
- "cameraConfigAdditionalCommandLine": "-tune zerolatency",
257
- "cameraConfigDebug": false,
258
- "cameraConfigSnapshotOutput": "disabled",
259
- "cameraConfigInterfaceName": "",
260
- "characteristicProperties": "{ \"Brightness\":true, \"Hue\":true, \"Saturation\":true}",
261
- "waitForSetupMsg": false,
262
- "outputs": 2,
263
- "x": 490,
264
- "y": 720,
265
- "wires": [["d838176b.dbaf7"], []]
266
- },
267
- {
268
- "id": "ee1452a5.08edd",
269
- "type": "inject",
270
- "z": "eeb8b00c.2c18c",
271
- "g": "384e0889.1fdae",
272
- "name": "NO RESPONSE",
273
- "props": [
274
- {
275
- "p": "payload"
276
- }
277
- ],
278
- "repeat": "",
279
- "crontab": "",
280
- "once": false,
281
- "onceDelay": 0.1,
282
- "topic": "",
283
- "payload": "{\"On\":\"NO_RESPONSE\"}",
284
- "payloadType": "json",
285
- "x": 420,
286
- "y": 640,
287
- "wires": [["7bf880d4.3cd4d"]]
288
- },
289
- {
290
- "id": "c6ed2a2a.90a01",
291
- "type": "inject",
292
- "z": "eeb8b00c.2c18c",
293
- "g": "384e0889.1fdae",
294
- "name": "ON",
295
- "props": [
296
- {
297
- "p": "payload"
298
- }
299
- ],
300
- "repeat": "",
301
- "crontab": "",
302
- "once": false,
303
- "onceDelay": 0.1,
304
- "topic": "",
305
- "payload": "{\"On\":true}",
306
- "payloadType": "json",
307
- "x": 190,
308
- "y": 640,
309
- "wires": [["7bf880d4.3cd4d"]]
310
- },
311
- {
312
- "id": "8cdfae2b.2f2ce8",
313
- "type": "inject",
314
- "z": "eeb8b00c.2c18c",
315
- "g": "384e0889.1fdae",
316
- "name": "Reset HSV",
317
- "props": [
318
- {
319
- "p": "payload"
320
- }
321
- ],
322
- "repeat": "",
323
- "crontab": "",
324
- "once": false,
325
- "onceDelay": 0.1,
326
- "topic": "",
327
- "payload": "{\"Brightness\":50,\"Hue\":50,\"Saturation\":50}",
328
- "payloadType": "json",
329
- "x": 200,
330
- "y": 720,
331
- "wires": [["7bf880d4.3cd4d"]]
332
- },
333
- {
334
- "id": "1758401b.6c62e8",
335
- "type": "inject",
336
- "z": "eeb8b00c.2c18c",
337
- "g": "384e0889.1fdae",
338
- "name": "OFF",
339
- "props": [
340
- {
341
- "p": "payload"
342
- }
343
- ],
344
- "repeat": "",
345
- "crontab": "",
346
- "once": false,
347
- "onceDelay": 0.1,
348
- "topic": "",
349
- "payload": "{\"On\":false}",
350
- "payloadType": "json",
351
- "x": 190,
352
- "y": 680,
353
- "wires": [["7bf880d4.3cd4d"]]
354
- },
355
- {
356
- "id": "3a57bebe.a3b222",
357
- "type": "group",
358
- "z": "eeb8b00c.2c18c",
359
- "name": "Dimmable Bulb: input from device, output to device",
360
- "style": {
361
- "stroke": "#999999",
362
- "fill": "none",
363
- "label": true,
364
- "label-position": "nw",
365
- "color": "#a4a4a4"
366
- },
367
- "nodes": [
368
- "459254fe.49c72c",
369
- "379657db.a99df8",
370
- "52a07047.03ce7",
371
- "253b3550.729caa",
372
- "b9bc7f3d.51acf"
373
- ],
374
- "x": 94,
375
- "y": 459,
376
- "w": 752,
377
- "h": 122,
378
- "info": "# Dimmable Bulb\n\nThis is a dimmable bulb. The Characteristic Properties enable brightness. It is a white bulb which can be adjusted from 0 to 100% brightness."
379
- },
380
- {
381
- "id": "459254fe.49c72c",
382
- "type": "homekit-service",
383
- "z": "eeb8b00c.2c18c",
384
- "g": "3a57bebe.a3b222",
385
- "isParent": true,
386
- "hostType": "0",
387
- "bridge": "409001a1.3e7a78",
388
- "accessoryId": "",
389
- "parentService": "",
390
- "name": "Dimmable",
391
- "serviceName": "Lightbulb",
392
- "topic": "",
393
- "filter": false,
394
- "manufacturer": "Garrett",
395
- "model": "Dummy",
396
- "serialNo": "Default Serial Number",
397
- "firmwareRev": "1.1.9",
398
- "hardwareRev": "1.0.0",
399
- "softwareRev": "1.0.0",
400
- "cameraConfigVideoProcessor": "ffmpeg",
401
- "cameraConfigSource": "",
402
- "cameraConfigStillImageSource": "",
403
- "cameraConfigMaxStreams": 2,
404
- "cameraConfigMaxWidth": 1280,
405
- "cameraConfigMaxHeight": 720,
406
- "cameraConfigMaxFPS": 10,
407
- "cameraConfigMaxBitrate": 300,
408
- "cameraConfigVideoCodec": "libx264",
409
- "cameraConfigAudioCodec": "libfdk_aac",
410
- "cameraConfigAudio": false,
411
- "cameraConfigPacketSize": 1316,
412
- "cameraConfigVerticalFlip": false,
413
- "cameraConfigHorizontalFlip": false,
414
- "cameraConfigMapVideo": "0:0",
415
- "cameraConfigMapAudio": "0:1",
416
- "cameraConfigVideoFilter": "scale=1280:720",
417
- "cameraConfigAdditionalCommandLine": "-tune zerolatency",
418
- "cameraConfigDebug": false,
419
- "cameraConfigSnapshotOutput": "disabled",
420
- "cameraConfigInterfaceName": "",
421
- "characteristicProperties": "{ \"Brightness\":true}",
422
- "waitForSetupMsg": false,
423
- "outputs": 2,
424
- "x": 460,
425
- "y": 540,
426
- "wires": [["379657db.a99df8"], []]
427
- },
428
- {
429
- "id": "379657db.a99df8",
430
- "type": "debug",
431
- "z": "eeb8b00c.2c18c",
432
- "g": "3a57bebe.a3b222",
433
- "name": "Dimmable light output",
434
- "active": true,
435
- "tosidebar": true,
436
- "console": false,
437
- "tostatus": false,
438
- "complete": "payload",
439
- "targetType": "msg",
440
- "x": 700,
441
- "y": 540,
442
- "wires": []
443
- },
444
- {
445
- "id": "52a07047.03ce7",
446
- "type": "inject",
447
- "z": "eeb8b00c.2c18c",
448
- "g": "3a57bebe.a3b222",
449
- "name": "NO RESPONSE",
450
- "props": [
451
- {
452
- "p": "payload"
453
- }
454
- ],
455
- "repeat": "",
456
- "crontab": "",
457
- "once": false,
458
- "onceDelay": 0.1,
459
- "topic": "",
460
- "payload": "{\"On\":\"NO_RESPONSE\"}",
461
- "payloadType": "json",
462
- "x": 400,
463
- "y": 500,
464
- "wires": [["459254fe.49c72c"]]
465
- },
466
- {
467
- "id": "253b3550.729caa",
468
- "type": "inject",
469
- "z": "eeb8b00c.2c18c",
470
- "g": "3a57bebe.a3b222",
471
- "name": "ON",
472
- "props": [
473
- {
474
- "p": "payload"
475
- }
476
- ],
477
- "repeat": "",
478
- "crontab": "",
479
- "once": false,
480
- "onceDelay": 0.1,
481
- "topic": "",
482
- "payload": "{\"On\":true}",
483
- "payloadType": "json",
484
- "x": 190,
485
- "y": 500,
486
- "wires": [["459254fe.49c72c"]]
487
- },
488
- {
489
- "id": "b9bc7f3d.51acf",
490
- "type": "inject",
491
- "z": "eeb8b00c.2c18c",
492
- "g": "3a57bebe.a3b222",
493
- "name": "OFF",
494
- "props": [
495
- {
496
- "p": "payload"
497
- }
498
- ],
499
- "repeat": "",
500
- "crontab": "",
501
- "once": false,
502
- "onceDelay": 0.1,
503
- "topic": "",
504
- "payload": "{\"On\":false}",
505
- "payloadType": "json",
506
- "x": 190,
507
- "y": 540,
508
- "wires": [["459254fe.49c72c"]]
509
- },
510
- {
511
- "id": "60e44fde.c914f8",
512
- "type": "group",
513
- "z": "eeb8b00c.2c18c",
514
- "name": "Air Purifier: input power state, output commands device",
515
- "style": {
516
- "stroke": "#999999",
517
- "fill": "none",
518
- "label": true,
519
- "label-position": "nw",
520
- "color": "#a4a4a4"
521
- },
522
- "nodes": [
523
- "8dea49.4a770db8",
524
- "5302e4aa.1b466c",
525
- "bfe1c73d.c165a8",
526
- "9739d842.a402f",
527
- "87048a6e.df64e8",
528
- "db412cea.4a62f8",
529
- "46418e19.aa6d6",
530
- "664dadf9.85d0d4",
531
- "d7cd8a56.628178",
532
- "3de34c4c.1871a4",
533
- "ee8894e4.f1855"
534
- ],
535
- "x": 94,
536
- "y": 59,
537
- "w": 822,
538
- "h": 162,
539
- "info": "Turning the device on or off will send:\n`{\"Active\":[0, 1]}`\n\nAfter changing power state, the device will be \"Turning on\" or \"Turning off\" until a current state is sent of:\n`{\"CurrentAirPurifierState\":[0, 1, 2]}`\n0: off <br/>\n1: idle <br/>\n2: on <br/>\n\nThere will be a slider in the home app for sending `RotationSpeed`\n\nThere will be a switch on Home app for \"Oscillate\" which sends:\n`{\"SwingMode\":[0,1]}`\n\nChanging mode to manual to auto will send payload:\n`{\"TargetAirPurifierState\":[0, 1]}`\n\nChild lock will send \n`{\"LockPhysicalControls\": [0, 1]}`\n\n"
540
- },
541
- {
542
- "id": "8dea49.4a770db8",
543
- "type": "inject",
544
- "z": "eeb8b00c.2c18c",
545
- "g": "60e44fde.c914f8",
546
- "name": "off",
547
- "props": [
548
- {
549
- "p": "payload"
550
- }
551
- ],
552
- "repeat": "",
553
- "crontab": "",
554
- "once": false,
555
- "onceDelay": 0.1,
556
- "topic": "",
557
- "payload": "{\"CurrentAirPurifierState\":0}",
558
- "payloadType": "json",
559
- "x": 190,
560
- "y": 100,
561
- "wires": [["5302e4aa.1b466c"]]
562
- },
563
- {
564
- "id": "5302e4aa.1b466c",
565
- "type": "homekit-service",
566
- "z": "eeb8b00c.2c18c",
567
- "g": "60e44fde.c914f8",
568
- "isParent": true,
569
- "bridge": "409001a1.3e7a78",
570
- "parentService": "",
571
- "name": "Air purifier",
572
- "serviceName": "AirPurifier",
573
- "topic": "",
574
- "filter": false,
575
- "manufacturer": "Purity",
576
- "model": "Air",
577
- "serialNo": "23",
578
- "firmwareRev": "1.0.0",
579
- "hardwareRev": "1.0.0",
580
- "softwareRev": "1.0.0",
581
- "cameraConfigVideoProcessor": "ffmpeg",
582
- "cameraConfigSource": "",
583
- "cameraConfigStillImageSource": "",
584
- "cameraConfigMaxStreams": 2,
585
- "cameraConfigMaxWidth": 1280,
586
- "cameraConfigMaxHeight": 720,
587
- "cameraConfigMaxFPS": 10,
588
- "cameraConfigMaxBitrate": 300,
589
- "cameraConfigVideoCodec": "libx264",
590
- "cameraConfigAudioCodec": "libfdk_aac",
591
- "cameraConfigAudio": false,
592
- "cameraConfigPacketSize": 1316,
593
- "cameraConfigVerticalFlip": false,
594
- "cameraConfigHorizontalFlip": false,
595
- "cameraConfigMapVideo": "0:0",
596
- "cameraConfigMapAudio": "0:1",
597
- "cameraConfigVideoFilter": "scale=1280:720",
598
- "cameraConfigAdditionalCommandLine": "-tune zerolatency",
599
- "cameraConfigDebug": false,
600
- "cameraConfigSnapshotOutput": "disabled",
601
- "cameraConfigInterfaceName": "",
602
- "characteristicProperties": "{\n \"SwingMode\":true,\n \"RotationSpeed\":true,\n \"LockPhysicalControls\":true\n}",
603
- "outputs": 2,
604
- "x": 370,
605
- "y": 100,
606
- "wires": [["bfe1c73d.c165a8", "9739d842.a402f"], []]
607
- },
608
- {
609
- "id": "bfe1c73d.c165a8",
610
- "type": "debug",
611
- "z": "eeb8b00c.2c18c",
612
- "g": "60e44fde.c914f8",
613
- "name": "Purifier output",
614
- "active": true,
615
- "tosidebar": true,
616
- "console": false,
617
- "tostatus": false,
618
- "complete": "true",
619
- "targetType": "full",
620
- "x": 500,
621
- "y": 180,
622
- "wires": []
623
- },
624
- {
625
- "id": "9739d842.a402f",
626
- "type": "function",
627
- "z": "eeb8b00c.2c18c",
628
- "g": "60e44fde.c914f8",
629
- "name": "on/off",
630
- "func": "if (msg.hap !== undefined && msg.hap.context !== undefined){\n if (msg.payload.Active === 1){\n return [msg,null];\n }\n if (msg.payload.Active === 0){\n return [null,msg];\n }\n}\nreturn;",
631
- "outputs": 2,
632
- "noerr": 0,
633
- "initialize": "",
634
- "finalize": "",
635
- "x": 530,
636
- "y": 100,
637
- "wires": [["664dadf9.85d0d4", "d7cd8a56.628178"], ["3de34c4c.1871a4"]],
638
- "outputLabels": ["On", "Off"]
639
- },
640
- {
641
- "id": "87048a6e.df64e8",
642
- "type": "inject",
643
- "z": "eeb8b00c.2c18c",
644
- "g": "60e44fde.c914f8",
645
- "name": "idle",
646
- "props": [
647
- {
648
- "p": "payload"
649
- }
650
- ],
651
- "repeat": "",
652
- "crontab": "",
653
- "once": false,
654
- "onceDelay": 0.1,
655
- "topic": "",
656
- "payload": "{\"CurrentAirPurifierState\":1}",
657
- "payloadType": "json",
658
- "x": 190,
659
- "y": 140,
660
- "wires": [["5302e4aa.1b466c"]]
661
- },
662
- {
663
- "id": "db412cea.4a62f8",
664
- "type": "inject",
665
- "z": "eeb8b00c.2c18c",
666
- "g": "60e44fde.c914f8",
667
- "name": "on",
668
- "props": [
669
- {
670
- "p": "payload"
671
- }
672
- ],
673
- "repeat": "",
674
- "crontab": "",
675
- "once": false,
676
- "onceDelay": 0.1,
677
- "topic": "",
678
- "payload": "{\"CurrentAirPurifierState\":2}",
679
- "payloadType": "json",
680
- "x": 190,
681
- "y": 180,
682
- "wires": [["5302e4aa.1b466c"]]
683
- },
684
- {
685
- "id": "46418e19.aa6d6",
686
- "type": "link in",
687
- "z": "eeb8b00c.2c18c",
688
- "g": "60e44fde.c914f8",
689
- "name": "",
690
- "links": ["ee8894e4.f1855"],
691
- "x": 315,
692
- "y": 180,
693
- "wires": [["5302e4aa.1b466c"]]
694
- },
695
- {
696
- "id": "664dadf9.85d0d4",
697
- "type": "trigger",
698
- "z": "eeb8b00c.2c18c",
699
- "g": "60e44fde.c914f8",
700
- "name": "5 sec to idle",
701
- "op1": "",
702
- "op2": "{\"CurrentAirPurifierState\":1}",
703
- "op1type": "nul",
704
- "op2type": "json",
705
- "duration": "5",
706
- "extend": false,
707
- "units": "s",
708
- "reset": "",
709
- "bytopic": "all",
710
- "topic": "topic",
711
- "outputs": 1,
712
- "x": 730,
713
- "y": 100,
714
- "wires": [["ee8894e4.f1855"]]
715
- },
716
- {
717
- "id": "d7cd8a56.628178",
718
- "type": "trigger",
719
- "z": "eeb8b00c.2c18c",
720
- "g": "60e44fde.c914f8",
721
- "name": "10 sec to on",
722
- "op1": "",
723
- "op2": "{\"CurrentAirPurifierState\":2}",
724
- "op1type": "nul",
725
- "op2type": "json",
726
- "duration": "10",
727
- "extend": false,
728
- "units": "s",
729
- "reset": "",
730
- "bytopic": "all",
731
- "topic": "topic",
732
- "outputs": 1,
733
- "x": 730,
734
- "y": 140,
735
- "wires": [["ee8894e4.f1855"]]
736
- },
737
- {
738
- "id": "3de34c4c.1871a4",
739
- "type": "trigger",
740
- "z": "eeb8b00c.2c18c",
741
- "g": "60e44fde.c914f8",
742
- "name": "5 sec to off",
743
- "op1": "",
744
- "op2": "{\"CurrentAirPurifierState\":0}",
745
- "op1type": "nul",
746
- "op2type": "json",
747
- "duration": "5",
748
- "extend": false,
749
- "units": "s",
750
- "reset": "",
751
- "bytopic": "all",
752
- "topic": "topic",
753
- "outputs": 1,
754
- "x": 730,
755
- "y": 180,
756
- "wires": [["ee8894e4.f1855"]]
757
- },
758
- {
759
- "id": "ee8894e4.f1855",
760
- "type": "link out",
761
- "z": "eeb8b00c.2c18c",
762
- "g": "60e44fde.c914f8",
763
- "name": "",
764
- "links": ["46418e19.aa6d6"],
765
- "x": 875,
766
- "y": 140,
767
- "wires": []
768
- },
769
- {
770
- "id": "6eaa9b9e.282734",
771
- "type": "group",
772
- "z": "eeb8b00c.2c18c",
773
- "name": "CO plus CO2 Sensor: input only sensor",
774
- "style": {
775
- "stroke": "#999999",
776
- "fill": "none",
777
- "label": true,
778
- "label-position": "nw",
779
- "color": "#a4a4a4"
780
- },
781
- "nodes": [
782
- "2e6738a6.ef5dd8",
783
- "79889759.8219c",
784
- "7f53465b.356a68",
785
- "97aff586.786ff8",
786
- "659ff3da.236404",
787
- "e6105066.f8911",
788
- "b433a780.665a7",
789
- "d4b30334.a19e58",
790
- "b0eeeb34.2dde8"
791
- ],
792
- "x": 94,
793
- "y": 999,
794
- "w": 752,
795
- "h": 282,
796
- "info": "# Combined Sensor\nThis is a sensor which will display both Carbon Monoxide (poisonous, deadly gas) and Carbon Dioxide (what humans exhale) levels.\n\n# CO Sensor\n\nThere are three inputs to this example, one for each level of Carbon Monoxide in the air. Options are:\n\n**0 ppm:** this will assume no CO in the air <br/>\n**Low level:** this will assume a level between 1 and 35 ppm, inclusive. This level is generally assumed to not cause problems in healthy adults <br/>\n**Dangerous level:** this will assume a level between 35 and 5000, inclusive; this will also trigger an alert in Home app\n\n## IF YOU HAVE A CARBON MONOXIDE DETECTOR EVER READING ABOVE 35 PPM, PLEASE EVACUATE THE AREA AND SEEK FRESH AIR IMMEDIATELY TO AVOID RISK OF DEATH ##\n\n# CO2 Sensor\n\nThere are three inputs to this example, one for each level of Carbon Dioxide in the air. Options are:\n\n**0 ppm:** this will assume no CO2 in the air <br/>\n**CO2 Level:** this will assume a level between 1 and 100,000 ppm, inclusive <br/>\n**Dangerous level:** this will assume a level between 1,000 and 100,000, inclusive\n\n"
797
- },
798
- {
799
- "id": "2e6738a6.ef5dd8",
800
- "type": "homekit-service",
801
- "z": "eeb8b00c.2c18c",
802
- "g": "6eaa9b9e.282734",
803
- "isParent": true,
804
- "hostType": "0",
805
- "bridge": "409001a1.3e7a78",
806
- "accessoryId": "",
807
- "parentService": "",
808
- "name": "CO detector",
809
- "serviceName": "CarbonMonoxideSensor",
810
- "topic": "",
811
- "filter": false,
812
- "manufacturer": "MONOxide",
813
- "model": "1",
814
- "serialNo": "2",
815
- "firmwareRev": "2",
816
- "hardwareRev": "2",
817
- "softwareRev": "1.0.0",
818
- "cameraConfigVideoProcessor": "ffmpeg",
819
- "cameraConfigSource": "",
820
- "cameraConfigStillImageSource": "",
821
- "cameraConfigMaxStreams": 2,
822
- "cameraConfigMaxWidth": 1280,
823
- "cameraConfigMaxHeight": 720,
824
- "cameraConfigMaxFPS": 10,
825
- "cameraConfigMaxBitrate": 300,
826
- "cameraConfigVideoCodec": "libx264",
827
- "cameraConfigAudioCodec": "libfdk_aac",
828
- "cameraConfigAudio": false,
829
- "cameraConfigPacketSize": 1316,
830
- "cameraConfigVerticalFlip": false,
831
- "cameraConfigHorizontalFlip": false,
832
- "cameraConfigMapVideo": "0:0",
833
- "cameraConfigMapAudio": "0:1",
834
- "cameraConfigVideoFilter": "scale=1280:720",
835
- "cameraConfigAdditionalCommandLine": "-tune zerolatency",
836
- "cameraConfigDebug": false,
837
- "cameraConfigSnapshotOutput": "disabled",
838
- "cameraConfigInterfaceName": "",
839
- "characteristicProperties": "{ \"CarbonMonoxideLevel\":{ \"maxValue\":5000 }, \"CarbonMonoxidePeakLevel\":{ \"maxValue\":5000 }, \"CarbonDioxideLevel\":true, \"CarbonDioxidePeakLevel\":true}",
840
- "waitForSetupMsg": false,
841
- "outputs": 2,
842
- "x": 750,
843
- "y": 1040,
844
- "wires": [[], []]
845
- },
846
- {
847
- "id": "79889759.8219c",
848
- "type": "function",
849
- "z": "eeb8b00c.2c18c",
850
- "g": "6eaa9b9e.282734",
851
- "name": "Carbon DIoxide",
852
- "func": "if(msg.payload === 0){\n context.set('lastPeak',0);\n newMsg = {\n payload: {\n \"CarbonDioxideLevel\":0\n }\n }\n return newMsg;\n}\n\n// Initialize vars\nvar CurrentLevel = 0;\nvar lastPeak = context.get('lastPeak');\n\n// Set random level\nif(msg.payload === \"CO2\"){\n CurrentLevel = Math.floor(Math.random() * (100000 - 1 + 1) + 1);\n}\n\n\n// Formulate output message\nvar newMsg = {\n payload: {\n \"CarbonDioxideLevel\" : CurrentLevel\n }\n};\n\n// Set new peak level\nif(CurrentLevel > lastPeak){\n lastPeak = CurrentLevel;\n context.set('lastPeak',CurrentLevel);\n newMsg.payload.CarbonDioxidePeakLevel = CurrentLevel;\n}\n\nreturn newMsg;",
853
- "outputs": 1,
854
- "noerr": 0,
855
- "initialize": "// Code added here will be run once\n// whenever the node is deployed.\ncontext.set('lastPeak',0);",
856
- "finalize": "",
857
- "x": 460,
858
- "y": 1200,
859
- "wires": [["2e6738a6.ef5dd8"]]
860
- },
861
- {
862
- "id": "7f53465b.356a68",
863
- "type": "function",
864
- "z": "eeb8b00c.2c18c",
865
- "g": "6eaa9b9e.282734",
866
- "name": "Carbon MONoxide",
867
- "func": "// Reset all values to 0 if 0ppm input\nif(msg.payload === 0){\n context.set('lastPeak',0);\n newMsg = {\n payload: {\n \"CarbonMonoxideLevel\":0,\n \"CarbonMonoxidePeakLevel\":0,\n \"CarbonMonoxideDetected\":0\n }\n };\n return newMsg;\n}\n\n// Initialize vars\nvar CurrentLevel = 0;\nvar lastPeak = context.get('lastPeak');\n\n// Set random Low or Dangerous levels\nif(msg.payload === \"Low\"){\n CurrentLevel = Math.floor(Math.random() * (35 - 1 + 1) + 1);\n}\nif(msg.payload === \"Danger\"){\n CurrentLevel = Math.floor(Math.random() * (5000 - 35 + 1) + 35);\n}\n\n// Formulate output message\nvar newMsg = {\n payload: {\n \"CarbonMonoxideLevel\" : CurrentLevel,\n \"CarbonMonoxideDetected\" : 0\n }\n};\n\n// Set new peak level\nif(CurrentLevel > lastPeak){\n lastPeak = CurrentLevel;\n context.set('lastPeak',CurrentLevel);\n newMsg.payload.CarbonMonoxidePeakLevel = CurrentLevel;\n}\n\n// Set warning if dangerous\nif (CurrentLevel >= 35) {\n newMsg.payload.CarbonMonoxideDetected = 1;\n} \n\nreturn newMsg;",
868
- "outputs": 1,
869
- "noerr": 0,
870
- "initialize": "",
871
- "finalize": "",
872
- "x": 470,
873
- "y": 1080,
874
- "wires": [["2e6738a6.ef5dd8"]]
875
- },
876
- {
877
- "id": "97aff586.786ff8",
878
- "type": "inject",
879
- "z": "eeb8b00c.2c18c",
880
- "g": "6eaa9b9e.282734",
881
- "name": "NO RESPONSE",
882
- "props": [
883
- {
884
- "p": "payload"
885
- },
886
- {
887
- "p": "topic",
888
- "vt": "str"
889
- }
890
- ],
891
- "repeat": "",
892
- "crontab": "",
893
- "once": false,
894
- "onceDelay": 0.1,
895
- "topic": "",
896
- "payload": "{\"CarbonMonoxideLevel\":\"NO_RESPONSE\"}",
897
- "payloadType": "json",
898
- "x": 480,
899
- "y": 1040,
900
- "wires": [["2e6738a6.ef5dd8"]]
901
- },
902
- {
903
- "id": "659ff3da.236404",
904
- "type": "inject",
905
- "z": "eeb8b00c.2c18c",
906
- "g": "6eaa9b9e.282734",
907
- "name": "Clear CO2 Peak",
908
- "props": [
909
- {
910
- "p": "payload"
911
- }
912
- ],
913
- "repeat": "",
914
- "crontab": "",
915
- "once": false,
916
- "onceDelay": 0.1,
917
- "topic": "",
918
- "payload": "0",
919
- "payloadType": "num",
920
- "x": 220,
921
- "y": 1200,
922
- "wires": [["79889759.8219c"]]
923
- },
924
- {
925
- "id": "e6105066.f8911",
926
- "type": "inject",
927
- "z": "eeb8b00c.2c18c",
928
- "g": "6eaa9b9e.282734",
929
- "name": "0 ppm",
930
- "repeat": "",
931
- "crontab": "",
932
- "once": false,
933
- "onceDelay": 0.1,
934
- "topic": "",
935
- "payload": "0",
936
- "payloadType": "num",
937
- "x": 210,
938
- "y": 1040,
939
- "wires": [["7f53465b.356a68"]]
940
- },
941
- {
942
- "id": "b433a780.665a7",
943
- "type": "inject",
944
- "z": "eeb8b00c.2c18c",
945
- "g": "6eaa9b9e.282734",
946
- "name": "CO2 Level",
947
- "props": [
948
- {
949
- "p": "payload"
950
- }
951
- ],
952
- "repeat": "",
953
- "crontab": "",
954
- "once": false,
955
- "onceDelay": 0.1,
956
- "topic": "",
957
- "payload": "CO2",
958
- "payloadType": "str",
959
- "x": 200,
960
- "y": 1240,
961
- "wires": [["79889759.8219c"]]
962
- },
963
- {
964
- "id": "d4b30334.a19e58",
965
- "type": "inject",
966
- "z": "eeb8b00c.2c18c",
967
- "g": "6eaa9b9e.282734",
968
- "name": "Low level",
969
- "props": [
970
- {
971
- "p": "payload"
972
- }
973
- ],
974
- "repeat": "",
975
- "crontab": "",
976
- "once": false,
977
- "onceDelay": 0.1,
978
- "topic": "",
979
- "payload": "Low",
980
- "payloadType": "str",
981
- "x": 220,
982
- "y": 1080,
983
- "wires": [["7f53465b.356a68"]]
984
- },
985
- {
986
- "id": "b0eeeb34.2dde8",
987
- "type": "inject",
988
- "z": "eeb8b00c.2c18c",
989
- "g": "6eaa9b9e.282734",
990
- "name": "Danger level",
991
- "props": [
992
- {
993
- "p": "payload"
994
- }
995
- ],
996
- "repeat": "",
997
- "crontab": "",
998
- "once": false,
999
- "onceDelay": 0.1,
1000
- "topic": "",
1001
- "payload": "Danger",
1002
- "payloadType": "str",
1003
- "x": 230,
1004
- "y": 1120,
1005
- "wires": [["7f53465b.356a68"]]
1006
- },
1007
- {
1008
- "id": "a875cc7.a4c42b",
1009
- "type": "group",
1010
- "z": "eeb8b00c.2c18c",
1011
- "name": "Contact Sensor: input only sensor",
1012
- "style": {
1013
- "stroke": "#999999",
1014
- "fill": "none",
1015
- "label": true,
1016
- "label-position": "nw",
1017
- "color": "#a4a4a4"
1018
- },
1019
- "nodes": [
1020
- "a5194c26.18c628",
1021
- "2f9bc0d.42a73c",
1022
- "dfca0b2d.8b8e8",
1023
- "d74a610c.09a36",
1024
- "c15b6468.ae2eb8",
1025
- "6f7bc7fa.7f4f6",
1026
- "99b55eb3.e31bf8",
1027
- "508d9ccf.29e404"
1028
- ],
1029
- "x": 94,
1030
- "y": 1299,
1031
- "w": 752,
1032
- "h": 242,
1033
- "info": "# Contact Sensor\n\nThe contact sensor has one inject node to Open the sensor (door, window, etc). Once open, a ten second timer will run then set it back to closed.\n\nAdditional inputs are for \"No Response\", \"Tampered\", and \"Battery\". Note that this battery will not show a battery level but only a good/low battery status."
1034
- },
1035
- {
1036
- "id": "a5194c26.18c628",
1037
- "type": "homekit-service",
1038
- "z": "eeb8b00c.2c18c",
1039
- "g": "a875cc7.a4c42b",
1040
- "isParent": true,
1041
- "hostType": "0",
1042
- "bridge": "409001a1.3e7a78",
1043
- "accessoryId": "",
1044
- "parentService": "",
1045
- "name": "Contact Sensor",
1046
- "serviceName": "ContactSensor",
1047
- "topic": "",
1048
- "filter": false,
1049
- "manufacturer": "Full Contact",
1050
- "model": "Door",
1051
- "serialNo": "Sensor",
1052
- "firmwareRev": "1.0.0",
1053
- "hardwareRev": "1.0.0",
1054
- "softwareRev": "1.0.0",
1055
- "cameraConfigVideoProcessor": "ffmpeg",
1056
- "cameraConfigSource": "",
1057
- "cameraConfigStillImageSource": "",
1058
- "cameraConfigMaxStreams": 2,
1059
- "cameraConfigMaxWidth": 1280,
1060
- "cameraConfigMaxHeight": 720,
1061
- "cameraConfigMaxFPS": 10,
1062
- "cameraConfigMaxBitrate": 300,
1063
- "cameraConfigVideoCodec": "libx264",
1064
- "cameraConfigAudioCodec": "libfdk_aac",
1065
- "cameraConfigAudio": false,
1066
- "cameraConfigPacketSize": 1316,
1067
- "cameraConfigVerticalFlip": false,
1068
- "cameraConfigHorizontalFlip": false,
1069
- "cameraConfigMapVideo": "0:0",
1070
- "cameraConfigMapAudio": "0:1",
1071
- "cameraConfigVideoFilter": "scale=1280:720",
1072
- "cameraConfigAdditionalCommandLine": "-tune zerolatency",
1073
- "cameraConfigDebug": false,
1074
- "cameraConfigSnapshotOutput": "disabled",
1075
- "cameraConfigInterfaceName": "",
1076
- "characteristicProperties": "{ \"StatusTampered\":true, \"StatusLowBattery\":true}",
1077
- "waitForSetupMsg": false,
1078
- "outputs": 2,
1079
- "x": 740,
1080
- "y": 1340,
1081
- "wires": [[], []]
1082
- },
1083
- {
1084
- "id": "2f9bc0d.42a73c",
1085
- "type": "inject",
1086
- "z": "eeb8b00c.2c18c",
1087
- "g": "a875cc7.a4c42b",
1088
- "name": "Tampered",
1089
- "repeat": "",
1090
- "crontab": "",
1091
- "once": false,
1092
- "onceDelay": 0.1,
1093
- "topic": "",
1094
- "payload": "{\"StatusTampered\":1}",
1095
- "payloadType": "json",
1096
- "x": 200,
1097
- "y": 1460,
1098
- "wires": [["a5194c26.18c628"]]
1099
- },
1100
- {
1101
- "id": "dfca0b2d.8b8e8",
1102
- "type": "inject",
1103
- "z": "eeb8b00c.2c18c",
1104
- "g": "a875cc7.a4c42b",
1105
- "name": "Clear tampered",
1106
- "repeat": "",
1107
- "crontab": "",
1108
- "once": false,
1109
- "onceDelay": 0.1,
1110
- "topic": "",
1111
- "payload": "{\"StatusTampered\":0}",
1112
- "payloadType": "json",
1113
- "x": 220,
1114
- "y": 1500,
1115
- "wires": [["a5194c26.18c628"]]
1116
- },
1117
- {
1118
- "id": "d74a610c.09a36",
1119
- "type": "inject",
1120
- "z": "eeb8b00c.2c18c",
1121
- "g": "a875cc7.a4c42b",
1122
- "name": "Low batt",
1123
- "repeat": "",
1124
- "crontab": "",
1125
- "once": false,
1126
- "onceDelay": 0.1,
1127
- "topic": "",
1128
- "payload": "{\"StatusLowBattery\":1}",
1129
- "payloadType": "json",
1130
- "x": 560,
1131
- "y": 1460,
1132
- "wires": [["a5194c26.18c628"]]
1133
- },
1134
- {
1135
- "id": "c15b6468.ae2eb8",
1136
- "type": "inject",
1137
- "z": "eeb8b00c.2c18c",
1138
- "g": "a875cc7.a4c42b",
1139
- "name": "Good batt",
1140
- "repeat": "",
1141
- "crontab": "",
1142
- "once": false,
1143
- "onceDelay": 0.1,
1144
- "topic": "",
1145
- "payload": "{\"StatusLowBattery\":0}",
1146
- "payloadType": "json",
1147
- "x": 560,
1148
- "y": 1500,
1149
- "wires": [["a5194c26.18c628"]]
1150
- },
1151
- {
1152
- "id": "6f7bc7fa.7f4f6",
1153
- "type": "inject",
1154
- "z": "eeb8b00c.2c18c",
1155
- "g": "a875cc7.a4c42b",
1156
- "name": "NO RESPONSE",
1157
- "props": [
1158
- {
1159
- "p": "payload"
1160
- },
1161
- {
1162
- "p": "topic",
1163
- "vt": "str"
1164
- }
1165
- ],
1166
- "repeat": "",
1167
- "crontab": "",
1168
- "once": false,
1169
- "onceDelay": 0.1,
1170
- "topic": "",
1171
- "payload": "{\"ContactSensorState\":\"NO_RESPONSE\"}",
1172
- "payloadType": "json",
1173
- "x": 220,
1174
- "y": 1400,
1175
- "wires": [["a5194c26.18c628"]]
1176
- },
1177
- {
1178
- "id": "99b55eb3.e31bf8",
1179
- "type": "trigger",
1180
- "z": "eeb8b00c.2c18c",
1181
- "g": "a875cc7.a4c42b",
1182
- "name": "10 Sec open",
1183
- "op1": "",
1184
- "op2": "{\"ContactSensorState\":0}",
1185
- "op1type": "pay",
1186
- "op2type": "json",
1187
- "duration": "10",
1188
- "extend": false,
1189
- "units": "s",
1190
- "reset": "",
1191
- "bytopic": "all",
1192
- "topic": "topic",
1193
- "outputs": 1,
1194
- "x": 430,
1195
- "y": 1340,
1196
- "wires": [["a5194c26.18c628"]]
1197
- },
1198
- {
1199
- "id": "508d9ccf.29e404",
1200
- "type": "inject",
1201
- "z": "eeb8b00c.2c18c",
1202
- "g": "a875cc7.a4c42b",
1203
- "name": "Open",
1204
- "props": [
1205
- {
1206
- "p": "payload"
1207
- },
1208
- {
1209
- "p": "topic",
1210
- "vt": "str"
1211
- }
1212
- ],
1213
- "repeat": "",
1214
- "crontab": "",
1215
- "once": false,
1216
- "onceDelay": "1",
1217
- "topic": "",
1218
- "payload": "{\"ContactSensorState\":1}",
1219
- "payloadType": "json",
1220
- "x": 190,
1221
- "y": 1340,
1222
- "wires": [["99b55eb3.e31bf8"]]
1223
- },
1224
- {
1225
- "id": "ab48426e.25466",
1226
- "type": "group",
1227
- "z": "eeb8b00c.2c18c",
1228
- "name": "CO2 Sensor: input only sensor",
1229
- "style": {
1230
- "stroke": "#999999",
1231
- "fill": "none",
1232
- "label": true,
1233
- "label-position": "nw",
1234
- "color": "#a4a4a4"
1235
- },
1236
- "nodes": [
1237
- "88892b4.8a61bd8",
1238
- "3611c654.8a42f2",
1239
- "62cafcb0.8ade9c",
1240
- "a0171cdb.f209b",
1241
- "6f7de764.a6a688",
1242
- "8758b463.afb0f",
1243
- "69e8161b.74b7a",
1244
- "40010b09.c73cdc"
1245
- ],
1246
- "x": 94,
1247
- "y": 779,
1248
- "w": 752,
1249
- "h": 202,
1250
- "info": "# CO2 Sensor\n\nThere are three inputs to this example, one for each level of Carbon Dioxide in the air. Options are:\n\n**0 ppm:** this will assume no CO2 <br/>\n**Safe level:** this will assume a level between 1 and 999 ppm, inclusive <br/>\n**Dangerous level:** this will assume a level between 1,000 and 100,000, inclusive; this will also trigger an alert"
1251
- },
1252
- {
1253
- "id": "88892b4.8a61bd8",
1254
- "type": "homekit-service",
1255
- "z": "eeb8b00c.2c18c",
1256
- "g": "ab48426e.25466",
1257
- "isParent": true,
1258
- "hostType": "0",
1259
- "bridge": "409001a1.3e7a78",
1260
- "accessoryId": "",
1261
- "parentService": "",
1262
- "name": "CO2 Sensor",
1263
- "serviceName": "CarbonDioxideSensor",
1264
- "topic": "",
1265
- "filter": false,
1266
- "manufacturer": "Default Manufacturer",
1267
- "model": "Carbon",
1268
- "serialNo": "Default Serial Number",
1269
- "firmwareRev": "22",
1270
- "hardwareRev": "11",
1271
- "softwareRev": "",
1272
- "cameraConfigVideoProcessor": "",
1273
- "cameraConfigSource": "",
1274
- "cameraConfigStillImageSource": "",
1275
- "cameraConfigMaxStreams": "",
1276
- "cameraConfigMaxWidth": "",
1277
- "cameraConfigMaxHeight": "",
1278
- "cameraConfigMaxFPS": "",
1279
- "cameraConfigMaxBitrate": "",
1280
- "cameraConfigVideoCodec": "",
1281
- "cameraConfigAudioCodec": "",
1282
- "cameraConfigAudio": false,
1283
- "cameraConfigPacketSize": "",
1284
- "cameraConfigVerticalFlip": false,
1285
- "cameraConfigHorizontalFlip": false,
1286
- "cameraConfigMapVideo": "",
1287
- "cameraConfigMapAudio": "",
1288
- "cameraConfigVideoFilter": "",
1289
- "cameraConfigAdditionalCommandLine": "",
1290
- "cameraConfigDebug": false,
1291
- "cameraConfigSnapshotOutput": "disabled",
1292
- "cameraConfigInterfaceName": "",
1293
- "characteristicProperties": "{ \"CarbonDioxideLevel\" : true, \"CarbonDioxidePeakLevel\": true, \"StatusActive\" : true}",
1294
- "waitForSetupMsg": false,
1295
- "outputs": 2,
1296
- "x": 750,
1297
- "y": 820,
1298
- "wires": [[], []]
1299
- },
1300
- {
1301
- "id": "3611c654.8a42f2",
1302
- "type": "function",
1303
- "z": "eeb8b00c.2c18c",
1304
- "g": "ab48426e.25466",
1305
- "name": "Random values, peak value",
1306
- "func": "// Reset all values to 0 if 0ppm input\nif(msg.payload === 0){\n context.set('lastPeak',0);\n newMsg = {\n payload: {\n \"CarbonDioxideLevel\":0,\n \"CarbonDioxidePeakLevel\":0,\n \"CarbonDioxideDetected\":0\n }\n };\n return newMsg;\n}\n\n// Initialize vars\nvar CurrentLevel = 0;\nvar lastPeak = context.get('lastPeak');\n\n// Set random safe or dangerous levels\nif(msg.payload === \"Safe\"){\n CurrentLevel = Math.floor(Math.random() * (999 - 1 + 1) + 1);\n}\nif(msg.payload === \"Danger\"){\n CurrentLevel = Math.floor(Math.random() * (100000 - 1000 + 1) + 1000);\n}\n\n// Formulate output message\nvar newMsg = {\n payload: {\n \"CarbonDioxideLevel\" : CurrentLevel,\n \"CarbonDioxideDetected\" : 0\n }\n};\n\n// Set new peak level\nif(CurrentLevel > lastPeak){\n lastPeak = CurrentLevel;\n context.set('lastPeak',CurrentLevel);\n newMsg.payload.CarbonDioxidePeakLevel = CurrentLevel;\n}\n\n// Set warning if dangerous\nif (CurrentLevel >= 1000) {\n newMsg.payload.CarbonDioxideDetected = 1;\n} \n\nreturn newMsg;",
1307
- "outputs": 1,
1308
- "noerr": 0,
1309
- "initialize": "// Code added here will be run once\n// whenever the node is deployed.\ncontext.set('lastPeak',0);\n",
1310
- "finalize": "",
1311
- "x": 480,
1312
- "y": 820,
1313
- "wires": [["88892b4.8a61bd8"]]
1314
- },
1315
- {
1316
- "id": "62cafcb0.8ade9c",
1317
- "type": "inject",
1318
- "z": "eeb8b00c.2c18c",
1319
- "g": "ab48426e.25466",
1320
- "name": "Active",
1321
- "repeat": "",
1322
- "crontab": "",
1323
- "once": false,
1324
- "onceDelay": 0.1,
1325
- "topic": "",
1326
- "payload": "{\"StatusActive\":true}",
1327
- "payloadType": "json",
1328
- "x": 550,
1329
- "y": 860,
1330
- "wires": [["88892b4.8a61bd8"]]
1331
- },
1332
- {
1333
- "id": "a0171cdb.f209b",
1334
- "type": "inject",
1335
- "z": "eeb8b00c.2c18c",
1336
- "g": "ab48426e.25466",
1337
- "name": "Inactive",
1338
- "repeat": "",
1339
- "crontab": "",
1340
- "once": false,
1341
- "onceDelay": 0.1,
1342
- "topic": "",
1343
- "payload": "{\"StatusActive\":false}",
1344
- "payloadType": "json",
1345
- "x": 550,
1346
- "y": 900,
1347
- "wires": [["88892b4.8a61bd8"]]
1348
- },
1349
- {
1350
- "id": "6f7de764.a6a688",
1351
- "type": "inject",
1352
- "z": "eeb8b00c.2c18c",
1353
- "g": "ab48426e.25466",
1354
- "name": "NO RESPONSE",
1355
- "repeat": "",
1356
- "crontab": "",
1357
- "once": false,
1358
- "onceDelay": 0.1,
1359
- "topic": "",
1360
- "payload": "{\"CarbonDioxideLevel\":\"NO_RESPONSE\"}",
1361
- "payloadType": "json",
1362
- "x": 520,
1363
- "y": 940,
1364
- "wires": [["88892b4.8a61bd8"]]
1365
- },
1366
- {
1367
- "id": "8758b463.afb0f",
1368
- "type": "inject",
1369
- "z": "eeb8b00c.2c18c",
1370
- "g": "ab48426e.25466",
1371
- "name": "0 ppm",
1372
- "props": [
1373
- {
1374
- "p": "payload"
1375
- }
1376
- ],
1377
- "repeat": "",
1378
- "crontab": "",
1379
- "once": false,
1380
- "onceDelay": 0.1,
1381
- "topic": "",
1382
- "payload": "0",
1383
- "payloadType": "num",
1384
- "x": 190,
1385
- "y": 820,
1386
- "wires": [["3611c654.8a42f2"]]
1387
- },
1388
- {
1389
- "id": "69e8161b.74b7a",
1390
- "type": "inject",
1391
- "z": "eeb8b00c.2c18c",
1392
- "g": "ab48426e.25466",
1393
- "name": "Safe Level",
1394
- "props": [
1395
- {
1396
- "p": "payload"
1397
- }
1398
- ],
1399
- "repeat": "",
1400
- "crontab": "",
1401
- "once": false,
1402
- "onceDelay": 0.1,
1403
- "topic": "",
1404
- "payload": "Safe",
1405
- "payloadType": "str",
1406
- "x": 200,
1407
- "y": 860,
1408
- "wires": [["3611c654.8a42f2"]]
1409
- },
1410
- {
1411
- "id": "40010b09.c73cdc",
1412
- "type": "inject",
1413
- "z": "eeb8b00c.2c18c",
1414
- "g": "ab48426e.25466",
1415
- "name": "Dangerous level",
1416
- "props": [
1417
- {
1418
- "p": "payload"
1419
- }
1420
- ],
1421
- "repeat": "",
1422
- "crontab": "",
1423
- "once": false,
1424
- "onceDelay": 0.1,
1425
- "topic": "",
1426
- "payload": "Danger",
1427
- "payloadType": "str",
1428
- "x": 220,
1429
- "y": 900,
1430
- "wires": [["3611c654.8a42f2"]]
1431
- },
1432
- {
1433
- "id": "b3b5156e.cdf988",
1434
- "type": "group",
1435
- "z": "eeb8b00c.2c18c",
1436
- "name": "Air Quality with Battery: input only sensor",
1437
- "style": {
1438
- "stroke": "#999999",
1439
- "fill": "none",
1440
- "label": true,
1441
- "label-position": "nw",
1442
- "color": "#a4a4a4"
1443
- },
1444
- "nodes": [
1445
- "8088a797.e1a7c",
1446
- "a70b3192.dfb4f",
1447
- "d5708f5.036c87",
1448
- "90b692e4.b9f6c",
1449
- "54bfafbc.396898",
1450
- "560fc866.6de558",
1451
- "61e113b2.dbb714"
1452
- ],
1453
- "x": 94,
1454
- "y": 239,
1455
- "w": 758,
1456
- "h": 208,
1457
- "info": "# Air Quality Sensor\n\nThis sensor will inject random values for all of the air quality metrics available in the HomeKit spec. It will also inject random values for a linked battery service.\n\nWatch the input and Home app to learn how to see how things are working."
1458
- },
1459
- {
1460
- "id": "8088a797.e1a7c",
1461
- "type": "homekit-service",
1462
- "z": "eeb8b00c.2c18c",
1463
- "g": "b3b5156e.cdf988",
1464
- "isParent": true,
1465
- "hostType": "0",
1466
- "bridge": "409001a1.3e7a78",
1467
- "accessoryId": "",
1468
- "parentService": "",
1469
- "name": "Air Quality",
1470
- "serviceName": "AirQualitySensor",
1471
- "topic": "",
1472
- "filter": false,
1473
- "manufacturer": "Quality",
1474
- "model": "Battery",
1475
- "serialNo": "777",
1476
- "firmwareRev": "8.3",
1477
- "hardwareRev": "2.1",
1478
- "softwareRev": "1.0.0",
1479
- "cameraConfigVideoProcessor": "ffmpeg",
1480
- "cameraConfigSource": "",
1481
- "cameraConfigStillImageSource": "",
1482
- "cameraConfigMaxStreams": 2,
1483
- "cameraConfigMaxWidth": 1280,
1484
- "cameraConfigMaxHeight": 720,
1485
- "cameraConfigMaxFPS": 10,
1486
- "cameraConfigMaxBitrate": 300,
1487
- "cameraConfigVideoCodec": "libx264",
1488
- "cameraConfigAudioCodec": "libfdk_aac",
1489
- "cameraConfigAudio": false,
1490
- "cameraConfigPacketSize": 1316,
1491
- "cameraConfigVerticalFlip": false,
1492
- "cameraConfigHorizontalFlip": false,
1493
- "cameraConfigMapVideo": "0:0",
1494
- "cameraConfigMapAudio": "0:1",
1495
- "cameraConfigVideoFilter": "scale=1280:720",
1496
- "cameraConfigAdditionalCommandLine": "-tune zerolatency",
1497
- "cameraConfigDebug": false,
1498
- "cameraConfigSnapshotOutput": "disabled",
1499
- "cameraConfigInterfaceName": "",
1500
- "characteristicProperties": "{ \"AirQuality\":true, \"PM2_5Density\":true, \"PM10Density\":true}",
1501
- "waitForSetupMsg": false,
1502
- "outputs": 2,
1503
- "x": 750,
1504
- "y": 280,
1505
- "wires": [[], []]
1506
- },
1507
- {
1508
- "id": "a70b3192.dfb4f",
1509
- "type": "inject",
1510
- "z": "eeb8b00c.2c18c",
1511
- "g": "b3b5156e.cdf988",
1512
- "name": "Air quality random",
1513
- "props": [
1514
- {
1515
- "p": "payload"
1516
- }
1517
- ],
1518
- "repeat": "15",
1519
- "crontab": "",
1520
- "once": true,
1521
- "onceDelay": "5",
1522
- "topic": "",
1523
- "payload": "{}",
1524
- "payloadType": "json",
1525
- "x": 230,
1526
- "y": 280,
1527
- "wires": [["560fc866.6de558"]]
1528
- },
1529
- {
1530
- "id": "d5708f5.036c87",
1531
- "type": "inject",
1532
- "z": "eeb8b00c.2c18c",
1533
- "g": "b3b5156e.cdf988",
1534
- "name": "Battery random",
1535
- "props": [
1536
- {
1537
- "p": "payload"
1538
- }
1539
- ],
1540
- "repeat": "30",
1541
- "crontab": "",
1542
- "once": true,
1543
- "onceDelay": "5",
1544
- "topic": "",
1545
- "payload": "",
1546
- "payloadType": "date",
1547
- "x": 220,
1548
- "y": 380,
1549
- "wires": [["90b692e4.b9f6c"]]
1550
- },
1551
- {
1552
- "id": "90b692e4.b9f6c",
1553
- "type": "function",
1554
- "z": "eeb8b00c.2c18c",
1555
- "g": "b3b5156e.cdf988",
1556
- "name": "Batt",
1557
- "func": "// Define random battery level\nconst level = Math.floor(Math.random() * Math.floor(100))\nvar newMsg = {\n payload: {\n \"BatteryLevel\": level\n }\n};\n\n// Show \"Low Battery\" if less than 10%\nif (level < 10)newMsg.payload.StatusLowBattery = 1;\nelse newMsg.payload.StatusLowBattery = 0;\n\n// Show \"Charging\" if greater than 60%\nif (level > 60) newMsg.payload.ChargingState = 1;\nelse newMsg.payload.ChargingState = 0;\n\nreturn newMsg;",
1558
- "outputs": 1,
1559
- "noerr": 0,
1560
- "initialize": "",
1561
- "finalize": "",
1562
- "x": 470,
1563
- "y": 380,
1564
- "wires": [["5cd5342a.cfd72c"]]
1565
- },
1566
- {
1567
- "id": "54bfafbc.396898",
1568
- "type": "inject",
1569
- "z": "eeb8b00c.2c18c",
1570
- "g": "b3b5156e.cdf988",
1571
- "name": "NO RESPONSE",
1572
- "props": [
1573
- {
1574
- "p": "payload"
1575
- }
1576
- ],
1577
- "repeat": "",
1578
- "crontab": "",
1579
- "once": false,
1580
- "onceDelay": 0.1,
1581
- "topic": "",
1582
- "payload": "{\"AirQuality\":\"NO_RESPONSE\"}",
1583
- "payloadType": "json",
1584
- "x": 500,
1585
- "y": 320,
1586
- "wires": [["8088a797.e1a7c"]]
1587
- },
1588
- {
1589
- "id": "560fc866.6de558",
1590
- "type": "function",
1591
- "z": "eeb8b00c.2c18c",
1592
- "g": "b3b5156e.cdf988",
1593
- "name": "Random values",
1594
- "func": "var newMsg = {\n \"payload\":{\n \"AirQuality\":Math.floor(Math.random() * Math.floor(5)),\n \"PM2_5Density\":Math.floor(Math.random() * Math.floor(1000)),\n \"PM10Density\":Math.floor(Math.random() * Math.floor(1000)),\n \"OzoneDensity\":Math.floor(Math.random() * Math.floor(1000)),\n \"NitrogenDioxideDensity\":Math.floor(Math.random() * Math.floor(1000)),\n \"SulphurDioxideDensity\": Math.floor(Math.random() * Math.floor(1000))\n }\n}\n\n\n\nreturn newMsg;",
1595
- "outputs": 1,
1596
- "noerr": 0,
1597
- "initialize": "",
1598
- "finalize": "",
1599
- "x": 500,
1600
- "y": 280,
1601
- "wires": [["8088a797.e1a7c"]]
1602
- },
1603
- {
1604
- "id": "61e113b2.dbb714",
1605
- "type": "group",
1606
- "z": "eeb8b00c.2c18c",
1607
- "g": "b3b5156e.cdf988",
1608
- "name": "LINKED",
1609
- "style": {
1610
- "stroke": "#0070c0",
1611
- "fill": "#bfdbef",
1612
- "label": true
1613
- },
1614
- "nodes": ["5cd5342a.cfd72c"],
1615
- "x": 654,
1616
- "y": 339,
1617
- "w": 172,
1618
- "h": 82
1619
- },
1620
- {
1621
- "id": "5cd5342a.cfd72c",
1622
- "type": "homekit-service",
1623
- "z": "eeb8b00c.2c18c",
1624
- "g": "61e113b2.dbb714",
1625
- "isParent": false,
1626
- "bridge": "",
1627
- "accessoryId": "",
1628
- "parentService": "8088a797.e1a7c",
1629
- "name": "Battery",
1630
- "serviceName": "Battery",
1631
- "topic": "Air Quality",
1632
- "filter": false,
1633
- "manufacturer": "Default Manufacturer",
1634
- "model": "Default Model",
1635
- "serialNo": "Default Serial Number",
1636
- "firmwareRev": "1.0.0",
1637
- "hardwareRev": "1.0.0",
1638
- "softwareRev": "1.0.0",
1639
- "cameraConfigVideoProcessor": "ffmpeg",
1640
- "cameraConfigSource": "",
1641
- "cameraConfigStillImageSource": "",
1642
- "cameraConfigMaxStreams": 2,
1643
- "cameraConfigMaxWidth": 1280,
1644
- "cameraConfigMaxHeight": 720,
1645
- "cameraConfigMaxFPS": 10,
1646
- "cameraConfigMaxBitrate": 300,
1647
- "cameraConfigVideoCodec": "libx264",
1648
- "cameraConfigAudioCodec": "libfdk_aac",
1649
- "cameraConfigAudio": false,
1650
- "cameraConfigPacketSize": 1316,
1651
- "cameraConfigVerticalFlip": false,
1652
- "cameraConfigHorizontalFlip": false,
1653
- "cameraConfigMapVideo": "0:0",
1654
- "cameraConfigMapAudio": "0:1",
1655
- "cameraConfigVideoFilter": "scale=1280:720",
1656
- "cameraConfigAdditionalCommandLine": "-tune zerolatency",
1657
- "cameraConfigDebug": false,
1658
- "cameraConfigSnapshotOutput": "disabled",
1659
- "cameraConfigInterfaceName": "",
1660
- "characteristicProperties": "{}",
1661
- "waitForSetupMsg": false,
1662
- "outputs": 2,
1663
- "x": 740,
1664
- "y": 380,
1665
- "wires": [[], []]
1666
- },
1667
- {
1668
- "id": "c869b0a5.e4def8",
1669
- "type": "group",
1670
- "z": "eeb8b00c.2c18c",
1671
- "name": "Fan Simplified: input from device, output to device",
1672
- "style": {
1673
- "stroke": "#999999",
1674
- "fill": "none",
1675
- "label": true,
1676
- "label-position": "nw",
1677
- "color": "#a4a4a4"
1678
- },
1679
- "nodes": [
1680
- "dadd634c.ae2258",
1681
- "753e3777.49a1d",
1682
- "992f4930.012aa",
1683
- "2497a466.aa0e84",
1684
- "c53b76fb.7a3cc8",
1685
- "6c9646ee.1f3a18",
1686
- "1e42a8f3.cf008f"
1687
- ],
1688
- "x": 94,
1689
- "y": 1759,
1690
- "w": 752,
1691
- "h": 202,
1692
- "info": "# Fan Simple\n\nThis example is for a 3-speed fan.\n\nSpeeds are: <br/>\nLow = 33<br/>\nMedium = 66<br/>\nHigh = 99<br/>\n\nValues outside of this are restricted and will not work. The home app will \"snap\" to these values. Siri will respond to \"set fan to low/medium/high\" with the corresponding value."
1693
- },
1694
- {
1695
- "id": "dadd634c.ae2258",
1696
- "type": "debug",
1697
- "z": "eeb8b00c.2c18c",
1698
- "g": "c869b0a5.e4def8",
1699
- "name": "Fan output",
1700
- "active": true,
1701
- "tosidebar": true,
1702
- "console": false,
1703
- "tostatus": false,
1704
- "complete": "payload",
1705
- "targetType": "msg",
1706
- "statusVal": "",
1707
- "statusType": "auto",
1708
- "x": 730,
1709
- "y": 1800,
1710
- "wires": []
1711
- },
1712
- {
1713
- "id": "753e3777.49a1d",
1714
- "type": "homekit-service",
1715
- "z": "eeb8b00c.2c18c",
1716
- "g": "c869b0a5.e4def8",
1717
- "isParent": true,
1718
- "bridge": "409001a1.3e7a78",
1719
- "parentService": "",
1720
- "name": "Fan Speeds",
1721
- "serviceName": "Fan",
1722
- "topic": "",
1723
- "filter": false,
1724
- "manufacturer": "Gman",
1725
- "model": "Default Model",
1726
- "serialNo": "CRX1",
1727
- "firmwareRev": "1.0.0",
1728
- "hardwareRev": "1.0.0",
1729
- "softwareRev": "1.0.0",
1730
- "cameraConfigVideoProcessor": "ffmpeg",
1731
- "cameraConfigSource": "",
1732
- "cameraConfigStillImageSource": "",
1733
- "cameraConfigMaxStreams": 2,
1734
- "cameraConfigMaxWidth": 1280,
1735
- "cameraConfigMaxHeight": 720,
1736
- "cameraConfigMaxFPS": 10,
1737
- "cameraConfigMaxBitrate": 300,
1738
- "cameraConfigVideoCodec": "libx264",
1739
- "cameraConfigAudioCodec": "libfdk_aac",
1740
- "cameraConfigAudio": false,
1741
- "cameraConfigPacketSize": 1316,
1742
- "cameraConfigVerticalFlip": false,
1743
- "cameraConfigHorizontalFlip": false,
1744
- "cameraConfigMapVideo": "0:0",
1745
- "cameraConfigMapAudio": "0:1",
1746
- "cameraConfigVideoFilter": "scale=1280:720",
1747
- "cameraConfigAdditionalCommandLine": "-tune zerolatency",
1748
- "cameraConfigDebug": false,
1749
- "cameraConfigSnapshotOutput": "disabled",
1750
- "cameraConfigInterfaceName": "",
1751
- "characteristicProperties": "{\n \"RotationSpeed\": {\n \"minValue\":0,\n \"maxValue\":99,\n \"minStep\":33\n }\n}",
1752
- "outputs": 2,
1753
- "x": 510,
1754
- "y": 1800,
1755
- "wires": [["dadd634c.ae2258"], []]
1756
- },
1757
- {
1758
- "id": "992f4930.012aa",
1759
- "type": "inject",
1760
- "z": "eeb8b00c.2c18c",
1761
- "g": "c869b0a5.e4def8",
1762
- "name": "NO RESPONSE",
1763
- "props": [
1764
- {
1765
- "p": "payload"
1766
- },
1767
- {
1768
- "p": "topic",
1769
- "vt": "str"
1770
- }
1771
- ],
1772
- "repeat": "",
1773
- "crontab": "",
1774
- "once": false,
1775
- "onceDelay": 0.1,
1776
- "topic": "",
1777
- "payload": "{\"On\":\"NO_RESPONSE\"}",
1778
- "payloadType": "json",
1779
- "x": 460,
1780
- "y": 1880,
1781
- "wires": [["753e3777.49a1d"]]
1782
- },
1783
- {
1784
- "id": "2497a466.aa0e84",
1785
- "type": "inject",
1786
- "z": "eeb8b00c.2c18c",
1787
- "g": "c869b0a5.e4def8",
1788
- "name": "OFF",
1789
- "props": [
1790
- {
1791
- "p": "payload"
1792
- },
1793
- {
1794
- "p": "topic",
1795
- "vt": "str"
1796
- }
1797
- ],
1798
- "repeat": "",
1799
- "crontab": "",
1800
- "once": false,
1801
- "onceDelay": 0.1,
1802
- "topic": "",
1803
- "payload": "{\"On\":false}",
1804
- "payloadType": "json",
1805
- "x": 190,
1806
- "y": 1800,
1807
- "wires": [["753e3777.49a1d"]]
1808
- },
1809
- {
1810
- "id": "c53b76fb.7a3cc8",
1811
- "type": "inject",
1812
- "z": "eeb8b00c.2c18c",
1813
- "g": "c869b0a5.e4def8",
1814
- "name": "Low",
1815
- "props": [
1816
- {
1817
- "p": "payload"
1818
- },
1819
- {
1820
- "p": "topic",
1821
- "vt": "str"
1822
- }
1823
- ],
1824
- "repeat": "",
1825
- "crontab": "",
1826
- "once": false,
1827
- "onceDelay": 0.1,
1828
- "topic": "",
1829
- "payload": "{\"On\":true,\"RotationSpeed\":33}",
1830
- "payloadType": "json",
1831
- "x": 190,
1832
- "y": 1840,
1833
- "wires": [["753e3777.49a1d"]]
1834
- },
1835
- {
1836
- "id": "6c9646ee.1f3a18",
1837
- "type": "inject",
1838
- "z": "eeb8b00c.2c18c",
1839
- "g": "c869b0a5.e4def8",
1840
- "name": "Medium",
1841
- "props": [
1842
- {
1843
- "p": "payload"
1844
- },
1845
- {
1846
- "p": "topic",
1847
- "vt": "str"
1848
- }
1849
- ],
1850
- "repeat": "",
1851
- "crontab": "",
1852
- "once": false,
1853
- "onceDelay": 0.1,
1854
- "topic": "",
1855
- "payload": "{\"On\":true,\"RotationSpeed\":66}",
1856
- "payloadType": "json",
1857
- "x": 200,
1858
- "y": 1880,
1859
- "wires": [["753e3777.49a1d"]]
1860
- },
1861
- {
1862
- "id": "1e42a8f3.cf008f",
1863
- "type": "inject",
1864
- "z": "eeb8b00c.2c18c",
1865
- "g": "c869b0a5.e4def8",
1866
- "name": "High",
1867
- "props": [
1868
- {
1869
- "p": "payload"
1870
- },
1871
- {
1872
- "p": "topic",
1873
- "vt": "str"
1874
- }
1875
- ],
1876
- "repeat": "",
1877
- "crontab": "",
1878
- "once": false,
1879
- "onceDelay": 0.1,
1880
- "topic": "",
1881
- "payload": "{\"On\":true,\"RotationSpeed\":99}",
1882
- "payloadType": "json",
1883
- "x": 190,
1884
- "y": 1920,
1885
- "wires": [["753e3777.49a1d"]]
1886
- }
2
+ {
3
+ "id": "2c464315.51c50c",
4
+ "type": "group",
5
+ "z": "eeb8b00c.2c18c",
6
+ "name": "Fan Full Example: input from device, output to device",
7
+ "style": {
8
+ "stroke": "#999999",
9
+ "fill": "none",
10
+ "label": true,
11
+ "label-position": "nw",
12
+ "color": "#a4a4a4"
13
+ },
14
+ "nodes": [
15
+ "b7778e52.220a5",
16
+ "fd8aff55.91d41",
17
+ "c717b796.0735b8",
18
+ "f56a2f96.509c1",
19
+ "d945ba75.897998"
20
+ ],
21
+ "x": 94,
22
+ "y": 1559,
23
+ "w": 752,
24
+ "h": 182,
25
+ "info": "# Fan V2\n\nThis example shows a fan. The inputs from node red are to turn the fan on, off, or set \"No Response\".\n\nThe outputs going to \"Fan output\" will show:\n\nOn / off state <br/>\nRotation speed<br/>\nSwing mode on / off (oscillate) <br/>\nRotation direction (clockwise/counterclockwise)"
26
+ },
27
+ {
28
+ "id": "b7778e52.220a5",
29
+ "type": "debug",
30
+ "z": "eeb8b00c.2c18c",
31
+ "g": "2c464315.51c50c",
32
+ "name": "Fan output",
33
+ "active": true,
34
+ "tosidebar": true,
35
+ "console": false,
36
+ "tostatus": false,
37
+ "complete": "payload",
38
+ "targetType": "msg",
39
+ "x": 730,
40
+ "y": 1600,
41
+ "wires": []
42
+ },
43
+ {
44
+ "id": "fd8aff55.91d41",
45
+ "type": "homekit-service",
46
+ "z": "eeb8b00c.2c18c",
47
+ "g": "2c464315.51c50c",
48
+ "isParent": true,
49
+ "bridge": "409001a1.3e7a78",
50
+ "parentService": "",
51
+ "name": "Fan V2",
52
+ "serviceName": "Fanv2",
53
+ "topic": "",
54
+ "filter": false,
55
+ "manufacturer": "Default Manufacturer",
56
+ "model": "Default Model",
57
+ "serialNo": "Default Serial Number",
58
+ "firmwareRev": "1.0.0",
59
+ "hardwareRev": "1.0.0",
60
+ "softwareRev": "1.0.0",
61
+ "cameraConfigVideoProcessor": "ffmpeg",
62
+ "cameraConfigSource": "",
63
+ "cameraConfigStillImageSource": "",
64
+ "cameraConfigMaxStreams": 2,
65
+ "cameraConfigMaxWidth": 1280,
66
+ "cameraConfigMaxHeight": 720,
67
+ "cameraConfigMaxFPS": 10,
68
+ "cameraConfigMaxBitrate": 300,
69
+ "cameraConfigVideoCodec": "libx264",
70
+ "cameraConfigAudioCodec": "libfdk_aac",
71
+ "cameraConfigAudio": false,
72
+ "cameraConfigPacketSize": 1316,
73
+ "cameraConfigVerticalFlip": false,
74
+ "cameraConfigHorizontalFlip": false,
75
+ "cameraConfigMapVideo": "0:0",
76
+ "cameraConfigMapAudio": "0:1",
77
+ "cameraConfigVideoFilter": "scale=1280:720",
78
+ "cameraConfigAdditionalCommandLine": "-tune zerolatency",
79
+ "cameraConfigDebug": false,
80
+ "cameraConfigSnapshotOutput": "disabled",
81
+ "cameraConfigInterfaceName": "",
82
+ "characteristicProperties": "{\n \"RotationSpeed\":true,\n \"RotationDirection\":true,\n \"SwingMode\":true\n}",
83
+ "outputs": 2,
84
+ "x": 500,
85
+ "y": 1600,
86
+ "wires": [["b7778e52.220a5"], []]
87
+ },
88
+ {
89
+ "id": "c717b796.0735b8",
90
+ "type": "inject",
91
+ "z": "eeb8b00c.2c18c",
92
+ "g": "2c464315.51c50c",
93
+ "name": "NO RESPONSE",
94
+ "repeat": "",
95
+ "crontab": "",
96
+ "once": false,
97
+ "onceDelay": 0.1,
98
+ "topic": "",
99
+ "payload": "{\"Active\":\"NO_RESPONSE\"}",
100
+ "payloadType": "json",
101
+ "x": 220,
102
+ "y": 1700,
103
+ "wires": [["fd8aff55.91d41"]]
104
+ },
105
+ {
106
+ "id": "f56a2f96.509c1",
107
+ "type": "inject",
108
+ "z": "eeb8b00c.2c18c",
109
+ "g": "2c464315.51c50c",
110
+ "name": "ON",
111
+ "props": [
112
+ {
113
+ "p": "payload"
114
+ },
115
+ {
116
+ "p": "topic",
117
+ "vt": "str"
118
+ }
119
+ ],
120
+ "repeat": "",
121
+ "crontab": "",
122
+ "once": false,
123
+ "onceDelay": 0.1,
124
+ "topic": "",
125
+ "payload": "{\"Active\":true}",
126
+ "payloadType": "json",
127
+ "x": 200,
128
+ "y": 1600,
129
+ "wires": [["fd8aff55.91d41"]]
130
+ },
131
+ {
132
+ "id": "d945ba75.897998",
133
+ "type": "inject",
134
+ "z": "eeb8b00c.2c18c",
135
+ "g": "2c464315.51c50c",
136
+ "name": "OFF",
137
+ "props": [
138
+ {
139
+ "p": "payload"
140
+ },
141
+ {
142
+ "p": "topic",
143
+ "vt": "str"
144
+ }
145
+ ],
146
+ "repeat": "",
147
+ "crontab": "",
148
+ "once": false,
149
+ "onceDelay": 0.1,
150
+ "topic": "",
151
+ "payload": "{\"Active\":false}",
152
+ "payloadType": "json",
153
+ "x": 200,
154
+ "y": 1640,
155
+ "wires": [["fd8aff55.91d41"]]
156
+ },
157
+ {
158
+ "id": "409001a1.3e7a78",
159
+ "type": "homekit-bridge",
160
+ "bridgeName": "Demo 1",
161
+ "pinCode": "153-10-538",
162
+ "port": "",
163
+ "allowInsecureRequest": false,
164
+ "manufacturer": "NRCHKB",
165
+ "model": "Demo",
166
+ "serialNo": "1.1.2",
167
+ "customMdnsConfig": false,
168
+ "mdnsMulticast": true,
169
+ "mdnsInterface": "",
170
+ "mdnsPort": "",
171
+ "mdnsIp": "",
172
+ "mdnsTtl": "",
173
+ "mdnsLoopback": true,
174
+ "mdnsReuseAddr": true,
175
+ "allowMessagePassthrough": true
176
+ },
177
+ {
178
+ "id": "384e0889.1fdae",
179
+ "type": "group",
180
+ "z": "eeb8b00c.2c18c",
181
+ "name": "Color Bulb: input from device, output to device",
182
+ "style": {
183
+ "stroke": "#999999",
184
+ "fill": "none",
185
+ "label": true,
186
+ "label-position": "nw",
187
+ "color": "#a4a4a4"
188
+ },
189
+ "nodes": [
190
+ "d838176b.dbaf7",
191
+ "7bf880d4.3cd4d",
192
+ "ee1452a5.08edd",
193
+ "c6ed2a2a.90a01",
194
+ "8cdfae2b.2f2ce8",
195
+ "1758401b.6c62e8"
196
+ ],
197
+ "x": 94,
198
+ "y": 599,
199
+ "w": 752,
200
+ "h": 162,
201
+ "info": "# Color Bulb\n\nThis is a color bulb. It accepts and sends out Hue, Saturation, Value, and On/off state.\n\nHue is the color\n\nSaturation is how deep the color is\n\nValue is brightness\n\nOn is power state"
202
+ },
203
+ {
204
+ "id": "d838176b.dbaf7",
205
+ "type": "debug",
206
+ "z": "eeb8b00c.2c18c",
207
+ "g": "384e0889.1fdae",
208
+ "name": "Color light output",
209
+ "active": true,
210
+ "tosidebar": true,
211
+ "console": false,
212
+ "tostatus": false,
213
+ "complete": "payload",
214
+ "targetType": "msg",
215
+ "x": 710,
216
+ "y": 720,
217
+ "wires": []
218
+ },
219
+ {
220
+ "id": "7bf880d4.3cd4d",
221
+ "type": "homekit-service",
222
+ "z": "eeb8b00c.2c18c",
223
+ "g": "384e0889.1fdae",
224
+ "isParent": true,
225
+ "hostType": "0",
226
+ "bridge": "409001a1.3e7a78",
227
+ "accessoryId": "",
228
+ "parentService": "",
229
+ "name": "Color",
230
+ "serviceName": "Lightbulb",
231
+ "topic": "",
232
+ "filter": false,
233
+ "manufacturer": "Garrett",
234
+ "model": "Color",
235
+ "serialNo": "42",
236
+ "firmwareRev": "1.2",
237
+ "hardwareRev": "1.0.0",
238
+ "softwareRev": "1.0.0",
239
+ "cameraConfigVideoProcessor": "ffmpeg",
240
+ "cameraConfigSource": "",
241
+ "cameraConfigStillImageSource": "",
242
+ "cameraConfigMaxStreams": 2,
243
+ "cameraConfigMaxWidth": 1280,
244
+ "cameraConfigMaxHeight": 720,
245
+ "cameraConfigMaxFPS": 10,
246
+ "cameraConfigMaxBitrate": 300,
247
+ "cameraConfigVideoCodec": "libx264",
248
+ "cameraConfigAudioCodec": "libfdk_aac",
249
+ "cameraConfigAudio": false,
250
+ "cameraConfigPacketSize": 1316,
251
+ "cameraConfigVerticalFlip": false,
252
+ "cameraConfigHorizontalFlip": false,
253
+ "cameraConfigMapVideo": "0:0",
254
+ "cameraConfigMapAudio": "0:1",
255
+ "cameraConfigVideoFilter": "scale=1280:720",
256
+ "cameraConfigAdditionalCommandLine": "-tune zerolatency",
257
+ "cameraConfigDebug": false,
258
+ "cameraConfigSnapshotOutput": "disabled",
259
+ "cameraConfigInterfaceName": "",
260
+ "characteristicProperties": "{ \"Brightness\":true, \"Hue\":true, \"Saturation\":true}",
261
+ "waitForSetupMsg": false,
262
+ "outputs": 2,
263
+ "x": 490,
264
+ "y": 720,
265
+ "wires": [["d838176b.dbaf7"], []]
266
+ },
267
+ {
268
+ "id": "ee1452a5.08edd",
269
+ "type": "inject",
270
+ "z": "eeb8b00c.2c18c",
271
+ "g": "384e0889.1fdae",
272
+ "name": "NO RESPONSE",
273
+ "props": [
274
+ {
275
+ "p": "payload"
276
+ }
277
+ ],
278
+ "repeat": "",
279
+ "crontab": "",
280
+ "once": false,
281
+ "onceDelay": 0.1,
282
+ "topic": "",
283
+ "payload": "{\"On\":\"NO_RESPONSE\"}",
284
+ "payloadType": "json",
285
+ "x": 420,
286
+ "y": 640,
287
+ "wires": [["7bf880d4.3cd4d"]]
288
+ },
289
+ {
290
+ "id": "c6ed2a2a.90a01",
291
+ "type": "inject",
292
+ "z": "eeb8b00c.2c18c",
293
+ "g": "384e0889.1fdae",
294
+ "name": "ON",
295
+ "props": [
296
+ {
297
+ "p": "payload"
298
+ }
299
+ ],
300
+ "repeat": "",
301
+ "crontab": "",
302
+ "once": false,
303
+ "onceDelay": 0.1,
304
+ "topic": "",
305
+ "payload": "{\"On\":true}",
306
+ "payloadType": "json",
307
+ "x": 190,
308
+ "y": 640,
309
+ "wires": [["7bf880d4.3cd4d"]]
310
+ },
311
+ {
312
+ "id": "8cdfae2b.2f2ce8",
313
+ "type": "inject",
314
+ "z": "eeb8b00c.2c18c",
315
+ "g": "384e0889.1fdae",
316
+ "name": "Reset HSV",
317
+ "props": [
318
+ {
319
+ "p": "payload"
320
+ }
321
+ ],
322
+ "repeat": "",
323
+ "crontab": "",
324
+ "once": false,
325
+ "onceDelay": 0.1,
326
+ "topic": "",
327
+ "payload": "{\"Brightness\":50,\"Hue\":50,\"Saturation\":50}",
328
+ "payloadType": "json",
329
+ "x": 200,
330
+ "y": 720,
331
+ "wires": [["7bf880d4.3cd4d"]]
332
+ },
333
+ {
334
+ "id": "1758401b.6c62e8",
335
+ "type": "inject",
336
+ "z": "eeb8b00c.2c18c",
337
+ "g": "384e0889.1fdae",
338
+ "name": "OFF",
339
+ "props": [
340
+ {
341
+ "p": "payload"
342
+ }
343
+ ],
344
+ "repeat": "",
345
+ "crontab": "",
346
+ "once": false,
347
+ "onceDelay": 0.1,
348
+ "topic": "",
349
+ "payload": "{\"On\":false}",
350
+ "payloadType": "json",
351
+ "x": 190,
352
+ "y": 680,
353
+ "wires": [["7bf880d4.3cd4d"]]
354
+ },
355
+ {
356
+ "id": "3a57bebe.a3b222",
357
+ "type": "group",
358
+ "z": "eeb8b00c.2c18c",
359
+ "name": "Dimmable Bulb: input from device, output to device",
360
+ "style": {
361
+ "stroke": "#999999",
362
+ "fill": "none",
363
+ "label": true,
364
+ "label-position": "nw",
365
+ "color": "#a4a4a4"
366
+ },
367
+ "nodes": [
368
+ "459254fe.49c72c",
369
+ "379657db.a99df8",
370
+ "52a07047.03ce7",
371
+ "253b3550.729caa",
372
+ "b9bc7f3d.51acf"
373
+ ],
374
+ "x": 94,
375
+ "y": 459,
376
+ "w": 752,
377
+ "h": 122,
378
+ "info": "# Dimmable Bulb\n\nThis is a dimmable bulb. The Characteristic Properties enable brightness. It is a white bulb which can be adjusted from 0 to 100% brightness."
379
+ },
380
+ {
381
+ "id": "459254fe.49c72c",
382
+ "type": "homekit-service",
383
+ "z": "eeb8b00c.2c18c",
384
+ "g": "3a57bebe.a3b222",
385
+ "isParent": true,
386
+ "hostType": "0",
387
+ "bridge": "409001a1.3e7a78",
388
+ "accessoryId": "",
389
+ "parentService": "",
390
+ "name": "Dimmable",
391
+ "serviceName": "Lightbulb",
392
+ "topic": "",
393
+ "filter": false,
394
+ "manufacturer": "Garrett",
395
+ "model": "Dummy",
396
+ "serialNo": "Default Serial Number",
397
+ "firmwareRev": "1.1.9",
398
+ "hardwareRev": "1.0.0",
399
+ "softwareRev": "1.0.0",
400
+ "cameraConfigVideoProcessor": "ffmpeg",
401
+ "cameraConfigSource": "",
402
+ "cameraConfigStillImageSource": "",
403
+ "cameraConfigMaxStreams": 2,
404
+ "cameraConfigMaxWidth": 1280,
405
+ "cameraConfigMaxHeight": 720,
406
+ "cameraConfigMaxFPS": 10,
407
+ "cameraConfigMaxBitrate": 300,
408
+ "cameraConfigVideoCodec": "libx264",
409
+ "cameraConfigAudioCodec": "libfdk_aac",
410
+ "cameraConfigAudio": false,
411
+ "cameraConfigPacketSize": 1316,
412
+ "cameraConfigVerticalFlip": false,
413
+ "cameraConfigHorizontalFlip": false,
414
+ "cameraConfigMapVideo": "0:0",
415
+ "cameraConfigMapAudio": "0:1",
416
+ "cameraConfigVideoFilter": "scale=1280:720",
417
+ "cameraConfigAdditionalCommandLine": "-tune zerolatency",
418
+ "cameraConfigDebug": false,
419
+ "cameraConfigSnapshotOutput": "disabled",
420
+ "cameraConfigInterfaceName": "",
421
+ "characteristicProperties": "{ \"Brightness\":true}",
422
+ "waitForSetupMsg": false,
423
+ "outputs": 2,
424
+ "x": 460,
425
+ "y": 540,
426
+ "wires": [["379657db.a99df8"], []]
427
+ },
428
+ {
429
+ "id": "379657db.a99df8",
430
+ "type": "debug",
431
+ "z": "eeb8b00c.2c18c",
432
+ "g": "3a57bebe.a3b222",
433
+ "name": "Dimmable light output",
434
+ "active": true,
435
+ "tosidebar": true,
436
+ "console": false,
437
+ "tostatus": false,
438
+ "complete": "payload",
439
+ "targetType": "msg",
440
+ "x": 700,
441
+ "y": 540,
442
+ "wires": []
443
+ },
444
+ {
445
+ "id": "52a07047.03ce7",
446
+ "type": "inject",
447
+ "z": "eeb8b00c.2c18c",
448
+ "g": "3a57bebe.a3b222",
449
+ "name": "NO RESPONSE",
450
+ "props": [
451
+ {
452
+ "p": "payload"
453
+ }
454
+ ],
455
+ "repeat": "",
456
+ "crontab": "",
457
+ "once": false,
458
+ "onceDelay": 0.1,
459
+ "topic": "",
460
+ "payload": "{\"On\":\"NO_RESPONSE\"}",
461
+ "payloadType": "json",
462
+ "x": 400,
463
+ "y": 500,
464
+ "wires": [["459254fe.49c72c"]]
465
+ },
466
+ {
467
+ "id": "253b3550.729caa",
468
+ "type": "inject",
469
+ "z": "eeb8b00c.2c18c",
470
+ "g": "3a57bebe.a3b222",
471
+ "name": "ON",
472
+ "props": [
473
+ {
474
+ "p": "payload"
475
+ }
476
+ ],
477
+ "repeat": "",
478
+ "crontab": "",
479
+ "once": false,
480
+ "onceDelay": 0.1,
481
+ "topic": "",
482
+ "payload": "{\"On\":true}",
483
+ "payloadType": "json",
484
+ "x": 190,
485
+ "y": 500,
486
+ "wires": [["459254fe.49c72c"]]
487
+ },
488
+ {
489
+ "id": "b9bc7f3d.51acf",
490
+ "type": "inject",
491
+ "z": "eeb8b00c.2c18c",
492
+ "g": "3a57bebe.a3b222",
493
+ "name": "OFF",
494
+ "props": [
495
+ {
496
+ "p": "payload"
497
+ }
498
+ ],
499
+ "repeat": "",
500
+ "crontab": "",
501
+ "once": false,
502
+ "onceDelay": 0.1,
503
+ "topic": "",
504
+ "payload": "{\"On\":false}",
505
+ "payloadType": "json",
506
+ "x": 190,
507
+ "y": 540,
508
+ "wires": [["459254fe.49c72c"]]
509
+ },
510
+ {
511
+ "id": "60e44fde.c914f8",
512
+ "type": "group",
513
+ "z": "eeb8b00c.2c18c",
514
+ "name": "Air Purifier: input power state, output commands device",
515
+ "style": {
516
+ "stroke": "#999999",
517
+ "fill": "none",
518
+ "label": true,
519
+ "label-position": "nw",
520
+ "color": "#a4a4a4"
521
+ },
522
+ "nodes": [
523
+ "8dea49.4a770db8",
524
+ "5302e4aa.1b466c",
525
+ "bfe1c73d.c165a8",
526
+ "9739d842.a402f",
527
+ "87048a6e.df64e8",
528
+ "db412cea.4a62f8",
529
+ "46418e19.aa6d6",
530
+ "664dadf9.85d0d4",
531
+ "d7cd8a56.628178",
532
+ "3de34c4c.1871a4",
533
+ "ee8894e4.f1855"
534
+ ],
535
+ "x": 94,
536
+ "y": 59,
537
+ "w": 822,
538
+ "h": 162,
539
+ "info": "Turning the device on or off will send:\n`{\"Active\":[0, 1]}`\n\nAfter changing power state, the device will be \"Turning on\" or \"Turning off\" until a current state is sent of:\n`{\"CurrentAirPurifierState\":[0, 1, 2]}`\n0: off <br/>\n1: idle <br/>\n2: on <br/>\n\nThere will be a slider in the home app for sending `RotationSpeed`\n\nThere will be a switch on Home app for \"Oscillate\" which sends:\n`{\"SwingMode\":[0,1]}`\n\nChanging mode to manual to auto will send payload:\n`{\"TargetAirPurifierState\":[0, 1]}`\n\nChild lock will send \n`{\"LockPhysicalControls\": [0, 1]}`\n\n"
540
+ },
541
+ {
542
+ "id": "8dea49.4a770db8",
543
+ "type": "inject",
544
+ "z": "eeb8b00c.2c18c",
545
+ "g": "60e44fde.c914f8",
546
+ "name": "off",
547
+ "props": [
548
+ {
549
+ "p": "payload"
550
+ }
551
+ ],
552
+ "repeat": "",
553
+ "crontab": "",
554
+ "once": false,
555
+ "onceDelay": 0.1,
556
+ "topic": "",
557
+ "payload": "{\"CurrentAirPurifierState\":0}",
558
+ "payloadType": "json",
559
+ "x": 190,
560
+ "y": 100,
561
+ "wires": [["5302e4aa.1b466c"]]
562
+ },
563
+ {
564
+ "id": "5302e4aa.1b466c",
565
+ "type": "homekit-service",
566
+ "z": "eeb8b00c.2c18c",
567
+ "g": "60e44fde.c914f8",
568
+ "isParent": true,
569
+ "bridge": "409001a1.3e7a78",
570
+ "parentService": "",
571
+ "name": "Air purifier",
572
+ "serviceName": "AirPurifier",
573
+ "topic": "",
574
+ "filter": false,
575
+ "manufacturer": "Purity",
576
+ "model": "Air",
577
+ "serialNo": "23",
578
+ "firmwareRev": "1.0.0",
579
+ "hardwareRev": "1.0.0",
580
+ "softwareRev": "1.0.0",
581
+ "cameraConfigVideoProcessor": "ffmpeg",
582
+ "cameraConfigSource": "",
583
+ "cameraConfigStillImageSource": "",
584
+ "cameraConfigMaxStreams": 2,
585
+ "cameraConfigMaxWidth": 1280,
586
+ "cameraConfigMaxHeight": 720,
587
+ "cameraConfigMaxFPS": 10,
588
+ "cameraConfigMaxBitrate": 300,
589
+ "cameraConfigVideoCodec": "libx264",
590
+ "cameraConfigAudioCodec": "libfdk_aac",
591
+ "cameraConfigAudio": false,
592
+ "cameraConfigPacketSize": 1316,
593
+ "cameraConfigVerticalFlip": false,
594
+ "cameraConfigHorizontalFlip": false,
595
+ "cameraConfigMapVideo": "0:0",
596
+ "cameraConfigMapAudio": "0:1",
597
+ "cameraConfigVideoFilter": "scale=1280:720",
598
+ "cameraConfigAdditionalCommandLine": "-tune zerolatency",
599
+ "cameraConfigDebug": false,
600
+ "cameraConfigSnapshotOutput": "disabled",
601
+ "cameraConfigInterfaceName": "",
602
+ "characteristicProperties": "{\n \"SwingMode\":true,\n \"RotationSpeed\":true,\n \"LockPhysicalControls\":true\n}",
603
+ "outputs": 2,
604
+ "x": 370,
605
+ "y": 100,
606
+ "wires": [["bfe1c73d.c165a8", "9739d842.a402f"], []]
607
+ },
608
+ {
609
+ "id": "bfe1c73d.c165a8",
610
+ "type": "debug",
611
+ "z": "eeb8b00c.2c18c",
612
+ "g": "60e44fde.c914f8",
613
+ "name": "Purifier output",
614
+ "active": true,
615
+ "tosidebar": true,
616
+ "console": false,
617
+ "tostatus": false,
618
+ "complete": "true",
619
+ "targetType": "full",
620
+ "x": 500,
621
+ "y": 180,
622
+ "wires": []
623
+ },
624
+ {
625
+ "id": "9739d842.a402f",
626
+ "type": "function",
627
+ "z": "eeb8b00c.2c18c",
628
+ "g": "60e44fde.c914f8",
629
+ "name": "on/off",
630
+ "func": "if (msg.hap !== undefined && msg.hap.context !== undefined){\n if (msg.payload.Active === 1){\n return [msg,null];\n }\n if (msg.payload.Active === 0){\n return [null,msg];\n }\n}\nreturn;",
631
+ "outputs": 2,
632
+ "noerr": 0,
633
+ "initialize": "",
634
+ "finalize": "",
635
+ "x": 530,
636
+ "y": 100,
637
+ "wires": [["664dadf9.85d0d4", "d7cd8a56.628178"], ["3de34c4c.1871a4"]],
638
+ "outputLabels": ["On", "Off"]
639
+ },
640
+ {
641
+ "id": "87048a6e.df64e8",
642
+ "type": "inject",
643
+ "z": "eeb8b00c.2c18c",
644
+ "g": "60e44fde.c914f8",
645
+ "name": "idle",
646
+ "props": [
647
+ {
648
+ "p": "payload"
649
+ }
650
+ ],
651
+ "repeat": "",
652
+ "crontab": "",
653
+ "once": false,
654
+ "onceDelay": 0.1,
655
+ "topic": "",
656
+ "payload": "{\"CurrentAirPurifierState\":1}",
657
+ "payloadType": "json",
658
+ "x": 190,
659
+ "y": 140,
660
+ "wires": [["5302e4aa.1b466c"]]
661
+ },
662
+ {
663
+ "id": "db412cea.4a62f8",
664
+ "type": "inject",
665
+ "z": "eeb8b00c.2c18c",
666
+ "g": "60e44fde.c914f8",
667
+ "name": "on",
668
+ "props": [
669
+ {
670
+ "p": "payload"
671
+ }
672
+ ],
673
+ "repeat": "",
674
+ "crontab": "",
675
+ "once": false,
676
+ "onceDelay": 0.1,
677
+ "topic": "",
678
+ "payload": "{\"CurrentAirPurifierState\":2}",
679
+ "payloadType": "json",
680
+ "x": 190,
681
+ "y": 180,
682
+ "wires": [["5302e4aa.1b466c"]]
683
+ },
684
+ {
685
+ "id": "46418e19.aa6d6",
686
+ "type": "link in",
687
+ "z": "eeb8b00c.2c18c",
688
+ "g": "60e44fde.c914f8",
689
+ "name": "",
690
+ "links": ["ee8894e4.f1855"],
691
+ "x": 315,
692
+ "y": 180,
693
+ "wires": [["5302e4aa.1b466c"]]
694
+ },
695
+ {
696
+ "id": "664dadf9.85d0d4",
697
+ "type": "trigger",
698
+ "z": "eeb8b00c.2c18c",
699
+ "g": "60e44fde.c914f8",
700
+ "name": "5 sec to idle",
701
+ "op1": "",
702
+ "op2": "{\"CurrentAirPurifierState\":1}",
703
+ "op1type": "nul",
704
+ "op2type": "json",
705
+ "duration": "5",
706
+ "extend": false,
707
+ "units": "s",
708
+ "reset": "",
709
+ "bytopic": "all",
710
+ "topic": "topic",
711
+ "outputs": 1,
712
+ "x": 730,
713
+ "y": 100,
714
+ "wires": [["ee8894e4.f1855"]]
715
+ },
716
+ {
717
+ "id": "d7cd8a56.628178",
718
+ "type": "trigger",
719
+ "z": "eeb8b00c.2c18c",
720
+ "g": "60e44fde.c914f8",
721
+ "name": "10 sec to on",
722
+ "op1": "",
723
+ "op2": "{\"CurrentAirPurifierState\":2}",
724
+ "op1type": "nul",
725
+ "op2type": "json",
726
+ "duration": "10",
727
+ "extend": false,
728
+ "units": "s",
729
+ "reset": "",
730
+ "bytopic": "all",
731
+ "topic": "topic",
732
+ "outputs": 1,
733
+ "x": 730,
734
+ "y": 140,
735
+ "wires": [["ee8894e4.f1855"]]
736
+ },
737
+ {
738
+ "id": "3de34c4c.1871a4",
739
+ "type": "trigger",
740
+ "z": "eeb8b00c.2c18c",
741
+ "g": "60e44fde.c914f8",
742
+ "name": "5 sec to off",
743
+ "op1": "",
744
+ "op2": "{\"CurrentAirPurifierState\":0}",
745
+ "op1type": "nul",
746
+ "op2type": "json",
747
+ "duration": "5",
748
+ "extend": false,
749
+ "units": "s",
750
+ "reset": "",
751
+ "bytopic": "all",
752
+ "topic": "topic",
753
+ "outputs": 1,
754
+ "x": 730,
755
+ "y": 180,
756
+ "wires": [["ee8894e4.f1855"]]
757
+ },
758
+ {
759
+ "id": "ee8894e4.f1855",
760
+ "type": "link out",
761
+ "z": "eeb8b00c.2c18c",
762
+ "g": "60e44fde.c914f8",
763
+ "name": "",
764
+ "links": ["46418e19.aa6d6"],
765
+ "x": 875,
766
+ "y": 140,
767
+ "wires": []
768
+ },
769
+ {
770
+ "id": "6eaa9b9e.282734",
771
+ "type": "group",
772
+ "z": "eeb8b00c.2c18c",
773
+ "name": "CO plus CO2 Sensor: input only sensor",
774
+ "style": {
775
+ "stroke": "#999999",
776
+ "fill": "none",
777
+ "label": true,
778
+ "label-position": "nw",
779
+ "color": "#a4a4a4"
780
+ },
781
+ "nodes": [
782
+ "2e6738a6.ef5dd8",
783
+ "79889759.8219c",
784
+ "7f53465b.356a68",
785
+ "97aff586.786ff8",
786
+ "659ff3da.236404",
787
+ "e6105066.f8911",
788
+ "b433a780.665a7",
789
+ "d4b30334.a19e58",
790
+ "b0eeeb34.2dde8"
791
+ ],
792
+ "x": 94,
793
+ "y": 999,
794
+ "w": 752,
795
+ "h": 282,
796
+ "info": "# Combined Sensor\nThis is a sensor which will display both Carbon Monoxide (poisonous, deadly gas) and Carbon Dioxide (what humans exhale) levels.\n\n# CO Sensor\n\nThere are three inputs to this example, one for each level of Carbon Monoxide in the air. Options are:\n\n**0 ppm:** this will assume no CO in the air <br/>\n**Low level:** this will assume a level between 1 and 35 ppm, inclusive. This level is generally assumed to not cause problems in healthy adults <br/>\n**Dangerous level:** this will assume a level between 35 and 5000, inclusive; this will also trigger an alert in Home app\n\n## IF YOU HAVE A CARBON MONOXIDE DETECTOR EVER READING ABOVE 35 PPM, PLEASE EVACUATE THE AREA AND SEEK FRESH AIR IMMEDIATELY TO AVOID RISK OF DEATH ##\n\n# CO2 Sensor\n\nThere are three inputs to this example, one for each level of Carbon Dioxide in the air. Options are:\n\n**0 ppm:** this will assume no CO2 in the air <br/>\n**CO2 Level:** this will assume a level between 1 and 100,000 ppm, inclusive <br/>\n**Dangerous level:** this will assume a level between 1,000 and 100,000, inclusive\n\n"
797
+ },
798
+ {
799
+ "id": "2e6738a6.ef5dd8",
800
+ "type": "homekit-service",
801
+ "z": "eeb8b00c.2c18c",
802
+ "g": "6eaa9b9e.282734",
803
+ "isParent": true,
804
+ "hostType": "0",
805
+ "bridge": "409001a1.3e7a78",
806
+ "accessoryId": "",
807
+ "parentService": "",
808
+ "name": "CO detector",
809
+ "serviceName": "CarbonMonoxideSensor",
810
+ "topic": "",
811
+ "filter": false,
812
+ "manufacturer": "MONOxide",
813
+ "model": "1",
814
+ "serialNo": "2",
815
+ "firmwareRev": "2",
816
+ "hardwareRev": "2",
817
+ "softwareRev": "1.0.0",
818
+ "cameraConfigVideoProcessor": "ffmpeg",
819
+ "cameraConfigSource": "",
820
+ "cameraConfigStillImageSource": "",
821
+ "cameraConfigMaxStreams": 2,
822
+ "cameraConfigMaxWidth": 1280,
823
+ "cameraConfigMaxHeight": 720,
824
+ "cameraConfigMaxFPS": 10,
825
+ "cameraConfigMaxBitrate": 300,
826
+ "cameraConfigVideoCodec": "libx264",
827
+ "cameraConfigAudioCodec": "libfdk_aac",
828
+ "cameraConfigAudio": false,
829
+ "cameraConfigPacketSize": 1316,
830
+ "cameraConfigVerticalFlip": false,
831
+ "cameraConfigHorizontalFlip": false,
832
+ "cameraConfigMapVideo": "0:0",
833
+ "cameraConfigMapAudio": "0:1",
834
+ "cameraConfigVideoFilter": "scale=1280:720",
835
+ "cameraConfigAdditionalCommandLine": "-tune zerolatency",
836
+ "cameraConfigDebug": false,
837
+ "cameraConfigSnapshotOutput": "disabled",
838
+ "cameraConfigInterfaceName": "",
839
+ "characteristicProperties": "{ \"CarbonMonoxideLevel\":{ \"maxValue\":5000 }, \"CarbonMonoxidePeakLevel\":{ \"maxValue\":5000 }, \"CarbonDioxideLevel\":true, \"CarbonDioxidePeakLevel\":true}",
840
+ "waitForSetupMsg": false,
841
+ "outputs": 2,
842
+ "x": 750,
843
+ "y": 1040,
844
+ "wires": [[], []]
845
+ },
846
+ {
847
+ "id": "79889759.8219c",
848
+ "type": "function",
849
+ "z": "eeb8b00c.2c18c",
850
+ "g": "6eaa9b9e.282734",
851
+ "name": "Carbon DIoxide",
852
+ "func": "if(msg.payload === 0){\n context.set('lastPeak',0);\n newMsg = {\n payload: {\n \"CarbonDioxideLevel\":0\n }\n }\n return newMsg;\n}\n\n// Initialize vars\nvar CurrentLevel = 0;\nvar lastPeak = context.get('lastPeak');\n\n// Set random level\nif(msg.payload === \"CO2\"){\n CurrentLevel = Math.floor(Math.random() * (100000 - 1 + 1) + 1);\n}\n\n\n// Formulate output message\nvar newMsg = {\n payload: {\n \"CarbonDioxideLevel\" : CurrentLevel\n }\n};\n\n// Set new peak level\nif(CurrentLevel > lastPeak){\n lastPeak = CurrentLevel;\n context.set('lastPeak',CurrentLevel);\n newMsg.payload.CarbonDioxidePeakLevel = CurrentLevel;\n}\n\nreturn newMsg;",
853
+ "outputs": 1,
854
+ "noerr": 0,
855
+ "initialize": "// Code added here will be run once\n// whenever the node is deployed.\ncontext.set('lastPeak',0);",
856
+ "finalize": "",
857
+ "x": 460,
858
+ "y": 1200,
859
+ "wires": [["2e6738a6.ef5dd8"]]
860
+ },
861
+ {
862
+ "id": "7f53465b.356a68",
863
+ "type": "function",
864
+ "z": "eeb8b00c.2c18c",
865
+ "g": "6eaa9b9e.282734",
866
+ "name": "Carbon MONoxide",
867
+ "func": "// Reset all values to 0 if 0ppm input\nif(msg.payload === 0){\n context.set('lastPeak',0);\n newMsg = {\n payload: {\n \"CarbonMonoxideLevel\":0,\n \"CarbonMonoxidePeakLevel\":0,\n \"CarbonMonoxideDetected\":0\n }\n };\n return newMsg;\n}\n\n// Initialize vars\nvar CurrentLevel = 0;\nvar lastPeak = context.get('lastPeak');\n\n// Set random Low or Dangerous levels\nif(msg.payload === \"Low\"){\n CurrentLevel = Math.floor(Math.random() * (35 - 1 + 1) + 1);\n}\nif(msg.payload === \"Danger\"){\n CurrentLevel = Math.floor(Math.random() * (5000 - 35 + 1) + 35);\n}\n\n// Formulate output message\nvar newMsg = {\n payload: {\n \"CarbonMonoxideLevel\" : CurrentLevel,\n \"CarbonMonoxideDetected\" : 0\n }\n};\n\n// Set new peak level\nif(CurrentLevel > lastPeak){\n lastPeak = CurrentLevel;\n context.set('lastPeak',CurrentLevel);\n newMsg.payload.CarbonMonoxidePeakLevel = CurrentLevel;\n}\n\n// Set warning if dangerous\nif (CurrentLevel >= 35) {\n newMsg.payload.CarbonMonoxideDetected = 1;\n} \n\nreturn newMsg;",
868
+ "outputs": 1,
869
+ "noerr": 0,
870
+ "initialize": "",
871
+ "finalize": "",
872
+ "x": 470,
873
+ "y": 1080,
874
+ "wires": [["2e6738a6.ef5dd8"]]
875
+ },
876
+ {
877
+ "id": "97aff586.786ff8",
878
+ "type": "inject",
879
+ "z": "eeb8b00c.2c18c",
880
+ "g": "6eaa9b9e.282734",
881
+ "name": "NO RESPONSE",
882
+ "props": [
883
+ {
884
+ "p": "payload"
885
+ },
886
+ {
887
+ "p": "topic",
888
+ "vt": "str"
889
+ }
890
+ ],
891
+ "repeat": "",
892
+ "crontab": "",
893
+ "once": false,
894
+ "onceDelay": 0.1,
895
+ "topic": "",
896
+ "payload": "{\"CarbonMonoxideLevel\":\"NO_RESPONSE\"}",
897
+ "payloadType": "json",
898
+ "x": 480,
899
+ "y": 1040,
900
+ "wires": [["2e6738a6.ef5dd8"]]
901
+ },
902
+ {
903
+ "id": "659ff3da.236404",
904
+ "type": "inject",
905
+ "z": "eeb8b00c.2c18c",
906
+ "g": "6eaa9b9e.282734",
907
+ "name": "Clear CO2 Peak",
908
+ "props": [
909
+ {
910
+ "p": "payload"
911
+ }
912
+ ],
913
+ "repeat": "",
914
+ "crontab": "",
915
+ "once": false,
916
+ "onceDelay": 0.1,
917
+ "topic": "",
918
+ "payload": "0",
919
+ "payloadType": "num",
920
+ "x": 220,
921
+ "y": 1200,
922
+ "wires": [["79889759.8219c"]]
923
+ },
924
+ {
925
+ "id": "e6105066.f8911",
926
+ "type": "inject",
927
+ "z": "eeb8b00c.2c18c",
928
+ "g": "6eaa9b9e.282734",
929
+ "name": "0 ppm",
930
+ "repeat": "",
931
+ "crontab": "",
932
+ "once": false,
933
+ "onceDelay": 0.1,
934
+ "topic": "",
935
+ "payload": "0",
936
+ "payloadType": "num",
937
+ "x": 210,
938
+ "y": 1040,
939
+ "wires": [["7f53465b.356a68"]]
940
+ },
941
+ {
942
+ "id": "b433a780.665a7",
943
+ "type": "inject",
944
+ "z": "eeb8b00c.2c18c",
945
+ "g": "6eaa9b9e.282734",
946
+ "name": "CO2 Level",
947
+ "props": [
948
+ {
949
+ "p": "payload"
950
+ }
951
+ ],
952
+ "repeat": "",
953
+ "crontab": "",
954
+ "once": false,
955
+ "onceDelay": 0.1,
956
+ "topic": "",
957
+ "payload": "CO2",
958
+ "payloadType": "str",
959
+ "x": 200,
960
+ "y": 1240,
961
+ "wires": [["79889759.8219c"]]
962
+ },
963
+ {
964
+ "id": "d4b30334.a19e58",
965
+ "type": "inject",
966
+ "z": "eeb8b00c.2c18c",
967
+ "g": "6eaa9b9e.282734",
968
+ "name": "Low level",
969
+ "props": [
970
+ {
971
+ "p": "payload"
972
+ }
973
+ ],
974
+ "repeat": "",
975
+ "crontab": "",
976
+ "once": false,
977
+ "onceDelay": 0.1,
978
+ "topic": "",
979
+ "payload": "Low",
980
+ "payloadType": "str",
981
+ "x": 220,
982
+ "y": 1080,
983
+ "wires": [["7f53465b.356a68"]]
984
+ },
985
+ {
986
+ "id": "b0eeeb34.2dde8",
987
+ "type": "inject",
988
+ "z": "eeb8b00c.2c18c",
989
+ "g": "6eaa9b9e.282734",
990
+ "name": "Danger level",
991
+ "props": [
992
+ {
993
+ "p": "payload"
994
+ }
995
+ ],
996
+ "repeat": "",
997
+ "crontab": "",
998
+ "once": false,
999
+ "onceDelay": 0.1,
1000
+ "topic": "",
1001
+ "payload": "Danger",
1002
+ "payloadType": "str",
1003
+ "x": 230,
1004
+ "y": 1120,
1005
+ "wires": [["7f53465b.356a68"]]
1006
+ },
1007
+ {
1008
+ "id": "a875cc7.a4c42b",
1009
+ "type": "group",
1010
+ "z": "eeb8b00c.2c18c",
1011
+ "name": "Contact Sensor: input only sensor",
1012
+ "style": {
1013
+ "stroke": "#999999",
1014
+ "fill": "none",
1015
+ "label": true,
1016
+ "label-position": "nw",
1017
+ "color": "#a4a4a4"
1018
+ },
1019
+ "nodes": [
1020
+ "a5194c26.18c628",
1021
+ "2f9bc0d.42a73c",
1022
+ "dfca0b2d.8b8e8",
1023
+ "d74a610c.09a36",
1024
+ "c15b6468.ae2eb8",
1025
+ "6f7bc7fa.7f4f6",
1026
+ "99b55eb3.e31bf8",
1027
+ "508d9ccf.29e404"
1028
+ ],
1029
+ "x": 94,
1030
+ "y": 1299,
1031
+ "w": 752,
1032
+ "h": 242,
1033
+ "info": "# Contact Sensor\n\nThe contact sensor has one inject node to Open the sensor (door, window, etc). Once open, a ten second timer will run then set it back to closed.\n\nAdditional inputs are for \"No Response\", \"Tampered\", and \"Battery\". Note that this battery will not show a battery level but only a good/low battery status."
1034
+ },
1035
+ {
1036
+ "id": "a5194c26.18c628",
1037
+ "type": "homekit-service",
1038
+ "z": "eeb8b00c.2c18c",
1039
+ "g": "a875cc7.a4c42b",
1040
+ "isParent": true,
1041
+ "hostType": "0",
1042
+ "bridge": "409001a1.3e7a78",
1043
+ "accessoryId": "",
1044
+ "parentService": "",
1045
+ "name": "Contact Sensor",
1046
+ "serviceName": "ContactSensor",
1047
+ "topic": "",
1048
+ "filter": false,
1049
+ "manufacturer": "Full Contact",
1050
+ "model": "Door",
1051
+ "serialNo": "Sensor",
1052
+ "firmwareRev": "1.0.0",
1053
+ "hardwareRev": "1.0.0",
1054
+ "softwareRev": "1.0.0",
1055
+ "cameraConfigVideoProcessor": "ffmpeg",
1056
+ "cameraConfigSource": "",
1057
+ "cameraConfigStillImageSource": "",
1058
+ "cameraConfigMaxStreams": 2,
1059
+ "cameraConfigMaxWidth": 1280,
1060
+ "cameraConfigMaxHeight": 720,
1061
+ "cameraConfigMaxFPS": 10,
1062
+ "cameraConfigMaxBitrate": 300,
1063
+ "cameraConfigVideoCodec": "libx264",
1064
+ "cameraConfigAudioCodec": "libfdk_aac",
1065
+ "cameraConfigAudio": false,
1066
+ "cameraConfigPacketSize": 1316,
1067
+ "cameraConfigVerticalFlip": false,
1068
+ "cameraConfigHorizontalFlip": false,
1069
+ "cameraConfigMapVideo": "0:0",
1070
+ "cameraConfigMapAudio": "0:1",
1071
+ "cameraConfigVideoFilter": "scale=1280:720",
1072
+ "cameraConfigAdditionalCommandLine": "-tune zerolatency",
1073
+ "cameraConfigDebug": false,
1074
+ "cameraConfigSnapshotOutput": "disabled",
1075
+ "cameraConfigInterfaceName": "",
1076
+ "characteristicProperties": "{ \"StatusTampered\":true, \"StatusLowBattery\":true}",
1077
+ "waitForSetupMsg": false,
1078
+ "outputs": 2,
1079
+ "x": 740,
1080
+ "y": 1340,
1081
+ "wires": [[], []]
1082
+ },
1083
+ {
1084
+ "id": "2f9bc0d.42a73c",
1085
+ "type": "inject",
1086
+ "z": "eeb8b00c.2c18c",
1087
+ "g": "a875cc7.a4c42b",
1088
+ "name": "Tampered",
1089
+ "repeat": "",
1090
+ "crontab": "",
1091
+ "once": false,
1092
+ "onceDelay": 0.1,
1093
+ "topic": "",
1094
+ "payload": "{\"StatusTampered\":1}",
1095
+ "payloadType": "json",
1096
+ "x": 200,
1097
+ "y": 1460,
1098
+ "wires": [["a5194c26.18c628"]]
1099
+ },
1100
+ {
1101
+ "id": "dfca0b2d.8b8e8",
1102
+ "type": "inject",
1103
+ "z": "eeb8b00c.2c18c",
1104
+ "g": "a875cc7.a4c42b",
1105
+ "name": "Clear tampered",
1106
+ "repeat": "",
1107
+ "crontab": "",
1108
+ "once": false,
1109
+ "onceDelay": 0.1,
1110
+ "topic": "",
1111
+ "payload": "{\"StatusTampered\":0}",
1112
+ "payloadType": "json",
1113
+ "x": 220,
1114
+ "y": 1500,
1115
+ "wires": [["a5194c26.18c628"]]
1116
+ },
1117
+ {
1118
+ "id": "d74a610c.09a36",
1119
+ "type": "inject",
1120
+ "z": "eeb8b00c.2c18c",
1121
+ "g": "a875cc7.a4c42b",
1122
+ "name": "Low batt",
1123
+ "repeat": "",
1124
+ "crontab": "",
1125
+ "once": false,
1126
+ "onceDelay": 0.1,
1127
+ "topic": "",
1128
+ "payload": "{\"StatusLowBattery\":1}",
1129
+ "payloadType": "json",
1130
+ "x": 560,
1131
+ "y": 1460,
1132
+ "wires": [["a5194c26.18c628"]]
1133
+ },
1134
+ {
1135
+ "id": "c15b6468.ae2eb8",
1136
+ "type": "inject",
1137
+ "z": "eeb8b00c.2c18c",
1138
+ "g": "a875cc7.a4c42b",
1139
+ "name": "Good batt",
1140
+ "repeat": "",
1141
+ "crontab": "",
1142
+ "once": false,
1143
+ "onceDelay": 0.1,
1144
+ "topic": "",
1145
+ "payload": "{\"StatusLowBattery\":0}",
1146
+ "payloadType": "json",
1147
+ "x": 560,
1148
+ "y": 1500,
1149
+ "wires": [["a5194c26.18c628"]]
1150
+ },
1151
+ {
1152
+ "id": "6f7bc7fa.7f4f6",
1153
+ "type": "inject",
1154
+ "z": "eeb8b00c.2c18c",
1155
+ "g": "a875cc7.a4c42b",
1156
+ "name": "NO RESPONSE",
1157
+ "props": [
1158
+ {
1159
+ "p": "payload"
1160
+ },
1161
+ {
1162
+ "p": "topic",
1163
+ "vt": "str"
1164
+ }
1165
+ ],
1166
+ "repeat": "",
1167
+ "crontab": "",
1168
+ "once": false,
1169
+ "onceDelay": 0.1,
1170
+ "topic": "",
1171
+ "payload": "{\"ContactSensorState\":\"NO_RESPONSE\"}",
1172
+ "payloadType": "json",
1173
+ "x": 220,
1174
+ "y": 1400,
1175
+ "wires": [["a5194c26.18c628"]]
1176
+ },
1177
+ {
1178
+ "id": "99b55eb3.e31bf8",
1179
+ "type": "trigger",
1180
+ "z": "eeb8b00c.2c18c",
1181
+ "g": "a875cc7.a4c42b",
1182
+ "name": "10 Sec open",
1183
+ "op1": "",
1184
+ "op2": "{\"ContactSensorState\":0}",
1185
+ "op1type": "pay",
1186
+ "op2type": "json",
1187
+ "duration": "10",
1188
+ "extend": false,
1189
+ "units": "s",
1190
+ "reset": "",
1191
+ "bytopic": "all",
1192
+ "topic": "topic",
1193
+ "outputs": 1,
1194
+ "x": 430,
1195
+ "y": 1340,
1196
+ "wires": [["a5194c26.18c628"]]
1197
+ },
1198
+ {
1199
+ "id": "508d9ccf.29e404",
1200
+ "type": "inject",
1201
+ "z": "eeb8b00c.2c18c",
1202
+ "g": "a875cc7.a4c42b",
1203
+ "name": "Open",
1204
+ "props": [
1205
+ {
1206
+ "p": "payload"
1207
+ },
1208
+ {
1209
+ "p": "topic",
1210
+ "vt": "str"
1211
+ }
1212
+ ],
1213
+ "repeat": "",
1214
+ "crontab": "",
1215
+ "once": false,
1216
+ "onceDelay": "1",
1217
+ "topic": "",
1218
+ "payload": "{\"ContactSensorState\":1}",
1219
+ "payloadType": "json",
1220
+ "x": 190,
1221
+ "y": 1340,
1222
+ "wires": [["99b55eb3.e31bf8"]]
1223
+ },
1224
+ {
1225
+ "id": "ab48426e.25466",
1226
+ "type": "group",
1227
+ "z": "eeb8b00c.2c18c",
1228
+ "name": "CO2 Sensor: input only sensor",
1229
+ "style": {
1230
+ "stroke": "#999999",
1231
+ "fill": "none",
1232
+ "label": true,
1233
+ "label-position": "nw",
1234
+ "color": "#a4a4a4"
1235
+ },
1236
+ "nodes": [
1237
+ "88892b4.8a61bd8",
1238
+ "3611c654.8a42f2",
1239
+ "62cafcb0.8ade9c",
1240
+ "a0171cdb.f209b",
1241
+ "6f7de764.a6a688",
1242
+ "8758b463.afb0f",
1243
+ "69e8161b.74b7a",
1244
+ "40010b09.c73cdc"
1245
+ ],
1246
+ "x": 94,
1247
+ "y": 779,
1248
+ "w": 752,
1249
+ "h": 202,
1250
+ "info": "# CO2 Sensor\n\nThere are three inputs to this example, one for each level of Carbon Dioxide in the air. Options are:\n\n**0 ppm:** this will assume no CO2 <br/>\n**Safe level:** this will assume a level between 1 and 999 ppm, inclusive <br/>\n**Dangerous level:** this will assume a level between 1,000 and 100,000, inclusive; this will also trigger an alert"
1251
+ },
1252
+ {
1253
+ "id": "88892b4.8a61bd8",
1254
+ "type": "homekit-service",
1255
+ "z": "eeb8b00c.2c18c",
1256
+ "g": "ab48426e.25466",
1257
+ "isParent": true,
1258
+ "hostType": "0",
1259
+ "bridge": "409001a1.3e7a78",
1260
+ "accessoryId": "",
1261
+ "parentService": "",
1262
+ "name": "CO2 Sensor",
1263
+ "serviceName": "CarbonDioxideSensor",
1264
+ "topic": "",
1265
+ "filter": false,
1266
+ "manufacturer": "Default Manufacturer",
1267
+ "model": "Carbon",
1268
+ "serialNo": "Default Serial Number",
1269
+ "firmwareRev": "22",
1270
+ "hardwareRev": "11",
1271
+ "softwareRev": "",
1272
+ "cameraConfigVideoProcessor": "",
1273
+ "cameraConfigSource": "",
1274
+ "cameraConfigStillImageSource": "",
1275
+ "cameraConfigMaxStreams": "",
1276
+ "cameraConfigMaxWidth": "",
1277
+ "cameraConfigMaxHeight": "",
1278
+ "cameraConfigMaxFPS": "",
1279
+ "cameraConfigMaxBitrate": "",
1280
+ "cameraConfigVideoCodec": "",
1281
+ "cameraConfigAudioCodec": "",
1282
+ "cameraConfigAudio": false,
1283
+ "cameraConfigPacketSize": "",
1284
+ "cameraConfigVerticalFlip": false,
1285
+ "cameraConfigHorizontalFlip": false,
1286
+ "cameraConfigMapVideo": "",
1287
+ "cameraConfigMapAudio": "",
1288
+ "cameraConfigVideoFilter": "",
1289
+ "cameraConfigAdditionalCommandLine": "",
1290
+ "cameraConfigDebug": false,
1291
+ "cameraConfigSnapshotOutput": "disabled",
1292
+ "cameraConfigInterfaceName": "",
1293
+ "characteristicProperties": "{ \"CarbonDioxideLevel\" : true, \"CarbonDioxidePeakLevel\": true, \"StatusActive\" : true}",
1294
+ "waitForSetupMsg": false,
1295
+ "outputs": 2,
1296
+ "x": 750,
1297
+ "y": 820,
1298
+ "wires": [[], []]
1299
+ },
1300
+ {
1301
+ "id": "3611c654.8a42f2",
1302
+ "type": "function",
1303
+ "z": "eeb8b00c.2c18c",
1304
+ "g": "ab48426e.25466",
1305
+ "name": "Random values, peak value",
1306
+ "func": "// Reset all values to 0 if 0ppm input\nif(msg.payload === 0){\n context.set('lastPeak',0);\n newMsg = {\n payload: {\n \"CarbonDioxideLevel\":0,\n \"CarbonDioxidePeakLevel\":0,\n \"CarbonDioxideDetected\":0\n }\n };\n return newMsg;\n}\n\n// Initialize vars\nvar CurrentLevel = 0;\nvar lastPeak = context.get('lastPeak');\n\n// Set random safe or dangerous levels\nif(msg.payload === \"Safe\"){\n CurrentLevel = Math.floor(Math.random() * (999 - 1 + 1) + 1);\n}\nif(msg.payload === \"Danger\"){\n CurrentLevel = Math.floor(Math.random() * (100000 - 1000 + 1) + 1000);\n}\n\n// Formulate output message\nvar newMsg = {\n payload: {\n \"CarbonDioxideLevel\" : CurrentLevel,\n \"CarbonDioxideDetected\" : 0\n }\n};\n\n// Set new peak level\nif(CurrentLevel > lastPeak){\n lastPeak = CurrentLevel;\n context.set('lastPeak',CurrentLevel);\n newMsg.payload.CarbonDioxidePeakLevel = CurrentLevel;\n}\n\n// Set warning if dangerous\nif (CurrentLevel >= 1000) {\n newMsg.payload.CarbonDioxideDetected = 1;\n} \n\nreturn newMsg;",
1307
+ "outputs": 1,
1308
+ "noerr": 0,
1309
+ "initialize": "// Code added here will be run once\n// whenever the node is deployed.\ncontext.set('lastPeak',0);\n",
1310
+ "finalize": "",
1311
+ "x": 480,
1312
+ "y": 820,
1313
+ "wires": [["88892b4.8a61bd8"]]
1314
+ },
1315
+ {
1316
+ "id": "62cafcb0.8ade9c",
1317
+ "type": "inject",
1318
+ "z": "eeb8b00c.2c18c",
1319
+ "g": "ab48426e.25466",
1320
+ "name": "Active",
1321
+ "repeat": "",
1322
+ "crontab": "",
1323
+ "once": false,
1324
+ "onceDelay": 0.1,
1325
+ "topic": "",
1326
+ "payload": "{\"StatusActive\":true}",
1327
+ "payloadType": "json",
1328
+ "x": 550,
1329
+ "y": 860,
1330
+ "wires": [["88892b4.8a61bd8"]]
1331
+ },
1332
+ {
1333
+ "id": "a0171cdb.f209b",
1334
+ "type": "inject",
1335
+ "z": "eeb8b00c.2c18c",
1336
+ "g": "ab48426e.25466",
1337
+ "name": "Inactive",
1338
+ "repeat": "",
1339
+ "crontab": "",
1340
+ "once": false,
1341
+ "onceDelay": 0.1,
1342
+ "topic": "",
1343
+ "payload": "{\"StatusActive\":false}",
1344
+ "payloadType": "json",
1345
+ "x": 550,
1346
+ "y": 900,
1347
+ "wires": [["88892b4.8a61bd8"]]
1348
+ },
1349
+ {
1350
+ "id": "6f7de764.a6a688",
1351
+ "type": "inject",
1352
+ "z": "eeb8b00c.2c18c",
1353
+ "g": "ab48426e.25466",
1354
+ "name": "NO RESPONSE",
1355
+ "repeat": "",
1356
+ "crontab": "",
1357
+ "once": false,
1358
+ "onceDelay": 0.1,
1359
+ "topic": "",
1360
+ "payload": "{\"CarbonDioxideLevel\":\"NO_RESPONSE\"}",
1361
+ "payloadType": "json",
1362
+ "x": 520,
1363
+ "y": 940,
1364
+ "wires": [["88892b4.8a61bd8"]]
1365
+ },
1366
+ {
1367
+ "id": "8758b463.afb0f",
1368
+ "type": "inject",
1369
+ "z": "eeb8b00c.2c18c",
1370
+ "g": "ab48426e.25466",
1371
+ "name": "0 ppm",
1372
+ "props": [
1373
+ {
1374
+ "p": "payload"
1375
+ }
1376
+ ],
1377
+ "repeat": "",
1378
+ "crontab": "",
1379
+ "once": false,
1380
+ "onceDelay": 0.1,
1381
+ "topic": "",
1382
+ "payload": "0",
1383
+ "payloadType": "num",
1384
+ "x": 190,
1385
+ "y": 820,
1386
+ "wires": [["3611c654.8a42f2"]]
1387
+ },
1388
+ {
1389
+ "id": "69e8161b.74b7a",
1390
+ "type": "inject",
1391
+ "z": "eeb8b00c.2c18c",
1392
+ "g": "ab48426e.25466",
1393
+ "name": "Safe Level",
1394
+ "props": [
1395
+ {
1396
+ "p": "payload"
1397
+ }
1398
+ ],
1399
+ "repeat": "",
1400
+ "crontab": "",
1401
+ "once": false,
1402
+ "onceDelay": 0.1,
1403
+ "topic": "",
1404
+ "payload": "Safe",
1405
+ "payloadType": "str",
1406
+ "x": 200,
1407
+ "y": 860,
1408
+ "wires": [["3611c654.8a42f2"]]
1409
+ },
1410
+ {
1411
+ "id": "40010b09.c73cdc",
1412
+ "type": "inject",
1413
+ "z": "eeb8b00c.2c18c",
1414
+ "g": "ab48426e.25466",
1415
+ "name": "Dangerous level",
1416
+ "props": [
1417
+ {
1418
+ "p": "payload"
1419
+ }
1420
+ ],
1421
+ "repeat": "",
1422
+ "crontab": "",
1423
+ "once": false,
1424
+ "onceDelay": 0.1,
1425
+ "topic": "",
1426
+ "payload": "Danger",
1427
+ "payloadType": "str",
1428
+ "x": 220,
1429
+ "y": 900,
1430
+ "wires": [["3611c654.8a42f2"]]
1431
+ },
1432
+ {
1433
+ "id": "b3b5156e.cdf988",
1434
+ "type": "group",
1435
+ "z": "eeb8b00c.2c18c",
1436
+ "name": "Air Quality with Battery: input only sensor",
1437
+ "style": {
1438
+ "stroke": "#999999",
1439
+ "fill": "none",
1440
+ "label": true,
1441
+ "label-position": "nw",
1442
+ "color": "#a4a4a4"
1443
+ },
1444
+ "nodes": [
1445
+ "8088a797.e1a7c",
1446
+ "a70b3192.dfb4f",
1447
+ "d5708f5.036c87",
1448
+ "90b692e4.b9f6c",
1449
+ "54bfafbc.396898",
1450
+ "560fc866.6de558",
1451
+ "61e113b2.dbb714"
1452
+ ],
1453
+ "x": 94,
1454
+ "y": 239,
1455
+ "w": 758,
1456
+ "h": 208,
1457
+ "info": "# Air Quality Sensor\n\nThis sensor will inject random values for all of the air quality metrics available in the HomeKit spec. It will also inject random values for a linked battery service.\n\nWatch the input and Home app to learn how to see how things are working."
1458
+ },
1459
+ {
1460
+ "id": "8088a797.e1a7c",
1461
+ "type": "homekit-service",
1462
+ "z": "eeb8b00c.2c18c",
1463
+ "g": "b3b5156e.cdf988",
1464
+ "isParent": true,
1465
+ "hostType": "0",
1466
+ "bridge": "409001a1.3e7a78",
1467
+ "accessoryId": "",
1468
+ "parentService": "",
1469
+ "name": "Air Quality",
1470
+ "serviceName": "AirQualitySensor",
1471
+ "topic": "",
1472
+ "filter": false,
1473
+ "manufacturer": "Quality",
1474
+ "model": "Battery",
1475
+ "serialNo": "777",
1476
+ "firmwareRev": "8.3",
1477
+ "hardwareRev": "2.1",
1478
+ "softwareRev": "1.0.0",
1479
+ "cameraConfigVideoProcessor": "ffmpeg",
1480
+ "cameraConfigSource": "",
1481
+ "cameraConfigStillImageSource": "",
1482
+ "cameraConfigMaxStreams": 2,
1483
+ "cameraConfigMaxWidth": 1280,
1484
+ "cameraConfigMaxHeight": 720,
1485
+ "cameraConfigMaxFPS": 10,
1486
+ "cameraConfigMaxBitrate": 300,
1487
+ "cameraConfigVideoCodec": "libx264",
1488
+ "cameraConfigAudioCodec": "libfdk_aac",
1489
+ "cameraConfigAudio": false,
1490
+ "cameraConfigPacketSize": 1316,
1491
+ "cameraConfigVerticalFlip": false,
1492
+ "cameraConfigHorizontalFlip": false,
1493
+ "cameraConfigMapVideo": "0:0",
1494
+ "cameraConfigMapAudio": "0:1",
1495
+ "cameraConfigVideoFilter": "scale=1280:720",
1496
+ "cameraConfigAdditionalCommandLine": "-tune zerolatency",
1497
+ "cameraConfigDebug": false,
1498
+ "cameraConfigSnapshotOutput": "disabled",
1499
+ "cameraConfigInterfaceName": "",
1500
+ "characteristicProperties": "{ \"AirQuality\":true, \"PM2_5Density\":true, \"PM10Density\":true}",
1501
+ "waitForSetupMsg": false,
1502
+ "outputs": 2,
1503
+ "x": 750,
1504
+ "y": 280,
1505
+ "wires": [[], []]
1506
+ },
1507
+ {
1508
+ "id": "a70b3192.dfb4f",
1509
+ "type": "inject",
1510
+ "z": "eeb8b00c.2c18c",
1511
+ "g": "b3b5156e.cdf988",
1512
+ "name": "Air quality random",
1513
+ "props": [
1514
+ {
1515
+ "p": "payload"
1516
+ }
1517
+ ],
1518
+ "repeat": "15",
1519
+ "crontab": "",
1520
+ "once": true,
1521
+ "onceDelay": "5",
1522
+ "topic": "",
1523
+ "payload": "{}",
1524
+ "payloadType": "json",
1525
+ "x": 230,
1526
+ "y": 280,
1527
+ "wires": [["560fc866.6de558"]]
1528
+ },
1529
+ {
1530
+ "id": "d5708f5.036c87",
1531
+ "type": "inject",
1532
+ "z": "eeb8b00c.2c18c",
1533
+ "g": "b3b5156e.cdf988",
1534
+ "name": "Battery random",
1535
+ "props": [
1536
+ {
1537
+ "p": "payload"
1538
+ }
1539
+ ],
1540
+ "repeat": "30",
1541
+ "crontab": "",
1542
+ "once": true,
1543
+ "onceDelay": "5",
1544
+ "topic": "",
1545
+ "payload": "",
1546
+ "payloadType": "date",
1547
+ "x": 220,
1548
+ "y": 380,
1549
+ "wires": [["90b692e4.b9f6c"]]
1550
+ },
1551
+ {
1552
+ "id": "90b692e4.b9f6c",
1553
+ "type": "function",
1554
+ "z": "eeb8b00c.2c18c",
1555
+ "g": "b3b5156e.cdf988",
1556
+ "name": "Batt",
1557
+ "func": "// Define random battery level\nconst level = Math.floor(Math.random() * Math.floor(100))\nvar newMsg = {\n payload: {\n \"BatteryLevel\": level\n }\n};\n\n// Show \"Low Battery\" if less than 10%\nif (level < 10)newMsg.payload.StatusLowBattery = 1;\nelse newMsg.payload.StatusLowBattery = 0;\n\n// Show \"Charging\" if greater than 60%\nif (level > 60) newMsg.payload.ChargingState = 1;\nelse newMsg.payload.ChargingState = 0;\n\nreturn newMsg;",
1558
+ "outputs": 1,
1559
+ "noerr": 0,
1560
+ "initialize": "",
1561
+ "finalize": "",
1562
+ "x": 470,
1563
+ "y": 380,
1564
+ "wires": [["5cd5342a.cfd72c"]]
1565
+ },
1566
+ {
1567
+ "id": "54bfafbc.396898",
1568
+ "type": "inject",
1569
+ "z": "eeb8b00c.2c18c",
1570
+ "g": "b3b5156e.cdf988",
1571
+ "name": "NO RESPONSE",
1572
+ "props": [
1573
+ {
1574
+ "p": "payload"
1575
+ }
1576
+ ],
1577
+ "repeat": "",
1578
+ "crontab": "",
1579
+ "once": false,
1580
+ "onceDelay": 0.1,
1581
+ "topic": "",
1582
+ "payload": "{\"AirQuality\":\"NO_RESPONSE\"}",
1583
+ "payloadType": "json",
1584
+ "x": 500,
1585
+ "y": 320,
1586
+ "wires": [["8088a797.e1a7c"]]
1587
+ },
1588
+ {
1589
+ "id": "560fc866.6de558",
1590
+ "type": "function",
1591
+ "z": "eeb8b00c.2c18c",
1592
+ "g": "b3b5156e.cdf988",
1593
+ "name": "Random values",
1594
+ "func": "var newMsg = {\n \"payload\":{\n \"AirQuality\":Math.floor(Math.random() * Math.floor(5)),\n \"PM2_5Density\":Math.floor(Math.random() * Math.floor(1000)),\n \"PM10Density\":Math.floor(Math.random() * Math.floor(1000)),\n \"OzoneDensity\":Math.floor(Math.random() * Math.floor(1000)),\n \"NitrogenDioxideDensity\":Math.floor(Math.random() * Math.floor(1000)),\n \"SulphurDioxideDensity\": Math.floor(Math.random() * Math.floor(1000))\n }\n}\n\n\n\nreturn newMsg;",
1595
+ "outputs": 1,
1596
+ "noerr": 0,
1597
+ "initialize": "",
1598
+ "finalize": "",
1599
+ "x": 500,
1600
+ "y": 280,
1601
+ "wires": [["8088a797.e1a7c"]]
1602
+ },
1603
+ {
1604
+ "id": "61e113b2.dbb714",
1605
+ "type": "group",
1606
+ "z": "eeb8b00c.2c18c",
1607
+ "g": "b3b5156e.cdf988",
1608
+ "name": "LINKED",
1609
+ "style": {
1610
+ "stroke": "#0070c0",
1611
+ "fill": "#bfdbef",
1612
+ "label": true
1613
+ },
1614
+ "nodes": ["5cd5342a.cfd72c"],
1615
+ "x": 654,
1616
+ "y": 339,
1617
+ "w": 172,
1618
+ "h": 82
1619
+ },
1620
+ {
1621
+ "id": "5cd5342a.cfd72c",
1622
+ "type": "homekit-service",
1623
+ "z": "eeb8b00c.2c18c",
1624
+ "g": "61e113b2.dbb714",
1625
+ "isParent": false,
1626
+ "bridge": "",
1627
+ "accessoryId": "",
1628
+ "parentService": "8088a797.e1a7c",
1629
+ "name": "Battery",
1630
+ "serviceName": "Battery",
1631
+ "topic": "Air Quality",
1632
+ "filter": false,
1633
+ "manufacturer": "Default Manufacturer",
1634
+ "model": "Default Model",
1635
+ "serialNo": "Default Serial Number",
1636
+ "firmwareRev": "1.0.0",
1637
+ "hardwareRev": "1.0.0",
1638
+ "softwareRev": "1.0.0",
1639
+ "cameraConfigVideoProcessor": "ffmpeg",
1640
+ "cameraConfigSource": "",
1641
+ "cameraConfigStillImageSource": "",
1642
+ "cameraConfigMaxStreams": 2,
1643
+ "cameraConfigMaxWidth": 1280,
1644
+ "cameraConfigMaxHeight": 720,
1645
+ "cameraConfigMaxFPS": 10,
1646
+ "cameraConfigMaxBitrate": 300,
1647
+ "cameraConfigVideoCodec": "libx264",
1648
+ "cameraConfigAudioCodec": "libfdk_aac",
1649
+ "cameraConfigAudio": false,
1650
+ "cameraConfigPacketSize": 1316,
1651
+ "cameraConfigVerticalFlip": false,
1652
+ "cameraConfigHorizontalFlip": false,
1653
+ "cameraConfigMapVideo": "0:0",
1654
+ "cameraConfigMapAudio": "0:1",
1655
+ "cameraConfigVideoFilter": "scale=1280:720",
1656
+ "cameraConfigAdditionalCommandLine": "-tune zerolatency",
1657
+ "cameraConfigDebug": false,
1658
+ "cameraConfigSnapshotOutput": "disabled",
1659
+ "cameraConfigInterfaceName": "",
1660
+ "characteristicProperties": "{}",
1661
+ "waitForSetupMsg": false,
1662
+ "outputs": 2,
1663
+ "x": 740,
1664
+ "y": 380,
1665
+ "wires": [[], []]
1666
+ },
1667
+ {
1668
+ "id": "c869b0a5.e4def8",
1669
+ "type": "group",
1670
+ "z": "eeb8b00c.2c18c",
1671
+ "name": "Fan Simplified: input from device, output to device",
1672
+ "style": {
1673
+ "stroke": "#999999",
1674
+ "fill": "none",
1675
+ "label": true,
1676
+ "label-position": "nw",
1677
+ "color": "#a4a4a4"
1678
+ },
1679
+ "nodes": [
1680
+ "dadd634c.ae2258",
1681
+ "753e3777.49a1d",
1682
+ "992f4930.012aa",
1683
+ "2497a466.aa0e84",
1684
+ "c53b76fb.7a3cc8",
1685
+ "6c9646ee.1f3a18",
1686
+ "1e42a8f3.cf008f"
1687
+ ],
1688
+ "x": 94,
1689
+ "y": 1759,
1690
+ "w": 752,
1691
+ "h": 202,
1692
+ "info": "# Fan Simple\n\nThis example is for a 3-speed fan.\n\nSpeeds are: <br/>\nLow = 33<br/>\nMedium = 66<br/>\nHigh = 99<br/>\n\nValues outside of this are restricted and will not work. The home app will \"snap\" to these values. Siri will respond to \"set fan to low/medium/high\" with the corresponding value."
1693
+ },
1694
+ {
1695
+ "id": "dadd634c.ae2258",
1696
+ "type": "debug",
1697
+ "z": "eeb8b00c.2c18c",
1698
+ "g": "c869b0a5.e4def8",
1699
+ "name": "Fan output",
1700
+ "active": true,
1701
+ "tosidebar": true,
1702
+ "console": false,
1703
+ "tostatus": false,
1704
+ "complete": "payload",
1705
+ "targetType": "msg",
1706
+ "statusVal": "",
1707
+ "statusType": "auto",
1708
+ "x": 730,
1709
+ "y": 1800,
1710
+ "wires": []
1711
+ },
1712
+ {
1713
+ "id": "753e3777.49a1d",
1714
+ "type": "homekit-service",
1715
+ "z": "eeb8b00c.2c18c",
1716
+ "g": "c869b0a5.e4def8",
1717
+ "isParent": true,
1718
+ "bridge": "409001a1.3e7a78",
1719
+ "parentService": "",
1720
+ "name": "Fan Speeds",
1721
+ "serviceName": "Fan",
1722
+ "topic": "",
1723
+ "filter": false,
1724
+ "manufacturer": "Gman",
1725
+ "model": "Default Model",
1726
+ "serialNo": "CRX1",
1727
+ "firmwareRev": "1.0.0",
1728
+ "hardwareRev": "1.0.0",
1729
+ "softwareRev": "1.0.0",
1730
+ "cameraConfigVideoProcessor": "ffmpeg",
1731
+ "cameraConfigSource": "",
1732
+ "cameraConfigStillImageSource": "",
1733
+ "cameraConfigMaxStreams": 2,
1734
+ "cameraConfigMaxWidth": 1280,
1735
+ "cameraConfigMaxHeight": 720,
1736
+ "cameraConfigMaxFPS": 10,
1737
+ "cameraConfigMaxBitrate": 300,
1738
+ "cameraConfigVideoCodec": "libx264",
1739
+ "cameraConfigAudioCodec": "libfdk_aac",
1740
+ "cameraConfigAudio": false,
1741
+ "cameraConfigPacketSize": 1316,
1742
+ "cameraConfigVerticalFlip": false,
1743
+ "cameraConfigHorizontalFlip": false,
1744
+ "cameraConfigMapVideo": "0:0",
1745
+ "cameraConfigMapAudio": "0:1",
1746
+ "cameraConfigVideoFilter": "scale=1280:720",
1747
+ "cameraConfigAdditionalCommandLine": "-tune zerolatency",
1748
+ "cameraConfigDebug": false,
1749
+ "cameraConfigSnapshotOutput": "disabled",
1750
+ "cameraConfigInterfaceName": "",
1751
+ "characteristicProperties": "{\n \"RotationSpeed\": {\n \"minValue\":0,\n \"maxValue\":99,\n \"minStep\":33\n }\n}",
1752
+ "outputs": 2,
1753
+ "x": 510,
1754
+ "y": 1800,
1755
+ "wires": [["dadd634c.ae2258"], []]
1756
+ },
1757
+ {
1758
+ "id": "992f4930.012aa",
1759
+ "type": "inject",
1760
+ "z": "eeb8b00c.2c18c",
1761
+ "g": "c869b0a5.e4def8",
1762
+ "name": "NO RESPONSE",
1763
+ "props": [
1764
+ {
1765
+ "p": "payload"
1766
+ },
1767
+ {
1768
+ "p": "topic",
1769
+ "vt": "str"
1770
+ }
1771
+ ],
1772
+ "repeat": "",
1773
+ "crontab": "",
1774
+ "once": false,
1775
+ "onceDelay": 0.1,
1776
+ "topic": "",
1777
+ "payload": "{\"On\":\"NO_RESPONSE\"}",
1778
+ "payloadType": "json",
1779
+ "x": 460,
1780
+ "y": 1880,
1781
+ "wires": [["753e3777.49a1d"]]
1782
+ },
1783
+ {
1784
+ "id": "2497a466.aa0e84",
1785
+ "type": "inject",
1786
+ "z": "eeb8b00c.2c18c",
1787
+ "g": "c869b0a5.e4def8",
1788
+ "name": "OFF",
1789
+ "props": [
1790
+ {
1791
+ "p": "payload"
1792
+ },
1793
+ {
1794
+ "p": "topic",
1795
+ "vt": "str"
1796
+ }
1797
+ ],
1798
+ "repeat": "",
1799
+ "crontab": "",
1800
+ "once": false,
1801
+ "onceDelay": 0.1,
1802
+ "topic": "",
1803
+ "payload": "{\"On\":false}",
1804
+ "payloadType": "json",
1805
+ "x": 190,
1806
+ "y": 1800,
1807
+ "wires": [["753e3777.49a1d"]]
1808
+ },
1809
+ {
1810
+ "id": "c53b76fb.7a3cc8",
1811
+ "type": "inject",
1812
+ "z": "eeb8b00c.2c18c",
1813
+ "g": "c869b0a5.e4def8",
1814
+ "name": "Low",
1815
+ "props": [
1816
+ {
1817
+ "p": "payload"
1818
+ },
1819
+ {
1820
+ "p": "topic",
1821
+ "vt": "str"
1822
+ }
1823
+ ],
1824
+ "repeat": "",
1825
+ "crontab": "",
1826
+ "once": false,
1827
+ "onceDelay": 0.1,
1828
+ "topic": "",
1829
+ "payload": "{\"On\":true,\"RotationSpeed\":33}",
1830
+ "payloadType": "json",
1831
+ "x": 190,
1832
+ "y": 1840,
1833
+ "wires": [["753e3777.49a1d"]]
1834
+ },
1835
+ {
1836
+ "id": "6c9646ee.1f3a18",
1837
+ "type": "inject",
1838
+ "z": "eeb8b00c.2c18c",
1839
+ "g": "c869b0a5.e4def8",
1840
+ "name": "Medium",
1841
+ "props": [
1842
+ {
1843
+ "p": "payload"
1844
+ },
1845
+ {
1846
+ "p": "topic",
1847
+ "vt": "str"
1848
+ }
1849
+ ],
1850
+ "repeat": "",
1851
+ "crontab": "",
1852
+ "once": false,
1853
+ "onceDelay": 0.1,
1854
+ "topic": "",
1855
+ "payload": "{\"On\":true,\"RotationSpeed\":66}",
1856
+ "payloadType": "json",
1857
+ "x": 200,
1858
+ "y": 1880,
1859
+ "wires": [["753e3777.49a1d"]]
1860
+ },
1861
+ {
1862
+ "id": "1e42a8f3.cf008f",
1863
+ "type": "inject",
1864
+ "z": "eeb8b00c.2c18c",
1865
+ "g": "c869b0a5.e4def8",
1866
+ "name": "High",
1867
+ "props": [
1868
+ {
1869
+ "p": "payload"
1870
+ },
1871
+ {
1872
+ "p": "topic",
1873
+ "vt": "str"
1874
+ }
1875
+ ],
1876
+ "repeat": "",
1877
+ "crontab": "",
1878
+ "once": false,
1879
+ "onceDelay": 0.1,
1880
+ "topic": "",
1881
+ "payload": "{\"On\":true,\"RotationSpeed\":99}",
1882
+ "payloadType": "json",
1883
+ "x": 190,
1884
+ "y": 1920,
1885
+ "wires": [["753e3777.49a1d"]]
1886
+ }
1887
1887
  ]