Integration with Amazon Echo

If you have a feature you'd like to see in Indigo, post it here. Others can refine the idea if they like. Please keep each topic to one feature or a closely related set of features and don't add other unrelated requests to an existing topic. Use the Hardware Support Requests forum below to request support for some bit of hardware - but be sure to check the 3rd Party Plugins Forum first though to make sure there isn't already a plugin for it.
DVDDave
Posts: 490
Joined: Sun Feb 26, 2006 6:33 pm
Location: San Jose, CA

Re: Integration with Amazon Echo

Post by DVDDave »

jay (support) wrote:We just added a blog post that discusses the Amazon Echo and Indigo.
Excellent writeup, Jay! My Echo is working great with Indigo right now but I agree that it takes quite a bit of effort and understanding to get it there. Looking forward to a more turn-key solution eventually.
chomicz
Posts: 3
Joined: Tue Nov 03, 2015 11:56 pm

Re: Integration with Amazon Echo

Post by chomicz »

Almost got this working... anyone know what I'm missing? I can see in the log `output that its hitting my Indigo server address, but without the port number which I did include in the index.js file. Here is part of the log output:
Making request: http://69.17.20.178/devices/Living%20Ro ... method=put
2015-11-04T05:49:48.997Z dc05031f-82b7-11e5-8f29-81fe792d6dc0 Unexpected exception Error: Cannot find module 'request-digest'

here is the general error:

{
"errorMessage": "Cannot find module 'request-digest'",
"errorType": "Error",
"stackTrace": [
"Function.Module._resolveFilename (module.js:338:15)",
"Function.Module._load (module.js:280:25)",
"Module.require (module.js:364:17)",
"require (module.js:380:17)",
"makeRequest (/var/task/index.js:201:25)",
"setDevice (/var/task/index.js:157:5)",
"ASKIndigo.intentHandlers.DeviceChangeIntent (/var/task/index.js:82:9)",
"AlexaSkill.eventHandlers.onIntent (/var/task/AlexaSkill.js:51:27)",
"AlexaSkill.requestHandlers.IntentRequest (/var/task/AlexaSkill.js:14:37)",
"AlexaSkill.execute (/var/task/AlexaSkill.js:91:24)"
]
}

Any help would be appreciated.

Mike
spiv
Posts: 190
Joined: Tue Jul 15, 2014 2:25 pm

Re: Integration with Amazon Echo

Post by spiv »

I think it is great that Indigo is looking at trying to develop an official integration with Amazon Echo. I've read the blog post by Jay about the OAuth challenges in trying to work with the Echo and it does bring to mind the related issue that Indigo Web Server only supports basic authentication and does not have any user login capability, even on the local LAN. So there is a little bit of irony in Indigo complaining about the lack of authorization/login support in the Echo when Indigo has been in the same position.

This has been a feature request for a long time to enable guest access and general use of the Indigo Web interface from multiple front-end devices without having to use the primary administrators login/password.

I would humbly suggest fixing this long-standing request would probably be easier and help more people than the more complex Amazon Echo situation.

There are so many interesting integrations that could be done with Indigo if the REST/web server interface supported proper multiple user login/authentication credentials.

I do recall that some experts have succeeded in creating a solution using another web server acting as a proxy between the web clients and the Indigo server, but this "man-in-the-middle" setup is very complex and not something most of us can, or want, to tackle.
User avatar
jay (support)
Site Admin
Posts: 19232
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: Integration with Amazon Echo

Post by jay (support) »

Your theory has a variety of problems.

First, Indigo does support HTTP DIGEST authentication (not basic), which is synonymous with a login. A single login, granted, but a login regardless. Allowing multiple users has absolutely nothing to do with OAuth. And our problem with the Alexa API is not about it's lack of login support (which OAuth provides) but rather it's lack of any kind of config UI and how OAuth breaks our security model.

