SlideShare a Scribd company logo
1 of 51
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Rodney Haywood
Solutions Architect Manager, Amazon Web Services
Level 200
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Voice-Enabling Your Home and Devices
with Amazon Alexa and AWS IoT
Building Your Device
Amazon Lex
Amazon Polly
Amazon
Rekognition
AWS IoT
Brains are hard to build!
Natural Voice Control
Automatic speech recognition (ASR)
and natural language understanding
(NLU) engines.
Always Getting Smarter
New capabilities and services through
machine learning, regular API updates,
feature launches.
Free, Easy Integration
Programming language agnostic service
that makes it easy to integrate Alexa into
your devices, services, and applications.
Best of all, it’s free.
Let’s voice enable my
home with Alexa and
AWS IoT by giving her
a new skill.
How will we
interact with the
Garage Door?
Raspberry Pi
GPIO4
Raspberry Pi
IoT thing
GarageDoor
IoT
reported
state
GPIO4
ClosedSensor: true
Raspberry Pi
IoT thing
GarageDoor
IoT topic
IoT
reported
state
GPIO4
ClosedSensor: true
Raspberry Pi
IoT
rule
IoT thing
GarageDoor
IoT topic
IoT
reported
state
GPIO4
ClosedSensor: true
Raspberry Pi
IoT
rule
IoT thing
GarageDoor
IoT topic
IoT
device
shadow
IoT
reported
state
GPIO4
{
"reported":
{
"ClosedSensor": "true",
"OpenedSensor": "false”
}
}
ClosedSensor: true
Raspberry Pi
IoT
rule
IoT thing
GarageDoor
IoT topic
$aws/things/GarageDoor
/shadow/update/documents
IoT
device
shadow
IoT
reported
state
GPIO4
{
"reported":
{
"ClosedSensor": "true",
"OpenedSensor": "false”
}
}
Web Socket
ClosedSensor: true
Setup
Monitoring the State on the Raspberry PI
1 var GPIO = require('onoff').Gpio;
2 var AWS = require('aws-sdk');
3 var IOTdevicename = 'GarageDoor';
4 var IOTendpoint = 'aju7zuv46stdy.iot.ap-southeast-2.amazonaws.com';
5 var IOTregion = 'ap-southeast-2';
6
7 var iotdata = new AWS.IotData({endpoint: IOTendpoint, region: IOTregion});
8 var closedSwitch = new GPIO(5, 'in', 'both');
9 var openedSwitch = new GPIO(4, 'in', 'both');
10
11 closedSwitch.watch(function (err, value) {
12 updateShadow(IOTdevicename,'{"state": {"reported": {"ClosedSensor": ' + ((value == 1) ? '"true"' : '"false"') + '}}}');
13 });
14
15 openedSwitch.watch(function (err, value) {
16 updateShadow(IOTdevicename,'{"state": {"reported": {"OpenedSensor": ' + ((value == 1) ? '"true"' : '"false"') + '}}}');
17 });
18
19 function updateShadow(device, ourPayload) {
20 iotdata.updateThingShadow({ "thingName": device, "payload": ourPayload }, function (err, data) {
21 if (err) { console.log('Opps : ',err); }
22 });
23 }
Initialise
Monitoring the State on the Raspberry PI
1 var GPIO = require('onoff').Gpio;
2 var AWS = require('aws-sdk');
3 var IOTdevicename = 'GarageDoor';
4 var IOTendpoint = 'aju7zuv46stdy.iot.ap-southeast-2.amazonaws.com';
5 var IOTregion = 'ap-southeast-2';
6
7 var iotdata = new AWS.IotData({endpoint: IOTendpoint, region: IOTregion});
8 var closedSwitch = new GPIO(5, 'in', 'both');
9 var openedSwitch = new GPIO(4, 'in', 'both');
10
11 closedSwitch.watch(function (err, value) {
12 updateShadow(IOTdevicename,'{"state": {"reported": {"ClosedSensor": ' + ((value == 1) ? '"true"' : '"false"') + '}}}');
13 });
14
15 openedSwitch.watch(function (err, value) {
16 updateShadow(IOTdevicename,'{"state": {"reported": {"OpenedSensor": ' + ((value == 1) ? '"true"' : '"false"') + '}}}');
17 });
18
19 function updateShadow(device, ourPayload) {
20 iotdata.updateThingShadow({ "thingName": device, "payload": ourPayload }, function (err, data) {
21 if (err) { console.log('Opps : ',err); }
22 });
23 }
Monitor GPIO State
Monitoring the State on the Raspberry PI
1 var GPIO = require('onoff').Gpio;
2 var AWS = require('aws-sdk');
3 var IOTdevicename = 'GarageDoor';
4 var IOTendpoint = 'aju7zuv46stdy.iot.ap-southeast-2.amazonaws.com';
5 var IOTregion = 'ap-southeast-2';
6
7 var iotdata = new AWS.IotData({endpoint: IOTendpoint, region: IOTregion});
8 var closedSwitch = new GPIO(5, 'in', 'both');
9 var openedSwitch = new GPIO(4, 'in', 'both');
10
11 closedSwitch.watch(function (err, value) {
12 updateShadow(IOTdevicename,'{"state": {"reported": {"ClosedSensor": ' + ((value == 1) ? '"true"' : '"false"') + '}}}');
13 });
14
15 openedSwitch.watch(function (err, value) {
16 updateShadow(IOTdevicename,'{"state": {"reported": {"OpenedSensor": ' + ((value == 1) ? '"true"' : '"false"') + '}}}');
17 });
18
19 function updateShadow(device, ourPayload) {
20 iotdata.updateThingShadow({ "thingName": device, "payload": ourPayload }, function (err, data) {
21 if (err) { console.log('Opps : ',err); }
22 });
23 }
Send payload
Monitoring the State on the Raspberry PI
1 var GPIO = require('onoff').Gpio;
2 var AWS = require('aws-sdk');
3 var IOTdevicename = 'GarageDoor';
4 var IOTendpoint = 'aju7zuv46stdy.iot.ap-southeast-2.amazonaws.com';
5 var IOTregion = 'ap-southeast-2';
6
7 var iotdata = new AWS.IotData({endpoint: IOTendpoint, region: IOTregion});
8 var closedSwitch = new GPIO(5, 'in', 'both');
9 var openedSwitch = new GPIO(4, 'in', 'both');
10
11 closedSwitch.watch(function (err, value) {
12 updateShadow(IOTdevicename,'{"state": {"reported": {"ClosedSensor": ' + ((value == 1) ? '"true"' : '"false"') + '}}}');
13 });
14
15 openedSwitch.watch(function (err, value) {
16 updateShadow(IOTdevicename,'{"state": {"reported": {"OpenedSensor": ' + ((value == 1) ? '"true"' : '"false"') + '}}}');
17 });
18
19 function updateShadow(device, ourPayload) {
20 iotdata.updateThingShadow({ "thingName": device, "payload": ourPayload }, function (err, data) {
21 if (err) { console.log('Opps : ',err); }
22 });
23 }
Setup
Monitoring via WebSocket
1 $(document).ready(function(){
2 var creds = new AWS.Credentials(’<access key>', ’<secret key>');
3 var requestUrl = SigV4Utils.getSignedUrl('aju7zuv46stdy.iot.ap-southeast-2.amazonaws.com', 'ap-southeast-2', creds)
4 var client = new Paho.MQTT.Client(requestUrl, guid());
5 var connectOptions = {
6 onSuccess: function(){
7 client.subscribe("$aws/things/GarageDoor/shadow/update/documents");
8 },
9 useSSL: true, timeout: 10, mqttVersion: 4,
10 onFailure: function(err) {
11 console.log('Connection Failed:', err);
12 }
13 };
14
15 client.onMessageArrived = onShadowUpdate;
16 client.connect(connectOptions);
17 });
Connect and monitor topic
Monitoring via WebSocket
1 $(document).ready(function(){
2 var creds = new AWS.Credentials(’<access key>', ’<secret key>');
3 var requestUrl = SigV4Utils.getSignedUrl('aju7zuv46stdy.iot.ap-southeast-2.amazonaws.com', 'ap-southeast-2', creds)
4 var client = new Paho.MQTT.Client(requestUrl, guid());
5 var connectOptions = {
6 onSuccess: function(){
7 client.subscribe("$aws/things/GarageDoor/shadow/update/documents");
8 },
9 useSSL: true, timeout: 10, mqttVersion: 4,
10 onFailure: function(err) {
11 console.log('Connection Failed:', err);
12 }
13 };
14
15 client.onMessageArrived = onShadowUpdate;
16 client.connect(connectOptions);
17 });
Parse topic payload to json
Monitoring via WebSocket
18 function onShadowUpdate(message) {
19
20 d = JSON.parse(message.payloadString);
21
22 if (d.current.state.reported.ClosedSensor == 'true' &&
23 d.current.state.reported.OpenedSensor == 'false' &&
24 d.current.metadata.reported.OpenedSensor.timestamp > d.previous.metadata.reported.ClosedSensor.timestamp) {
25
26 var wasOpenedFor = d.current.metadata.reported.OpenedSensor.timestamp –
d.previous.metadata.reported.ClosedSensor.timestamp
27 var duration = d.current.metadata.reported.ClosedSensor.timestamp –
d.current.metadata.reported.OpenedSensor.timestamp
28
29 document.getElementById("state").innerHTML = "Closed";
30 document.getElementById("traveltime").innerHTML = duration.toString() + "s";
31 document.getElementById("opentime").innerHTML = wasOpenedFor.toString() + "s";
32 document.getElementById("message").innerHTML = message.payloadString;
33 }
34 /* ... */
35 }
Test for which event
Monitoring via WebSocket
18 function onShadowUpdate(message) {
19
20 d = JSON.parse(message.payloadString);
21
22 if (d.current.state.reported.ClosedSensor == 'true' &&
23 d.current.state.reported.OpenedSensor == 'false' &&
24 d.current.metadata.reported.OpenedSensor.timestamp > d.previous.metadata.reported.ClosedSensor.timestamp) {
25
26 var wasOpenedFor = d.current.metadata.reported.OpenedSensor.timestamp –
d.previous.metadata.reported.ClosedSensor.timestamp
27 var duration = d.current.metadata.reported.ClosedSensor.timestamp –
d.current.metadata.reported.OpenedSensor.timestamp
28
29 document.getElementById("state").innerHTML = "Closed";
30 document.getElementById("traveltime").innerHTML = duration.toString() + "s";
31 document.getElementById("opentime").innerHTML = wasOpenedFor.toString() + "s";
32 document.getElementById("message").innerHTML = message.payloadString;
33 }
34 /* ... */
35 }
Pre-calculate some values
Monitoring via WebSocket
18 function onShadowUpdate(message) {
19
20 d = JSON.parse(message.payloadString);
21
22 if (d.current.state.reported.ClosedSensor == 'true' &&
23 d.current.state.reported.OpenedSensor == 'false' &&
24 d.current.metadata.reported.OpenedSensor.timestamp > d.previous.metadata.reported.ClosedSensor.timestamp) {
25
26 var wasOpenedFor = d.current.metadata.reported.OpenedSensor.timestamp –
d.previous.metadata.reported.ClosedSensor.timestamp
27 var duration = d.current.metadata.reported.ClosedSensor.timestamp –
d.current.metadata.reported.OpenedSensor.timestamp
28
29 document.getElementById("state").innerHTML = "Closed";
30 document.getElementById("traveltime").innerHTML = duration.toString() + "s";
31 document.getElementById("opentime").innerHTML = wasOpenedFor.toString() + "s";
32 document.getElementById("message").innerHTML = message.payloadString;
33 }
34 /* ... */
35 }
Update the page content
Monitoring via WebSocket
18 function onShadowUpdate(message) {
19
20 d = JSON.parse(message.payloadString);
21
22 if (d.current.state.reported.ClosedSensor == 'true' &&
23 d.current.state.reported.OpenedSensor == 'false' &&
24 d.current.metadata.reported.OpenedSensor.timestamp > d.previous.metadata.reported.ClosedSensor.timestamp) {
25
26 var wasOpenedFor = d.current.metadata.reported.OpenedSensor.timestamp –
d.previous.metadata.reported.ClosedSensor.timestamp
27 var duration = d.current.metadata.reported.ClosedSensor.timestamp –
d.current.metadata.reported.OpenedSensor.timestamp
28
29 document.getElementById("state").innerHTML = "Closed";
30 4ocument.getElementById("traveltime").innerHTML = duration.toString() + "s";
31 document.getElementById("opentime").innerHTML = wasOpenedFor.toString() + "s";
32 document.getElementById("message").innerHTML = message.payloadString;
33 }
34 /* ... */
35 }
1
2
3
4
1 2 34
We now have
the door state in
an IoT “thing”.
Lets teach Alexa the skill.
Custom Skill Smart Home Skill API
Smart Home Skill API Reference
Discovery
• DiscoverAppliancesRequest
• DiscoverApplianceResponse
Control
• DecrementPercentageRequest
• DecrementPercentageConfirmation
• IncrementPercentageRequest
• IncrementPercentageConfirmation
• IncrementTargetTemperatureRequest
• IncrementTargetTemperatureConfirmation
• SetLockStateRequest
• SetLockStateConfirmation
• SetPercentageRequest
• SetPercentageConfirmation
• SetTargetTemperatureRequest
• SetTargetTemperatureConfirmation
• TurnOnRequest
• TurnOnConfirmation
• TurnOffRequest
• TurnOffConfirmation
Query
• GetLockStateRequest
• GetLockStateResponse
• GetTargetTemperatureRequest
• GetTargetTemperatureResponse
• GetTemperatureReadingRequest
• GetTemperatureReadingResponse
Alexa smart
home skill
Register
Skill
Alexa smart
home skill
Lambda
function
GarageDoor
DiscoverAppliancesRequest
Register
Skill
Request type handler
Lambda Function
1 exports.handler = function(event, context) {
2
3 log('Input', event);
4
5 switch (event.header.namespace) {
6
7 case 'Alexa.ConnectedHome.Discovery':
8 handleDiscovery(event, context);
9 break;
10 case 'Alexa.ConnectedHome.Query':
11 handleQuery(event, context);
12 break;
13 default:
14 log('Err', 'No supported namespace: ' + event.header.namespace);
15 context.fail('Something went wrong');
16 break;
17 }
18 };
Response Header
Alexa.ConnectedHome.Discovery
19 function handleDiscovery(accessToken, context) {
20 var headers = {
21 namespace: 'Alexa.ConnectedHome.Discovery',
22 name: 'DiscoverAppliancesResponse',
23 payloadVersion: '2'
24 };
25 var payload = {
26 "discoveredAppliances":[
27 {
28 "applianceId": "GarageDoor", // IoT Thing name
29 "friendlyName": "Garage Door", // What we say to Alexa
30 "isReachable": true,
31 "actions": ["getLockState”],
32 "additionalApplianceDetails":{ // Extra data returned in future requests
33 "IOT_Endpoint": "aju7zuv46stdy.iot.ap-southeast-2.amazonaws.com",
34 "IOT_Region": "ap-southeast-2"
35 }
36 }
37 ]
38 }
39 var result = { header: headers, payload: payload };
40 context.succeed(result);
41 }
An array of available appliances
Alexa.ConnectedHome.Discovery
19 function handleDiscovery(accessToken, context) {
20 var headers = {
21 namespace: 'Alexa.ConnectedHome.Discovery',
22 name: 'DiscoverAppliancesResponse',
23 payloadVersion: '2'
24 };
25 var payload = {
26 "discoveredAppliances":[
27 {
28 "applianceId": "GarageDoor", // IoT Thing name
29 "friendlyName": "Garage Door", // What we say to Alexa
30 "isReachable": true,
31 "actions": ["getLockState”],
32 "additionalApplianceDetails":{ // Extra data returned in future requests
33 "IOT_Endpoint": "aju7zuv46stdy.iot.ap-southeast-2.amazonaws.com",
34 "IOT_Region": "ap-southeast-2"
35 }
36 }
37 ]
38 }
39 var result = { header: headers, payload: payload };
40 context.succeed(result);
41 }
Return header and payload
Alexa.ConnectedHome.Discovery
19 function handleDiscovery(accessToken, context) {
20 var headers = {
21 namespace: 'Alexa.ConnectedHome.Discovery',
22 name: 'DiscoverAppliancesResponse',
23 payloadVersion: '2'
24 };
25 var payload = {
26 "discoveredAppliances":[
27 {
28 "applianceId": "GarageDoor", // IoT Thing name
29 "friendlyName": "Garage Door", // What we say to Alexa
30 "isReachable": true,
31 "actions": ["getLockState”],
32 "additionalApplianceDetails":{ // Extra data returned in future requests
33 "IOT_Endpoint": "aju7zuv46stdy.iot.ap-southeast-2.amazonaws.com",
34 "IOT_Region": "ap-southeast-2"
35 }
36 }
37 ]
38 }
39 var result = { header: headers, payload: payload };
40 context.succeed(result);
41 }
Echo
Is the
Garage Door
locked?
Echo
Alexa smart
home skill
Lambda
function
GarageDoor
Is the
Garage Door
locked?GetLockStateRequest
Echo
Alexa smart
home skill
IoT
device
shadow
Lambda
function
GarageDoor
Is the
Garage Door
locked?
{
"reported":
{
"ClosedSensor": "true",
"OpenedSensor": "false”
}
}
GetLockStateRequest
Handle “Is the door locked?” query
Alexa.ConnectedHome.Query
42 function handleQuery(event, context) {
43
44 if (event.header.name === 'GetLockStateRequest') {
45
46 // The payload contains our IoT device details in the appliance which were supplied in the original device discovery
47 var IOTdevicename = event.payload.appliance.applianceId;
48 var IOTendpoint = event.payload.appliance.additionalApplianceDetails.IOT_Endpoint;
49 var IOTregion = event.payload.appliance.additionalApplianceDetails.IOT_Region;
50
51 var AWS = require('aws-sdk');
52 var iotdata = new AWS.IotData({endpoint: IOTendpoint, region: IOTregion});
53 var params = { "thingName" : IOTdevicename};
54
55 iotdata.getThingShadow(params, function (err, data) {
56 if (err) {
57 // Build an error response here.
58 context.fail(result);
59 } else {
60
Prepare to read the
IoT Device Shadow
Alexa.ConnectedHome.Query
42 function handleQuery(event, context) {
43
44 if (event.header.name === 'GetLockStateRequest') {
45
46 // The payload contains our IoT device details in the appliance which were supplied in the original device discovery
47 var IOTdevicename = event.payload.appliance.applianceId;
48 var IOTendpoint = event.payload.appliance.additionalApplianceDetails.IOT_Endpoint;
49 var IOTregion = event.payload.appliance.additionalApplianceDetails.IOT_Region;
50
51 var AWS = require('aws-sdk');
52 var iotdata = new AWS.IotData({endpoint: IOTendpoint, region: IOTregion});
53 var params = { "thingName" : IOTdevicename};
54
55 iotdata.getThingShadow(params, function (err, data) {
56 if (err) {
57 // Build an error response here.
58 context.fail(result);
59 } else {
60
Call
Alexa.ConnectedHome.Query
42 function handleQuery(event, context) {
43
44 if (event.header.name === 'GetLockStateRequest') {
45
46 // The payload contains our IoT device details in the appliance which were supplied in the original device discovery
47 var IOTdevicename = event.payload.appliance.applianceId;
48 var IOTendpoint = event.payload.appliance.additionalApplianceDetails.IOT_Endpoint;
49 var IOTregion = event.payload.appliance.additionalApplianceDetails.IOT_Region;
50
51 var AWS = require('aws-sdk');
52 var iotdata = new AWS.IotData({endpoint: IOTendpoint, region: IOTregion});
53 var params = { "thingName" : IOTdevicename};
54
55 iotdata.getThingShadow(params, function (err, data) {
56 if (err) {
57 // Build an error response here.
58 context.fail(result);
59 } else {
60
Determine the state
Alexa.ConnectedHome.Query
61 var currentState;
62 if (JSON.parse(data.payload).state.reported.ClosedSensor == "false") {
63 currentState = "UNLOCKED";
64 } else {
65 currentState = "LOCKED";
66 }
67
68 var result = {
69 "header":{
70 "messageId": guid(),
71 "name":"GetLockStateResponse",
72 "namespace":"Alexa.ConnectedHome.Query",
73 "payloadVersion":"2"
74 },
75 "payload":{
76 "lockState":currentState,
77 }
78 }
79 context.succeed(result);
80 }
81 });
82 }
83 }
Respond with a header and payload
Alexa.ConnectedHome.Query
61 var currentState;
62 if (JSON.parse(data.payload).state.reported.ClosedSensor == "false") {
63 currentState = "UNLOCKED";
64 } else {
65 currentState = "LOCKED";
66 }
67
68 var result = {
69 "header":{
70 "messageId": guid(),
71 "name":"GetLockStateResponse",
72 "namespace":"Alexa.ConnectedHome.Query",
73 "payloadVersion":"2"
74 },
75 "payload":{
76 "lockState":currentState,
77 }
78 }
79 context.succeed(result);
80 }
81 });
82 }
83 }
IoT
rule
IoT thing
GarageDoor
IoT topic
$aws/things/GarageDoor
/shadow/update/documents
Lambda
function
setLIFX
LIFX
lightbulb
SELECT
"opened" AS message
FROM
'$aws/things/GarageDoor/shadow/update/documents'
WHERE
current.state.reported.ClosedSensor = 'false' AND
current.state.reported.OpenedSensor = 'true' AND
current.metadata.reported.ClosedSensor.timestamp >
previous.metadata.reported.OpenedSensor.timestamp
What did we build?
Raspberry Pi
Echo
Alexa smart
home skill
IoT
rule
IoT thing
GarageDoor
IoT topic
$aws/things/GarageDoor
/shadow/update/documents
IoT
device
shadow
Lambda
function
setLIFX
Lambda
function
GarageDoor
LIFX
lightbulb
IoT
reported
state
DiscoverAppliancesRequest
Register
Skill
GPIO4
Is the
Garage Door
locked?
{
"reported":
{
"ClosedSensor": "true",
"OpenedSensor": "false”
}
}
GetLockStateRequest
Web Socket
1 $0.0034
* $USD / month Sydney Region
1 $0.0034
100 $0.34
* $USD / month Sydney Region
1 $0.0034
100 $0.34
10,000 $33.78
* $USD / month Sydney Region
Its easy to voice enable
things with Alexa and
AWS IoT.
What could you build?
Thank you!

More Related Content

What's hot

The Ring programming language version 1.5.1 book - Part 64 of 180
The Ring programming language version 1.5.1 book - Part 64 of 180The Ring programming language version 1.5.1 book - Part 64 of 180
The Ring programming language version 1.5.1 book - Part 64 of 180Mahmoud Samir Fayed
 
CCM Escape Case Study - SkySQL Paris Meetup 17.12.2013
CCM Escape Case Study - SkySQL Paris Meetup 17.12.2013CCM Escape Case Study - SkySQL Paris Meetup 17.12.2013
CCM Escape Case Study - SkySQL Paris Meetup 17.12.2013MariaDB Corporation
 
Cluj Big Data Meetup - Big Data in Practice
Cluj Big Data Meetup - Big Data in PracticeCluj Big Data Meetup - Big Data in Practice
Cluj Big Data Meetup - Big Data in PracticeSteffen Wenz
 
The Ring programming language version 1.6 book - Part 79 of 189
The Ring programming language version 1.6 book - Part 79 of 189The Ring programming language version 1.6 book - Part 79 of 189
The Ring programming language version 1.6 book - Part 79 of 189Mahmoud Samir Fayed
 
Using Cerberus and PySpark to validate semi-structured datasets
Using Cerberus and PySpark to validate semi-structured datasetsUsing Cerberus and PySpark to validate semi-structured datasets
Using Cerberus and PySpark to validate semi-structured datasetsBartosz Konieczny
 
Debugging JavaScript with Chrome
Debugging JavaScript with ChromeDebugging JavaScript with Chrome
Debugging JavaScript with ChromeIgor Zalutsky
 
Aaron Bedra - Effective Software Security Teams
Aaron Bedra - Effective Software Security TeamsAaron Bedra - Effective Software Security Teams
Aaron Bedra - Effective Software Security Teamscentralohioissa
 
คอมพ วเตอร
คอมพ วเตอร คอมพ วเตอร
คอมพ วเตอร TaaTao Smile
 
Akka.NET streams and reactive streams
Akka.NET streams and reactive streamsAkka.NET streams and reactive streams
Akka.NET streams and reactive streamsBartosz Sypytkowski
 
Codestrong 2012 breakout session hacking titanium
Codestrong 2012 breakout session   hacking titaniumCodestrong 2012 breakout session   hacking titanium
Codestrong 2012 breakout session hacking titaniumAxway Appcelerator
 
Coordination of Distributed Software with Redis
Coordination of Distributed Software with RedisCoordination of Distributed Software with Redis
Coordination of Distributed Software with RedisKonrad Bucheli
 
The Ring programming language version 1.6 book - Part 71 of 189
The Ring programming language version 1.6 book - Part 71 of 189The Ring programming language version 1.6 book - Part 71 of 189
The Ring programming language version 1.6 book - Part 71 of 189Mahmoud Samir Fayed
 
The Ring programming language version 1.5.1 book - Part 65 of 180
The Ring programming language version 1.5.1 book - Part 65 of 180The Ring programming language version 1.5.1 book - Part 65 of 180
The Ring programming language version 1.5.1 book - Part 65 of 180Mahmoud Samir Fayed
 
Behind modern concurrency primitives
Behind modern concurrency primitivesBehind modern concurrency primitives
Behind modern concurrency primitivesBartosz Sypytkowski
 
The redux saga begins
The redux saga beginsThe redux saga begins
The redux saga beginsDaniel Franz
 
Expert JavaScript tricks of the masters
Expert JavaScript  tricks of the mastersExpert JavaScript  tricks of the masters
Expert JavaScript tricks of the mastersAra Pehlivanian
 
當電子發票遇見 Google Cloud Function
當電子發票遇見 Google Cloud Function當電子發票遇見 Google Cloud Function
當電子發票遇見 Google Cloud Functioninwin stack
 
Zone.js 2017
Zone.js 2017Zone.js 2017
Zone.js 2017Jia Li
 

What's hot (20)

The Ring programming language version 1.5.1 book - Part 64 of 180
The Ring programming language version 1.5.1 book - Part 64 of 180The Ring programming language version 1.5.1 book - Part 64 of 180
The Ring programming language version 1.5.1 book - Part 64 of 180
 
Caching a page
Caching a pageCaching a page
Caching a page
 
CCM Escape Case Study - SkySQL Paris Meetup 17.12.2013
CCM Escape Case Study - SkySQL Paris Meetup 17.12.2013CCM Escape Case Study - SkySQL Paris Meetup 17.12.2013
CCM Escape Case Study - SkySQL Paris Meetup 17.12.2013
 
Cluj Big Data Meetup - Big Data in Practice
Cluj Big Data Meetup - Big Data in PracticeCluj Big Data Meetup - Big Data in Practice
Cluj Big Data Meetup - Big Data in Practice
 
The Ring programming language version 1.6 book - Part 79 of 189
The Ring programming language version 1.6 book - Part 79 of 189The Ring programming language version 1.6 book - Part 79 of 189
The Ring programming language version 1.6 book - Part 79 of 189
 
Using Cerberus and PySpark to validate semi-structured datasets
Using Cerberus and PySpark to validate semi-structured datasetsUsing Cerberus and PySpark to validate semi-structured datasets
Using Cerberus and PySpark to validate semi-structured datasets
 
Debugging JavaScript with Chrome
Debugging JavaScript with ChromeDebugging JavaScript with Chrome
Debugging JavaScript with Chrome
 
Aaron Bedra - Effective Software Security Teams
Aaron Bedra - Effective Software Security TeamsAaron Bedra - Effective Software Security Teams
Aaron Bedra - Effective Software Security Teams
 
คอมพ วเตอร
คอมพ วเตอร คอมพ วเตอร
คอมพ วเตอร
 
Akka.NET streams and reactive streams
Akka.NET streams and reactive streamsAkka.NET streams and reactive streams
Akka.NET streams and reactive streams
 
Codestrong 2012 breakout session hacking titanium
Codestrong 2012 breakout session   hacking titaniumCodestrong 2012 breakout session   hacking titanium
Codestrong 2012 breakout session hacking titanium
 
Coordination of Distributed Software with Redis
Coordination of Distributed Software with RedisCoordination of Distributed Software with Redis
Coordination of Distributed Software with Redis
 
The Ring programming language version 1.6 book - Part 71 of 189
The Ring programming language version 1.6 book - Part 71 of 189The Ring programming language version 1.6 book - Part 71 of 189
The Ring programming language version 1.6 book - Part 71 of 189
 
The Ring programming language version 1.5.1 book - Part 65 of 180
The Ring programming language version 1.5.1 book - Part 65 of 180The Ring programming language version 1.5.1 book - Part 65 of 180
The Ring programming language version 1.5.1 book - Part 65 of 180
 
Angular2 rxjs
Angular2 rxjsAngular2 rxjs
Angular2 rxjs
 
Behind modern concurrency primitives
Behind modern concurrency primitivesBehind modern concurrency primitives
Behind modern concurrency primitives
 
The redux saga begins
The redux saga beginsThe redux saga begins
The redux saga begins
 
Expert JavaScript tricks of the masters
Expert JavaScript  tricks of the mastersExpert JavaScript  tricks of the masters
Expert JavaScript tricks of the masters
 
當電子發票遇見 Google Cloud Function
當電子發票遇見 Google Cloud Function當電子發票遇見 Google Cloud Function
當電子發票遇見 Google Cloud Function
 
Zone.js 2017
Zone.js 2017Zone.js 2017
Zone.js 2017
 

Similar to Voice-enabling Your Home and Devices with Amazon Alexa and AWS IoT - Level 200

WebAPIs & WebRTC - Spotify/sthlm.js
WebAPIs & WebRTC - Spotify/sthlm.jsWebAPIs & WebRTC - Spotify/sthlm.js
WebAPIs & WebRTC - Spotify/sthlm.jsRobert Nyman
 
Firefox OS, une plateforme à découvrir - IO Saglac - 2014-09-09
Firefox OS, une plateforme à découvrir - IO Saglac - 2014-09-09Firefox OS, une plateforme à découvrir - IO Saglac - 2014-09-09
Firefox OS, une plateforme à découvrir - IO Saglac - 2014-09-09Frédéric Harper
 
AWS IoTで家庭内IoTをやってみた【JAWS DAYS 2016】
AWS IoTで家庭内IoTをやってみた【JAWS DAYS 2016】AWS IoTで家庭内IoTをやってみた【JAWS DAYS 2016】
AWS IoTで家庭内IoTをやってみた【JAWS DAYS 2016】tsuchimon
 
Decentralized Stream Processing over Web-enabled Devices
Decentralized Stream Processing over Web-enabled DevicesDecentralized Stream Processing over Web-enabled Devices
Decentralized Stream Processing over Web-enabled DevicesMasiar Babazadeh
 
AWS IoT 핸즈온 워크샵 - 실습 3. AWS IoT Thing Shadow (김무현 솔루션즈 아키텍트)
AWS IoT 핸즈온 워크샵 - 실습 3. AWS IoT Thing Shadow (김무현 솔루션즈 아키텍트)AWS IoT 핸즈온 워크샵 - 실습 3. AWS IoT Thing Shadow (김무현 솔루션즈 아키텍트)
AWS IoT 핸즈온 워크샵 - 실습 3. AWS IoT Thing Shadow (김무현 솔루션즈 아키텍트)Amazon Web Services Korea
 
HTML pour le web mobile, Firefox OS - Devfest Nantes - 2014-11-07
HTML pour le web mobile, Firefox OS - Devfest Nantes - 2014-11-07HTML pour le web mobile, Firefox OS - Devfest Nantes - 2014-11-07
HTML pour le web mobile, Firefox OS - Devfest Nantes - 2014-11-07Frédéric Harper
 
Firefox OS: HTML5 sur les stéroïdes - HTML5mtl - 2014-04-22
Firefox OS: HTML5 sur les stéroïdes - HTML5mtl - 2014-04-22Firefox OS: HTML5 sur les stéroïdes - HTML5mtl - 2014-04-22
Firefox OS: HTML5 sur les stéroïdes - HTML5mtl - 2014-04-22Frédéric Harper
 
Michael Hackstein - NoSQL meets Microservices - NoSQL matters Dublin 2015
Michael Hackstein - NoSQL meets Microservices - NoSQL matters Dublin 2015Michael Hackstein - NoSQL meets Microservices - NoSQL matters Dublin 2015
Michael Hackstein - NoSQL meets Microservices - NoSQL matters Dublin 2015NoSQLmatters
 
node.js and the AR.Drone: building a real-time dashboard using socket.io
node.js and the AR.Drone: building a real-time dashboard using socket.ionode.js and the AR.Drone: building a real-time dashboard using socket.io
node.js and the AR.Drone: building a real-time dashboard using socket.ioSteven Beeckman
 
HTML for the Mobile Web, Firefox OS - All Things Open - 2014-10-22
HTML for the Mobile Web, Firefox OS - All Things Open - 2014-10-22HTML for the Mobile Web, Firefox OS - All Things Open - 2014-10-22
HTML for the Mobile Web, Firefox OS - All Things Open - 2014-10-22Frédéric Harper
 
Firefox OS, HTML5 to the next level - Python Montreal - 2014-05-12
Firefox OS, HTML5 to the next level - Python Montreal - 2014-05-12Firefox OS, HTML5 to the next level - Python Montreal - 2014-05-12
Firefox OS, HTML5 to the next level - Python Montreal - 2014-05-12Frédéric Harper
 
Backend, app e internet das coisas com NodeJS no Google Cloud Platform
Backend, app e internet das coisas com NodeJS no Google Cloud PlatformBackend, app e internet das coisas com NodeJS no Google Cloud Platform
Backend, app e internet das coisas com NodeJS no Google Cloud PlatformDevMT
 
Backend, app e internet das coisas com NodeJS no Google Cloud Platform
Backend, app e internet das coisas com NodeJS no Google Cloud PlatformBackend, app e internet das coisas com NodeJS no Google Cloud Platform
Backend, app e internet das coisas com NodeJS no Google Cloud PlatformAlvaro Viebrantz
 
Øredev2013 - FirefoxOS - the platform HTML5 deserves
Øredev2013 - FirefoxOS - the platform HTML5 deservesØredev2013 - FirefoxOS - the platform HTML5 deserves
Øredev2013 - FirefoxOS - the platform HTML5 deservesChristian Heilmann
 
NoSQL meets Microservices - Michael Hackstein
NoSQL meets Microservices - Michael HacksteinNoSQL meets Microservices - Michael Hackstein
NoSQL meets Microservices - Michael Hacksteindistributed matters
 
HTML, not just for desktops: Firefox OS - Congreso Universitario Móvil - 201...
HTML, not just for desktops: Firefox OS - Congreso Universitario Móvil - 201...HTML, not just for desktops: Firefox OS - Congreso Universitario Móvil - 201...
HTML, not just for desktops: Firefox OS - Congreso Universitario Móvil - 201...Frédéric Harper
 
Wprowadzenie do technologi Big Data i Apache Hadoop
Wprowadzenie do technologi Big Data i Apache HadoopWprowadzenie do technologi Big Data i Apache Hadoop
Wprowadzenie do technologi Big Data i Apache HadoopSages
 
Connecting Pebble to the World
Connecting Pebble to the WorldConnecting Pebble to the World
Connecting Pebble to the WorldPebble Technology
 

Similar to Voice-enabling Your Home and Devices with Amazon Alexa and AWS IoT - Level 200 (20)

WebAPIs & WebRTC - Spotify/sthlm.js
WebAPIs & WebRTC - Spotify/sthlm.jsWebAPIs & WebRTC - Spotify/sthlm.js
WebAPIs & WebRTC - Spotify/sthlm.js
 
Firefox OS, une plateforme à découvrir - IO Saglac - 2014-09-09
Firefox OS, une plateforme à découvrir - IO Saglac - 2014-09-09Firefox OS, une plateforme à découvrir - IO Saglac - 2014-09-09
Firefox OS, une plateforme à découvrir - IO Saglac - 2014-09-09
 
AWS IoTで家庭内IoTをやってみた【JAWS DAYS 2016】
AWS IoTで家庭内IoTをやってみた【JAWS DAYS 2016】AWS IoTで家庭内IoTをやってみた【JAWS DAYS 2016】
AWS IoTで家庭内IoTをやってみた【JAWS DAYS 2016】
 
Firefox OS
Firefox OSFirefox OS
Firefox OS
 
Decentralized Stream Processing over Web-enabled Devices
Decentralized Stream Processing over Web-enabled DevicesDecentralized Stream Processing over Web-enabled Devices
Decentralized Stream Processing over Web-enabled Devices
 
AWS IoT 핸즈온 워크샵 - 실습 3. AWS IoT Thing Shadow (김무현 솔루션즈 아키텍트)
AWS IoT 핸즈온 워크샵 - 실습 3. AWS IoT Thing Shadow (김무현 솔루션즈 아키텍트)AWS IoT 핸즈온 워크샵 - 실습 3. AWS IoT Thing Shadow (김무현 솔루션즈 아키텍트)
AWS IoT 핸즈온 워크샵 - 실습 3. AWS IoT Thing Shadow (김무현 솔루션즈 아키텍트)
 
HTML pour le web mobile, Firefox OS - Devfest Nantes - 2014-11-07
HTML pour le web mobile, Firefox OS - Devfest Nantes - 2014-11-07HTML pour le web mobile, Firefox OS - Devfest Nantes - 2014-11-07
HTML pour le web mobile, Firefox OS - Devfest Nantes - 2014-11-07
 
Firefox OS: HTML5 sur les stéroïdes - HTML5mtl - 2014-04-22
Firefox OS: HTML5 sur les stéroïdes - HTML5mtl - 2014-04-22Firefox OS: HTML5 sur les stéroïdes - HTML5mtl - 2014-04-22
Firefox OS: HTML5 sur les stéroïdes - HTML5mtl - 2014-04-22
 
NoSQL meets Microservices
NoSQL meets MicroservicesNoSQL meets Microservices
NoSQL meets Microservices
 
Michael Hackstein - NoSQL meets Microservices - NoSQL matters Dublin 2015
Michael Hackstein - NoSQL meets Microservices - NoSQL matters Dublin 2015Michael Hackstein - NoSQL meets Microservices - NoSQL matters Dublin 2015
Michael Hackstein - NoSQL meets Microservices - NoSQL matters Dublin 2015
 
node.js and the AR.Drone: building a real-time dashboard using socket.io
node.js and the AR.Drone: building a real-time dashboard using socket.ionode.js and the AR.Drone: building a real-time dashboard using socket.io
node.js and the AR.Drone: building a real-time dashboard using socket.io
 
HTML for the Mobile Web, Firefox OS - All Things Open - 2014-10-22
HTML for the Mobile Web, Firefox OS - All Things Open - 2014-10-22HTML for the Mobile Web, Firefox OS - All Things Open - 2014-10-22
HTML for the Mobile Web, Firefox OS - All Things Open - 2014-10-22
 
Firefox OS, HTML5 to the next level - Python Montreal - 2014-05-12
Firefox OS, HTML5 to the next level - Python Montreal - 2014-05-12Firefox OS, HTML5 to the next level - Python Montreal - 2014-05-12
Firefox OS, HTML5 to the next level - Python Montreal - 2014-05-12
 
Backend, app e internet das coisas com NodeJS no Google Cloud Platform
Backend, app e internet das coisas com NodeJS no Google Cloud PlatformBackend, app e internet das coisas com NodeJS no Google Cloud Platform
Backend, app e internet das coisas com NodeJS no Google Cloud Platform
 
Backend, app e internet das coisas com NodeJS no Google Cloud Platform
Backend, app e internet das coisas com NodeJS no Google Cloud PlatformBackend, app e internet das coisas com NodeJS no Google Cloud Platform
Backend, app e internet das coisas com NodeJS no Google Cloud Platform
 
Øredev2013 - FirefoxOS - the platform HTML5 deserves
Øredev2013 - FirefoxOS - the platform HTML5 deservesØredev2013 - FirefoxOS - the platform HTML5 deserves
Øredev2013 - FirefoxOS - the platform HTML5 deserves
 
NoSQL meets Microservices - Michael Hackstein
NoSQL meets Microservices - Michael HacksteinNoSQL meets Microservices - Michael Hackstein
NoSQL meets Microservices - Michael Hackstein
 
HTML, not just for desktops: Firefox OS - Congreso Universitario Móvil - 201...
HTML, not just for desktops: Firefox OS - Congreso Universitario Móvil - 201...HTML, not just for desktops: Firefox OS - Congreso Universitario Móvil - 201...
HTML, not just for desktops: Firefox OS - Congreso Universitario Móvil - 201...
 
Wprowadzenie do technologi Big Data i Apache Hadoop
Wprowadzenie do technologi Big Data i Apache HadoopWprowadzenie do technologi Big Data i Apache Hadoop
Wprowadzenie do technologi Big Data i Apache Hadoop
 
Connecting Pebble to the World
Connecting Pebble to the WorldConnecting Pebble to the World
Connecting Pebble to the World
 

More from Amazon Web Services

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Amazon Web Services
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Amazon Web Services
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateAmazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSAmazon Web Services
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Amazon Web Services
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Amazon Web Services
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...Amazon Web Services
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsAmazon Web Services
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareAmazon Web Services
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSAmazon Web Services
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAmazon Web Services
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareAmazon Web Services
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWSAmazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckAmazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...Amazon Web Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceAmazon Web Services
 

More from Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Recently uploaded

Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 

Recently uploaded (20)

Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 

Voice-enabling Your Home and Devices with Amazon Alexa and AWS IoT - Level 200

  • 1. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Rodney Haywood Solutions Architect Manager, Amazon Web Services Level 200 © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Voice-Enabling Your Home and Devices with Amazon Alexa and AWS IoT
  • 2. Building Your Device Amazon Lex Amazon Polly Amazon Rekognition AWS IoT
  • 3. Brains are hard to build!
  • 4. Natural Voice Control Automatic speech recognition (ASR) and natural language understanding (NLU) engines. Always Getting Smarter New capabilities and services through machine learning, regular API updates, feature launches. Free, Easy Integration Programming language agnostic service that makes it easy to integrate Alexa into your devices, services, and applications. Best of all, it’s free.
  • 5.
  • 6. Let’s voice enable my home with Alexa and AWS IoT by giving her a new skill.
  • 7. How will we interact with the Garage Door?
  • 8.
  • 11. Raspberry Pi IoT thing GarageDoor IoT topic IoT reported state GPIO4 ClosedSensor: true
  • 12. Raspberry Pi IoT rule IoT thing GarageDoor IoT topic IoT reported state GPIO4 ClosedSensor: true
  • 13. Raspberry Pi IoT rule IoT thing GarageDoor IoT topic IoT device shadow IoT reported state GPIO4 { "reported": { "ClosedSensor": "true", "OpenedSensor": "false” } } ClosedSensor: true
  • 14. Raspberry Pi IoT rule IoT thing GarageDoor IoT topic $aws/things/GarageDoor /shadow/update/documents IoT device shadow IoT reported state GPIO4 { "reported": { "ClosedSensor": "true", "OpenedSensor": "false” } } Web Socket ClosedSensor: true
  • 15. Setup Monitoring the State on the Raspberry PI 1 var GPIO = require('onoff').Gpio; 2 var AWS = require('aws-sdk'); 3 var IOTdevicename = 'GarageDoor'; 4 var IOTendpoint = 'aju7zuv46stdy.iot.ap-southeast-2.amazonaws.com'; 5 var IOTregion = 'ap-southeast-2'; 6 7 var iotdata = new AWS.IotData({endpoint: IOTendpoint, region: IOTregion}); 8 var closedSwitch = new GPIO(5, 'in', 'both'); 9 var openedSwitch = new GPIO(4, 'in', 'both'); 10 11 closedSwitch.watch(function (err, value) { 12 updateShadow(IOTdevicename,'{"state": {"reported": {"ClosedSensor": ' + ((value == 1) ? '"true"' : '"false"') + '}}}'); 13 }); 14 15 openedSwitch.watch(function (err, value) { 16 updateShadow(IOTdevicename,'{"state": {"reported": {"OpenedSensor": ' + ((value == 1) ? '"true"' : '"false"') + '}}}'); 17 }); 18 19 function updateShadow(device, ourPayload) { 20 iotdata.updateThingShadow({ "thingName": device, "payload": ourPayload }, function (err, data) { 21 if (err) { console.log('Opps : ',err); } 22 }); 23 }
  • 16. Initialise Monitoring the State on the Raspberry PI 1 var GPIO = require('onoff').Gpio; 2 var AWS = require('aws-sdk'); 3 var IOTdevicename = 'GarageDoor'; 4 var IOTendpoint = 'aju7zuv46stdy.iot.ap-southeast-2.amazonaws.com'; 5 var IOTregion = 'ap-southeast-2'; 6 7 var iotdata = new AWS.IotData({endpoint: IOTendpoint, region: IOTregion}); 8 var closedSwitch = new GPIO(5, 'in', 'both'); 9 var openedSwitch = new GPIO(4, 'in', 'both'); 10 11 closedSwitch.watch(function (err, value) { 12 updateShadow(IOTdevicename,'{"state": {"reported": {"ClosedSensor": ' + ((value == 1) ? '"true"' : '"false"') + '}}}'); 13 }); 14 15 openedSwitch.watch(function (err, value) { 16 updateShadow(IOTdevicename,'{"state": {"reported": {"OpenedSensor": ' + ((value == 1) ? '"true"' : '"false"') + '}}}'); 17 }); 18 19 function updateShadow(device, ourPayload) { 20 iotdata.updateThingShadow({ "thingName": device, "payload": ourPayload }, function (err, data) { 21 if (err) { console.log('Opps : ',err); } 22 }); 23 }
  • 17. Monitor GPIO State Monitoring the State on the Raspberry PI 1 var GPIO = require('onoff').Gpio; 2 var AWS = require('aws-sdk'); 3 var IOTdevicename = 'GarageDoor'; 4 var IOTendpoint = 'aju7zuv46stdy.iot.ap-southeast-2.amazonaws.com'; 5 var IOTregion = 'ap-southeast-2'; 6 7 var iotdata = new AWS.IotData({endpoint: IOTendpoint, region: IOTregion}); 8 var closedSwitch = new GPIO(5, 'in', 'both'); 9 var openedSwitch = new GPIO(4, 'in', 'both'); 10 11 closedSwitch.watch(function (err, value) { 12 updateShadow(IOTdevicename,'{"state": {"reported": {"ClosedSensor": ' + ((value == 1) ? '"true"' : '"false"') + '}}}'); 13 }); 14 15 openedSwitch.watch(function (err, value) { 16 updateShadow(IOTdevicename,'{"state": {"reported": {"OpenedSensor": ' + ((value == 1) ? '"true"' : '"false"') + '}}}'); 17 }); 18 19 function updateShadow(device, ourPayload) { 20 iotdata.updateThingShadow({ "thingName": device, "payload": ourPayload }, function (err, data) { 21 if (err) { console.log('Opps : ',err); } 22 }); 23 }
  • 18. Send payload Monitoring the State on the Raspberry PI 1 var GPIO = require('onoff').Gpio; 2 var AWS = require('aws-sdk'); 3 var IOTdevicename = 'GarageDoor'; 4 var IOTendpoint = 'aju7zuv46stdy.iot.ap-southeast-2.amazonaws.com'; 5 var IOTregion = 'ap-southeast-2'; 6 7 var iotdata = new AWS.IotData({endpoint: IOTendpoint, region: IOTregion}); 8 var closedSwitch = new GPIO(5, 'in', 'both'); 9 var openedSwitch = new GPIO(4, 'in', 'both'); 10 11 closedSwitch.watch(function (err, value) { 12 updateShadow(IOTdevicename,'{"state": {"reported": {"ClosedSensor": ' + ((value == 1) ? '"true"' : '"false"') + '}}}'); 13 }); 14 15 openedSwitch.watch(function (err, value) { 16 updateShadow(IOTdevicename,'{"state": {"reported": {"OpenedSensor": ' + ((value == 1) ? '"true"' : '"false"') + '}}}'); 17 }); 18 19 function updateShadow(device, ourPayload) { 20 iotdata.updateThingShadow({ "thingName": device, "payload": ourPayload }, function (err, data) { 21 if (err) { console.log('Opps : ',err); } 22 }); 23 }
  • 19. Setup Monitoring via WebSocket 1 $(document).ready(function(){ 2 var creds = new AWS.Credentials(’<access key>', ’<secret key>'); 3 var requestUrl = SigV4Utils.getSignedUrl('aju7zuv46stdy.iot.ap-southeast-2.amazonaws.com', 'ap-southeast-2', creds) 4 var client = new Paho.MQTT.Client(requestUrl, guid()); 5 var connectOptions = { 6 onSuccess: function(){ 7 client.subscribe("$aws/things/GarageDoor/shadow/update/documents"); 8 }, 9 useSSL: true, timeout: 10, mqttVersion: 4, 10 onFailure: function(err) { 11 console.log('Connection Failed:', err); 12 } 13 }; 14 15 client.onMessageArrived = onShadowUpdate; 16 client.connect(connectOptions); 17 });
  • 20. Connect and monitor topic Monitoring via WebSocket 1 $(document).ready(function(){ 2 var creds = new AWS.Credentials(’<access key>', ’<secret key>'); 3 var requestUrl = SigV4Utils.getSignedUrl('aju7zuv46stdy.iot.ap-southeast-2.amazonaws.com', 'ap-southeast-2', creds) 4 var client = new Paho.MQTT.Client(requestUrl, guid()); 5 var connectOptions = { 6 onSuccess: function(){ 7 client.subscribe("$aws/things/GarageDoor/shadow/update/documents"); 8 }, 9 useSSL: true, timeout: 10, mqttVersion: 4, 10 onFailure: function(err) { 11 console.log('Connection Failed:', err); 12 } 13 }; 14 15 client.onMessageArrived = onShadowUpdate; 16 client.connect(connectOptions); 17 });
  • 21. Parse topic payload to json Monitoring via WebSocket 18 function onShadowUpdate(message) { 19 20 d = JSON.parse(message.payloadString); 21 22 if (d.current.state.reported.ClosedSensor == 'true' && 23 d.current.state.reported.OpenedSensor == 'false' && 24 d.current.metadata.reported.OpenedSensor.timestamp > d.previous.metadata.reported.ClosedSensor.timestamp) { 25 26 var wasOpenedFor = d.current.metadata.reported.OpenedSensor.timestamp – d.previous.metadata.reported.ClosedSensor.timestamp 27 var duration = d.current.metadata.reported.ClosedSensor.timestamp – d.current.metadata.reported.OpenedSensor.timestamp 28 29 document.getElementById("state").innerHTML = "Closed"; 30 document.getElementById("traveltime").innerHTML = duration.toString() + "s"; 31 document.getElementById("opentime").innerHTML = wasOpenedFor.toString() + "s"; 32 document.getElementById("message").innerHTML = message.payloadString; 33 } 34 /* ... */ 35 }
  • 22. Test for which event Monitoring via WebSocket 18 function onShadowUpdate(message) { 19 20 d = JSON.parse(message.payloadString); 21 22 if (d.current.state.reported.ClosedSensor == 'true' && 23 d.current.state.reported.OpenedSensor == 'false' && 24 d.current.metadata.reported.OpenedSensor.timestamp > d.previous.metadata.reported.ClosedSensor.timestamp) { 25 26 var wasOpenedFor = d.current.metadata.reported.OpenedSensor.timestamp – d.previous.metadata.reported.ClosedSensor.timestamp 27 var duration = d.current.metadata.reported.ClosedSensor.timestamp – d.current.metadata.reported.OpenedSensor.timestamp 28 29 document.getElementById("state").innerHTML = "Closed"; 30 document.getElementById("traveltime").innerHTML = duration.toString() + "s"; 31 document.getElementById("opentime").innerHTML = wasOpenedFor.toString() + "s"; 32 document.getElementById("message").innerHTML = message.payloadString; 33 } 34 /* ... */ 35 }
  • 23. Pre-calculate some values Monitoring via WebSocket 18 function onShadowUpdate(message) { 19 20 d = JSON.parse(message.payloadString); 21 22 if (d.current.state.reported.ClosedSensor == 'true' && 23 d.current.state.reported.OpenedSensor == 'false' && 24 d.current.metadata.reported.OpenedSensor.timestamp > d.previous.metadata.reported.ClosedSensor.timestamp) { 25 26 var wasOpenedFor = d.current.metadata.reported.OpenedSensor.timestamp – d.previous.metadata.reported.ClosedSensor.timestamp 27 var duration = d.current.metadata.reported.ClosedSensor.timestamp – d.current.metadata.reported.OpenedSensor.timestamp 28 29 document.getElementById("state").innerHTML = "Closed"; 30 document.getElementById("traveltime").innerHTML = duration.toString() + "s"; 31 document.getElementById("opentime").innerHTML = wasOpenedFor.toString() + "s"; 32 document.getElementById("message").innerHTML = message.payloadString; 33 } 34 /* ... */ 35 }
  • 24. Update the page content Monitoring via WebSocket 18 function onShadowUpdate(message) { 19 20 d = JSON.parse(message.payloadString); 21 22 if (d.current.state.reported.ClosedSensor == 'true' && 23 d.current.state.reported.OpenedSensor == 'false' && 24 d.current.metadata.reported.OpenedSensor.timestamp > d.previous.metadata.reported.ClosedSensor.timestamp) { 25 26 var wasOpenedFor = d.current.metadata.reported.OpenedSensor.timestamp – d.previous.metadata.reported.ClosedSensor.timestamp 27 var duration = d.current.metadata.reported.ClosedSensor.timestamp – d.current.metadata.reported.OpenedSensor.timestamp 28 29 document.getElementById("state").innerHTML = "Closed"; 30 4ocument.getElementById("traveltime").innerHTML = duration.toString() + "s"; 31 document.getElementById("opentime").innerHTML = wasOpenedFor.toString() + "s"; 32 document.getElementById("message").innerHTML = message.payloadString; 33 } 34 /* ... */ 35 } 1 2 3 4 1 2 34
  • 25. We now have the door state in an IoT “thing”. Lets teach Alexa the skill.
  • 26. Custom Skill Smart Home Skill API
  • 27.
  • 28. Smart Home Skill API Reference Discovery • DiscoverAppliancesRequest • DiscoverApplianceResponse Control • DecrementPercentageRequest • DecrementPercentageConfirmation • IncrementPercentageRequest • IncrementPercentageConfirmation • IncrementTargetTemperatureRequest • IncrementTargetTemperatureConfirmation • SetLockStateRequest • SetLockStateConfirmation • SetPercentageRequest • SetPercentageConfirmation • SetTargetTemperatureRequest • SetTargetTemperatureConfirmation • TurnOnRequest • TurnOnConfirmation • TurnOffRequest • TurnOffConfirmation Query • GetLockStateRequest • GetLockStateResponse • GetTargetTemperatureRequest • GetTargetTemperatureResponse • GetTemperatureReadingRequest • GetTemperatureReadingResponse
  • 31. Request type handler Lambda Function 1 exports.handler = function(event, context) { 2 3 log('Input', event); 4 5 switch (event.header.namespace) { 6 7 case 'Alexa.ConnectedHome.Discovery': 8 handleDiscovery(event, context); 9 break; 10 case 'Alexa.ConnectedHome.Query': 11 handleQuery(event, context); 12 break; 13 default: 14 log('Err', 'No supported namespace: ' + event.header.namespace); 15 context.fail('Something went wrong'); 16 break; 17 } 18 };
  • 32. Response Header Alexa.ConnectedHome.Discovery 19 function handleDiscovery(accessToken, context) { 20 var headers = { 21 namespace: 'Alexa.ConnectedHome.Discovery', 22 name: 'DiscoverAppliancesResponse', 23 payloadVersion: '2' 24 }; 25 var payload = { 26 "discoveredAppliances":[ 27 { 28 "applianceId": "GarageDoor", // IoT Thing name 29 "friendlyName": "Garage Door", // What we say to Alexa 30 "isReachable": true, 31 "actions": ["getLockState”], 32 "additionalApplianceDetails":{ // Extra data returned in future requests 33 "IOT_Endpoint": "aju7zuv46stdy.iot.ap-southeast-2.amazonaws.com", 34 "IOT_Region": "ap-southeast-2" 35 } 36 } 37 ] 38 } 39 var result = { header: headers, payload: payload }; 40 context.succeed(result); 41 }
  • 33. An array of available appliances Alexa.ConnectedHome.Discovery 19 function handleDiscovery(accessToken, context) { 20 var headers = { 21 namespace: 'Alexa.ConnectedHome.Discovery', 22 name: 'DiscoverAppliancesResponse', 23 payloadVersion: '2' 24 }; 25 var payload = { 26 "discoveredAppliances":[ 27 { 28 "applianceId": "GarageDoor", // IoT Thing name 29 "friendlyName": "Garage Door", // What we say to Alexa 30 "isReachable": true, 31 "actions": ["getLockState”], 32 "additionalApplianceDetails":{ // Extra data returned in future requests 33 "IOT_Endpoint": "aju7zuv46stdy.iot.ap-southeast-2.amazonaws.com", 34 "IOT_Region": "ap-southeast-2" 35 } 36 } 37 ] 38 } 39 var result = { header: headers, payload: payload }; 40 context.succeed(result); 41 }
  • 34. Return header and payload Alexa.ConnectedHome.Discovery 19 function handleDiscovery(accessToken, context) { 20 var headers = { 21 namespace: 'Alexa.ConnectedHome.Discovery', 22 name: 'DiscoverAppliancesResponse', 23 payloadVersion: '2' 24 }; 25 var payload = { 26 "discoveredAppliances":[ 27 { 28 "applianceId": "GarageDoor", // IoT Thing name 29 "friendlyName": "Garage Door", // What we say to Alexa 30 "isReachable": true, 31 "actions": ["getLockState”], 32 "additionalApplianceDetails":{ // Extra data returned in future requests 33 "IOT_Endpoint": "aju7zuv46stdy.iot.ap-southeast-2.amazonaws.com", 34 "IOT_Region": "ap-southeast-2" 35 } 36 } 37 ] 38 } 39 var result = { header: headers, payload: payload }; 40 context.succeed(result); 41 }
  • 36. Echo Alexa smart home skill Lambda function GarageDoor Is the Garage Door locked?GetLockStateRequest
  • 37. Echo Alexa smart home skill IoT device shadow Lambda function GarageDoor Is the Garage Door locked? { "reported": { "ClosedSensor": "true", "OpenedSensor": "false” } } GetLockStateRequest
  • 38. Handle “Is the door locked?” query Alexa.ConnectedHome.Query 42 function handleQuery(event, context) { 43 44 if (event.header.name === 'GetLockStateRequest') { 45 46 // The payload contains our IoT device details in the appliance which were supplied in the original device discovery 47 var IOTdevicename = event.payload.appliance.applianceId; 48 var IOTendpoint = event.payload.appliance.additionalApplianceDetails.IOT_Endpoint; 49 var IOTregion = event.payload.appliance.additionalApplianceDetails.IOT_Region; 50 51 var AWS = require('aws-sdk'); 52 var iotdata = new AWS.IotData({endpoint: IOTendpoint, region: IOTregion}); 53 var params = { "thingName" : IOTdevicename}; 54 55 iotdata.getThingShadow(params, function (err, data) { 56 if (err) { 57 // Build an error response here. 58 context.fail(result); 59 } else { 60
  • 39. Prepare to read the IoT Device Shadow Alexa.ConnectedHome.Query 42 function handleQuery(event, context) { 43 44 if (event.header.name === 'GetLockStateRequest') { 45 46 // The payload contains our IoT device details in the appliance which were supplied in the original device discovery 47 var IOTdevicename = event.payload.appliance.applianceId; 48 var IOTendpoint = event.payload.appliance.additionalApplianceDetails.IOT_Endpoint; 49 var IOTregion = event.payload.appliance.additionalApplianceDetails.IOT_Region; 50 51 var AWS = require('aws-sdk'); 52 var iotdata = new AWS.IotData({endpoint: IOTendpoint, region: IOTregion}); 53 var params = { "thingName" : IOTdevicename}; 54 55 iotdata.getThingShadow(params, function (err, data) { 56 if (err) { 57 // Build an error response here. 58 context.fail(result); 59 } else { 60
  • 40. Call Alexa.ConnectedHome.Query 42 function handleQuery(event, context) { 43 44 if (event.header.name === 'GetLockStateRequest') { 45 46 // The payload contains our IoT device details in the appliance which were supplied in the original device discovery 47 var IOTdevicename = event.payload.appliance.applianceId; 48 var IOTendpoint = event.payload.appliance.additionalApplianceDetails.IOT_Endpoint; 49 var IOTregion = event.payload.appliance.additionalApplianceDetails.IOT_Region; 50 51 var AWS = require('aws-sdk'); 52 var iotdata = new AWS.IotData({endpoint: IOTendpoint, region: IOTregion}); 53 var params = { "thingName" : IOTdevicename}; 54 55 iotdata.getThingShadow(params, function (err, data) { 56 if (err) { 57 // Build an error response here. 58 context.fail(result); 59 } else { 60
  • 41. Determine the state Alexa.ConnectedHome.Query 61 var currentState; 62 if (JSON.parse(data.payload).state.reported.ClosedSensor == "false") { 63 currentState = "UNLOCKED"; 64 } else { 65 currentState = "LOCKED"; 66 } 67 68 var result = { 69 "header":{ 70 "messageId": guid(), 71 "name":"GetLockStateResponse", 72 "namespace":"Alexa.ConnectedHome.Query", 73 "payloadVersion":"2" 74 }, 75 "payload":{ 76 "lockState":currentState, 77 } 78 } 79 context.succeed(result); 80 } 81 }); 82 } 83 }
  • 42. Respond with a header and payload Alexa.ConnectedHome.Query 61 var currentState; 62 if (JSON.parse(data.payload).state.reported.ClosedSensor == "false") { 63 currentState = "UNLOCKED"; 64 } else { 65 currentState = "LOCKED"; 66 } 67 68 var result = { 69 "header":{ 70 "messageId": guid(), 71 "name":"GetLockStateResponse", 72 "namespace":"Alexa.ConnectedHome.Query", 73 "payloadVersion":"2" 74 }, 75 "payload":{ 76 "lockState":currentState, 77 } 78 } 79 context.succeed(result); 80 } 81 }); 82 } 83 }
  • 44. SELECT "opened" AS message FROM '$aws/things/GarageDoor/shadow/update/documents' WHERE current.state.reported.ClosedSensor = 'false' AND current.state.reported.OpenedSensor = 'true' AND current.metadata.reported.ClosedSensor.timestamp > previous.metadata.reported.OpenedSensor.timestamp
  • 45. What did we build?
  • 46. Raspberry Pi Echo Alexa smart home skill IoT rule IoT thing GarageDoor IoT topic $aws/things/GarageDoor /shadow/update/documents IoT device shadow Lambda function setLIFX Lambda function GarageDoor LIFX lightbulb IoT reported state DiscoverAppliancesRequest Register Skill GPIO4 Is the Garage Door locked? { "reported": { "ClosedSensor": "true", "OpenedSensor": "false” } } GetLockStateRequest Web Socket
  • 47. 1 $0.0034 * $USD / month Sydney Region
  • 48. 1 $0.0034 100 $0.34 * $USD / month Sydney Region
  • 49. 1 $0.0034 100 $0.34 10,000 $33.78 * $USD / month Sydney Region
  • 50. Its easy to voice enable things with Alexa and AWS IoT. What could you build?