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

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 +152 -90
  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 +433 -375
  45. package/build/lib/utils/ServiceUtils2.js +519 -309
  46. package/build/lib/utils/index.js +10 -11
  47. package/build/nodes/bridge.html +206 -168
  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 +1753 -117
  51. package/build/nodes/nrchkb.js +66 -88
  52. package/build/nodes/plugin-instance.html +509 -0
  53. package/build/nodes/plugin-instance.js +46 -0
  54. package/build/nodes/service.html +544 -307
  55. package/build/nodes/service.js +5 -6
  56. package/build/nodes/service2.html +1721 -455
  57. package/build/nodes/service2.js +5 -8
  58. package/build/nodes/standalone.html +208 -176
  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,282 +1,282 @@
1
1
  [
2
- {
3
- "id": "60e44fde.c914f8",
4
- "type": "group",
5
- "z": "60b06629.a2ebd",
6
- "name": "Air Purifier: input power state, output commands device",
7
- "style": {
8
- "stroke": "#999999",
9
- "fill": "none",
10
- "label": true,
11
- "label-position": "nw",
12
- "color": "#a4a4a4"
2
+ {
3
+ "id": "60e44fde.c914f8",
4
+ "type": "group",
5
+ "z": "60b06629.a2ebd",
6
+ "name": "Air Purifier: input power state, output commands device",
7
+ "style": {
8
+ "stroke": "#999999",
9
+ "fill": "none",
10
+ "label": true,
11
+ "label-position": "nw",
12
+ "color": "#a4a4a4"
13
+ },
14
+ "nodes": [
15
+ "8dea49.4a770db8",
16
+ "5302e4aa.1b466c",
17
+ "bfe1c73d.c165a8",
18
+ "9739d842.a402f",
19
+ "87048a6e.df64e8",
20
+ "db412cea.4a62f8",
21
+ "46418e19.aa6d6",
22
+ "664dadf9.85d0d4",
23
+ "d7cd8a56.628178",
24
+ "3de34c4c.1871a4",
25
+ "ee8894e4.f1855"
26
+ ],
27
+ "x": 14,
28
+ "y": 119,
29
+ "w": 822,
30
+ "h": 162,
31
+ "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"
13
32
  },
14
- "nodes": [
15
- "8dea49.4a770db8",
16
- "5302e4aa.1b466c",
17
- "bfe1c73d.c165a8",
18
- "9739d842.a402f",
19
- "87048a6e.df64e8",
20
- "db412cea.4a62f8",
21
- "46418e19.aa6d6",
22
- "664dadf9.85d0d4",
23
- "d7cd8a56.628178",
24
- "3de34c4c.1871a4",
25
- "ee8894e4.f1855"
26
- ],
27
- "x": 14,
28
- "y": 119,
29
- "w": 822,
30
- "h": 162,
31
- "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"
32
- },
33
- {
34
- "id": "8dea49.4a770db8",
35
- "type": "inject",
36
- "z": "60b06629.a2ebd",
37
- "g": "60e44fde.c914f8",
38
- "name": "off",
39
- "props": [
40
- {
41
- "p": "payload"
42
- }
43
- ],
44
- "repeat": "",
45
- "crontab": "",
46
- "once": false,
47
- "onceDelay": 0.1,
48
- "topic": "",
49
- "payload": "{\"CurrentAirPurifierState\":0}",
50
- "payloadType": "json",
51
- "x": 110,
52
- "y": 160,
53
- "wires": [["5302e4aa.1b466c"]]
54
- },
55
- {
56
- "id": "5302e4aa.1b466c",
57
- "type": "homekit-service",
58
- "z": "60b06629.a2ebd",
59
- "g": "60e44fde.c914f8",
60
- "isParent": true,
61
- "bridge": "409001a1.3e7a78",
62
- "parentService": "",
63
- "name": "Air purifier",
64
- "serviceName": "AirPurifier",
65
- "topic": "",
66
- "filter": false,
67
- "manufacturer": "Purity",
68
- "model": "Air",
69
- "serialNo": "23",
70
- "firmwareRev": "1.0.0",
71
- "hardwareRev": "1.0.0",
72
- "softwareRev": "1.0.0",
73
- "cameraConfigVideoProcessor": "ffmpeg",
74
- "cameraConfigSource": "",
75
- "cameraConfigStillImageSource": "",
76
- "cameraConfigMaxStreams": 2,
77
- "cameraConfigMaxWidth": 1280,
78
- "cameraConfigMaxHeight": 720,
79
- "cameraConfigMaxFPS": 10,
80
- "cameraConfigMaxBitrate": 300,
81
- "cameraConfigVideoCodec": "libx264",
82
- "cameraConfigAudioCodec": "libfdk_aac",
83
- "cameraConfigAudio": false,
84
- "cameraConfigPacketSize": 1316,
85
- "cameraConfigVerticalFlip": false,
86
- "cameraConfigHorizontalFlip": false,
87
- "cameraConfigMapVideo": "0:0",
88
- "cameraConfigMapAudio": "0:1",
89
- "cameraConfigVideoFilter": "scale=1280:720",
90
- "cameraConfigAdditionalCommandLine": "-tune zerolatency",
91
- "cameraConfigDebug": false,
92
- "cameraConfigSnapshotOutput": "disabled",
93
- "cameraConfigInterfaceName": "",
94
- "characteristicProperties": "{\n \"SwingMode\":true,\n \"RotationSpeed\":true,\n \"LockPhysicalControls\":true\n}",
95
- "outputs": 2,
96
- "x": 290,
97
- "y": 160,
98
- "wires": [["bfe1c73d.c165a8", "9739d842.a402f"], []]
99
- },
100
- {
101
- "id": "bfe1c73d.c165a8",
102
- "type": "debug",
103
- "z": "60b06629.a2ebd",
104
- "g": "60e44fde.c914f8",
105
- "name": "Purifier output",
106
- "active": true,
107
- "tosidebar": true,
108
- "console": false,
109
- "tostatus": false,
110
- "complete": "true",
111
- "targetType": "full",
112
- "x": 420,
113
- "y": 240,
114
- "wires": []
115
- },
116
- {
117
- "id": "9739d842.a402f",
118
- "type": "function",
119
- "z": "60b06629.a2ebd",
120
- "g": "60e44fde.c914f8",
121
- "name": "on/off",
122
- "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;",
123
- "outputs": 2,
124
- "noerr": 0,
125
- "initialize": "",
126
- "finalize": "",
127
- "x": 450,
128
- "y": 160,
129
- "wires": [["664dadf9.85d0d4", "d7cd8a56.628178"], ["3de34c4c.1871a4"]],
130
- "outputLabels": ["On", "Off"]
131
- },
132
- {
133
- "id": "87048a6e.df64e8",
134
- "type": "inject",
135
- "z": "60b06629.a2ebd",
136
- "g": "60e44fde.c914f8",
137
- "name": "idle",
138
- "props": [
139
- {
140
- "p": "payload"
141
- }
142
- ],
143
- "repeat": "",
144
- "crontab": "",
145
- "once": false,
146
- "onceDelay": 0.1,
147
- "topic": "",
148
- "payload": "{\"CurrentAirPurifierState\":1}",
149
- "payloadType": "json",
150
- "x": 110,
151
- "y": 200,
152
- "wires": [["5302e4aa.1b466c"]]
153
- },
154
- {
155
- "id": "db412cea.4a62f8",
156
- "type": "inject",
157
- "z": "60b06629.a2ebd",
158
- "g": "60e44fde.c914f8",
159
- "name": "on",
160
- "props": [
161
- {
162
- "p": "payload"
163
- }
164
- ],
165
- "repeat": "",
166
- "crontab": "",
167
- "once": false,
168
- "onceDelay": 0.1,
169
- "topic": "",
170
- "payload": "{\"CurrentAirPurifierState\":2}",
171
- "payloadType": "json",
172
- "x": 110,
173
- "y": 240,
174
- "wires": [["5302e4aa.1b466c"]]
175
- },
176
- {
177
- "id": "46418e19.aa6d6",
178
- "type": "link in",
179
- "z": "60b06629.a2ebd",
180
- "g": "60e44fde.c914f8",
181
- "name": "",
182
- "links": ["ee8894e4.f1855"],
183
- "x": 235,
184
- "y": 240,
185
- "wires": [["5302e4aa.1b466c"]]
186
- },
187
- {
188
- "id": "664dadf9.85d0d4",
189
- "type": "trigger",
190
- "z": "60b06629.a2ebd",
191
- "g": "60e44fde.c914f8",
192
- "name": "5 sec to idle",
193
- "op1": "",
194
- "op2": "{\"CurrentAirPurifierState\":1}",
195
- "op1type": "nul",
196
- "op2type": "json",
197
- "duration": "5",
198
- "extend": false,
199
- "units": "s",
200
- "reset": "",
201
- "bytopic": "all",
202
- "topic": "topic",
203
- "outputs": 1,
204
- "x": 650,
205
- "y": 160,
206
- "wires": [["ee8894e4.f1855"]]
207
- },
208
- {
209
- "id": "d7cd8a56.628178",
210
- "type": "trigger",
211
- "z": "60b06629.a2ebd",
212
- "g": "60e44fde.c914f8",
213
- "name": "10 sec to on",
214
- "op1": "",
215
- "op2": "{\"CurrentAirPurifierState\":2}",
216
- "op1type": "nul",
217
- "op2type": "json",
218
- "duration": "10",
219
- "extend": false,
220
- "units": "s",
221
- "reset": "",
222
- "bytopic": "all",
223
- "topic": "topic",
224
- "outputs": 1,
225
- "x": 650,
226
- "y": 200,
227
- "wires": [["ee8894e4.f1855"]]
228
- },
229
- {
230
- "id": "3de34c4c.1871a4",
231
- "type": "trigger",
232
- "z": "60b06629.a2ebd",
233
- "g": "60e44fde.c914f8",
234
- "name": "5 sec to off",
235
- "op1": "",
236
- "op2": "{\"CurrentAirPurifierState\":0}",
237
- "op1type": "nul",
238
- "op2type": "json",
239
- "duration": "5",
240
- "extend": false,
241
- "units": "s",
242
- "reset": "",
243
- "bytopic": "all",
244
- "topic": "topic",
245
- "outputs": 1,
246
- "x": 650,
247
- "y": 240,
248
- "wires": [["ee8894e4.f1855"]]
249
- },
250
- {
251
- "id": "ee8894e4.f1855",
252
- "type": "link out",
253
- "z": "60b06629.a2ebd",
254
- "g": "60e44fde.c914f8",
255
- "name": "",
256
- "links": ["46418e19.aa6d6"],
257
- "x": 795,
258
- "y": 200,
259
- "wires": []
260
- },
261
- {
262
- "id": "409001a1.3e7a78",
263
- "type": "homekit-bridge",
264
- "z": "",
265
- "bridgeName": "Demo 1",
266
- "pinCode": "153-10-538",
267
- "port": "",
268
- "allowInsecureRequest": false,
269
- "manufacturer": "NRCHKB",
270
- "model": "Demo",
271
- "serialNo": "1.1.2",
272
- "customMdnsConfig": false,
273
- "mdnsMulticast": true,
274
- "mdnsInterface": "",
275
- "mdnsPort": "",
276
- "mdnsIp": "",
277
- "mdnsTtl": "",
278
- "mdnsLoopback": true,
279
- "mdnsReuseAddr": true,
280
- "allowMessagePassthrough": true
281
- }
33
+ {
34
+ "id": "8dea49.4a770db8",
35
+ "type": "inject",
36
+ "z": "60b06629.a2ebd",
37
+ "g": "60e44fde.c914f8",
38
+ "name": "off",
39
+ "props": [
40
+ {
41
+ "p": "payload"
42
+ }
43
+ ],
44
+ "repeat": "",
45
+ "crontab": "",
46
+ "once": false,
47
+ "onceDelay": 0.1,
48
+ "topic": "",
49
+ "payload": "{\"CurrentAirPurifierState\":0}",
50
+ "payloadType": "json",
51
+ "x": 110,
52
+ "y": 160,
53
+ "wires": [["5302e4aa.1b466c"]]
54
+ },
55
+ {
56
+ "id": "5302e4aa.1b466c",
57
+ "type": "homekit-service",
58
+ "z": "60b06629.a2ebd",
59
+ "g": "60e44fde.c914f8",
60
+ "isParent": true,
61
+ "bridge": "409001a1.3e7a78",
62
+ "parentService": "",
63
+ "name": "Air purifier",
64
+ "serviceName": "AirPurifier",
65
+ "topic": "",
66
+ "filter": false,
67
+ "manufacturer": "Purity",
68
+ "model": "Air",
69
+ "serialNo": "23",
70
+ "firmwareRev": "1.0.0",
71
+ "hardwareRev": "1.0.0",
72
+ "softwareRev": "1.0.0",
73
+ "cameraConfigVideoProcessor": "ffmpeg",
74
+ "cameraConfigSource": "",
75
+ "cameraConfigStillImageSource": "",
76
+ "cameraConfigMaxStreams": 2,
77
+ "cameraConfigMaxWidth": 1280,
78
+ "cameraConfigMaxHeight": 720,
79
+ "cameraConfigMaxFPS": 10,
80
+ "cameraConfigMaxBitrate": 300,
81
+ "cameraConfigVideoCodec": "libx264",
82
+ "cameraConfigAudioCodec": "libfdk_aac",
83
+ "cameraConfigAudio": false,
84
+ "cameraConfigPacketSize": 1316,
85
+ "cameraConfigVerticalFlip": false,
86
+ "cameraConfigHorizontalFlip": false,
87
+ "cameraConfigMapVideo": "0:0",
88
+ "cameraConfigMapAudio": "0:1",
89
+ "cameraConfigVideoFilter": "scale=1280:720",
90
+ "cameraConfigAdditionalCommandLine": "-tune zerolatency",
91
+ "cameraConfigDebug": false,
92
+ "cameraConfigSnapshotOutput": "disabled",
93
+ "cameraConfigInterfaceName": "",
94
+ "characteristicProperties": "{\n \"SwingMode\":true,\n \"RotationSpeed\":true,\n \"LockPhysicalControls\":true\n}",
95
+ "outputs": 2,
96
+ "x": 290,
97
+ "y": 160,
98
+ "wires": [["bfe1c73d.c165a8", "9739d842.a402f"], []]
99
+ },
100
+ {
101
+ "id": "bfe1c73d.c165a8",
102
+ "type": "debug",
103
+ "z": "60b06629.a2ebd",
104
+ "g": "60e44fde.c914f8",
105
+ "name": "Purifier output",
106
+ "active": true,
107
+ "tosidebar": true,
108
+ "console": false,
109
+ "tostatus": false,
110
+ "complete": "true",
111
+ "targetType": "full",
112
+ "x": 420,
113
+ "y": 240,
114
+ "wires": []
115
+ },
116
+ {
117
+ "id": "9739d842.a402f",
118
+ "type": "function",
119
+ "z": "60b06629.a2ebd",
120
+ "g": "60e44fde.c914f8",
121
+ "name": "on/off",
122
+ "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;",
123
+ "outputs": 2,
124
+ "noerr": 0,
125
+ "initialize": "",
126
+ "finalize": "",
127
+ "x": 450,
128
+ "y": 160,
129
+ "wires": [["664dadf9.85d0d4", "d7cd8a56.628178"], ["3de34c4c.1871a4"]],
130
+ "outputLabels": ["On", "Off"]
131
+ },
132
+ {
133
+ "id": "87048a6e.df64e8",
134
+ "type": "inject",
135
+ "z": "60b06629.a2ebd",
136
+ "g": "60e44fde.c914f8",
137
+ "name": "idle",
138
+ "props": [
139
+ {
140
+ "p": "payload"
141
+ }
142
+ ],
143
+ "repeat": "",
144
+ "crontab": "",
145
+ "once": false,
146
+ "onceDelay": 0.1,
147
+ "topic": "",
148
+ "payload": "{\"CurrentAirPurifierState\":1}",
149
+ "payloadType": "json",
150
+ "x": 110,
151
+ "y": 200,
152
+ "wires": [["5302e4aa.1b466c"]]
153
+ },
154
+ {
155
+ "id": "db412cea.4a62f8",
156
+ "type": "inject",
157
+ "z": "60b06629.a2ebd",
158
+ "g": "60e44fde.c914f8",
159
+ "name": "on",
160
+ "props": [
161
+ {
162
+ "p": "payload"
163
+ }
164
+ ],
165
+ "repeat": "",
166
+ "crontab": "",
167
+ "once": false,
168
+ "onceDelay": 0.1,
169
+ "topic": "",
170
+ "payload": "{\"CurrentAirPurifierState\":2}",
171
+ "payloadType": "json",
172
+ "x": 110,
173
+ "y": 240,
174
+ "wires": [["5302e4aa.1b466c"]]
175
+ },
176
+ {
177
+ "id": "46418e19.aa6d6",
178
+ "type": "link in",
179
+ "z": "60b06629.a2ebd",
180
+ "g": "60e44fde.c914f8",
181
+ "name": "",
182
+ "links": ["ee8894e4.f1855"],
183
+ "x": 235,
184
+ "y": 240,
185
+ "wires": [["5302e4aa.1b466c"]]
186
+ },
187
+ {
188
+ "id": "664dadf9.85d0d4",
189
+ "type": "trigger",
190
+ "z": "60b06629.a2ebd",
191
+ "g": "60e44fde.c914f8",
192
+ "name": "5 sec to idle",
193
+ "op1": "",
194
+ "op2": "{\"CurrentAirPurifierState\":1}",
195
+ "op1type": "nul",
196
+ "op2type": "json",
197
+ "duration": "5",
198
+ "extend": false,
199
+ "units": "s",
200
+ "reset": "",
201
+ "bytopic": "all",
202
+ "topic": "topic",
203
+ "outputs": 1,
204
+ "x": 650,
205
+ "y": 160,
206
+ "wires": [["ee8894e4.f1855"]]
207
+ },
208
+ {
209
+ "id": "d7cd8a56.628178",
210
+ "type": "trigger",
211
+ "z": "60b06629.a2ebd",
212
+ "g": "60e44fde.c914f8",
213
+ "name": "10 sec to on",
214
+ "op1": "",
215
+ "op2": "{\"CurrentAirPurifierState\":2}",
216
+ "op1type": "nul",
217
+ "op2type": "json",
218
+ "duration": "10",
219
+ "extend": false,
220
+ "units": "s",
221
+ "reset": "",
222
+ "bytopic": "all",
223
+ "topic": "topic",
224
+ "outputs": 1,
225
+ "x": 650,
226
+ "y": 200,
227
+ "wires": [["ee8894e4.f1855"]]
228
+ },
229
+ {
230
+ "id": "3de34c4c.1871a4",
231
+ "type": "trigger",
232
+ "z": "60b06629.a2ebd",
233
+ "g": "60e44fde.c914f8",
234
+ "name": "5 sec to off",
235
+ "op1": "",
236
+ "op2": "{\"CurrentAirPurifierState\":0}",
237
+ "op1type": "nul",
238
+ "op2type": "json",
239
+ "duration": "5",
240
+ "extend": false,
241
+ "units": "s",
242
+ "reset": "",
243
+ "bytopic": "all",
244
+ "topic": "topic",
245
+ "outputs": 1,
246
+ "x": 650,
247
+ "y": 240,
248
+ "wires": [["ee8894e4.f1855"]]
249
+ },
250
+ {
251
+ "id": "ee8894e4.f1855",
252
+ "type": "link out",
253
+ "z": "60b06629.a2ebd",
254
+ "g": "60e44fde.c914f8",
255
+ "name": "",
256
+ "links": ["46418e19.aa6d6"],
257
+ "x": 795,
258
+ "y": 200,
259
+ "wires": []
260
+ },
261
+ {
262
+ "id": "409001a1.3e7a78",
263
+ "type": "homekit-bridge",
264
+ "z": "",
265
+ "bridgeName": "Demo 1",
266
+ "pinCode": "153-10-538",
267
+ "port": "",
268
+ "allowInsecureRequest": false,
269
+ "manufacturer": "NRCHKB",
270
+ "model": "Demo",
271
+ "serialNo": "1.1.2",
272
+ "customMdnsConfig": false,
273
+ "mdnsMulticast": true,
274
+ "mdnsInterface": "",
275
+ "mdnsPort": "",
276
+ "mdnsIp": "",
277
+ "mdnsTtl": "",
278
+ "mdnsLoopback": true,
279
+ "mdnsReuseAddr": true,
280
+ "allowMessagePassthrough": true
281
+ }
282
282
  ]