1. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
Beginning to Automate
your home with Amazon
Alexa
PETE GALLAGHER
PJGCREATIONS.CO.UK
21/06/2018
2. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
About Me
Pete Gallagher
@pete_codes / @PJGCreations
www.PJGCreations.co.uk
Pete@PJGCreations.co.uk
• IT Consultant
• Decades of Desktop, Web & Embedded
Software experience
• Gadget Addict
3. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
What we’re going to be doing…
A description of the basic elements
Amazon Echo and Alexa
An introduction to the software elements
Building a Basic Alexa Skill
Amazon IoT
Smart Home Skills
Amazon Rekognition
Q&A
4. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
The Parts
5. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
Amazon Echo
6. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
Amazon Echo
“Amazon Echo is a hands-free speaker you control with your
voice.
Echo connects to the Alexa Voice Service to play music, answer
questions, make calls, send and receive messages, provide
information, news, sports scores, weather and more.
All you have to do is ask”
7. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
Invocation, Intents and Utterances
Voice First Design
Connects to AWS Lambda
Alexa Skills
8. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
Skill Name
Doesn’t have to be unique
Name used for the Store
Invocation
Used to launch
Must be at least two words – Unless you are a recognised brand name
Doesn’t have to be unique
Choose something Memorable, easy and relevant
Can be different to the skill name
Can’t use Alexa Reserved Words or infringe copyright
Building a Basic Alexa Skill
9. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
Intents
Used to access sections of the Skill
Acts as a separation between distinct operations
Must be unique to the Skill
Naming is only for reference and convention
Utterances
Per Intent
Set out how the user will invoke the Intents
Multiple different permutations of how to invoke.
Contain Slots – Options fed back to lambda.
Building a Basic Alexa Skill
10. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
Download here:
http://bit.ly/AlexaSmartHome2018Instruction
s
Instructions
11. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
Let’s Build a Skill…
Building a Basic Alexa Skill
12. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
Serverless Computing
Endpoint for Alexa Skills
Process and return responses using ASK SDK
Can be written in Node, Python, C#, Java, GO
Can call out to other services to compute response
AWS Lambda
13. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
Enables Developers to integrate Alexa into their products
SDK’s & API’s for Windows, Linux, Mac OS, Raspberry Pi
https://github.com/alexa/avs-device-sdk/
https://github.com/alexa/avs-device-sdk/wiki/Raspberry-Pi-Quick-Start-
Guide-with-Script
Hardware Development Kits from Synaptics, Intel, Amlogic
Alexa Voice Service
14. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
Let’s add a Lambda…
AWS Lambda
15. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
“Managed Cloud Platform”
Allows billions of devices to securely communicate through a centralised
location.
Devices referred to as “Things”
Works even while offline using “Device Shadow”
AWS IoT Core
16. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
R
E
S
O
U
R
C
E
S
F
I
E
L
D
IoT and Amazon IoT Core
I
O
T
C
O
R
E
Device Gateway
Message Broker
AWS Lambda
S3 Storage
Queue
Notification Service
17. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
Let’s add a “Thing”…
AWS IoT Core
18. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
Raspberry Pi 3B+
Manufacturer: Raspberry Pi Foundation
Processor:
Quad Core Broadcom BCM2837 ARM Cortex
A53 @ 1.4GHz + 1GB RAM
Connectivity: 4x USB, Gigabit Lan, Wifi, Bluetooth LE
I/O: 40 GPIO Pins – SPI, UART, I2C, PWM
Sensors etc: None
Cost: £35 (+ SD Card + PSU + Peripherals)
19. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
4 Channel Relay
Can switch anything from 3v up to 240v
Powered by 5v directly from Pi
Controlled via simple logic direct from Pi
Mains Relay
20. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
Mains Relay
21. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
Code in JavaScript (Node), Python, Node Red etc
Node for this example
Add Node Packages for AWS (IoT Core, S3 etc), Camera, GPIO
Raspberry Pi Code
22. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
Let’s create some code…
Raspberry Pi
23. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
Simpler Skill System
No need to Invoke via a skill name
Requires user to link their account to discover Smart
Things
Building an Alexa Smart Home Skill
24. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
Let’s Build a Smart Home Skill…
Building an Alexa Smart Home Skill
25. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
Image and Video Recognition
Understands Image and Video contents.
Understands Expressions and Emotions
Can recognise faces when compared to a set of known images.
AWS Rekognition
26. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
Cloud Storage
Fast and Cheap
Central repository between Pi and Lambda
AWS S3
27. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
Who’s at the door?
Adding Rekognition to our Skill
28. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
Cheese!
Taking Photos with the
Raspberry Pi Camera
29. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
Questions?
All done