Second, implementing OAuth or multiple logins in the Indigo server would not solve the Echo integration issue. If you read the blog post carefully, there is no way to authenticate against a user-defined URL (i.e. each user's Indigo Server) - you can only hardcode the server to authenticate against in the Alexa skill. This would mean that the authentication credentials reside in a server hosted by us which would break our security model.

Third, there are plenty of interesting REST integrations using the standard HTTP DIGEST authentication - there are several out there already including Roomie, Home Remote, HomeBridge, etc. None of which are particularly hampered based on the lack of multiuser support.

So in summary, trying to tie the Echo integration issues to our lack of multiple users is just fallacious. They are separate issues that, other than falling under the general category of "authentication", have nothing to do with each other. Let's keep this conversation on topic: Integrating with Amazon Echo.
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
chomicz
Posts: 3
Joined: Tue Nov 03, 2015 11:56 pm

Re: Integration with Amazon Echo

Post by chomicz »

Do I need to install a request-digest file. Where can I find this module?

So close, yet so far.

Please!
chomicz wrote:Almost got this working... anyone know what I'm missing? I can see in the log `output that its hitting my Indigo server address, but without the port number which I did include in the index.js file. Here is part of the log output:
Making request: http://69.17.20.178/devices/Living%20Ro ... method=put
2015-11-04T05:49:48.997Z dc05031f-82b7-11e5-8f29-81fe792d6dc0 Unexpected exception Error: Cannot find module 'request-digest'

here is the general error:

{
"errorMessage": "Cannot find module 'request-digest'",
"errorType": "Error",
"stackTrace": [
"Function.Module._resolveFilename (module.js:338:15)",
"Function.Module._load (module.js:280:25)",
"Module.require (module.js:364:17)",
"require (module.js:380:17)",
"makeRequest (/var/task/index.js:201:25)",
"setDevice (/var/task/index.js:157:5)",
"ASKIndigo.intentHandlers.DeviceChangeIntent (/var/task/index.js:82:9)",
"AlexaSkill.eventHandlers.onIntent (/var/task/AlexaSkill.js:51:27)",
"AlexaSkill.requestHandlers.IntentRequest (/var/task/AlexaSkill.js:14:37)",
"AlexaSkill.execute (/var/task/AlexaSkill.js:91:24)"
]
}

Any help would be appreciated.

Mike
akimball
Posts: 571
Joined: Wed Aug 07, 2013 1:26 pm
Location: Sandy, Utah

Re: Integration with Amazon Echo

Post by akimball »

Still just starting to swim through this... as a Mac guy, I want to use Siri... not Alexa. Maybe it would work something like "Hey Siri... tell Alexa to turn off the lights." ;)
-Al
polycron
Posts: 100
Joined: Sun Jan 08, 2006 10:22 am

Re: Integration with Amazon Echo

Post by polycron »

Wouldn't it be "Siri, ask Alexa to ask Indigo to turn on the lights?" :) lol

Jeff
DVDDave
Posts: 490
Joined: Sun Feb 26, 2006 6:33 pm
Location: San Jose, CA

Re: Integration with Amazon Echo

Post by DVDDave »

akimball wrote:Still just starting to swim through this... as a Mac guy, I want to use Siri... not Alexa. Maybe it would work something like "Hey Siri... tell Alexa to turn off the lights." ;)
You should probably hop on over the the "Homebridge for HomeKit hack" thread. For me, it works great with Siri and is faster and more reliable than Alexa, probably since the device names are totally in context and automatically discovered. In addition to slogging through the technical installation, I think you also need an Apple TV (3rd or 4th gen) to provide the HomeKit infrastructure. Just say "Hey Siri...turn off the lights" :D

--Dave
User avatar
mreyn2005
Posts: 161
Joined: Fri Oct 06, 2006 8:36 pm

Re: Integration with Amazon Echo

Post by mreyn2005 »

The build script should run

Code: Select all

npm install
and install a module called request-digest:

https://github.com/msreynolds/askIndigo ... uild.sh#L2

Matt
chomicz wrote:Do I need to install a request-digest file. Where can I find this module?

So close, yet so far.

Please!
chomicz wrote:Almost got this working... anyone know what I'm missing? I can see in the log `output that its hitting my Indigo server address, but without the port number which I did include in the index.js file. Here is part of the log output:
Making request: http://69.17.20.178/devices/Living%20Ro ... method=put
2015-11-04T05:49:48.997Z dc05031f-82b7-11e5-8f29-81fe792d6dc0 Unexpected exception Error: Cannot find module 'request-digest'

