homebridge-alexa 0.6.4 → 0.6.6

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/CHANGELOG.md CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. This project uses [Semantic Versioning](https://semver.org/).
4
4
 
5
+ ## 0.6.6 (2023-07-07)
6
+
7
+ ## [Version 0.6.6](https://github.com/northernman54/homebridge-alexa/compare/v0.6.5...v0.6.6)
8
+
9
+ #### Changes
10
+
11
+ - Fix for issue #572, Issue with Heater/Cooler devices and alexa status request failing with an error.
12
+
13
+ ## 0.6.5 (2023-01-03)
14
+
15
+ ## [Version 0.6.4](https://github.com/northernman54/homebridge-alexa/compare/v0.6.4...v0.6.5)
16
+
17
+ #### Changes
18
+
19
+ - Fix for issue #551, which includes an alternate device naming approach that combines the HomeKit internal services names for an accessory to resolve some issues with duplicate device names. The new config option `mergeServiceName` enables this feature. This option if enabled is a break changing for existing implementations, and will cause existing devices to no longer be controllable by Alexa. You will need to remove the non-functioning devices from the Alexa App and ask Alexa to discover devices again to resolve.
20
+
5
21
  ## 0.6.4 (2023-01-03)
6
22
 
7
23
  ## [Version 0.6.4](https://github.com/northernman54/homebridge-alexa/compare/v0.6.3...v0.6.4)
package/Installation.md CHANGED
@@ -26,6 +26,7 @@ Installation and Configuration of Homebridge Alexa
26
26
  * [keepalive - Cloud Server Connection Keepalive](#keepalive---cloud-server-connection-keepalive)
27
27
  * [refresh - Accessory Cache Refresh Interval](#refresh---accessory-cache-refresh-interval)
28
28
  * [filter - Homebridge Instance Filter](#filter---homebridge-instance-filter)
29
+ * [mergeServiceName - Alternate device naming](#mergeservicename---alternate-device-naming)
29
30
  * [blind](#blind)
30
31
  * [door](#door)
31
32
  * [Speaker Settings](#speaker-settings)
@@ -40,7 +41,7 @@ Installation and Configuration of Homebridge Alexa
40
41
  * [Discover Devices](#discover-devices)
41
42
 
42
43
  <!-- Created by https://github.com/ekalinin/github-markdown-toc -->
43
- <!-- Added by: sgracey, at: Wed 11 Jan 2023 11:26:38 EST -->
44
+ <!-- Added by: sgracey, at: Fri 7 Jul 2023 10:05:41 EDT -->
44
45
 
45
46
  <!--te-->
46
47
 
@@ -306,6 +307,21 @@ sudo npm install -g homebridge-alexa
306
307
  ],
307
308
  ```
308
309
 
310
+ #### mergeServiceName - Alternate device naming
311
+ - An alternate device naming approach that combines the HomeKit internal services names for an accessory to resolve some issues with duplicate device names. This option if enabled is a break changing for existing implementations, and will cause existing devices to no longer be controllable by Alexa. You will need to remove the non-functioning devices from the Alexa App and ask Alexa to discover devices again to resolve.
312
+
313
+ ```
314
+ "platforms": [
315
+ {
316
+ "platform": "Alexa",
317
+ "name": "Alexa",
318
+ "username": "....",
319
+ "password": "....",
320
+ "mergeServiceName": true
321
+ }
322
+ ],
323
+ ```
324
+
309
325
  #### blind
310
326
  - Enables natural wording for opening and closing blinds, and window coverings. Not supported in all countries. Defaults to false
311
327
 
package/README.md CHANGED
@@ -19,7 +19,7 @@ For the subscription model, we have set this up with PayPal to start with, and w
19
19
  ## New Users
20
20
 
21
21
  For new users of the service, they will receive a trial account, with 7 days of service to test out the service and work thru any issues prior to a subscription being required to continue service. During the trial period users can apply for a subscription at any time, and it will be future dated to start on the trial period end date.
22
-
22
+
23
23
  # Availability
24
24
 
25
25
  Country availability - The plugin is available in these countries, English (AU), German (DE), English (CA), English (US), French (FR), English (UK), Italian (IT), English (IN), Spanish (ES), Japanese (JP), Spanish(US), Portuguese (BR) and Spanish (MX).
@@ -46,6 +46,7 @@ Country availability - The plugin is available in these countries, English (AU),
46
46
  * [HomeKit/Homebridge Devices supported](#homekithomebridge-devices-supported)
47
47
  * [Native Support](#native-support)
48
48
  * [Supported as Other Types](#supported-as-other-types)
49
+ * [Non-Homebridge Devices](#non-homebridge-devices)
49
50
  * [Unsupported device types](#unsupported-device-types)
50
51
  * [Alexa Voice Commands](#alexa-voice-commands)
51
52
  * [Setup](#setup)
@@ -83,7 +84,7 @@ Country availability - The plugin is available in these countries, English (AU),
83
84
  * [Credits](#credits)
84
85
 
85
86
  <!-- Created by https://github.com/ekalinin/github-markdown-toc -->
86
- <!-- Added by: sgracey, at: Wed 11 Jan 2023 11:26:37 EST -->
87
+ <!-- Added by: sgracey, at: Fri 7 Jul 2023 10:05:40 EDT -->
87
88
 
88
89
  <!--te-->
89
90
 
@@ -109,7 +110,7 @@ Country availability - The plugin is available in these countries, English (AU),
109
110
 
110
111
  Alexa device names are the same as the homebridge device names.
111
112
 
112
- This only supports accessories connected via a homebridge plugin, any 'Homekit' accessories are not supported, and will never be supported.
113
+ This only supports accessories connected via a homebridge plugin, any 'Homekit' accessories are not supported, and will never be supported. See [Non-Homebridge Devices](#non-homebridge-devices)
113
114
 
114
115
  ## HomeKit/Homebridge Devices supported
115
116
 
@@ -136,6 +137,10 @@ This only supports accessories connected via a homebridge plugin, any 'Homekit'
136
137
  * Valves, Sprinklers and Shower Heads - Supported as a light bulb
137
138
  * Occupancy Sensors - Supported as a Contact Sensor
138
139
 
140
+ ### Non-Homebridge Devices
141
+
142
+ * `homebridge-alexa` only supports devices that are managed by the Homebridge instance. This means that HomeKit-supported devices that you add to your home via *only* HomeKit _will not be available to Alexa through this plugin_. You may wish to use the device manufacturer's app (if they have one) to link Alexa to the device(s) in duplicate to your existing HomeKit binding. Most devices are perfectly happy to be part of two worlds in this sense.
143
+
139
144
  ## Unsupported device types
140
145
 
141
146
  * Camera's ( for use with an Alexa show etc )
@@ -34,7 +34,7 @@
34
34
  * [[Alexa] ERROR: Event gateway token refresh error: 400](#alexa-error--event-gateway-token-refresh-error-400)
35
35
 
36
36
  <!-- Created by https://github.com/ekalinin/github-markdown-toc -->
37
- <!-- Added by: sgracey, at: Wed 11 Jan 2023 11:26:38 EST -->
37
+ <!-- Added by: sgracey, at: Fri 7 Jul 2023 10:05:40 EDT -->
38
38
 
39
39
  <!--te-->
40
40
 
@@ -71,6 +71,12 @@
71
71
  "functionBody": "return model.CloudTransport !== 'wss';"
72
72
  }
73
73
  },
74
+ "mergeServiceName": {
75
+ "title": "Alternate device naming approach",
76
+ "type": "boolean",
77
+ "description": "This is an alternate device naming approach, which combines the internal HomeKit names for a device. It may resolve duplicate device name issues. Do not enable on an existing implementation, as you will lose control of your existing devices.",
78
+ "placeholder": false
79
+ },
74
80
  "CloudTransport": {
75
81
  "title": "Cloud Server Connection Transport",
76
82
  "description": "Transport options for cloud server connection. MQTTS - this is the recommended setting. MQTT - this is the original/legacy option. WSS - this is the an alternative transport option.",
@@ -232,7 +238,8 @@
232
238
  "CloudTransport",
233
239
  "keepalive",
234
240
  "refresh",
235
- "filter"
241
+ "filter",
242
+ "mergeServiceName"
236
243
  ]
237
244
  },
238
245
  {
@@ -253,10 +253,11 @@ function _getActions(description, context, devices) {
253
253
  reportState.push(messages.reportState("Alexa.ThermostatControllerupperSetpoint", context));
254
254
  cookie["upperSetpoint"] = messages.cookie(context);
255
255
  // issue #312 - target setpoint missing from heater / cooler devices
256
- if (context.type === '000000BC') {
257
- reportState.push(messages.reportState("Alexa.ThermostatControllertargetSetpoint", context));
258
- cookie["targetSetpoint"] = messages.cookie(context);
259
- }
256
+ // Issue #572 - requesting status multiple times from the same iid triggers an error
257
+ // if (context.type === '000000BC') {
258
+ // reportState.push(messages.reportState("Alexa.ThermostatControllertargetSetpoint", context));
259
+ // cookie["targetSetpoint"] = messages.cookie(context);
260
+ // }
260
261
  break;
261
262
  case "Target Heater-Cooler State":
262
263
  case "Target Heater Cooler State":
@@ -20,7 +20,8 @@ function Homebridge(devices, context) {
20
20
  events: context.events,
21
21
  speakers: context.speakers,
22
22
  blind: context.blind,
23
- door: context.door
23
+ door: context.door,
24
+ mergeServiceName: context.mergeServiceName
24
25
  };
25
26
  this.playback = {};
26
27
  devices.accessories.accessories.forEach(function(element) {
@@ -17,9 +17,9 @@ function Service(devices, context) {
17
17
  // });
18
18
  this.iid = devices.iid;
19
19
  // Pre parser for Service overrides for services HomeKit doesn't support natively
20
- if (context.options.speakers && context.options.speakers.some(function(element) {
21
- return (element.manufacturer === context.info.Manufacturer && element.name === context.info.Name);
22
- })) {
20
+ if (context.options.speakers && context.options.speakers.some(function (element) {
21
+ return (element.manufacturer === context.info.Manufacturer && element.name === context.info.Name);
22
+ })) {
23
23
  this.type = "00000113"; // HomeKit Speaker service
24
24
  } else {
25
25
  this.type = devices.type.substring(0, 8);
@@ -47,10 +47,9 @@ function Service(devices, context) {
47
47
  break;
48
48
  default:
49
49
  // First pass to grab service names
50
- devices.characteristics.forEach(function(element) {
50
+ devices.characteristics.forEach(function (element) {
51
51
  if (element.type.substring(0, 8) === '00000023' && element.description === "Name") {
52
52
  // debug("context.info.Manufacturer %s -> %s -> %s", context.info.Manufacturer, context.name, element.value);
53
-
54
53
  // Fix for issue #218 - Nest devices with duplicate's
55
54
  if (element.value) {
56
55
  this.name = element.value;
@@ -66,13 +65,18 @@ function Service(devices, context) {
66
65
  // debug("Issue #284 Name %s - %s", element.value, context.info.Name);
67
66
  // debug("issue #284 Manufacturer %s -> %s -> %s", context.info.Manufacturer, context.name, element.value);
68
67
  this.EPname = context.name + " " + element.value;
68
+ } else if (this.options.mergeServiceName && context.name !== element.value) {
69
+ // Fix for #551
70
+ this.name = context.name + " " + element.value;
71
+ this.EPname = context.name + " " + element.value;
72
+ debug("mergeServiceName", this.name);
69
73
  }
70
74
 
71
75
  this.endpointID = Buffer.from(this.id + "-" + context.homebridge + "-" + context.info.Manufacturer + "-" + this.EPname + "-" + this.serviceType).toString('base64').replace(endpointReg, '#');
72
76
  }
73
77
  }.bind(this));
74
78
  // second pass to grab service names
75
- devices.characteristics.forEach(function(element) {
79
+ devices.characteristics.forEach(function (element) {
76
80
  if (element.type.substring(0, 8) === '00000023' && element.description === "Name") {
77
81
  // second pass, no need to grab names
78
82
  } else {
@@ -93,7 +97,7 @@ function Service(devices, context) {
93
97
  }
94
98
  }
95
99
 
96
- Service.prototype.toList = function(context) {
100
+ Service.prototype.toList = function (context) {
97
101
  var descriptions;
98
102
  var getCharacteristics;
99
103
  var putCharacteristics = [];
@@ -141,7 +145,7 @@ Service.prototype.toList = function(context) {
141
145
  }
142
146
  };
143
147
 
144
- Service.prototype.toCookie = function(characteristic, context, value) {
148
+ Service.prototype.toCookie = function (characteristic, context, value) {
145
149
  // debug("toCookie", this.characteristics[characteristic], characteristic, context);
146
150
  // var iid = this.characteristics[characteristic].iid;
147
151
  if (value === undefined) value = 1;
@@ -163,7 +167,7 @@ Service.prototype.toCookie = function(characteristic, context, value) {
163
167
  }
164
168
  };
165
169
 
166
- Service.prototype.toAlexa = function(context) {
170
+ Service.prototype.toAlexa = function (context) {
167
171
  var cookie = {};
168
172
  var capabilities = [];
169
173
  var reportState = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homebridge-alexa",
3
- "version": "0.6.4",
3
+ "version": "0.6.6",
4
4
  "description": "Control your Homebridge devices with Amazon Alexa.",
5
5
  "main": "plugin.js",
6
6
  "scripts": {
package/plugin.js CHANGED
@@ -40,6 +40,7 @@ function alexaHome(log, config, api) {
40
40
  this.deviceList = config['deviceList'] || []; // Use ea
41
41
  this.door = config['door'] || false; // Use mode controller for Garage Doors
42
42
  this.name = config['name'] || "Alexa";
43
+ this.mergeServiceName = config['mergeServiceName'] || false;
43
44
  this.CloudTransport = config['CloudTransport'] || "mqtts"; // Default to mqtts Transport
44
45
  this.LegacyCloudTransport = config['LegacyCloudTransport'] || false; // Default to new Transport ( Setting from discarded beta )
45
46
  var mqttKeepalive = config['keepalive'] || 5; // MQTT Connection Keepalive
@@ -138,6 +139,7 @@ alexaHome.prototype.didFinishLaunching = function () {
138
139
  deviceListHandling: this.deviceListHandling,
139
140
  deviceList: this.deviceList,
140
141
  door: this.door,
142
+ mergeServiceName: this.mergeServiceName,
141
143
  // Other Options
142
144
  events: this.events
143
145
  };