-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy pathStepByStepInstructions
172 lines (124 loc) · 8.68 KB
/
StepByStepInstructions
1
2
3
4
5
6
7
8
9
10
11
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
1. Download a zip file of all the contents provided in Git by clicking on the green
"Clone or download" button located at the upper right side of the file listing section
2. Unzip the contents of the downloaded zip file onto a folder in your computer as you
will be using and editing the text content of the files extracted in the directory
3. Create a free Amazon developer account via url "developer.amazon.com"
4. On the Amazon developer main page, click on the "Alexa" tab and select "Alexa Skills Kit"
5. Add a new skill using the following settings:
NOTE: Settings not mentioned below can be left as is
----------------------------------------------------------------------------
Skill Information
----------------------------------------------------------------------------
Skill Type : Custom Interaction Model
Name : <Your Own Custom Skill Name>
Invocation Name : <A Custom Device Name For Alexa to Recognize>
Example: Garage
NOTE:
In my experience, it is better to give the skill a single
word invocation name because it will shorten your command
instruction.
It is easier to say "Alexa, ask GARAGE to close" than to
say "Alexa, ask MY GARAGE to close"
----------------------------------------------------------------------------
Interaction Model
----------------------------------------------------------------------------
Intent Schema : <Paste the contents of the intent_schema.json file here>
Custom Slot Types: <Add a slot type using the following info>
Enter Type : DOOR_STATES
Enter Values : <Paste the contents of the door_states.txt file here>
Sample Utterances: <Paste the contents of the sample_utterances.txt file here>
----------------------------------------------------------------------------
Configuration
----------------------------------------------------------------------------
You will need an ARN to get pass this step so you will come back to this
step only after you have created your lambda function which will provide
the ARN information that you need. For now, proceed to step 6
------
6. Click on the "Skill Information" navigation link on the left side to navigate back to
the "Skill Information" section of the skill you are trying to create and copy the
"Application ID" of the skill onto a notepad as you will be needing it for the next step.
NOTE: If your application id is "amzn1.ask.skill.2dc3256e-f143-41a6-ab8f-194c3df2d789",
you only need to copy the section after "amzn1.ask.skill." which is
"2dc3256e-f143-41a6-ab8f-194c3df2d789"
7. Locate the folder that contains the extracted contents of the file downloaded in step 1
and edit the following contents of the "main.py" file in a text editor like "Notepad"
as shown below:
a. Replace the following keywords with your actual MyQ login credentials:
<MYQ_LOGIN_USERNAME> (NOTE: Replace entire string including <> to something like [email protected])
<MYQ_LOGIN_PASSWORD>
IMPORTANT: As of 18-FEB-2017, URL encoding the username and the password is no longer
a necessity and should not be done because it will cause login failures.
Please enter the username and password exactly the way you would enter
them in the MyQ app similar to the sample shown above.
b. Replace the keyword below (including <>) with your Alexa skills ID copied from step 6:
<your-alexa-skills-id>
IMPORTANT: There is only one section in the file that contains this keyword that needs to
be replaced with your skills ID, everything else must remain untouched.
c. Save your changes.
8. Create a zip file named "lambda-upload.zip" containing the edited "main.py" file, the "myq.py" file,
the "requests" folder and the "requests-2.9.1.dist-info" folder. Be sure to keep the folder structures
in tact. You will be needing this zip file in step 11.c
9. Create a free/Basic Amazon webservice (AWS) account via url "aws.amazon.com"
10. On the upper right corner of the AWS main page, just beside your AWS account name,
shows a location that you need click on and select "US East (N. Virginia)"
11. Still on the AWS main page, search for AWS Services called "lambda"
12. Click the "Create a Lambda Function" button and follow the steps below:
a. On the "Select Blueprint" page, choose "Blank Function"
b. On the "Configure Triggers" page, click on the dotted square box and choose
"Alexa Skills Kit", then click the "Next" button
NOTE: If "Alexa Skills Kit" is not available, it is because your location
is not set correctly (Please refer back to step 5 for more info)
c. On the "Configure function" page, enter the following information:
NOTE: Settings not mentioned below can be left as is
Name : <Your Custom Function Name Without Spaces>
Example: OperateGarage
Runtime : Python 2.7
----------------------------------------------------------------
Lambda function code
----------------------------------------------------------------
Code Entry Type : Upload a .ZIP file
Function Package : <Click the "Upload" button and select the
"lambda-upload.zip" file that you created in step 8
----------------------------------------------------------------
Lambda function handler and role
----------------------------------------------------------------
Handler : main.lambda_handler
Role : Create new role from template(s)
Role name : <Your Custom Role Name>
Example: GarageOperator
Policy templates : Simple Microservice permissions
d. Click the "Next" button
e. Click the "Create function" button
f. On the page that comes up immediately after clicking the "Create function"
button, notice that you now have the ARN information provided to you located
at the upper right section of the screen, just below your AWS account name.
This will look something like the sample below and you will need to copy this
information in order to proceed to the next step.
Example: arn:aws:lambda:us-east-1:563954059256:function:OperateGarage
13. Return to your Amazon developer account >> Alexa >> Alexa Skills Kit project and
edit the custom skill that you have already started creating back in step 5 and
navigate to the "Configuration" section of the skill and enter the information
below:
NOTE: Settings not mentioned below can be left as is
----------------------------------------------------------------------------
Configuration
----------------------------------------------------------------------------
Service Endpoint Type: AWS Lambda ARN (Amazon Resource Name)
For Geographical Region, choose "North America" and
on the text box that popped up immediately underneath,
enter the ARN information similar to the one shown
below and then click on the "Next" button.
arn:aws:lambda:us-east-1:563954059256:function:OperateGarage
----------------------------------------------------------------------------
Test
----------------------------------------------------------------------------
On the "Test" section, just make sure that the skill is ENABLED and that's it.
14. Congratulations! You are now ready to test your skill by giving Alexa the
command below:
Assuming that your skill invocation name is "Garage", you would say
"Alexa, ask GARAGE if it's open"
OR
"Alexa, ask GARAGE to close"
I hope this semi-step by step guide helps make your implementation easier. If you encounter
any problems, I would advise that you double check your "main.py" file and make sure that
you have done your edits correctly. Good luck!