here is the general error:

{
"errorMessage": "Cannot find module 'request-digest'",
"errorType": "Error",
"stackTrace": [
"Function.Module._resolveFilename (module.js:338:15)",
"Function.Module._load (module.js:280:25)",
"Module.require (module.js:364:17)",
"require (module.js:380:17)",
"makeRequest (/var/task/index.js:201:25)",
"setDevice (/var/task/index.js:157:5)",
"ASKIndigo.intentHandlers.DeviceChangeIntent (/var/task/index.js:82:9)",
"AlexaSkill.eventHandlers.onIntent (/var/task/AlexaSkill.js:51:27)",
"AlexaSkill.requestHandlers.IntentRequest (/var/task/AlexaSkill.js:14:37)",
"AlexaSkill.execute (/var/task/AlexaSkill.js:91:24)"
]
}

Any help would be appreciated.

Mike
chomicz
Posts: 3
Joined: Tue Nov 03, 2015 11:56 pm

Re: Integration with Amazon Echo

Post by chomicz »

Thank you! Getting closer. But still have this problem:

Execution result: failed end ngIf: result.error (logs)
The area below shows the result returned by your function execution using the context methods. Learn more about returning results from your function.
{
"errorMessage": "Process exited before completing request"
}


Here is some detail:

Making request: http://69.17.20.178/devices/Living%20Ro ... method=put

2015-11-06T05:18:27.858Z ccaf52fc-8445-11e5-aee1-4b63fb2f1fec TypeError: Cannot call method 'indexOf' of undefined
at parseDigestResponse [as _parseDigestResponse] (/var/task/node_modules/request-digest/request-digest.js:104:54)
at handleResponse [as _handleResponse] (/var/task/node_modules/request-digest/request-digest.js:39:26)
at Request._callback (/var/task/node_modules/request-digest/request-digest.js:29:12)
at Request.self.callback (/var/task/node_modules/request/request.js:354:22)
at Request.emit (events.js:98:17)
at Request.<anonymous> (/var/task/node_modules/request/request.js:1207:14)
at Request.emit (events.js:117:20)
at IncomingMessage.<anonymous> (/var/task/node_modules/request/request.js:1153:12)
at IncomingMessage.emit (events.js:117:20)
at _stream_readable.js:944:16
END RequestId: ccaf52fc-8445-11e5-aee1-4b63fb2f1fec
REPORT RequestId: ccaf52fc-8445-11e5-aee1-4b63fb2f1fec Duration: 5239.28 ms Billed Duration: 5300 ms Memory Size: 128 MB Max Memory Used: 18 MB
Process exited before completing request


mreyn2005 wrote:The build script should run

Code: Select all

npm install
and install a module called request-digest:

https://github.com/msreynolds/askIndigo ... uild.sh#L2

Matt
chomicz wrote:Do I need to install a request-digest file. Where can I find this module?

So close, yet so far.

Please!
chomicz wrote:Almost got this working... anyone know what I'm missing? I can see in the log `output that its hitting my Indigo server address, but without the port number which I did include in the index.js file. Here is part of the log output:
Making request: http://69.17.20.178/devices/Living%20Ro ... method=put
2015-11-04T05:49:48.997Z dc05031f-82b7-11e5-8f29-81fe792d6dc0 Unexpected exception Error: Cannot find module 'request-digest'

here is the general error:

{
"errorMessage": "Cannot find module 'request-digest'",
"errorType": "Error",
"stackTrace": [
"Function.Module._resolveFilename (module.js:338:15)",
"Function.Module._load (module.js:280:25)",
"Module.require (module.js:364:17)",
"require (module.js:380:17)",
"makeRequest (/var/task/index.js:201:25)",
"setDevice (/var/task/index.js:157:5)",
"ASKIndigo.intentHandlers.DeviceChangeIntent (/var/task/index.js:82:9)",
"AlexaSkill.eventHandlers.onIntent (/var/task/AlexaSkill.js:51:27)",
"AlexaSkill.requestHandlers.IntentRequest (/var/task/AlexaSkill.js:14:37)",
"AlexaSkill.execute (/var/task/AlexaSkill.js:91:24)"
]
}

