homebridge-alexa 0.5.48

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/Roadmap.md ADDED
@@ -0,0 +1,42 @@
1
+ ## awsLambda - Alexa HomeSkill Lambda Function
2
+
3
+ ## awsWebsite - Skill linking website
4
+
5
+ * [x] Implement message routing to homebridge instance
6
+ * [ ] Enable MQTTS
7
+ * [ ] Automate SSL Cert renewal process
8
+ * [x] Automate DNS link process
9
+ * [x] Implement Alexa Events and Proactive reporting for Home Skills
10
+ * [x] Clean up logging, way too noisy
11
+ * [x] Move to real DNS name
12
+
13
+ ## Homebridge-Alexa plugin
14
+
15
+
16
+ ### Other Backlog items
17
+
18
+ * [x] Fix endpoint id AID and IID change issues
19
+ * [x] Increase level of documentation
20
+
21
+
22
+ ## HAPNode-JS
23
+
24
+ * [x] Determine method for accessing accessories and accessory events in HAPNode-JS
25
+
26
+ ### HomeKit Device Support
27
+
28
+ * [x] Lightbulb Color and Color Temperature
29
+ * [x] Outlet
30
+ * [x] Switch
31
+ * [x] Fan
32
+ * [x] Window Covering
33
+ * [x] Temperature Sensor
34
+ * [x] Fan 2 aka Dyson
35
+ * [x] Garage Door as a Light bulb
36
+ * [x] Valve as a sprinkler
37
+ * [x] Yamaha Receiver as a Speaker
38
+ * [x] Apple TV as a PlaybackController
39
+ * [x] Thermostat
40
+ * [x] Motion Sensor
41
+ * [x] Contact Sensor
42
+ * [ ] Camera - Needs more research and a Echo Show
@@ -0,0 +1,216 @@
1
+ **Troubleshooting Tips**
2
+
3
+ <!--ts-->
4
+ * [Initial Setup](#initial-setup)
5
+ * [[Alexa] ERROR: ( homebridge-alexa) Login to homebridge.ca failed, please validate your credentials in config.json and restart homebridge.](#alexa-error--homebridge-alexa-login-to-homebridgeca-failed-please-validate-your-credentials-in-configjson-and-restart-homebridge)
6
+ * [- Bad login or password in your config.json for <a href="https://www.homebridge.ca" rel="nofollow">https://www.homebridge.ca</a>](#--bad-login-or-password-in-your-configjson-for-httpswwwhomebridgeca)
7
+ * [[Alexa] ERROR: ( homebridge-alexa) You have an issue with your installation, please review the README.](#alexa-error--homebridge-alexa-you-have-an-issue-with-your-installation-please-review-the-readme)
8
+ * [- Cloud Server DDOS Protection has blocked your IP address](#--cloud-server-ddos-protection-has-blocked-your-ip-address)
9
+ * [- Multiple copies of homebridge-alexa on your network](#--multiple-copies-of-homebridge-alexa-on-your-network)
10
+ * [- VPN Software interfering with homebridge-alexa to homebridge.ca communications](#--vpn-software-interfering-with-homebridge-alexa-to-homebridgeca-communications)
11
+ * [[Alexa] ERROR: ( homebridge-alexa) Stopping Home Skill connection due to excessive reconnects, please review the README.](#alexa-error--homebridge-alexa-stopping-home-skill-connection-due-to-excessive-reconnects-please-review-the-readme)
12
+ * [[Alexa] WARNING: Duplicate device name xxxxx](#alexa-warning-duplicate-device-name-xxxxx)
13
+ * [Initial Setup Messages from DEBUG mode](#initial-setup-messages-from-debug-mode)
14
+ * [alexaHAP HAP Discover failed ... is not running in insecure mode](#alexahap-hap-discover-failed--is-not-running-in-insecure-mode)
15
+ * [HAP Discover failed ..... error code 470](#hap-discover-failed--error-code-470)
16
+ * [Upgraded from old version and am seeing this error message](#upgraded-from-old-version-and-am-seeing-this-error-message)
17
+ * [[Alexa] ERROR: HAP Discovery failed, please review config](#alexa-error-hap-discovery-failed-please-review-config)
18
+ * [alexaLocal ERROR: connect ECONNREFUSED 35.169.132.61:1883 -&gt; ECONNREFUSED](#alexalocal-error-connect-econnrefused-35169132611883----econnrefused)
19
+ * [alexaLocal error { Error: connect ECONNREFUSED 35.169.132.61:8883](#alexalocal-error--error-connect-econnrefused-35169132618883)
20
+ * [Device Discovery](#device-discovery)
21
+ * [Device discovery fails and the plugin logs show no issues.](#device-discovery-fails-and-the-plugin-logs-show-no-issues)
22
+ * [Device discovery fails, and this message is in the logs ERROR: Empty accessory name, parsing failed.](#device-discovery-fails-and-this-message-is-in-the-logs-error-empty-accessory-name-parsing-failed)
23
+ * [Device discovery fails, and this message is in the logs ERROR: Maximum devices/accessories of 300 exceeded.](#device-discovery-fails-and-this-message-is-in-the-logs-error-maximum-devicesaccessories-of-300-exceeded)
24
+ * [Device discovery fails, and this message is in the logs ERROR: Parsing failed, duplicate endpointID.](#device-discovery-fails-and-this-message-is-in-the-logs-error-parsing-failed-duplicate-endpointid)
25
+ * [After restarting homebridge Alexa can't find devices and needs to discover them again. Or you have duplicate devices in Alexa](#after-restarting-homebridge-alexa-cant-find-devices-and-needs-to-discover-them-again--or-you-have-duplicate-devices-in-alexa)
26
+ * [Controlling devices](#controlling-devices)
27
+ * [[Alexa] PowerController TurnOff 192.168.1.226 51826 undefined Error: Homebridge auth failed, invalid PIN](#alexa-powercontroller-turnoff-1921681226-51826-undefined-error-homebridge-auth-failed-invalid-pin)
28
+ * [Event error messages](#event-error-messages)
29
+ * [[Alexa] WARNING: ( homebridge-alexa) Dropped event message, message rate too high.](#alexa-warning--homebridge-alexa-dropped-event-message-message-rate-too-high)
30
+ * [ERROR: Error: getAccessToken No data Error: XXXXXXXXXX](#error--error-getaccesstoken-no-data-error-xxxxxxxxxx)
31
+ * [ERROR: Error: getAccessToken Token not found](#error--error-getaccesstoken-token-not-found)
32
+ * [Unsuccessful event message ( No event gateway token )](#unsuccessful-event-message--no-event-gateway-token-)
33
+ * [Successful event message being sent to Alexa](#successful-event-message-being-sent-to-alexa)
34
+ * [[Alexa] ERROR: Event gateway token refresh error: 400](#alexa-error--event-gateway-token-refresh-error-400)
35
+
36
+ <!-- Added by: sgracey, at: -->
37
+
38
+ <!--te-->
39
+
40
+ # Initial Setup
41
+
42
+ ## [Alexa] ERROR: ( homebridge-alexa) Login to homebridge.ca failed, please validate your credentials in config.json and restart homebridge.
43
+
44
+ ### - Bad login or password in your config.json for https://www.homebridge.ca
45
+
46
+ ## [Alexa] ERROR: ( homebridge-alexa) You have an issue with your installation, please review the README.
47
+
48
+ This message is triggered when the plugin repeatably has an issue connecting to the homebridge.ca cloud server. After 5 connection failures this message appears.
49
+
50
+ Known possible causes:
51
+
52
+ ### - Cloud Server DDOS Protection has blocked your IP address
53
+
54
+ If the cloud server detects multiple connection attempts from your IP address in a short period of time, the cloud service will prevent access from your IP Address for a few minutes. To recover from this condition you need to stop the plugin for 5 minutes, then start it again. Easiest method of clearing the issue is to turn off your RPI for 5 minutes, then turn it on again.
55
+
56
+ ### - Multiple copies of homebridge-alexa on your network
57
+ ### - VPN Software interfering with homebridge-alexa to homebridge.ca communications
58
+
59
+ Please note, this message appears every 5 times the skill needs to reconnect to the skill cloud backend, so the message may occasionally appear.
60
+
61
+ ## [Alexa] ERROR: ( homebridge-alexa) Stopping Home Skill connection due to excessive reconnects, please review the README.
62
+
63
+ Due to configuration or other issues
64
+
65
+ ## [Alexa] WARNING: Duplicate device name xxxxx
66
+
67
+ Some of your devices have duplicate names, and will need to be edited and the Alexa App before using.
68
+
69
+ # Initial Setup Messages from DEBUG mode
70
+
71
+ ## alexaHAP HAP Discover failed ... is not running in insecure mode
72
+
73
+ ```
74
+ alexaHAP HAP Discover failed Bart-Dev http://192.168.1.231:51826 homebridge is not running in insecure mode with -I
75
+ ```
76
+
77
+ Your homebridge instance is running without the -I option set.
78
+
79
+ ## HAP Discover failed ..... error code 470
80
+
81
+ These are other HomeKit devices on your network, that are not compatible with homebridge-alexa. These errors can be ignored.
82
+
83
+ ```
84
+ alexaHAP HAP Discover failed Philips hue - 6C4C68 http://192.168.2.38:8080 error code 470 +282ms
85
+ alexaHAP HAP Discover failed iDevices Switch http://192.168.2.2:80 error code 470 +61ms
86
+ ```
87
+
88
+ ## Upgraded from old version and am seeing this error message
89
+
90
+ ```
91
+ Mär 10 19:01:49 homebridge homebridge[8313]: /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/util/ssdp.js:216
92
+ Mär 10 19:01:49 homebridge homebridge[8313]: return (config.username)
93
+ Mär 10 19:01:49 homebridge homebridge[8313]: ^
94
+ Mär 10 19:01:49 homebridge homebridge[8313]: TypeError: Cannot read property 'username' of undefined
95
+ Mär 10 19:01:49 homebridge homebridge[8313]: at Object.getHueBridgeMac (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/util/ssdp.js:216:20)
96
+ Mär 10 19:01:49 homebridge homebridge[8313]: at _getUniqueid (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/util/hue.js:373:20)
97
+ ```
98
+
99
+ If you have upgraded from the non-skill version to the skill based version you need to tell Alexa to forget all your old devices.
100
+
101
+ ## [Alexa] ERROR: HAP Discovery failed, please review config
102
+
103
+ Possible causes:
104
+
105
+ 1 - Discovery of your homebridge instances failed, please confirm that you have added the -I to the homebridge command line.
106
+
107
+ 2 - Discovery is working, but you don't have any devices that are supported by homebridge-alexa.
108
+
109
+
110
+ ## alexaLocal ERROR: connect ECONNREFUSED 35.169.132.61:1883 -> ECONNREFUSED
111
+
112
+ Cloud Server DDOS Protection has blocked your IP address
113
+
114
+ If the cloud server detects multiple connection attempts from your IP address in a short period of time, the cloud service will prevent access from your IP Address for a few minutes. To recover from this condition you need to stop the plugin for 5 minutes, then start it again. Easiest method of clearing the issue is to turn off your RPI for 5 minutes, then turn it on again.
115
+
116
+ ## alexaLocal error { Error: connect ECONNREFUSED 35.169.132.61:8883
117
+
118
+ When message has port 8883, this error is a future expansion option, and can be ignored
119
+
120
+ ```
121
+ alexaLocal error { Error: connect ECONNREFUSED 35.169.132.61:8883
122
+ at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1191:14)
123
+ errno: 'ECONNREFUSED',
124
+ code: 'ECONNREFUSED',
125
+ syscall: 'connect',
126
+ address: '35.169.132.61',
127
+ port: 8883 } +179ms
128
+ alexaLocal offline +8ms
129
+ ```
130
+
131
+ This is for a future feature enhancement, and can be ignored.
132
+
133
+ # Device Discovery
134
+
135
+ ## Device discovery fails and the plugin logs show no issues.
136
+
137
+ 1 - Using just the website/app without an Alexa device does not work.
138
+
139
+ 2 - If device discovery is not working, and you have no errors. Trying relinking the skill in the Alexa App. To relink the skill, first 'Disable Skill', then 'Enable' skill.
140
+
141
+ In the plugin debug logs, when a discovery request is received by the plugin it looks like this
142
+
143
+ ```
144
+ [2018-3-12 19:10:33] [Alexa] alexaDiscovery - returned 36 devices
145
+ ```
146
+
147
+ ## Device discovery fails, and this message is in the logs `ERROR: Empty accessory name, parsing failed.`
148
+
149
+ Alexa requires each accessory to have a name, please update your plugin config so that every accessory has a name.
150
+
151
+ ## Device discovery fails, and this message is in the logs `ERROR: Maximum devices/accessories of 300 exceeded.`
152
+
153
+ Amazon only supports a maximum of 300 devices per skill. Please see further details here https://developer.amazon.com/docs/device-apis/alexa-discovery.html#response
154
+
155
+
156
+ ## Device discovery fails, and this message is in the logs `ERROR: Parsing failed, duplicate endpointID.`
157
+
158
+ The likely cause of this error is a duplicate accessory name. Please adjust your devices names in your plugins config.json.
159
+
160
+ ## After restarting homebridge Alexa can't find devices and needs to discover them again. Or you have duplicate devices in Alexa
161
+
162
+ Homebridge-Alexa needs to have a consistent port number for homebridge, please ensure your config.json for each homebridge instance contains a port number.
163
+
164
+ # Controlling devices
165
+
166
+ ## [Alexa] PowerController TurnOff 192.168.1.226 51826 undefined Error: Homebridge auth failed, invalid PIN
167
+
168
+ Your homebridge access pin is incorrect, please set the PIN as part of the config. See here
169
+
170
+ https://github.com/NorthernMan54/homebridge-alexa#optional-parameters
171
+
172
+ # Event error messages
173
+
174
+ ## [Alexa] WARNING: ( homebridge-alexa) Dropped event message, message rate too high.
175
+
176
+ Events from your contact or motion sensors are sending updates faster than the Alexa backend can handle. Maximum rate is 1 message every 10 seconds, any faster and the messages will be dropped and forwarded to Alexa.
177
+
178
+ ## ERROR: Error: getAccessToken No data Error: XXXXXXXXXX
179
+ ## ERROR: Error: getAccessToken Token not found
180
+
181
+ This occurs if your homebridge-alexa account is not enabled to send events. To enable your account for events, please disable the Alexa Homebridge skill and enable the skill again. This will register your account for events.
182
+
183
+ If your homebridge-alexa account was created after Feb 15, 2019, and your receiving this message, please raise an issue.
184
+
185
+ ### Unsuccessful event message ( No event gateway token )
186
+
187
+ ```
188
+ Feb 16 13:19:44 raj homebridge[2088]: 2019-02-16T18:19:44.123Z alexaActions Event {"host":"192.168.1.253","port":51826,"aid":13,"iid":16,"status":false}
189
+ Feb 16 13:19:44 raj homebridge[2088]: 2019-02-16T18:19:44.125Z alexaLocal Sending message {"context":{},"event":{"header":{"messageId":"e53c5dd3-b8a8-45e8-bb9a-b7f78e474baf","namespace":"Alexa","name":"ChangeReport","payloadVersion":"3"},"endpoint":{"endpointId":"Q0M6MjI6M0Q6RTM6Q0Y6MzItUmFqLVdTU0VOU09SLVBvcmNoIE1vdGlvbi0wMDAwMDA4NS0wMDAwLTEwMDAtODAwMC0wMDI2QkI3NjUyOTE="},"payload":{"change":{"cause":{"type":"PHYSICAL_INTERACTION"},"properties":[{"namespace":"Alexa.MotionSensor","name":"detectionState","value":"NOT_DETECTED","timeOfSample":"2019-02-16T18:19:44.123Z","uncertaintyInMilliseconds":500}]}}}}
190
+ Feb 16 13:19:46 raj homebridge[2088]: 2019-02-16T18:19:46.177Z alexaLocal Emitting System
191
+ Feb 16 13:19:46 raj homebridge[2088]: [2/16/2019, 1:19:46 PM] [Alexa] ERROR: Error: getAccessToken No data Error: Northern.Man54
192
+ ```
193
+
194
+ ### Successful event message being sent to Alexa
195
+
196
+ This is from my homebridge-wssensor plugin YMMV
197
+
198
+ ```
199
+ Feb 16 14:29:05 raj homebridge[2088]: Sat, 16 Feb 2019 19:29:05 GMT websocket on.message: ::ffff:192.168.1.13 { "Hostname": "NODE-2BA0FF", "Model": "BME-MS", "Version": "2.0", "Firmware": "2.1.0", "Data": { "Temperature": -1.68, "Humidity": 60.978, "Moisture": 0, "Status": 0, "Barometer": 998.206, "Dew": -8.22, "Motion": 1, "MotionStatus": 0 }}
200
+ Feb 16 14:29:05 raj homebridge[2088]: Sat, 16 Feb 2019 19:29:05 GMT EventedHTTPServer [::ffff:192.168.1.65] Sending HTTP event '13.10' with data: {"characteristics":[{"aid":13,"iid":10,"value":-1.6}]}
201
+ Feb 16 14:29:05 raj homebridge[2088]: Sat, 16 Feb 2019 19:29:05 GMT EventedHTTPServer [::ffff:192.168.1.253] Sending HTTP event '13.16' with data: {"characteristics":[{"aid":13,"iid":16,"value":true}]}
202
+ Feb 16 14:29:05 raj homebridge[2088]: Sat, 16 Feb 2019 19:29:05 GMT EventedHTTPServer [::ffff:192.168.1.65] Sending HTTP event '13.16' with data: {"characteristics":[{"aid":13,"iid":16,"value":true}]}
203
+ Feb 16 14:29:05 raj homebridge[2088]: Sat, 16 Feb 2019 19:29:05 GMT EventedHTTPServer [::ffff:192.168.1.70] Sending HTTP event '13.16' with data: {"characteristics":[{"aid":13,"iid":16,"value":true}]}
204
+ Feb 16 14:29:05 raj homebridge[2088]: Sat, 16 Feb 2019 19:29:05 GMT EventedHTTPServer [fe80::cd6:6862:b69f:44d2] Sending HTTP event '13.16' with data: {"characteristics":[{"aid":13,"iid":16,"value":true}]}
205
+ Feb 16 14:29:05 raj homebridge[2088]: 2019-02-16T19:29:05.098Z hapClient Event { host: '192.168.1.253',
206
+ Feb 16 14:29:05 raj homebridge[2088]: port: 51826,
207
+ Feb 16 14:29:05 raj homebridge[2088]: aid: 13,
208
+ Feb 16 14:29:05 raj homebridge[2088]: iid: 16,
209
+ Feb 16 14:29:05 raj homebridge[2088]: status: true }
210
+ Feb 16 14:29:05 raj homebridge[2088]: 2019-02-16T19:29:05.101Z alexaActions Event {"host":"192.168.1.253","port":51826,"aid":13,"iid":16,"status":true}
211
+ Feb 16 14:29:05 raj homebridge[2088]: 2019-02-16T19:29:05.107Z alexaLocal Sending message {"context":{},"event":{"header":{"messageId":"6efb7ccb-1720-4f79-9552-9c27f9b27bec","namespace":"Alexa","name":"ChangeReport","payloadVersion":"3"},"endpoint":{"endpointId":"Q0M6MjI6M0Q6RTM6Q0Y6MzItUmFqLVdTU0VOU09SLVBvcmNoIE1vdGlvbi0wMDAwMDA4NS0wMDAwLTEwMDAtODAwMC0wMDI2QkI3NjUyOTE="},"payload":{"change":{"cause":{"type":"PHYSICAL_INTERACTION"},"properties":[{"namespace":"Alexa.MotionSensor","name":"detectionState","value":"DETECTED","timeOfSample":"2019-02-16T19:29:05.103Z","uncertaintyInMilliseconds":500}]}}}}
212
+ ```
213
+
214
+ ## [Alexa] ERROR: Event gateway token refresh error: 400
215
+
216
+ Your event gateway authorization needs a manual refresh, this is required in order to utilize events from Motion and Contact sensors in routines. In the Amazon Alexa app, please "Disable Skill" and "Enable" the skill, and re-enter your password.
package/V1_README.md ADDED
@@ -0,0 +1,63 @@
1
+ # homebridge-alexa
2
+
3
+ Homebridge-Alexa is not your typical homebridge plugin, but a placeholder for my work to expose
4
+ homebridge controlled accessories to Amazon Alexa. This is a version of homebridge and hap-nodejs that enables
5
+ Amazon Alexa to discover accessories controlled and managed by homebridge. The discovery of homebridge devices
6
+ leverages the native support of Hue devices by Alexa, and does not require a skill to be installed on Alexa.
7
+
8
+ * Supports devices of homekit type Lightbulb, Outlet, and Switch. Others are not exposed.
9
+ * If device supports the 'Brightness', then the ability to set brightness is included.
10
+ * This does not have any devices or accessories that are visible from Homekit,
11
+ and does not need to be added on the Home app.
12
+ * This only works with real Amazon devices, and does not work with faux Amazon devices like Amazon AVS or AlexaPI
13
+ * Please note that this approach does not work the Amazon Echo 2nd generation launched in the fall of 2017.
14
+
15
+ # Installation
16
+
17
+ * To enable this capability please install this special version of Homebridge and HAP-NodeJS.
18
+
19
+ ```
20
+ sudo npm install -g --unsafe-perm https://github.com/NorthernMan54/homebridge
21
+ ```
22
+
23
+ # Configuration
24
+
25
+ * add a new setting "ssdp" to the bridge section of your homebridge config.json file. Value must be 1900. i.e
26
+
27
+ ```
28
+ "bridge": {
29
+ "name": "Howard",
30
+ "username": "CC:22:3D:E3:CE:31",
31
+ "port": 51826,
32
+ "pin": "031-45-154",
33
+ "ssdp": 1900
34
+ },
35
+ ```
36
+ * If the setting is not enabled, then your homebridge instance will not be visible to Alexa, useful when you have devices / plugins that you don't want Alexa to see. For example, Philips hue or Belkin wemo devices.
37
+
38
+ * Ask Alexa to Discover Devices. She take about 20 seconds to discover your devices.
39
+
40
+ # Voice commands supported
41
+
42
+ * Alexa, turn on the _______
43
+ * Alexa, turn off the _______
44
+ * Alexa, set ______ to number percent
45
+
46
+ # Known issues
47
+
48
+ * This only works with Real Amazon Alexa devices, any RaspberryPI based devices like AlexaPI are not supported.
49
+ * If you have hue devices and homebridge-hue, your hue devices will appear twice to Alexa. If you want to avoid this, setup a second instance of homebridge and move the homebridge-hue plugin to it, and don't enable this feature.
50
+ * Does not work with Amazon Fire TV or Echo 2nd Generation
51
+
52
+ # Troubleshooting / Issues
53
+
54
+ * I have created a slack channel at (https://homebridgeteam.slack.com/messages/hap-alexa/) to troubleshoot issues.
55
+ * To enable debug mode, please start homebridge in debug mode. ie
56
+ DEBUG=* homebridge
57
+ * For issues, please use the slack channel and post a debug log
58
+
59
+ # Credits
60
+
61
+ * dsandor/fauxmojs - For the NodeJS UPNP/SSDP module
62
+ * BWS Systems - For the inspiration around the Hue emulation based approach
63
+ * neruve - Testing of Amazon Fire TV