Integration with Amazon Echo

Posted on
Tue Aug 18, 2015 10:10 pm
DVDDave offline
Posts: 470
Joined: Feb 26, 2006
Location: San Jose, CA

Re: Integration with Amazon Echo

Yep. I guess I could back out all the changes I made to use https although I would rather not. Any other suggestions? Does the error I'm getting suggest that is actually the problem?

Posted on
Thu Aug 20, 2015 9:06 pm
DVDDave offline
Posts: 470
Joined: Feb 26, 2006
Location: San Jose, CA

Re: Integration with Amazon Echo

mreyn2005 wrote:
Is your https endpoint using a self-signed cert? AmazonWS might not like that...

Matt


I think you're right about the self signed cert. Apparently, it can be done using https but not lambda. In any event, I got it working with http so I'm good to go. Now I have to deal with the upper case issue (which all of my devices and actions are) and try to get Alexa to speak phrases related to data returned from Indigo.

Thanks for this great capability, Matt!

--Dave

Posted on
Fri Aug 21, 2015 8:59 am
mreyn2005 offline
User avatar
Posts: 161
Joined: Oct 06, 2006

Re: Integration with Amazon Echo

DVDDave wrote:
Any other suggestions?

My solution was to pay $29 and use Go Prism. Easy enough. But I totally understand that might not work for some people for any variety of reasons.

I will try my best to tackle the Upper Case issue this weekend, its documented here: https://github.com/msreynolds/askIndigo/issues/1

Glad you got it working! I too enjoy this capability.

Matt

Posted on
Fri Aug 21, 2015 9:18 am
DVDDave offline
Posts: 470
Joined: Feb 26, 2006
Location: San Jose, CA

Re: Integration with Amazon Echo

mreyn2005 wrote:
...I will try my best to tackle the Upper Case issue this weekend, its documented here: https://github.com/msreynolds/askIndigo/issues/1...
Matt

Cool! I got Alexa to speak variables as well by isolating the variable value from the returned body text. Indigo's requirement for no spaces in variable names makes tricky. Looking forward to seeing what you come up with. Let me know if you want my code for handling variables. Pretty easy to do although it may get tricky reintegrating my changes as you add functions as well.

I was also having trouble with spoken commands turning devices off but not on even though the test worked. I played around with the sample utterances without really changing anything and it seems to work. I think there may be a bug in the AWS stuff.

Lots of fun!

--Dave

Posted on
Fri Aug 21, 2015 9:36 am
manoncloud9 offline
Posts: 75
Joined: Apr 27, 2014
Location: Minneapolis MN

Re: Integration with Amazon Echo

Matt,

Really appreciate the plug in and the work you have done. It would be great to Alexa respond with stuff like variables or status of devices. Is that something you are going to add in? I would be a vote for adding it in.

Thanks again, As was mentioned before if there is a way to donate to you for your time and effort let me know.

Joe

Posted on
Fri Aug 21, 2015 10:22 am
mreyn2005 offline
User avatar
Posts: 161
Joined: Oct 06, 2006

Re: Integration with Amazon Echo

All,
I was also having trouble with spoken commands turning devices off but not on even though the test worked.

Make sure your Intent Schema contents are up to date. I had a bug in v1 of that schema, which caused On commands to not come through properly.

Let me know if you want my code for handling variables.

Sure, that would help/save me some time. There are all sorts of uses for this kind of logic. Even when Indigo can't find a device by the name given, it still responds with an HTTP 200. So pulling out data from the response would be very useful for enhancing the natural language interface.

It would be great to Alexa respond with stuff like variables or status of devices. Is that something you are going to add in?

Sure, I use variables for my current energy use in KWh via The Energy Detective. It would be fun to ask Alexa what the current KWh value is, etc.

Variable values:
https://github.com/msreynolds/askIndigo/issues/4

Device status':
https://github.com/msreynolds/askIndigo/issues/5

Until I can publish a more formal version in the Skill's app store, I will only accept payments in the form of street cred. :mrgreen:

Thanks!
Matt

Posted on
Fri Aug 21, 2015 12:09 pm
DVDDave offline
Posts: 470
Joined: Feb 26, 2006
Location: San Jose, CA

Re: Integration with Amazon Echo

Make sure your Intent Schema contents are up to date. I had a bug in v1 of that schema, which caused On commands to not come through properly...

I think I was using the latest version. It was the one included in the recent downloaded repository zip file. I don't know what the bug was, but I don't think that is the issue. I got it working by adding a different utterance and reordering the utterances. That should not have made any difference since the original utterance then started working with no change.

For completeness, this is the schema file that I am using, including my variable handling stuff. The DeviceChangeIntent should be a direct lift from your schema file.

