SlideShare a Scribd company logo
Writing AlexaVoice
Skills With NodeJS
(with a little IoT)
David Janes
@dpjanes
davidjanes@iotdb.org
http://iotdb.org/social/imadeit/
October 2016
Introduction
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
Architecture
Many Moving Parts
• Home
• Amazon Echo
• IoT Device
• Iot Controller
• Amazon
• AlexaVoice Skill
• Cloud
• Skill Server
• Vendor Server
• Proxy Server
Typical AlexaVoice Skill
(hosted)
Typical AlexaVoice Skill
(AWS Lambda)
Cloud Based
Home Based
Proxy Based
This Presentation
• Focus on writing AlexaVoice Skill
• Communications between Cloud and your
Home will be "open"
e.g. mainly this
Creating
AlexaVoice Skills
e.g. here
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"
Alexa Skill Editor
Alexa Skill Editor
• We'll focus on
• Skill Information
• Interaction Model
• Configuration
• Test
Skill Editor:

Skill Information
Alexa Skill Editor
Creating New Skill:

Skill Information
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
Skill Editor:
Interaction Model
Writing Alexa Voice Skills with NodeJS- David Janes
This is the Cool Part
• The Interaction Model determines how
Alexa interprets your voice commands
Interaction Terminology
• Utterances
• Slots
• Intents
Utterances
• Step 1 in writing your AlexaVoice 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
Slots (Built-In)
• Date
• Duration
• Four Digit Number
• Number
• Time
• Cities…
Slots {Thing}
• lamp
• light
• coffee maker
• kettle
• stove
• tv…
Slots {Action}
• turn off
• turn on
• turn down
• turn up
• open
• close
Slots {Zone}
• Back Door
• Back Garden
• Back Hall
• Back Porch
• Basement
• Basement Bathroom…
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
Putting it together
Putting it together
Skill Editor:
Configuration
Writing Alexa Voice Skills with NodeJS- David Janes
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
Alexa Skill Endpoint /
Your Server
e.g. here
Sample Code
• url: 

https://github.com/dpjanes/homestar-alexa/
• ./hosted/monitor_1.js
N.B.
• Alexa Skill is configured to hit

https://alexa.homestar.io/request
• You must use HTTPS
• Amazon provides flexibility in certs
Sample Code (1)
Demo (1)
"monitor_1.js"
The Request
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"
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"
The Request
"request"
• "type"
• "locale"
• "intent"
The Request
"request/intent"
• "name"
• "slots"
• Action / Query / Zone / Thing
• We defined these!
The Request
"request/intent"
• "request/intent/slots/Action/value":

the {{ Action }}
• "request/intent/slots/Thing/value":

the {{ Thing }}
The Response
The Response
• "response/outputSpeech/text": 

this is what Alexa will say to the user
• "response/shouldEndSession": 

make false if you want to keep going
Sample Code (II)
Demo (II)
"monitor_2.js"
Skill Editor:

Test
Test
Going Further
IOTDB
• NPM modules
• iotdb
• homestar
• iotdb-commands
• takes Action / Thing / &c and does it
Demo (III)
live
Get in touch!
David Janes
@dpjanes
davidjanes@iotdb.org
http://iotdb.org/social/imadeit/

More Related Content

PDF
Your First Amazon Alexa Skill
PDF
David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda
PPTX
Multi-Factor Auth in Alexa Skills - Faisal Valli
PDF
Screencast dave dev-introtoask-andecho-july2015
PDF
Introduction to building alexa skills and putting your amazon echo to work
PPTX
Voice enable all the things with Alexa
PDF
Building Voice Apps & Experiences For Amazon Echo
PPTX
AWS API Gateway
Your First Amazon Alexa Skill
David Isbitski - Enabling new voice experiences with Amazon Alexa and AWS Lambda
Multi-Factor Auth in Alexa Skills - Faisal Valli
Screencast dave dev-introtoask-andecho-july2015
Introduction to building alexa skills and putting your amazon echo to work
Voice enable all the things with Alexa
Building Voice Apps & Experiences For Amazon Echo
AWS API Gateway

What's hot (11)

PPTX
Amazon API Gateway
PPTX
Amazon Alexa - Introduction & Custom Skills
PPTX
Start building for voice with alexa
PPTX
Alexa Skills Kit
PDF
Amazon API Gateway
PPTX
Alexa Smart Home Skill
PDF
Amazon Alexa: our successes and fails
PDF
DIY Your Amazon Echo
PPTX
Serverless everywhere
PPTX
Deploying computer vision model as api using aws lambda and api gateway
PDF
aws lambda & api gateway
Amazon API Gateway
Amazon Alexa - Introduction & Custom Skills
Start building for voice with alexa
Alexa Skills Kit
Amazon API Gateway
Alexa Smart Home Skill
Amazon Alexa: our successes and fails
DIY Your Amazon Echo
Serverless everywhere
Deploying computer vision model as api using aws lambda and api gateway
aws lambda & api gateway
Ad

Viewers also liked (13)

PDF
Arya.ai artificial intelligence platform vinay kumar
PDF
Chatbots in 2017 -- Ithaca Talk Dec 6
PDF
How to Create a Custom Skill
PDF
Minds ryl 사업
PDF
Telling Story Through Sound: Building an Interactive "Radio Play"
PPTX
Alexa Skills Kitを使って自作のSkillを作る
PPTX
Ai専門支部#2 Amazon AlexaとAmazon Polly
PPT
Voice Recognition
PPTX
Alexa and the Connected Car
PPTX
Voice based banking system
PPTX
Introducing The Amazon Echo
PPTX
Amazon Echo
PDF
Amazon Echo 기반 IoT 서비스 개발을 위한 Alexa Skills Kit 및 AWS Lambda 활용 (윤석찬)
Arya.ai artificial intelligence platform vinay kumar
Chatbots in 2017 -- Ithaca Talk Dec 6
How to Create a Custom Skill
Minds ryl 사업
Telling Story Through Sound: Building an Interactive "Radio Play"
Alexa Skills Kitを使って自作のSkillを作る
Ai専門支部#2 Amazon AlexaとAmazon Polly
Voice Recognition
Alexa and the Connected Car
Voice based banking system
Introducing The Amazon Echo
Amazon Echo
Amazon Echo 기반 IoT 서비스 개발을 위한 Alexa Skills Kit 및 AWS Lambda 활용 (윤석찬)
Ad