Any help would be appreciated.

Mike
ryanbuckner
Posts: 1409
Joined: Sat Oct 08, 2011 12:33 pm
Location: Northern Virginia
Contact:

Re: Integration with Amazon Echo

Post by ryanbuckner »

polycron wrote:Wouldn't it be "Siri, ask Alexa to ask Indigo to turn on the lights?" :) lol

Jeff
Wouldn't it be, "Siri, ask Alexa to ask Indigo to tell Insteon to turn on the lights?"

deeper?
polycron
Posts: 100
Joined: Sun Jan 08, 2006 10:22 am

Re: Integration with Amazon Echo

Post by polycron »

Hopefully a quick question:

I've been extremely successful in using the Skill creation to control Indigo with my Echo. Just for fun I tried the Hue bridge in conjunction to my Vera (which controls my door locks via Indigo) to see if I could bypass the "Alexa, ask Indigo" and just have Alexa directly control my lights. I've found that this method is extremely fast in comparison to the Skill option. Does anyone know why that would be? I'm currently using a hybrid of the two options since the Hue Bridge is much faster for controlling my lights and it allows me to use different names without having the need to rename my lights in indigo. I use the Skill for everything else since it is so much more powerful.

Do you think the speed issue using the Skill is due to the number of devices? Or the number of different iterations? I have multiple iterations for each device such as "Turn on the kitchen lights" and "Turn the kitchen lights on". Or is the difference just because a skill is being used versus the built in Home Control in the Echo?

Jeff
User avatar
jay (support)
Site Admin
Posts: 19232
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: Integration with Amazon Echo

Post by jay (support) »

My guess is the latter since Amazon would have optimized their Lighting API vs an external skill having to get dynamically loaded/started, etc.

But it's just a guess... ;)
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
User avatar
mreyn2005
Posts: 161
Joined: Fri Oct 06, 2006 8:36 pm

Re: Integration with Amazon Echo

Post by mreyn2005 »

polycron wrote:Hopefully a quick question:

I've been extremely successful in using the Skill creation to control Indigo with my Echo. Just for fun I tried the Hue bridge in conjunction to my Vera (which controls my door locks via Indigo) to see if I could bypass the "Alexa, ask Indigo" and just have Alexa directly control my lights. I've found that this method is extremely fast in comparison to the Skill option. Does anyone know why that would be? I'm currently using a hybrid of the two options since the Hue Bridge is much faster for controlling my lights and it allows me to use different names without having the need to rename my lights in indigo. I use the Skill for everything else since it is so much more powerful.

Do you think the speed issue using the Skill is due to the number of devices? Or the number of different iterations? I have multiple iterations for each device such as "Turn on the kitchen lights" and "Turn the kitchen lights on". Or is the difference just because a skill is being used versus the built in Home Control in the Echo?

Jeff
I think it is about the number of hops to make a complete request:

Native:
Echo* -> HUE hub on your lan -> hardware control

Skill:
Echo* -> AWS Lambda -> GoPrism -> Indigo -> hardware control

* There is still a call to Amazon servers to translate your speech to text, but its not the same step as hitting your own custom Lambda function with the translated text.

I've gotten my Skill round trip time down to about 2-3 seconds, especially for frequently used commands (seems there is some caching involved somewhere). One thing that really seemed to help with Indigo's speed (in general) was having a UPS on my electrical system. I believe this helps with insteon signal attenuation, by filtering out noise.

When the native API can do more, I will make another version to take advantage of it. I agree, it is and should be faster.

Matt
protean
Posts: 13
Joined: Wed Feb 15, 2006 10:12 am

Re: Integration with Amazon Echo

Post by protean »

I'm not an expert on anything but I do like to figure things out. Was able to get the Amazon Echo HA Bridge to work extremely well with Indigo. The only issue I have is spaces in the names of devices or action groups but the work around works great until me or someone can find a better way.

Big thumbs up to the Amazon Echo ha Bridge project!
https://github.com/armzilla/amazon-echo-ha-bridge
Post Reply

Return to “Feature Requests”