node-red-contrib-homebridge-automation 0.2.2-beta.2 → 0.2.2-beta.3
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 +56 -50
- package/package.json +1 -1
- package/src/hbControlNode.js +22 -1
- package/test/node-red/.config.nodes.json +1 -1
- package/test/node-red/flows.json +158 -24
package/README.md
CHANGED
|
@@ -9,56 +9,57 @@ The above Node-RED Flow, turns on my 'Outside Office' light when the powder room
|
|
|
9
9
|
# Table of Contents
|
|
10
10
|
|
|
11
11
|
<!--ts-->
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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
|
+
- [Dec 31, 2022 - Version 0.1.3](#dec-31-2022---version-013)
|
|
34
|
+
- [Jan 6, 2023 - Version 0.1.5](#jan-6-2023---version-015)
|
|
35
|
+
- [Jan 11, 2023 - Version 0.1.7](#jan-11-2023---version-017)
|
|
36
|
+
- [Jan 15, 2023 - Version 0.1.8](#jan-15-2023---version-018)
|
|
37
|
+
- [Dec 15, 2024 - Version 0.2.0](#dec-15-2024---version-020)
|
|
38
|
+
- [April 15, 2025 - Version 0.2.2](#april-15-2025---version-022)
|
|
39
|
+
- [Backlog / Roadmap](#backlog--roadmap)
|
|
40
|
+
- [Dropped items](#dropped-items)
|
|
41
|
+
- [Installation Steps](#installation-steps)
|
|
42
|
+
- [1 - Install Node-RED and Homebridge](#1---install-node-red-and-homebridge)
|
|
43
|
+
- [2 - Prepare Homebridge for integration with Homebridge-Automation](#2---prepare-homebridge-for-integration-with-homebridge-automation)
|
|
44
|
+
- [3 - Install Homebridge-Automation into Node-Red](#3---install-homebridge-automation-into-node-red)
|
|
45
|
+
- [4 - Start Node-Red](#4---start-node-red)
|
|
46
|
+
- [5 - Initial setup and configuration inside Node-Red](#5---initial-setup-and-configuration-inside-node-red)
|
|
47
|
+
- [6 - Configure 'hb event' to receive updates from your Accessories](#6---configure-hb-event-to-receive-updates-from-your-accessories)
|
|
48
|
+
- [Node-RED Homebridge-Automation Message Structure](#node-red-homebridge-automation-message-structure)
|
|
49
|
+
- [hb event](#hb-event)
|
|
50
|
+
- [Output](#output)
|
|
51
|
+
- [hb resume](#hb-resume)
|
|
52
|
+
- [input](#input)
|
|
53
|
+
- [output](#output-1)
|
|
54
|
+
- [hb status](#hb-status)
|
|
55
|
+
- [input](#input-1)
|
|
56
|
+
- [output](#output-2)
|
|
57
|
+
- [hb control](#hb-control)
|
|
58
|
+
- [Input](#input-2)
|
|
59
|
+
- [Flows Shared from Community](#flows-shared-from-community)
|
|
60
|
+
- [Donations](#donations)
|
|
61
|
+
- [Troubleshooting / DEBUG MODE](#troubleshooting--debug-mode)
|
|
62
|
+
- [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)
|
|
62
63
|
<!--te-->
|
|
63
64
|
|
|
64
65
|
# Introduction
|
|
@@ -186,6 +187,11 @@ With a plugin, you can see if it supports Real Time events, by opening the Home
|
|
|
186
187
|
- With the change in connectivity to homebridge, please validate all your nodes are connected after the update. And pay particular attention to `Camera` nodes, as for some devices the name has changed.
|
|
187
188
|
- Testing and Development was completed on Node-RED version: v4.0.2 and Node.js version: v20.18.1
|
|
188
189
|
|
|
190
|
+
### April 15, 2025 - Version 0.2.2
|
|
191
|
+
|
|
192
|
+
- Add common supported types Window, Window Covering, Light Sensor #151, tks @HDeKnop
|
|
193
|
+
- HB-Control Node Turns Off then On when this message is received #152
|
|
194
|
+
|
|
189
195
|
# Backlog / Roadmap
|
|
190
196
|
|
|
191
197
|
* [x] - Update Node Information with Homebridge Accessory Details ( hapEndpoint, deviceType, description )
|
package/package.json
CHANGED
package/src/hbControlNode.js
CHANGED
|
@@ -49,8 +49,21 @@ class HbControlNode extends hbBaseNode {
|
|
|
49
49
|
results.push({ Received: result.length });
|
|
50
50
|
} else {
|
|
51
51
|
// Handle other characteristics
|
|
52
|
+
try {
|
|
53
|
+
const result = await this.hbDevice.setCharacteristicsByTypes(filterIfOff(message.payload));
|
|
54
|
+
results.push(result.values);
|
|
55
|
+
} catch (error) {
|
|
56
|
+
console.log(error)
|
|
57
|
+
this.error(`Failed to set value for "${JSON.stringify(message.payload)}": ${error.message}`);
|
|
58
|
+
results.push({ 'Error': `Error: ${error.message}` });
|
|
59
|
+
fill = 'red';
|
|
60
|
+
this.hbConfigNode.disconnectClientNodes(this.hbDevice.instance);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/*
|
|
52
64
|
for (const key of Object.keys(message.payload)) {
|
|
53
65
|
try {
|
|
66
|
+
debug('Setting value for', key, message.payload[key]);
|
|
54
67
|
const result = await this.hbDevice.setCharacteristicByType(key, message.payload[key]);
|
|
55
68
|
results.push({ [result.type]: result.value });
|
|
56
69
|
} catch (error) {
|
|
@@ -60,7 +73,8 @@ class HbControlNode extends hbBaseNode {
|
|
|
60
73
|
fill = 'red';
|
|
61
74
|
this.hbConfigNode.disconnectClientNodes(this.hbDevice.instance);
|
|
62
75
|
}
|
|
63
|
-
|
|
76
|
+
|
|
77
|
+
} */
|
|
64
78
|
}
|
|
65
79
|
|
|
66
80
|
// Update status
|
|
@@ -74,4 +88,11 @@ class HbControlNode extends hbBaseNode {
|
|
|
74
88
|
}
|
|
75
89
|
}
|
|
76
90
|
|
|
91
|
+
function filterIfOff(payload) {
|
|
92
|
+
if (payload.On === 0 || payload.On === false) {
|
|
93
|
+
return { On: payload.On }; // Only keep "On"
|
|
94
|
+
}
|
|
95
|
+
return payload; // Pass as is
|
|
96
|
+
}
|
|
97
|
+
|
|
77
98
|
module.exports = HbControlNode;
|
package/test/node-red/flows.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "caef1e7b5b399e80",
|
|
4
4
|
"type": "tab",
|
|
5
5
|
"label": "Flow 1",
|
|
6
|
-
"disabled":
|
|
6
|
+
"disabled": true,
|
|
7
7
|
"info": "",
|
|
8
8
|
"env": []
|
|
9
9
|
},
|
|
@@ -825,47 +825,65 @@
|
|
|
825
825
|
"id": "834248faa510b756",
|
|
826
826
|
"type": "hb-event",
|
|
827
827
|
"z": "ddaa42d2292b69e2",
|
|
828
|
-
"name": "
|
|
828
|
+
"name": "Bunkie Light",
|
|
829
829
|
"Homebridge": "homebridge",
|
|
830
|
-
"Manufacturer": "
|
|
831
|
-
"Service": "
|
|
832
|
-
"device": "
|
|
830
|
+
"Manufacturer": "Tasmota",
|
|
831
|
+
"Service": "Lightbulb",
|
|
832
|
+
"device": "homebridge1C:22:3D:E3:CF:34TasmotaBunkie Light00000043",
|
|
833
833
|
"conf": "7e647d67.f33acc",
|
|
834
834
|
"sendInitialState": false,
|
|
835
|
-
"x":
|
|
835
|
+
"x": 110,
|
|
836
836
|
"y": 140,
|
|
837
837
|
"wires": [
|
|
838
|
-
[
|
|
838
|
+
[
|
|
839
|
+
"cfe1959b929ccdac"
|
|
840
|
+
]
|
|
839
841
|
]
|
|
840
842
|
},
|
|
841
843
|
{
|
|
842
844
|
"id": "55f84c7bfb7c121e",
|
|
843
845
|
"type": "hb-control",
|
|
844
846
|
"z": "ddaa42d2292b69e2",
|
|
845
|
-
"name": "
|
|
847
|
+
"name": "Bunkie Light",
|
|
846
848
|
"Homebridge": "homebridge",
|
|
847
|
-
"Manufacturer": "
|
|
848
|
-
"Service": "
|
|
849
|
-
"device": "
|
|
849
|
+
"Manufacturer": "Tasmota",
|
|
850
|
+
"Service": "Lightbulb",
|
|
851
|
+
"device": "homebridge1C:22:3D:E3:CF:34TasmotaBunkie Light00000043",
|
|
850
852
|
"conf": "7e647d67.f33acc",
|
|
851
853
|
"outputs": 0,
|
|
852
|
-
"x":
|
|
853
|
-
"y":
|
|
854
|
+
"x": 630,
|
|
855
|
+
"y": 500,
|
|
854
856
|
"wires": []
|
|
855
857
|
},
|
|
856
858
|
{
|
|
857
|
-
"id": "
|
|
858
|
-
"type": "
|
|
859
|
+
"id": "81f4056eb30cf459",
|
|
860
|
+
"type": "debug",
|
|
861
|
+
"z": "ddaa42d2292b69e2",
|
|
862
|
+
"name": "debug 8",
|
|
863
|
+
"active": true,
|
|
864
|
+
"tosidebar": true,
|
|
865
|
+
"console": false,
|
|
866
|
+
"tostatus": true,
|
|
867
|
+
"complete": "payload",
|
|
868
|
+
"targetType": "msg",
|
|
869
|
+
"statusVal": "payload",
|
|
870
|
+
"statusType": "auto",
|
|
871
|
+
"x": 540,
|
|
872
|
+
"y": 300,
|
|
873
|
+
"wires": []
|
|
874
|
+
},
|
|
875
|
+
{
|
|
876
|
+
"id": "fca1f0f1cde5b4de",
|
|
877
|
+
"type": "hb-status",
|
|
859
878
|
"z": "ddaa42d2292b69e2",
|
|
860
|
-
"name": "
|
|
879
|
+
"name": "Bunkie Light",
|
|
861
880
|
"Homebridge": "homebridge",
|
|
862
881
|
"Manufacturer": "Tasmota",
|
|
863
882
|
"Service": "Lightbulb",
|
|
864
|
-
"device": "homebridge1C:22:3D:E3:CF:
|
|
883
|
+
"device": "homebridge1C:22:3D:E3:CF:34TasmotaBunkie Light00000043",
|
|
865
884
|
"conf": "7e647d67.f33acc",
|
|
866
|
-
"
|
|
867
|
-
"
|
|
868
|
-
"y": 280,
|
|
885
|
+
"x": 250,
|
|
886
|
+
"y": 300,
|
|
869
887
|
"wires": [
|
|
870
888
|
[
|
|
871
889
|
"81f4056eb30cf459"
|
|
@@ -873,10 +891,39 @@
|
|
|
873
891
|
]
|
|
874
892
|
},
|
|
875
893
|
{
|
|
876
|
-
"id": "
|
|
894
|
+
"id": "ee39a8410853c7a2",
|
|
895
|
+
"type": "inject",
|
|
896
|
+
"z": "ddaa42d2292b69e2",
|
|
897
|
+
"name": "Off - Problem",
|
|
898
|
+
"props": [
|
|
899
|
+
{
|
|
900
|
+
"p": "payload"
|
|
901
|
+
},
|
|
902
|
+
{
|
|
903
|
+
"p": "topic",
|
|
904
|
+
"vt": "str"
|
|
905
|
+
}
|
|
906
|
+
],
|
|
907
|
+
"repeat": "",
|
|
908
|
+
"crontab": "",
|
|
909
|
+
"once": false,
|
|
910
|
+
"onceDelay": 0.1,
|
|
911
|
+
"topic": "",
|
|
912
|
+
"payload": "{\"On\":0,\"Brightness\":95}",
|
|
913
|
+
"payloadType": "json",
|
|
914
|
+
"x": 390,
|
|
915
|
+
"y": 420,
|
|
916
|
+
"wires": [
|
|
917
|
+
[
|
|
918
|
+
"55f84c7bfb7c121e"
|
|
919
|
+
]
|
|
920
|
+
]
|
|
921
|
+
},
|
|
922
|
+
{
|
|
923
|
+
"id": "cfe1959b929ccdac",
|
|
877
924
|
"type": "debug",
|
|
878
925
|
"z": "ddaa42d2292b69e2",
|
|
879
|
-
"name": "debug
|
|
926
|
+
"name": "debug 15",
|
|
880
927
|
"active": true,
|
|
881
928
|
"tosidebar": true,
|
|
882
929
|
"console": false,
|
|
@@ -885,10 +932,97 @@
|
|
|
885
932
|
"targetType": "msg",
|
|
886
933
|
"statusVal": "payload",
|
|
887
934
|
"statusType": "auto",
|
|
888
|
-
"x":
|
|
889
|
-
"y":
|
|
935
|
+
"x": 300,
|
|
936
|
+
"y": 80,
|
|
890
937
|
"wires": []
|
|
891
938
|
},
|
|
939
|
+
{
|
|
940
|
+
"id": "feb68f332b7930fe",
|
|
941
|
+
"type": "inject",
|
|
942
|
+
"z": "ddaa42d2292b69e2",
|
|
943
|
+
"name": "Off",
|
|
944
|
+
"props": [
|
|
945
|
+
{
|
|
946
|
+
"p": "payload"
|
|
947
|
+
},
|
|
948
|
+
{
|
|
949
|
+
"p": "topic",
|
|
950
|
+
"vt": "str"
|
|
951
|
+
}
|
|
952
|
+
],
|
|
953
|
+
"repeat": "",
|
|
954
|
+
"crontab": "",
|
|
955
|
+
"once": false,
|
|
956
|
+
"onceDelay": 0.1,
|
|
957
|
+
"topic": "",
|
|
958
|
+
"payload": "{\"On\":0}",
|
|
959
|
+
"payloadType": "json",
|
|
960
|
+
"x": 370,
|
|
961
|
+
"y": 580,
|
|
962
|
+
"wires": [
|
|
963
|
+
[
|
|
964
|
+
"55f84c7bfb7c121e"
|
|
965
|
+
]
|
|
966
|
+
]
|
|
967
|
+
},
|
|
968
|
+
{
|
|
969
|
+
"id": "01879231a47cb906",
|
|
970
|
+
"type": "inject",
|
|
971
|
+
"z": "ddaa42d2292b69e2",
|
|
972
|
+
"name": "Off - Problem",
|
|
973
|
+
"props": [
|
|
974
|
+
{
|
|
975
|
+
"p": "payload"
|
|
976
|
+
},
|
|
977
|
+
{
|
|
978
|
+
"p": "topic",
|
|
979
|
+
"vt": "str"
|
|
980
|
+
}
|
|
981
|
+
],
|
|
982
|
+
"repeat": "",
|
|
983
|
+
"crontab": "",
|
|
984
|
+
"once": false,
|
|
985
|
+
"onceDelay": 0.1,
|
|
986
|
+
"topic": "",
|
|
987
|
+
"payload": "{\"Brightness\":95}",
|
|
988
|
+
"payloadType": "json",
|
|
989
|
+
"x": 390,
|
|
990
|
+
"y": 480,
|
|
991
|
+
"wires": [
|
|
992
|
+
[
|
|
993
|
+
"55f84c7bfb7c121e"
|
|
994
|
+
]
|
|
995
|
+
]
|
|
996
|
+
},
|
|
997
|
+
{
|
|
998
|
+
"id": "0844ad85b07ffef7",
|
|
999
|
+
"type": "inject",
|
|
1000
|
+
"z": "ddaa42d2292b69e2",
|
|
1001
|
+
"name": "On",
|
|
1002
|
+
"props": [
|
|
1003
|
+
{
|
|
1004
|
+
"p": "payload"
|
|
1005
|
+
},
|
|
1006
|
+
{
|
|
1007
|
+
"p": "topic",
|
|
1008
|
+
"vt": "str"
|
|
1009
|
+
}
|
|
1010
|
+
],
|
|
1011
|
+
"repeat": "",
|
|
1012
|
+
"crontab": "",
|
|
1013
|
+
"once": false,
|
|
1014
|
+
"onceDelay": 0.1,
|
|
1015
|
+
"topic": "",
|
|
1016
|
+
"payload": "{\"On\":1}",
|
|
1017
|
+
"payloadType": "json",
|
|
1018
|
+
"x": 370,
|
|
1019
|
+
"y": 540,
|
|
1020
|
+
"wires": [
|
|
1021
|
+
[
|
|
1022
|
+
"55f84c7bfb7c121e"
|
|
1023
|
+
]
|
|
1024
|
+
]
|
|
1025
|
+
},
|
|
892
1026
|
{
|
|
893
1027
|
"id": "eb734b7121195eba",
|
|
894
1028
|
"type": "hb-event",
|