Similar to Writing Alexa Voice Skills with NodeJS- David Janes (20)

PPTX
Amazon alexa - building custom skills
PDF
Building Smart Home skills for Alexa
PPTX
NUS-ISS Learning Day 2017 - Voice Computing - The Next Digital Disruption!
PPTX
introductiontoalexaskillskit-160426090427.pptx
PDF
introductiontoalexaskillskit-160426090427.pdf
PPTX
Building custom skills with Amazon Alexa
PPTX
Building Amazon Alexa custom Skill step by step
PDF
Digital Muse “Girl Tech Fest - AWS Alexa Skills Coding Workshop
PDF
Building Alexa Skills - Floor28
PPTX
Alexa101 course slides
PPTX
Alexa, lets make a skill
PDF
Intro to Alexa skills development
PDF
Artificial Intelligence at Work - Assist Workshop 2016 - Dave Isbitski Amazon
PDF
Building Alexa Skills
PPTX
Make your home smarter with Alexa
PDF
Alexa Skills Kit with Web API on Azure
PDF
Amazon Alexa Home Automation Skills
PPTX
Hackster DFW - Amazon Echo Workshop
PDF
Alexa enabled smart home programming in Python - PyCon India 2018
PPTX
Amazon Alexa and Echo
Amazon alexa - building custom skills
Building Smart Home skills for Alexa
NUS-ISS Learning Day 2017 - Voice Computing - The Next Digital Disruption!
introductiontoalexaskillskit-160426090427.pptx
introductiontoalexaskillskit-160426090427.pdf
Building custom skills with Amazon Alexa
Building Amazon Alexa custom Skill step by step
Digital Muse “Girl Tech Fest - AWS Alexa Skills Coding Workshop
Building Alexa Skills - Floor28
Alexa101 course slides
Alexa, lets make a skill
Intro to Alexa skills development
Artificial Intelligence at Work - Assist Workshop 2016 - Dave Isbitski Amazon
Building Alexa Skills
Make your home smarter with Alexa
Alexa Skills Kit with Web API on Azure
Amazon Alexa Home Automation Skills
Hackster DFW - Amazon Echo Workshop
Alexa enabled smart home programming in Python - PyCon India 2018
Amazon Alexa and Echo

More from WithTheBest (20)

PDF
Riccardo Vittoria
PPTX
Recreating history in virtual reality
PDF
Engaging and sharing your VR experience
PDF
How to survive the early days of VR as an Indie Studio
PDF
Mixed reality 101
PDF
Unlocking Human Potential with Immersive Technology
PPTX
Building your own video devices
PPTX
Maximizing performance of 3 d user generated assets in unity
PPTX
Wizdish rovr
PPTX
Haptics & amp; null space vr
PPTX
How we use vr to break the laws of physics
PPTX
The Virtual Self
PPTX
You dont have to be mad to do VR and AR ... but it helps
PDF
Omnivirt overview
PDF
VR Interactions - Jason Jerald
PDF
Japheth Funding your startup - dating the devil
PDF
Transported vr the virtual reality platform for real estate
PDF
Measuring Behavior in VR - Rob Merki Cognitive VR
PDF
Global demand for Mixed Realty (VR/AR) content is about to explode.
PDF
VR, a new technology over 40,000 years old
Riccardo Vittoria
Recreating history in virtual reality
Engaging and sharing your VR experience
How to survive the early days of VR as an Indie Studio
Mixed reality 101
Unlocking Human Potential with Immersive Technology
Building your own video devices
Maximizing performance of 3 d user generated assets in unity
Wizdish rovr
Haptics & amp; null space vr
How we use vr to break the laws of physics
The Virtual Self
You dont have to be mad to do VR and AR ... but it helps
Omnivirt overview
VR Interactions - Jason Jerald
Japheth Funding your startup - dating the devil
Transported vr the virtual reality platform for real estate
Measuring Behavior in VR - Rob Merki Cognitive VR
Global demand for Mixed Realty (VR/AR) content is about to explode.
VR, a new technology over 40,000 years old

Recently uploaded (20)

PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
MYSQL Presentation for SQL database connectivity
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Approach and Philosophy of On baking technology
PPT
Teaching material agriculture food technology
PDF
Encapsulation theory and applications.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Modernizing your data center with Dell and AMD
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Diabetes mellitus diagnosis method based random forest with bat algorithm
MYSQL Presentation for SQL database connectivity
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Approach and Philosophy of On baking technology
Teaching material agriculture food technology
Encapsulation theory and applications.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Modernizing your data center with Dell and AMD
Encapsulation_ Review paper, used for researhc scholars
NewMind AI Monthly Chronicles - July 2025
NewMind AI Weekly Chronicles - August'25 Week I
Digital-Transformation-Roadmap-for-Companies.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Empathic Computing: Creating Shared Understanding
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Dropbox Q2 2025 Financial Results & Investor Presentation
CIFDAQ's Market Insight: SEC Turns Pro Crypto

Writing Alexa Voice Skills with NodeJS- David Janes