Difference between revisions of "Amazon Alexa & IoT"

From csn
Jump to navigation Jump to search
 
(33 intermediate revisions by 2 users not shown)
Line 1: Line 1:
building on the last lab we are going to use IFTT or If This Then That to allow us to trigger an action.  
+
If you are working through this, without instructor support and would like video walkthrough of this activity you can find one [http://csn.murdoch.edu.au/Amazon_Alexa_IoT_Vid.mp4 here]
  
in our example we are going to setup an IoT platform for elderly members of our community that are still living at home.
+
In this activity we will use IFTTT or If This Then That to trigger an action. IFTTT can link together devices and easily setup basic flows, allowing one action or trigger to cause another action. In this example, we will set up an IoT platform for users to tell family members that dinner is ready. Picture a large family with some members finishing up at work, some finishing sporting/music after school et cetera. To do this we will use Amazon Alexa, as a trigger for the notification that dinner is ready.
The idea is we can use something like an amazon echo for the final product but we will test on a mobile phone to start with.
+
 
 +
Alexa runs on iOS or Android-based phones as well as dedicated speakers such as the  Amazon Echo dot and Sonos Speaker systems. Alexa is just another voice assistant similar to Apple's Siri or Google's Assistant. After completing this lab with Amazon's Alexa, you may wish to try another voice assistant as the trigger.  
  
 
== Home Help: ==
 
== Home Help: ==
  
In this exercise we will download the Amazon Alexa app to your Apple or Android mobile phone.
+
In this exercise, we will download the Amazon Alexa app to your Apple or Android mobile phone.
  
 
====iOS:====  
 
====iOS:====  
 
[[File:Alexa-app.png|right|thumbnail| Teach Alexa your voice]]
 
[[File:Alexa-app.png|right|thumbnail| Teach Alexa your voice]]
the iOS Amazon Alexa app can be found here
+
The iOS Amazon Alexa app can be found here
 
https://apps.apple.com/au/app/amazon-alexa/id944011620
 
https://apps.apple.com/au/app/amazon-alexa/id944011620
 
====Android:====  
 
====Android:====  
the Android Amazon Alexa app can be found here
+
The Android Amazon Alexa app can be found here
 
https://play.google.com/store/apps/details?id=com.amazon.dee.app
 
https://play.google.com/store/apps/details?id=com.amazon.dee.app
  
 
===Signing in / Creating Amazon account:===
 
===Signing in / Creating Amazon account:===
 
Once the app is downloaded you will need to create an account if you do not have one.
 
Once the app is downloaded you will need to create an account if you do not have one.
On sign in you will get prompted for Alexa to learn you voice saying a few phrases like "Alexa how is the weather"
+
On the sign in you will get prompted for Alexa to learn your voice saying a few phrases like "Alexa how is the weather".
  
After you have done this ask Alexa a few questions and get a feel for how the app works.
+
After you have done this ask Alexa a few questions and get a feel for how the app works. Try:
Maybe "Alexa tell me a joke" or "Alexa I am hungry"
+
*"Alex, tell me a joke"  
 +
*"Alexa, I am hungry"
 +
*"Alexa, do you like pizza?"
  
Now we will need to link Alexa with IFTT.
+
For the prototype, you will need to link Alexa with IFTTT.
  
===IFTT===
+
===IFTTT===
  
Sign into the IFTT account https://ifttt.com/ that you set up in the previous lab.
+
On your computer, sign in to your IFTTT account https://ifttt.com/ or setup an account. Linking devices together that run on different platforms is one of the reasons IFTTT is such a useful service. To add the Amazon Alexa service in Explore area search for "alexa" Click on Amazon Alexa and select "Connect".
 +
 
 +
[[File:IFTTT-ALEXA.PNG|right|thumbnail| Connecting Alexa to IFTTT]]
  
Linking devices together that run different platforms is why IFTTT is such a useful service.
+
This should take you to an Amazon sign-in page, use the username and password that you created/used on the Alexa app on your mobile device.
  
To add the amazon alexa service in the explore area search for "alexa" then click services.
+
You should then get "Service connected successfully!" shown at the top of the page.
  
[[File:IFTTT-ALEXA.PNG|right|thumbnail| Connecting Alexa to IFTTT]]
+
If you get an error, try to connect again.
 +
====Creating the IFTTT function ====
  
Click on Amazon Alexa and select "Connect".
+
Click Explore and then create.
  
This should take you to an Amazon sign in page, use the username and password that you created / used on the Alexa app on your mobile drive.
+
===== If This =====
  
you should then get "Service connected successfully!" shown at the top of the page.
+
Click on ''This'', then search for ''alexa'' and Click on ''Amazon Alexa''
====Creating the IFTTT function ====
 
  
click Explore and then create.
+
In the next screen, select ''Say a specific phrase''.
  
=====if this =====
+
For the prototype, we are going to create an alert that dinner is ready. In the ''What phrase?'' area, write: "dinner ready soon".
  
for this section we will be searching for Alexa
+
Click ''create trigger''.
then selecting Say a specific phrase
 
  
for us we are going to create an alert for a fall, so in the phrase area write "fall help".
+
=====Then That=====
  
click create trigger
+
This example will get send an alert as a text message, but consider that this could also be a phone call or email.
  
=====then that=====
+
First we will sign up for a click send account https://murdochuni.online-send.com/
  
in our example we will get this alert to send an email, this could also be a phone call or text message (android only)
+
Fill out all the requirements. You should then get a confirmation text, type in the four numbers.
  
search email, select send an email.
+
You should now click on ''That'' then search for ''sms'', click on ''ClickSend SMS''.
  
for the subject write "IoT fall alert", and in the body "testing fall alert".
+
Login to ClickSend, click the cross and select connect in the IFTTT page. Click allow.
  
then click create and finally finish.
+
Fill out the phone number you would like the text message to be sent to and the from number, and the message e.g "Dinner will be served in 30 mins". Finally, click ''create action''. Reveiw the trigger message then click ''Finish''.
  
 +
Consider that we could send this to multiple different phone numbers.
  
 
===Testing our Voice command ===
 
===Testing our Voice command ===
  
Now open up the Alexa app on your mobile phone.
+
Now open up the Alexa app on your mobile phone. Say "Alexa trigger dinner ready". You should get a text message telling you dinner is ready. If this has worked then you have now created a custom trigger for Alexa and a subsequent action
  
say "Alexa trigger fall help"
+
===== Experimenting.=====
  
You should get an email saying that fall help has been triggered.
+
*Add another trigger and action: "dinner is ready in 10"
(check your junk mail folder)
+
*Could you create a fall detection mechanism, for the elderly? With an Amazon echo dot, someone could say "Alexa, trigger fall" and this could notify other family members that someone had fallen.
 +
*Can you get Alexa to call/find your phone?
 +
*Install IFTTT on your phone, then investigate the "Get yourself out of an awkward situation (International)" Applet.
 +
*Consider some smartplugs. I have had a lot of success with the following Brilliant Smartplug (https://www.officeworks.com.au/shop/officeworks/p/brilliant-lighting-smart-wifi-plug-with-usb-bl2067605) it works well with IFTTT and Amazon Alexa.

Latest revision as of 02:34, 13 August 2021

If you are working through this, without instructor support and would like video walkthrough of this activity you can find one here

In this activity we will use IFTTT or If This Then That to trigger an action. IFTTT can link together devices and easily setup basic flows, allowing one action or trigger to cause another action. In this example, we will set up an IoT platform for users to tell family members that dinner is ready. Picture a large family with some members finishing up at work, some finishing sporting/music after school et cetera. To do this we will use Amazon Alexa, as a trigger for the notification that dinner is ready.

Alexa runs on iOS or Android-based phones as well as dedicated speakers such as the Amazon Echo dot and Sonos Speaker systems. Alexa is just another voice assistant similar to Apple's Siri or Google's Assistant. After completing this lab with Amazon's Alexa, you may wish to try another voice assistant as the trigger.

Home Help:

In this exercise, we will download the Amazon Alexa app to your Apple or Android mobile phone.

iOS:

Teach Alexa your voice

The iOS Amazon Alexa app can be found here https://apps.apple.com/au/app/amazon-alexa/id944011620

Android:

The Android Amazon Alexa app can be found here https://play.google.com/store/apps/details?id=com.amazon.dee.app

Signing in / Creating Amazon account:

Once the app is downloaded you will need to create an account if you do not have one. On the sign in you will get prompted for Alexa to learn your voice saying a few phrases like "Alexa how is the weather".

After you have done this ask Alexa a few questions and get a feel for how the app works. Try:

  • "Alex, tell me a joke"
  • "Alexa, I am hungry"
  • "Alexa, do you like pizza?"

For the prototype, you will need to link Alexa with IFTTT.

IFTTT

On your computer, sign in to your IFTTT account https://ifttt.com/ or setup an account. Linking devices together that run on different platforms is one of the reasons IFTTT is such a useful service. To add the Amazon Alexa service in Explore area search for "alexa" Click on Amazon Alexa and select "Connect".

Connecting Alexa to IFTTT

This should take you to an Amazon sign-in page, use the username and password that you created/used on the Alexa app on your mobile device.

You should then get "Service connected successfully!" shown at the top of the page.

If you get an error, try to connect again.

Creating the IFTTT function

Click Explore and then create.

If This

Click on This, then search for alexa and Click on Amazon Alexa

In the next screen, select Say a specific phrase.

For the prototype, we are going to create an alert that dinner is ready. In the What phrase? area, write: "dinner ready soon".

Click create trigger.

Then That

This example will get send an alert as a text message, but consider that this could also be a phone call or email.

First we will sign up for a click send account https://murdochuni.online-send.com/

Fill out all the requirements. You should then get a confirmation text, type in the four numbers.

You should now click on That then search for sms, click on ClickSend SMS.

Login to ClickSend, click the cross and select connect in the IFTTT page. Click allow.

Fill out the phone number you would like the text message to be sent to and the from number, and the message e.g "Dinner will be served in 30 mins". Finally, click create action. Reveiw the trigger message then click Finish.

Consider that we could send this to multiple different phone numbers.

Testing our Voice command

Now open up the Alexa app on your mobile phone. Say "Alexa trigger dinner ready". You should get a text message telling you dinner is ready. If this has worked then you have now created a custom trigger for Alexa and a subsequent action

Experimenting.
  • Add another trigger and action: "dinner is ready in 10"
  • Could you create a fall detection mechanism, for the elderly? With an Amazon echo dot, someone could say "Alexa, trigger fall" and this could notify other family members that someone had fallen.
  • Can you get Alexa to call/find your phone?
  • Install IFTTT on your phone, then investigate the "Get yourself out of an awkward situation (International)" Applet.
  • Consider some smartplugs. I have had a lot of success with the following Brilliant Smartplug (https://www.officeworks.com.au/shop/officeworks/p/brilliant-lighting-smart-wifi-plug-with-usb-bl2067605) it works well with IFTTT and Amazon Alexa.