(I sent you a PM on the other issue we're discussing.)

Thanks.

--Dave

{
"intents":
[
{
"intent": "RunActionIntent",
"slots": [
{
"name": "ActionName",
"type": "LITERAL"
}
]
},
{
"intent": "DeviceChangeIntent",
"slots": [
{
"name": "Device",
"type": "LITERAL"
},
{
"name": "Binary",
"type": "LITERAL"
},
{
"name": "Numerical",
"type": "NUMBER"
},
{
"name": "Percent",
"type": "NUMBER"
}
]
},
{
"intent": "GetVariableIntent",
"slots": [
{
"name": "VariableName",
"type": "LITERAL"
}
]
}
]
}

Posted on
Sat Aug 22, 2015 3:54 pm
mreyn2005 offline
User avatar
Posts: 161
Joined: Oct 06, 2006

Re: Integration with Amazon Echo

Ok, so I fixed issues #1 and #4 today.

Update to the latest and do the song and dance. Pretty much everything needs to be updated in the amazonian portals (intent schema, utterances, askIndigo.zip) for these updates.

Issue #1: Device naming convention
FYI, this config applies to Action and Variable names as well!! I presume most people would use the same convention for all the things...
I added the following config variables:
Code: Select all
var upperCaseFirstLetter = false; // set this to true if you use Upper Case Device Names.  Leave this false if you use lower case device names
var spaceBetweenWords = true;      //default
var dashBetweenWords = false;       //untested, let me know
var underscoreBetweenWords = false;      //untested, let me know

Issue #2: Variable support
Added utterances such as:
Code: Select all
GetVariableIntent what is {current energy use|VariableName}
GetVariableIntent what is the {current energy use|VariableName}
GetVariableIntent what is {current energy use|VariableName} value
GetVariableIntent what is the {current energy use|VariableName} value
GetVariableIntent get value for {current energy use|VariableName}
GetVariableIntent get the value for {current energy use|VariableName}
GetVariableIntent get the value for the {current energy use|VariableName}
GetVariableIntent what is the value for {current energy use|VariableName}
GetVariableIntent what is the value for the {current energy use|VariableName}

GetVariableIntent are the {sprinklers enabled|VariableName}
GetVariableIntent get value for {sprinklers enabled|VariableName}
GetVariableIntent get the value for {sprinklers enabled|VariableName}
GetVariableIntent what is the value for {sprinklers enabled|VariableName}


Thanks to DVDDave for his supporting code. I will add support for requesting device status when I get some more free time.

Let me know if you guys see any bugs! Thanks
Matt

Posted on
Sat Aug 22, 2015 4:01 pm
JustJack offline
Posts: 53
Joined: Feb 16, 2013
Location: Ca

Re: Integration with Amazon Echo

Matt, Have you see yesterdays post on the Alexa blog? They announced a new Alexa Lighting API. You no longer will need to say
"Alexa ask indigo to turn on my kitchen light" instead you just say
"Alexa turn my kitchen light on"

It's a step in the right direction toward fully integrating our home automation with voice control. They do device discovery and support creating device groups just like they do for Wink, WiMo, Samsung SmartThings, and Hue.

Take a look at the announcement here: https://developer.amazon.com/public/com ... ghting-API

You still need to build and define a new skill adaptor that talks to your automation server but it looks pretty straightforward .

Jack

Posted on
Sat Aug 22, 2015 10:25 pm
JustJack offline
Posts: 53
Joined: Feb 16, 2013
Location: Ca

Re: Integration with Amazon Echo

I got my Echo a few days ago and I've been playing with Matt's Skill. I have pretty much got everything working. :D :D :D

Thanks Matt for all the work you have put into this.

Jack

Posted on
Sat Aug 22, 2015 11:35 pm
DVDDave offline
Posts: 470
Joined: Feb 26, 2006
Location: San Jose, CA

Re: Integration with Amazon Echo

I've had lots of luck with Matt's new version, including a few suggested changes that I sent to him. Works with all my actions and devices without renaming them. I still have some work to do with variables where I was not so consistent in naming them.

I was surprised to discover that Alexa generalizes commands beyond was is literally included as sample utterances. For instance, I have an utterance to turn on the family room light and discovered that she responded to turn on the entry light as well. I knew this was the case for numbers but did not know it applies to literals as well. Pretty cool except it leads to misinterpretations. For instance, I asked Alexa to "Get Test" for a variable that I did not define in a GetVariableIntent. She responded consistently by executing an action called Test. This was especially surprising since "Get" is not a lead in word for an Action intent.

I could make sure my devices, actions, and variables all have different names. However, for safety sake, it would be nice if the GetVariableIntent was given precedence, especially for keywords that only exist for that intent. Does anyone have some insight into how this is supposed to work or what can be done to refine it?

Thanks.

--Dave

Posted on
Sat Aug 22, 2015 11:59 pm
DVDDave offline
Posts: 470
Joined: Feb 26, 2006
Location: San Jose, CA

Re: Integration with Amazon Echo

DVDDave wrote:
...Does anyone have some insight into how this is supposed to work or what can be done to refine it?

Ah, I found at least part of an answer. Creating multiple utterances for the desired leadin makes it a priority. For example, I created 10 samples of Get VariableName and now Get Test gets the variable instead of executing the action.

Any other insights?

Posted on
Sun Aug 23, 2015 10:50 am
mreyn2005 offline
User avatar
Posts: 161
Joined: Oct 06, 2006

Re: Integration with Amazon Echo

JustJack,
You no longer will need to say
"Alexa ask indigo to turn on my kitchen light" instead you just say
"Alexa turn my kitchen light on"

Earlier in this thread, the alternative approach was to run your own HA emulator for the Wink/WeeMo/Hue stuff, which is what allows Alexa to forego a specific skill call sign:

From page 2 of this thread:
One of my colleagues is contributing to this:

https://github.com/armzilla/amazon-echo-ha-bridge

Set up a fake Hue hub, listen for echo hue commands, forward to Indigo. I'll have an Echo on Tuesday to test it.

Similar to this, Amazon is now releasing the ability for these common systems into its own native API. I really hope they keep adding more... I too agree that this is the most desired approach, as it further simplifies the natural language interface. I need to do some more investigation into what the amazon-echo-ha-bridge project supports... When amazon adds other HA API's to go along side the Lighting API, or the amazon-echo-ha-bridge project supports these additional HA aspects, I will probably go down that road for version 2 of this software. Right now, both of these approaches seem limited to Lighting/On/Off commands only. Until those API's or projects are equally as expressive as what we have now, I will be hard pressed to split my time/focus. But we'll head that direction eventually.

3. Did you see anything in the documentation that would suggest that the Echo could identify one user from another? It would be nice if my wife said "play my music" it would play a default playlist that she likes and when I said the same thing, it would know who uttered the command and play my playlist.

I just saw this. Looks like there is support (to what degree, I'm not sure) for multiple profiles. JustJack was asking if the Echo could recognize users to play from their own music collections when using the same music playback commands. I don't think this is quite on par with that description but its pointed in that direction at least...

Thanks for the positive feedback and for pointing out the latest announcement for the Lighting API. Keep me honest here (on this thread) as I don't always catch that stuff (I did not catch the Lighting API post otherwise). When its all out there, version 2 will be in progress...

DVDDave,

Ah, I found at least part of an answer. Creating multiple utterances for the desired leadin makes it a priority. For example, I created 10 samples of Get VariableName and now Get Test gets the variable instead of executing the action.

Any other insights?


Simply put, more sample utterances equals better results. In fact, I would suggest an exhaustive approach. I know that might mean a LOT of samples for people with many devices, actions, and variables, but that is how Alexa learns the domain for your skill. And its mostly limited to a one-time cost. I guess if people want to make pull requests into my project to simply add their utterances, we could get a large crowd-sourced set, which would probably work the best, even if some of the utterances would not apply to everyone's setup. Then people could assemble the desired portions to maximize the applicable phrasings and achieve 99% accuracy. Have at thee!

Matt

Posted on
Sun Aug 23, 2015 11:56 am
mreyn2005 offline
User avatar
Posts: 161
Joined: Oct 06, 2006

Re: Integration with Amazon Echo

People,
I just put in some more bug fixes for the changes I made yesterday. Thanks to DVDDave for the code review :mrgreen:

Only thing you need to update is the zip file (changes were to index.js).

Matt

Posted on
Wed Aug 26, 2015 4:33 pm
manoncloud9 offline
Posts: 75
Joined: Apr 27, 2014
Location: Minneapolis MN

Re: Integration with Amazon Echo

Here is my attempt to help to contribute to this topic. From discussions on this topic the more Utterance samples we have configured the more reliable the results are. I created an Excel workbook that will generate the utterance samples based on your list of devices and sample utterance pre and post texts (this will make sense when you look at the spread sheets in the workbook. I have a spreadsheet for each utterance type (Action, Device action, Device Status) that creates a text file that creates the examples to copy and paste into the configuration of the Alexa Skill.
I have used the first row in the spreadsheet to give the simple instructions. Basically you add your device names to the Device column and the pre and post texts in the corresponding columns. Then you fill in the number of devices in a cell and the number of pre-post texts in another cell. These are used to loop as you can guess. There is a column that gives you a preview of the sample utterance (be careful the formula is not tied to the code that creates the file, so changing the formula does not change the outcome in the file) then you hit the button and it creates the file.
I have a zip file with the workbook and the three files it creates.
Hope this helps out – it will for me. I am traveling for work and I did this on a plane and have not tested. Please feel free to let me know of errors or if you expand this simple tool.
Joe

OK I can not attach a ZIp or Excell file - Matt can I send this to you to put on your github site if you think it has value

Page 7 of 24 1 ... 4, 5, 6, 7, 8, 9, 10 ... 24

Who is online

Users browsing this forum: No registered users and 9 guests