SlideShare una empresa de Scribd logo
1 de 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!

Más contenido relacionado

La actualidad más candente

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
 

La actualidad más candente (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 a 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 a 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
 

Más de 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
 

Más de 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
 

Último

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 

Último (20)

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 

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?