node-red-contrib-homebridge-automation 0.0.85 → 0.0.86-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -30,6 +30,7 @@ The above Node-RED Flow, turns on my 'Outside Office' light when the powder room
30
30
  * [Feb 2, 2021 - Version 0.0.78](#feb-2-2021---version-0078)
31
31
  * [Mar 9, 2021 - Version 0.0.80](#mar-9-2021---version-0080)
32
32
  * [April 23, 2021 - Version 0.0.82](#april-23-2021---version-0082)
33
+ * [April 23, 2022 - Version 0.0.86](#april-23-2022---version-0086)
33
34
  * [Backlog / Roadmap](#backlog--roadmap)
34
35
  * [Dropped items](#dropped-items)
35
36
  * [Installation Steps](#installation-steps)
@@ -161,6 +162,10 @@ With a plugin, you can see if it supports Real Time events, by opening the Home
161
162
 
162
163
  - Support for homebridge instances with different PINS. Tks @dxdc
163
164
 
165
+ ### April 23, 2022 - Version 0.0.86
166
+
167
+ - Removal of request dependency from hap-node-client
168
+
164
169
  # Backlog / Roadmap
165
170
 
166
171
  * [x] - Update Node Information with Homebridge Accessory Details ( hapEndpoint, deviceType, description )
package/beta.sh ADDED
@@ -0,0 +1,16 @@
1
+ #! /bin/sh
2
+
3
+ npm audit
4
+ npm audit fix
5
+ #if npm audit; then
6
+ npm run-script document
7
+ rm *orig* *toc\.*
8
+ git add .
9
+ # npm version patch -m "$1" --force
10
+ npm version prerelease --preid beta -m "$1" --force
11
+ npm publish --tag beta
12
+ git commit -m "$1"
13
+ git push origin beta --tags
14
+ #else
15
+ # echo "Not publishing due to security vulnerabilites"
16
+ #fi
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-homebridge-automation",
3
- "version": "0.0.85",
3
+ "version": "0.0.86-beta.2",
4
4
  "description": "NodeRED Automation for HomeBridge",
5
5
  "main": "HAP-NodeRed.js",
6
6
  "scripts": {
@@ -22,12 +22,12 @@
22
22
  "url": "git+https://github.com/NorthernMan54/node-red-contrib-homebridge-automation.git"
23
23
  },
24
24
  "devDependencies": {
25
- "documentation": "13.2.4"
25
+ "documentation": "^13.2.5"
26
26
  },
27
27
  "dependencies": {
28
+ "better-queue": ">=3.8.10",
28
29
  "debug": ">2.6.9",
29
- "hap-node-client": ">=0.1.14",
30
- "better-queue": ">=3.8.10"
30
+ "hap-node-client": ">=0.1.22-beta.2"
31
31
  },
32
32
  "author": "NorthernMan54",
33
33
  "license": "ISC",
@@ -1,346 +0,0 @@
1
- # Homebridge Automation powered by Node-RED
2
-
3
- <p align="center">
4
- <img src="docs/Homebridge and Node Red.png"/>
5
- </p>
6
-
7
- The above Node-RED Flow, turns on my 'Outside Office' light when the powder room is turned on, and turns them both off after 10 seconds. Not practical but a good sample of the power behind Node-RED. [Link](docs/sample.json) to exported flow for above.
8
-
9
- # Table of Contents
10
-
11
- <!--ts-->
12
- * [Homebridge Automation powered by Node-RED](#homebridge-automation-powered-by-node-red)
13
- * [Table of Contents](#table-of-contents)
14
- * [Introduction](#introduction)
15
- * [Caveats](#caveats)
16
- * [Changes](#changes)
17
- * [Mar 18, 2019 - Version 0.0.39](#mar-18-2019---version-0039)
18
- * [Mar 19, 2019 - Version 0.0.42](#mar-19-2019---version-0042)
19
- * [Mar 31, 2019 - Version 0.0.](#mar-31-2019---version-00)
20
- * [May 9, 2019 - Version 0.0.43](#may-9-2019---version-0043)
21
- * [May 15, 2019 - Version 0.0.44](#may-15-2019---version-0044)
22
- * [May 29, 2019 - Version 0.0.45](#may-29-2019---version-0045)
23
- * [July 27, 2019 - Version 0.0.50](#july-27-2019---version-0050)
24
- * [Feb 24, 2020 - Version 0.0.56](#feb-24-2020---version-0056)
25
- * [Mar 18, 2020 - Version 0.0.59](#mar-18-2020---version-0059)
26
- * [Oct 13, 2020 - Version 0.0.71](#oct-13-2020---version-0071)
27
- * [Oct 24, 2020 - Version 0.0.71](#oct-24-2020---version-0071)
28
- * [Nov 1, 2020 - Version 0.0.73](#nov-1-2020---version-0073)
29
- * [Nov 13, 2020 - Version 0.0.76](#nov-13-2020---version-0076)
30
- * [Feb 2, 2021 - Version 0.0.78](#feb-2-2021---version-0078)
31
- * [Mar 9, 2021 - Version 0.0.80](#mar-9-2021---version-0080)
32
- * [April 23, 2021 - Version 0.0.82](#april-23-2021---version-0082)
33
- * [Backlog / Roadmap](#backlog--roadmap)
34
- * [Dropped items](#dropped-items)
35
- * [Installation Steps](#installation-steps)
36
- * [1 - Install Node-RED and Homebridge](#1---install-node-red-and-homebridge)
37
- * [2 - Prepare Homebridge for integration with Homebridge-Automation](#2---prepare-homebridge-for-integration-with-homebridge-automation)
38
- * [3 - Install Homebridge-Automation into Node-Red](#3---install-homebridge-automation-into-node-red)
39
- * [4 - Start Node-Red](#4---start-node-red)
40
- * [5 - Initial setup and configuration inside Node-Red](#5---initial-setup-and-configuration-inside-node-red)
41
- * [6 - Configure 'hb event' to receive updates from your Accessories](#6---configure-hb-event-to-receive-updates-from-your-accessories)
42
- * [Node-RED Homebridge-Automation Message Structure](#node-red-homebridge-automation-message-structure)
43
- * [hb event](#hb-event)
44
- * [Output](#output)
45
- * [hb resume](#hb-resume)
46
- * [input](#input)
47
- * [output](#output-1)
48
- * [hb status](#hb-status)
49
- * [input](#input-1)
50
- * [output](#output-2)
51
- * [hb control](#hb-control)
52
- * [Input](#input-2)
53
- * [Flows Shared from Community](#flows-shared-from-community)
54
- * [Troubleshooting / DEBUG MODE](#troubleshooting--debug-mode)
55
- * [To start Node-RED in DEBUG mode, and output Homebridge-Automation debug logs start Node-RED like this.](#to-start-node-red-in-debug-mode-and-output-homebridge-automation-debug-logs-start-node-red-like-this)
56
-
57
- <!-- Added by: sgracey, at: -->
58
-
59
- <!--te-->
60
-
61
- # Introduction
62
-
63
- This is a release of the ability to integrate Homebridge Accessories into [Node-RED](https://nodered.org) so that you can start flows from Homebridge accessory events and control your existing homebridge accessories. ( To create accessories in HomeKit, please use node-red-contrib-homekit-bridged. )
64
-
65
- ![Homebridge Nodes](docs/Homebridge%20Nodes.png)
66
-
67
- Four different node types are available, the first node `hb event` listens for changes to an accessory (ie on/off) and sends a message into Node-Red containing the updated accessory status. The second node `hb resume` holds the state of an accessory and supports creating a state resume function. The third node `hb status` allows you to poll an accessory for status. The forth node `hb control` allows you to control a homebridge accessory. Each node is tied to an individual Home App Tile/Service of an accessory (ie on/off and brightness).
68
-
69
- Payload from a dimmable lightbulb.
70
-
71
- ```
72
- { "On":true, "Brightness":100 }
73
- ```
74
-
75
- ![Homebridge Nodes](docs/HAP%20Event%20Nodes.png)
76
-
77
- ## Caveats
78
-
79
- * Please keep in mind that this integration only works with devices supported/exposed with HomeBridge Plugins. This does not have visibility to Native HomeKit devices. ( Similar to my homebridge-alexa plugin. )
80
-
81
- * For the `hb event` node, the ability of a Accessory to generate events in Real Time is dependent on how the plugin was architected and the actual device. Some are very good at generating events in real time, and others only generate events when the Home App is opened to the accessory. YMMV.
82
-
83
- With a plugin, you can see if it supports Real Time events, by opening the Home App, and looking at an accessory. Then trigger a local event outside of homebridge/homekit. If the accessory updates in real time, then it support Real Events. ( An example of a local event can be turning on a Smart Light Switch, by the local switch. Another example would be using the vendor app to control an accessory.)
84
-
85
- ## Changes
86
-
87
- ### Mar 18, 2019 - Version 0.0.39
88
-
89
- - Changed `hb state` to `hb resume` to make the use case for the node more self-explanatory. If you had used the `hb state` node in your existing flow, nodeRed will not start unless you manually change the node type in the flow file. To fix the issue, manually edit the flow file in your .node-red directory, and change the type reference `hb-state` to `hb resume`
90
- - Changed individual nodes from being characteristic based to device/service based. When updating from previous versions, you will need to select your devices again.
91
- - With the change in nodes to be device/service based, the payload message structure changed from being individual characteristic based to a JSON object containing all the characteristics you want to update on the device. ie in the previous version a device control message payload of `true` going to the On characteristic would turn on a light, with this version it would be be represented with a message payload of `{ "On":true, "Brightness":100 }`. This particular payload would turn on a light and set the brightness to 100. I made this change to enable easier intergradation with node-red-contrib-homekit-bridged.
92
- - If you send an incorrect message payload to the `hb resume` or `hb control` nodes it would output a debug message containing the valid/supported characteristics for use in the payload object.
93
- - Updated the Homebridge accessory parser, so more diverse devices will now be exposed.
94
-
95
- ### Mar 19, 2019 - Version 0.0.42
96
-
97
- - Fix for events being missed after homebridge restarts
98
-
99
- ### Mar 31, 2019 - Version 0.0.
100
-
101
- - Fix for a crash when events are received by an accessory with multiple services.
102
-
103
- ### May 9, 2019 - Version 0.0.43
104
-
105
- - Added retries for registering of events during startup. ( 1000 retries, retry delay of 30 seconds )
106
-
107
- ### May 15, 2019 - Version 0.0.44
108
-
109
- - Added reqTimeout and set default timeout on homebridge requests to 14 seconds
110
-
111
- ### May 29, 2019 - Version 0.0.45
112
-
113
- - Name Change to Homebridge-Automation
114
-
115
- ### July 27, 2019 - Version 0.0.50
116
-
117
- - Publish as a NPM package to resolve #17
118
-
119
- ### Feb 24, 2020 - Version 0.0.56
120
-
121
- - Fix for device naming for Nest FAN and ECO Mode
122
-
123
- ### Mar 18, 2020 - Version 0.0.59
124
-
125
- - Support for the new version of HAP-NodeJS
126
-
127
- ### Oct 13, 2020 - Version 0.0.71
128
-
129
- - Realize that I have not updated the change log for a while, so this is a laundry list of changes since 0.0.59
130
- - Additional error logging
131
- - Fix for issue #47 and #48
132
- - Support camera devices - tks dxdc
133
- - Improved timeout support
134
- - Support for the latest version of homebridge
135
-
136
- ### Oct 24, 2020 - Version 0.0.71
137
-
138
- - Added support for plugins that allow device name editing within the Home app.
139
-
140
- ### Nov 1, 2020 - Version 0.0.73
141
-
142
- - Added support for Air Pressure and Power devices
143
- - Fixed issue #69 TV accessory events not firing since update of homebridge-broadlink-rm plugin
144
-
145
- ### Nov 13, 2020 - Version 0.0.76
146
-
147
- - Update HB Control Node to output snapshot images from camera's. Payload output format is a buffer object containing image.
148
-
149
- ### Feb 2, 2021 - Version 0.0.78
150
-
151
- - Change hb-control to display control message payload rather than 'Ok'
152
- - Tweak device parser to remove these duplicates
153
- - Camera RTPStream Management
154
- - Input Source with a name of 'dummy'
155
-
156
- ### Mar 9, 2021 - Version 0.0.80
157
-
158
- - hbEvent: add option to send initial state
159
-
160
- ### April 23, 2021 - Version 0.0.82
161
-
162
- - Support for homebridge instances with different PINS. Tks @dxdc
163
-
164
- # Backlog / Roadmap
165
-
166
- * [x] - Update Node Information with Homebridge Accessory Details ( hapEndpoint, deviceType, description )
167
- * [x] - Sort device drop down listing
168
- * [x] - Trim Node name to just accessory Name
169
- * [x] - Documentation - Fix README with latest options
170
- * [x] - Documentation/Naming - Normalize on Accessory, Service, Event and Characteristic
171
- * [x] - Hap-Node-Client is not reentrant, and multiple requests get lost. Needs queuing at an instance level.
172
- * [x] - Refactor interface with Hap-Node-Client, and split events into a dedicated evented socket connection and use the regular request module for everything else.
173
- * [x] - Create a service/characteristic based node approach mimicking homekit icons
174
- * [x] - Adjust msg.payload to match other homekit / NodeRED integrations
175
- * [ ] - Further stability testing
176
- * [ ] - With hb-event add a delay function of about 30ms to put back together device level events
177
-
178
- ## Dropped items
179
-
180
- * [ ] - Add timestamp to Node msg object
181
- * [ ] - Do I need a node that emits events for all homebridge devices?
182
-
183
- # Installation Steps
184
-
185
- ## 1 - Install Node-RED and Homebridge
186
-
187
- This is covered in alot of other places, so I won't cover it here.
188
-
189
- ## 2 - Prepare Homebridge for integration with Homebridge-Automation
190
-
191
- Place your homebridge instances into "INSECURE MODE". This is same as my [Homebridge Alexa](https://github.com/NorthernMan54/homebridge-alexa) plugin, and you just need to follow the [Prepare homebridge for plugin](https://github.com/NorthernMan54/homebridge-alexa#prepare-homebridge-for-plugin-installation) instructions there.
192
-
193
- ## 3 - Install Homebridge-Automation into Node-Red
194
-
195
- cd ~/.node-red
196
- npm install node-red-contrib-homebridge-automation
197
-
198
- ## 4 - Start Node-Red
199
-
200
- ## 5 - Initial setup and configuration inside Node-Red
201
-
202
- * 5.1 Select 'hb event' node and place onto flow.
203
- * 5.2 Double click on hb event node ( now called 'Choose accessory/event')
204
-
205
- ![Choose](docs/Choose.png)
206
-
207
- * 5.3 Please select the **pencil** to the right of the PIN Field.
208
-
209
- ![Pencil](docs/Pencil.png)
210
-
211
- * 5.4 Please enter your PIN, and select **Add**.
212
-
213
- ![Pin Entered](docs/Pin%20Entered.png)
214
-
215
- * 5.5 Now select **Done**.
216
-
217
- ![Done](docs/HAP%20Event%20Done.png)
218
-
219
- * 5.6 Now select **Deploy**
220
- * 5.7 Please wait about 30 seconds. ( Node-RED is busy discovering all your accessories.)
221
- * 5.8 Initial setup and config is complete.
222
-
223
- ## 6 - Configure 'hb event' to receive updates from your Accessories
224
-
225
- * 6.1 Double click on hb event node ( now called 'Choose accessory/service')
226
-
227
- ![Populated](docs/HAP%20Event%20Populated.png)
228
-
229
- * 6.2 The device drop down should now be populated with all your Homebridge accessories.
230
-
231
- ![Populated](docs/HAP%20Event%20Drop%20Down.png)
232
-
233
- The accessory naming convention is:
234
-
235
- Accessory Name and Accessory Service Type
236
-
237
- # Node-RED Homebridge-Automation Message Structure
238
-
239
- ## hb event
240
-
241
- This node generates a message every time an Accessory changes status, and generates a message containing the updated status of all the characteristics.
242
-
243
- ### Output
244
-
245
- Message is structured like this
246
-
247
- ```
248
- msg = {
249
- name: Accessory Name,
250
- payload: { "On":true, "Brightness":100 }
251
- Homebridge: Homebridge instance name,
252
- Manufacturer: Plugin Manufacturer,
253
- Type: Homebridge device type,
254
- _device: Unique device identifier,
255
- _confId: node.confId,
256
- _rawEvent: Raw event message
257
- };
258
- ```
259
-
260
- Message payload will vary depending on characteristics support by the device, this example is from a dimmable light.
261
-
262
- Please note that multiple event messages may be received from a single device event, this is due to how homebridge controls devices and emits events.
263
-
264
- ## hb resume
265
-
266
- This node can be used to create a resume previous state flow. Where you change the state of an accessory, and have it resume the previous state afterwards. I'm using this, in conjunction with Alexa to give the ability to turn on and off the lights in a room, but not turn any lights that were already on. I'm also using it with the HomeKit "I'm home" automation, to turn a group of lights for a few minutes then turn off. But at the same time have any lights you already had on, stay on.
267
-
268
- ### input
269
-
270
- Based on the message input payload and state of the accessory the output changes.
271
-
272
- For `{"On":true}`, the node just passes the message to output. For the first `{"On":false}`, the output is the state of the accessory from prior to the last turn on. For the second `{"On":false}`, the out is `{"On":false}`.
273
-
274
- ```
275
- msg = {
276
- payload: { "On":true, "Brightness":100 }
277
- };
278
- ```
279
-
280
- ### output
281
-
282
- ```
283
- msg = {
284
- payload: { "On":true, "Brightness":100 }
285
- };
286
- ```
287
- Message payload will vary depending on characteristics support by the device, this sample is from a dimmable light.
288
-
289
- To find supported characteristics for a device, please send an invalid message payload to the node, and it will output the supported characteristics in the debug log.
290
-
291
- ## hb status
292
-
293
- This node allows you to poll a Homebridge accessory and collect the current status of all the characteristics.
294
-
295
- ### input
296
-
297
- Anything
298
-
299
- ### output
300
-
301
- Message is structured like this
302
-
303
- ```
304
- msg = {
305
- name: Accessory Name,
306
- payload: { "On":true, "Brightness":100 }
307
- Homebridge: Homebridge instance name,
308
- Manufacturer: Plugin Manufacturer,
309
- Type: Homebridge device type,
310
- _device: Unique device identifier,
311
- _confId: node.confId,
312
- _rawEvent: Raw event message
313
- };
314
- ```
315
- Message payload will vary depending on characteristics support by the device, this sample is from a dimmable light.
316
-
317
- ## hb control
318
-
319
- This node allows you to control all the characteristics of a Homebridge accessory. The message payload needs to be a JSON object containing the values of all the characteristics you want to change. If you send the node an invalid payload, it will output all the available characteristics of the accessory in the debug tab.
320
-
321
- ### Input
322
-
323
- The hb control node only looks at msg.payload value, and ignore's all others.
324
-
325
- ```
326
- msg = {
327
- payload: { "On":true, "Brightness":100 }
328
- }
329
- ```
330
- Message payload will vary depending on characteristics support by the device, this sample is from a dimmable light.
331
-
332
- To find supported characteristics for a device, please send an invalid message payload to the node, and it will output the supported characteristics in the debug log.
333
-
334
- # Flows Shared from Community
335
-
336
- I have started collecting flows for useful functions on the wiki.
337
-
338
- https://github.com/NorthernMan54/node-red-contrib-homebridge-automation/wiki
339
-
340
- # Troubleshooting / DEBUG MODE
341
-
342
- ## To start Node-RED in DEBUG mode, and output Homebridge-Automation debug logs start Node-RED like this.
343
-
344
- ```
345
- DEBUG=-express*,-send*,-body-parser*,* node-red
346
- ```
@@ -1,47 +0,0 @@
1
- * [Homebridge Automation powered by Node-RED](#homebridge-automation-powered-by-node-red)
2
- * [Table of Contents](#table-of-contents)
3
- * [Introduction](#introduction)
4
- * [Caveats](#caveats)
5
- * [Changes](#changes)
6
- * [Mar 18, 2019 - Version 0.0.39](#mar-18-2019---version-0039)
7
- * [Mar 19, 2019 - Version 0.0.42](#mar-19-2019---version-0042)
8
- * [Mar 31, 2019 - Version 0.0.](#mar-31-2019---version-00)
9
- * [May 9, 2019 - Version 0.0.43](#may-9-2019---version-0043)
10
- * [May 15, 2019 - Version 0.0.44](#may-15-2019---version-0044)
11
- * [May 29, 2019 - Version 0.0.45](#may-29-2019---version-0045)
12
- * [July 27, 2019 - Version 0.0.50](#july-27-2019---version-0050)
13
- * [Feb 24, 2020 - Version 0.0.56](#feb-24-2020---version-0056)
14
- * [Mar 18, 2020 - Version 0.0.59](#mar-18-2020---version-0059)
15
- * [Oct 13, 2020 - Version 0.0.71](#oct-13-2020---version-0071)
16
- * [Oct 24, 2020 - Version 0.0.71](#oct-24-2020---version-0071)
17
- * [Nov 1, 2020 - Version 0.0.73](#nov-1-2020---version-0073)
18
- * [Nov 13, 2020 - Version 0.0.76](#nov-13-2020---version-0076)
19
- * [Feb 2, 2021 - Version 0.0.78](#feb-2-2021---version-0078)
20
- * [Mar 9, 2021 - Version 0.0.80](#mar-9-2021---version-0080)
21
- * [April 23, 2021 - Version 0.0.82](#april-23-2021---version-0082)
22
- * [Backlog / Roadmap](#backlog--roadmap)
23
- * [Dropped items](#dropped-items)
24
- * [Installation Steps](#installation-steps)
25
- * [1 - Install Node-RED and Homebridge](#1---install-node-red-and-homebridge)
26
- * [2 - Prepare Homebridge for integration with Homebridge-Automation](#2---prepare-homebridge-for-integration-with-homebridge-automation)
27
- * [3 - Install Homebridge-Automation into Node-Red](#3---install-homebridge-automation-into-node-red)
28
- * [4 - Start Node-Red](#4---start-node-red)
29
- * [5 - Initial setup and configuration inside Node-Red](#5---initial-setup-and-configuration-inside-node-red)
30
- * [6 - Configure 'hb event' to receive updates from your Accessories](#6---configure-hb-event-to-receive-updates-from-your-accessories)
31
- * [Node-RED Homebridge-Automation Message Structure](#node-red-homebridge-automation-message-structure)
32
- * [hb event](#hb-event)
33
- * [Output](#output)
34
- * [hb resume](#hb-resume)
35
- * [input](#input)
36
- * [output](#output-1)
37
- * [hb status](#hb-status)
38
- * [input](#input-1)
39
- * [output](#output-2)
40
- * [hb control](#hb-control)
41
- * [Input](#input-2)
42
- * [Flows Shared from Community](#flows-shared-from-community)
43
- * [Troubleshooting / DEBUG MODE](#troubleshooting--debug-mode)
44
- * [To start Node-RED in DEBUG mode, and output Homebridge-Automation debug logs start Node-RED like this.](#to-start-node-red-in-debug-mode-and-output-homebridge-automation-debug-logs-start-node-red-like-this)
45
-
46
- <!-- Added by: sgracey, at: -->
47
-