Upload
withthebest
View
100
Download
0
Embed Size (px)
Citation preview
Important Links
• Alexa Skills Console https://developer.amazon.com/edw/home.html#/skills/list
• Sample Code & Skill https://github.com/dpjanes/homestar-alexa
Topics Covered
• Choosing an Architecture
• Creating a Skill
• Interaction Model
• Skills for the IoT
• Testing your Skill
Emphasis
• We'll focus on core concepts
• Intent, Slots, Utterances
• From definition to implementation
About IOTDB
• Open Source IoT Platform
• Based on Semantics
• Natural fit for voice control
• https://github.com/dpjanes/node-iotdb
Many Moving Parts
• Home
• Amazon Echo
• IoT Device
• Iot Controller
• Amazon
• Alexa Voice Skill
• Cloud
• Skill Server
• Vendor Server
• Proxy Server
This Presentation
• Focus on writing Alexa Voice Skill
• Communications between Cloud and your Home will be "open"
Getting Started
• https://developer.amazon.com/edw/home.html#/skills/list
• Create an Account if you don't have one
• will require SMS verification
• Select "Add a New Skill"
Skill Information: Skill Type
• Different types of Skills
• Custom: the most flexible
• Smart Home Skill: don't have to use the "magic word" (the Invocation Name)
• Flash Briefing: news
Skill Information: Skill Type
• What will appear in your Skills List
• What will appear in the App Store
Skill Information: Invocation Name
• The "Magic Word"
• Alexa, ask HomeStar to …
• Alexa, tell HomeStar to …
• Not needed with Smart Home Skills
Utterances
• Step 1 in writing your Alexa Voice Skill
• Write down things you want to say
• Look for Patterns
Utterances"Ask HomeStar…"
• turn on Stove
• turn off Stove
• turn on Light
• turn on Light in the Kitchen
• turn off TV
• turn off Living Room TV
• turn off everything
• to turn off everything
• to turn off everything in the Living Room
• turn down TV
• turn down TV in the Living Room
Utterances"Ask HomeStar…"
• turn on {Thing}
• turn off {Thing}
• turn on {Thing}
• turn on {Thing} in the Kitchen
• turn off {Thing}
• turn off Living Room {Thing}
• turn off {Thing}
• to turn off {Thing}
• to turn off {Thing} in the Living Room
• turn down {Thing}
Utterances"Ask HomeStar…"
• turn on {Thing}
• turn off {Thing}
• turn on {Thing}
• turn on {Thing} in the {Zone}
• turn off {Thing}
• turn off {Zone} {Thing}
• turn off {Thing}
• to turn off {Thing}
• to turn off {Thing} in the {Zone}
• turn down {Thing}
• turn down {Thing} in the {Zone}
Utterances"Ask HomeStar…"
• {Action} {Thing}
• {Action} {Thing}
• {Action} {Thing}
• {Action} {Thing} in the {Zone}
• {Action} {Thing}
• {Action} {Zone} {Thing}
• {Action} {Thing}
• to {Action} {Thing}
• to {Action} {Thing} in the {Zone}
• {Action} {Thing}
• {Action} {Thing} in the {Zone}
Utterances"Ask HomeStar…"
• {Action} {Thing}
• to {Action} {Thing}
• {Action} {Thing} in the {Zone}
• to {Action} {Thing} in the {Zone}
• {Action} {Zone} {Thing}
• to {Action} {Zone} {Thing}
Slots
• These are the {variables} in the Utterances
• e.g. {Thing}, {Zone}, {Action}
• two types of slots:
• Custom (e.g. above)
• Built-In
Intents
• Basically, Intents are "phases" of your conversation with Alexa
• If "single shot" then this isn't very complicated - just define a "FirstIntent", e.g. HomeStarFirst Intent
Configuration: Endpoint
• Two (major options)
• AWS Lambda
• Hosted - contacts a url
• Note the URL we are using - we'll see it again soon
Configuration: Account Linking
• Used for connecting to systems that have accounts!
• E.g. Smart Homes - what Smart Home does Alexa have to talk to
• Set up when user connects to Skill
Configuration: Account Linking
• Alexa calls your Authorize URL with a number of parameters
• Let the user do something on your website to confirm it
• Your website redirects back to Alexa with a number of magic parameters
N.B.
• Alexa Skill is configured to hit https://alexa.homestar.io/request
• You must use HTTPS
• Amazon provides flexibility in certs
The Request
• "session"
• a session of interactions (captured in Intents) between user and Alexa
• user login info (from Account Linking)
• "request"
• the Intent and Slot data
The Request"session"
• "new": we can be continuing a session
• "sessionId": in case you are, for logging
• "user": all this is set up by Account Linking
• not required if just for yourself
The Request"request/intent"
• "request/intent/slots/Action/value": the {{ Action }}
• "request/intent/slots/Thing/value": the {{ Thing }}
The Response
• "response/outputSpeech/text": this is what Alexa will say to the user
• "response/shouldEndSession": make false if you want to keep going
Get in touch! David Janes
http://iotdb.org/social/imadeit/