Wally Flow replaces bulky and uncomfortable wearable mindfulness trackers by seamlessly integrating mindfulness into the workspace. Its completely customizable experience uses Walabot's advanced sensing technology to track movement above a minimum threshold and help users be more mindful throughout the work day via a gentle visual reminder to get up and move.
More specifically: Wally Flow works by having Amazon Alexa control a Python application which uses Walabot to monitor the amount of time you sit at your desk without moving and, if you don't move within the specified amount of time, flashes leds to gently remind you that its time to move. Alexa controls the Raspberry Pi through the TP-Link HS-105 and the Walabot through the Wally Flow program, which is set to run on boot-up. Wally Flow takes in custom inputs each day and also saves your Walabot tracked activity to a local MySQL server for further analysis to help you develop better long-term habits.
DemoHardware
Before we get too deep into the code, let's familiarize ourselves with the hardware and get our setup ready.
Walabot
Walabot is a programmable 3D sensor that uses advanced radio frequency technology (RF) to sense the environment by transmitting, receiving, and recording signals from multiple antennas in its array. Wally Flow uses Walabot Creator which has a 15 antenna array and stands at the mid point in the Walabot line. Also available are the Walabot Starter with the 3 antenna array and Walabot Developer with the impressive 18 antenna array. Wally Flow is designed to be compatible with Walabot devices.
The antenna array is the part of the Walabot that senses the environment. It should be facing you.
Walabot requires a 5V (+/- 10%) power supply. The board can be powered using a USB port and can consume from between 0.4A to 0.9A. Because Wally Flow powers the LED strip through the Raspberry Pi's GPIO, we will need to connect Walabot to an external power source. This requires a change in jumper configuration; on the back of the Walabot, move the jumper from the right side (its starting position) to the left side. This tells Walabot to get its power from the micro USB port which can then be connected to an external 5V power supply.
To connect the Walabot to the Raspberry Pi 3 B, use either a micro-b USB cable or simply plug a micro USB into the right-most portion of the USB-cord port (highlighted in purple in the photographic diagram above).
Below, is a custom 3D-printed stand for the Walabot developer derived Adafruit's Octoprint Raspberry Pi enclosure. When selecting a stand for your Walabot, choose a non-conductive material (such as PLA) to prevent an electric short. It is recommended that the Walabot be stored in a permanent case when not in use. Walabot does sell a first party case as an add-on for the Creator that is ideal for this application; it comes stock with the Developer model.
Raspberry Pi 3 B
While Walabot works on Windows, Linux, and Raspberry Pi, this walk through focuses specifically on the Raspberry Pi 3 B installation. The Mindfulness Program, which is the core of the Wally Flow experience, is a Python 3 program and should work for both Windows and Linux as well. Raspberry Pi is a cheap, open source solution which is why it has been the focus of this walk through.
All you need is a Raspberry Pi 3 B, a monitor, hdmi cable, micro USB card, 5V USB power supply, and an 8GB SD card.
It is also recommended that you add a case to your Raspberry Pi. If you have access to a 3D printer, there are a wide variety of free case designs available. The Walabot stand that is used in this project also has a companion Raspberry Pi case that can be printed.
Here, I have used the SmartiPi Lego-Style Camera Case with custom built mount. An early iteration of this project (and perhaps a later update) had a Lego-enclosure for the Walabot. As you can see from the pictures, the wires from the GPIO connectors fit nicely in this case, even though it was originally intended for the Raspberry Pi 2 B. Another reason why the Raspberry Pi is a great fit for the Walabot's Maker and DIY spirit.
This is the custom mount that I've built for the Rasberry Pi. Originally, the Walabot was to attach directly to the enclosure. Time willing, I will complete the custom Lego enclosure.
Rasbian Installation
Its recommend that you use the latest version of Raspbian, the officially supported Raspberry Pi Operating System.
- Download Raspbian on your main machine
- Unzip the downloaded file
- Insert the SD card
- Format the SD card using your preferred formatting software. A good formatting can be found at SDCard.org.
- Download Etcher to flash Raspbian to the SD card
- Insert the SD card into the Raspberry Pi and boot it up
First Boot
On first boot, we need to install a couple of packages for later. Run the following commands in the terminal on the Raspberry Pi. They will update and check for new packages, install the module to control the Rapberry Pi GPIO channels (the LEDs later), install both the local MySQL database server and the Python 3 MySQL module.
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install rpi.gpio
sudo apt-get install python-mysqldb
sudo apt-get install mysql-server python-mysqldb
sudo pip install PyMySQL
Walabot SDK API Setup
Once you have installed Rasbian, its time to download and install both the Walabot SDK API and the Python Walabot API. We'll do the former first.
- Download the Raspberry Pi Installer from the Walabot 'Getting Started' Page
- Make sure you're in the same directory as the download
- Run the following command
sudo dpkg -i walabot-maker.deb
This installs the Walabot library, database, configuration files, etc, but doesn't add the Python Walabot API to the path. Instead, the Wally Flow program uses the built-in Python module load_source() to load the module.
Local MySQL Database
Our Wally Flow Walabot program uses a local MySQL database to store our movement data for future analysis and statistics. In order to support this, we must first initialize the local database.
Note: Possible future for a mobile application would include the ability to live track to your movement stats with the more portable-sized Walabot Starter
These commands should be entered into the terminal on your Raspberry Pi.
sudo mysql
CREATE DATABASE wallyflowdb;
GRANT ALL PRIVILEGES ON wallyflowdb.* to 'wallflow'@'localhost' IDENTIFIED BY 'wallyflow';
QUIT;`
Launch Wally Flow on Startup
Next, we want to create the functionality that the Wally Flow program launches at startup. In order to do that, we need to create a Desktop File. First, navigate to the hidden autostart directory and then create the desktop file using the following commands.
cd .config/autostart/
sudo vim wallyflow.desktop
Since this file is so small, I'm just going to include the file contents here. Be sure to edit the file path in exec line to match your program location.
[Destop Entry]
Encoding=UTF-8
Type=Application
Name=WallyFlow_Walabot
Exec=lxterminal -e python /home/hackster/wallyflow/wallyflow_walabot.py
StartupNotify=true
Terminal=true
Hidden=false
That should do it! Of course, you have to have a wallyflow_walabot.py file first (you can download it at the bottom or at my github if you haven't already).
5V LED White LED Strip
The Wally Flow Mindfulness program uses a strip of white 5V LEDs to gently remind/motivate the user that it is time to move if the Walabot does not detect movement after the user-specified Maximum Stillness Time by blinking the LED strip at 1 second intervals until movement is detected.
The LED strip is controlled using the RPi.GPIO Python Module using GPIO pin 4, as seen in the custom fritzing schematic below. The LED strip is also wired directly to one of the Raspberry Pi's ground pins. The wires are soldered directly to the LED strip. The LEDs are simple white lights, which is not correctly represented by the schematic, but I couldn't find the correct fritzing part to represent white LEDs.
I used a standard Weller soldering iron to solder the wires directly to the LED strip. The strip is just long enough to cover the monitor. I used only white LEDs so that USB would be sufficient power. The LEDs were attached to the monitor using simple double sided tape.
Amazon Alexa
For this project, I used the Amazon Alexa Echo Dot, but there are a wide variety of Alexa options available. Wally Flow isn't reliant on the type of Alexa you have and can even work with just the Alexa app on your phone.
TP Link HS 105
One of the ways that Wally Flow integrates Alexa smart home functionality and control is through the TP-Link HS-105 Smart Wi-Fi Plug Mini. Since we have set our Wally Flow Walabot Mindfulness tracker program to start at launch, we can now tell use our Alexa to control the Raspberry Pi's startup and shutdown process.
In order to achieve the desired functionality, we need to plug the Raspberry Pi directly into the TP-Link HS-105.
Bridging the gap from Walabot to Raspberry Pi to TP-Link to Alexa is a multi-step process and it does require a mobile device with the Alexa app. First, you have to connect the Tp Link HS-105 plug to the network. This is pretty straight forward.
Connecting TP-Link HS-105 to Wi-Fi
- Download Kasa for Mobile mobile application for either ios or android.
- Connect your mobile device to a 2.4 GHz network
- Launch the mobile app and follow the in-app instructions to connect the plug to the wi-fi network
Before moving on to the Alexa App, make sure that you go into the Device settings on the TP-Link HS-105 plug and toggle the 'Remote Control' option. This has to be on for the next step to work.
Connecting Alexa to TP Link HS-105
- Open the Alexa app
- Open the side menu
- Tap 'Smart Home'
- Scroll to the bottom and tap 'Your Smart Home Skills'
- Tap 'Enable Smart Home Skills'
- Search for 'Kasa'
- Tap 'TP-Link Kasa'
- Tap 'Enable'
- Enter your account information and tap 'Authorize'
- Close out the window by tapping 'x'
- Tap 'Discover Devices' or say 'Alexa, Discover Devices'
- Wait for Alexa to find your device!
Once Alexa has found your device, you can test the functionality with a simple command of 'Alexa, Turn on Desk.' or 'Alexa, Turn off Desk.'
Note: I named my plug 'Desk' because that's where its located. Feel free to name your plug whatever you like!
If everything has worked right, your Raspberry Pi should turn on and off on command. If you have already downloaded the wallyflow_walabot.py program, installed the dependencies, and created the .desktop file, you should see Wally Flow start up on boot!
Full Hardware SetupThis is what my desk looks like fully set up. I have my Raspberry Pi development machine off to the left, the Walabot in the center (keeping track of my movements throughout the day), the Raspberry Pi itself tucked safely in the back, and my Macbook off to the right. The LEDs are taped to the monitor and the Alexa sits next to the Raspberry Pi.
Now that we have fully discussed the hardware setup, we can finally take a look under the hood of the Wally Flow Walabot Python program that we have set to startup on boot in the previous step.
Let's start by taking a look at our Walabot Parameters in the Python file.
Walabot Parameters:
The first thing that is initialized in the program is the Walabot parameters. These parameters are used by the program to configure Walabot's Arena, which is a configurable and delimited space with configurable image resolution.
Before we discuss the input parameters, first we will briefly discuss Scan Profiles.
Walabot offers three different scan profiles depending on the needs of the program: short range; sensor; and sensor narrow.
- Short range is used for short range penetrative scanning and can see into dielectric materials such as walls.
- Sensor provides higher resolution images, but a slower capture rate
- Sensor narrow provides lower resolution images, but a higher capture rate
Short range uses Cartesian coordinates for its parameters whereas the others use spherical coordinates.
Wally Flow uses Sensor narrow. Accordingly, our parameters will be in spherical coordinates.
We're now ready to look at the program parameters.
#Walabot Parameters
#######################################
# Walabot_SetArenaR - input parameters
minInCm, maxInCm, resInCm = 10, 150, 5
# Walabot_SetArenaTheta - input parameters
minInDeg, maxInDeg, resInDeg = -45, 45, 5
# Walabot_SetArenaPhi - input parameters
minPhiInDeg, maxPhiInDeg, resPhiInDeg = -90, 90, 10
#Threshold
threshold = 100
We can see that we're setting the min, max, and resolution values for the radial distance (R) and the theta and phi angles which control how low and far the Walabot can see from its set location. Now these values may need to be adjusted depending on where your Walabot is placed and on what type of stand you're using.
Also notice the threshold value is being set here. This is a configurable sensitivity value. Walabot removes very weak signals according to this threshold.
Mindfulness Parameters:
These Mindfulness parameters are used to customize the user mindfulness experience.
#Mindfulness Parameters
#######################################
#Maximum Stillness Time (in seconds)
maxStillTime = 60 * 10
Maximum Stillness Time is initialized to an arbitrary 600 seconds, but this time is customized by the user at each startup. This value is included for testing purposes.
#Initialize Last Average Position to 0
lastPos = 0
Last Average Position is initialized to 0. Every time you move, Walabot marks your position using its antenna array and gives you a coordinate point. It then keeps track of your last average position to determine if you have moved.
#Minimum Delta needed to update LAP
minDelta = 50
Minimum Delta is the minimum change in position needed to trigger Walabot to update Last Moved Position. Any change that is less than the minimum delta won't trigger an update (changes less than minimum delta would be akin to moving around your desk, leaning over, etc.). You can adjust the minimum delta each day to suit your movement goals.
#Initialize Last Move Time to current time
lastMoveTime = time.time()
#Initialize tEnd to lastMoveTime plus maxStillTime
tEnd = lastMoveTime + maxStillTime
#Initialize Starting Time
startTime = time.time()
#Initialize Movement Count
moveCount = 0
Local MySQL Database
Wally Flow stores the data it collects on a local MySQL database for further analysis. Here, it is connects to the database.
#Set up Connection to MySQLdb
#######################################
db = MySQLdb.connect(user="wallyflow",
passwd="wallyflow",
host="localhost",
db="wallyflowdb")
cursor = db.cursor()
Walabot Class:
According to the Walabot API, there are seven steps for an image to be received by the Walabot application.
7 Steps:
- Connect
- Configure
- Start
- Calibrate
- Trigger
- Get Action
- Stop/Disconnect
The Wally Flow program handles these through a the use of a Walabot class.
#Create Class for Initializing and controling Walabot
#######################################
class Walabot:
def __init__(self):
#Instead of importing Walabot API, load the API directly
self.wlbt = load_source('WalabotAPI',
'/usr/share/walabot/python/WalabotAPI.py')
#Initialize the Walabot
self.wlbt.Init()
Connect
Connection Function
#Connection Function
def connect(self):
print("Connecting...")
while True:
try:
self.wlbt.ConnectAny()
print("Walabot Connected")
return
except self.wlbt.WalabotError as err:
#If there is an error, wait 1 second and retry
print("Connecting...")
time.sleep(1)
Configure
It may seem counterintuitive here to have the DynamicImageFilter set to FILTER_TYPE_NONE as opposed to MTI, but MTI only tracks when something has moved and we want to watch our target at all times. This makes sense because, unfortunately, when we're sitting at our desk's we're at rest (or not moving) for 99% of the time
#Configure Walabot
def configure(self):
print("Configuring...")
time.sleep(1)
# Set Profile to PROF_SENSOR_NARROW For lower resolution
# images but faster capture rate
self.wlbt.SetProfile(self.wlbt.PROF_SENSOR_NARROW)
#Set Arena Values Using Previously Declared Variables
self.wlbt.SetArenaR(minInCm, maxInCm, resInCm)
self.wlbt.SetArenaTheta(minInDeg, maxInDeg, resInDeg)
self.wlbt.SetArenaPhi(minPhiInDeg, maxPhiInDeg, resPhiInDeg)
# Wally Flow detects changes in movement, so no filter type
# MTI would only track targets that move
self.wlbt.SetDynamicImageFilter(self.wlbt.FILTER_TYPE_NONE)
print("Walabot Configured")
Start Walabot
#Start Walabot
def start(self):
print("Starting...")
time.sleep(1)
while True:
try:
self.wlbt.Start()
print("Walabot Started")
return
except self.wlbt.WalabotError as err:
#Retry if error detected
print("Starting...")
time.sleep(1)
Calibrate
def calibrate(self):
print("Calibrating...")
self.wlbt.StartCalibration()
#While the Walabot is still calibrating, trigger Walabot
while self.wlbt.GetStatus()[0] == self.wlbt.STATUS_CALIBRATING:
self.wlbt.Trigger()
print("Calibrated")
Stop and Disconnect
Stop and disconnect are both vital, but are handled as one function since, in Wally Flow, one is not done without the other.
#Stop and Disconnect Walabot at the end of each session to avoid errors
def stopAndDisconnect(self):
print("Stopping..")
time.sleep(1)
self.wlbt.Stop()
self.wlbt.Disconnect()
print("Disconnected")
'Get Action'
The wlbt.Trigger() call records signals for processing and the 'GetSensorTargets' 'Get Action' processes the data and returns target information based on the threshold specified in the earlier parameters.
#The 'Get Action' for Wally Flow is 'GetSensorTargets'
def getTargets(self):
self.wlbt.Trigger()
return self.wlbt.GetSensorTargets()
Wally Flow
This is the main mindfulness function which does the movement tracking.
#Main WallyFlow Function
def WallyFlow(self):
global lastPos, lastMoveTime, tEnd, moveCount
targets = wlbt.getTargets()
Wally Flow gets a list of all the targets in front of Walabot.
currPos = 0
count = len(targets)
if count != 0:
#Detect the 'main' target, i.e. the person sitting
mainTarget = max(targets, key = lambda t: t[3])
It then determines the 'main target'. According to the Walabot API, the main target is the target with the closest position. In this case it would be the closest target to the Walabot.
#Calculate the angle to determine the Main Target current position
angle = math.degrees(math.atan(mainTarget.yPosCm/mainTarget.zPosCm))
currPos += abs(angle)
Wally Flow then determines the Main Target's current position by looking its angle given its position coordinates retrieved from the 'Get Action'. The Main Target's current position is determined then updated.
#Current Delta is the difference between MT's
#current and last positions
currDelta = abs(currPos - lastPos)
#Check if current delta is greated than specified minimum
if currDelta > minDelta:
#Update Last Move Time to Current Time
lastMoveTime = time.time()
#End Time is the time when the MT should next move by
tEnd = lastMoveTime + maxStillTime
moveCount += 1
lastPos = currPos
Once the Main Target's Current Delta is calculated, a check is made to determine if the current delta is greater than the minimum delta. If it is, then Wally Flow goes back and updates the database for the Last Move Time, Time End, Move Count, and Still Time values. These values are saved for for further analysis at a later date.
#Update Last Move Time
sql = "INSERT INTO lmtTable(LastMoveTime, TimeStamp) VALUES ('{}', '{}')".format(cleanlastMoveTime, currentTime)
cursor.execute(sql)
#Update Time End
clean_tEnd = time.strftime("%H:%M",time.localtime(tEnd))
sql = "INSERT INTO teTable(TimeEnd, TimeStamp) VALUES ('{}', '{}')".format(clean_tEnd, currentTime)
cursor.execute(sql)
#Update Move Count
sql = "INSERT INTO mcTable(MoveCount, TimeStamp) VALUES ('{}', '{}')".format(moveCount, currentTime)
cursor.execute(sql)
#Update Still Time
stillTime = round((time.time() - startTime)/60,2)
sql = "INSERT INTO stillTable(StillTime, TimeStamp) VALUES ('{}', '{}')".format(stillTime, currentTime)
cursor.execute(sql)
db.commit()
print("Moved. Delta: ", round(currDelta,2))
return currDelta
else:
return 0
else:
return 0
If the delta was not greater, then the databases are not updated.
Main Function:
The mindfulness program is set to run on startup when the system first boots. It takes in as user input customized Max Still Time and Minimum Delta.
if __name__ == '__main__':
mstMinutes = input("Set maximum stillness time (in minutes): ")
maxStillTime = float(mstMinutes) * 60
print("Maximum stillness time set to {} minutes".format(mstMinutes))
minDelta = int(input("Set minimum delta (integer between 10 and 60): "))
print("Minimum delta is set to {}".format(minDelta))
It then runs the Wally Flow mindfulness program continuously until the program is cancelled or the machine is shutdown. This helps the user maintain a mindful and aware experience throughout the work day.
#Wally Flow runs continuously until cancelled or machine shutdown
while True:
wlbt.WallyFlow()
if time.time() > tEnd:
#Turn LED Strip On
GPIO.output(4,1)
#Wait 1 Second (Maximizes 'blinking light' effect)
time.sleep(1)
#Turn LED Strip Off
GPIO.output(4,0)
pass
AWS Lambda FunctionAmazon Web Services (AWS) Lambda function is an event-driven server-less computing platform. Its a pay-as you go type service where you pay only for the computing time your programs consume, which makes it the ideal endpoint for Alexa skills. Even better, it offers a free tier where the first 1M requests per month are free.
AWS offers an online console for creating lambda functions inline, but because we want to take advantage of the full functionality of new alexa-sdk, we're going to need to create our own deployment package.
Homebrew
These instructions are for Mac OS. It is recommended that you use Homebrew to install required packages, as it expedites the process. Instructions for installing Homebrew can be found on their website.
Node JS
If you don't already have Node JS installed locally, now's a good time to do it. We'll be using brew so it should be quick and painless.
But, it isn't strictly necessary, as the code is run remotely on AWS.
brew install node
That was it. Node JS installed.
Now, we're going to go ahead and make the deployment package.
mkdir wallyflow
cd wallyflow
touch index.js
Now, we're going to go ahead and make the lambda function. At this point, you can open up the index.js file in your favorite editor or, if you're looking to try out something new, I highly recommend Atom. It is an amazing text editor.
Lambda Function
At the start of the index.js file, if you are creating a custom skill, be certain to modify the APP_ID to correspond to your Alexa Skill ID.
const Alexa = require('alexa-sdk');
const AWS = require('aws-sdk');
const APP_ID = 'YOUR ALEXA SKILL HERE ';
Registered Handlers
There are constant handlers that are registered with the lambda handler. In an Alexa skill such as Wally Flow, these represent the intents. Each intent must have a corresponding function for the skill to work properly. I recommend assigning the built in intents such as HelpIntent, StopIntent, and CancelIntent to custom functions to avoid unintended functionality.
const handlers = {
"AboutMindfulnessIntent": function () {
var speechOutput = "Mindfulness is the quality or state of being concious or aware of something. ";
this.emit(':tell', speechOutput);
},
"AboutWallyFlowIntent": function () {
var speechOutput = "Wally Flow helps you be more mindful by gently raising your awareness of periods of extended inactivity.";
this.emit(':tell',speechOutput);
},
"AboutWalabot": function() {
var speechOutput = "Walabot is a programmable 3D imaging sensor. It has flexible sensor system with between 3 and 18 antennas. Walabot can see through solid objects, track movements, and detect surroundings and speed. To purchase a Walabot, go to Walabot.com. ";
this.emit(':tell', speechOutput);
},
"AMAZON.HelpIntent": function () {
var speechOutput = "Here are some things you can say. Tell me about Walabot. Tell me about Wally Flow. Tell me about Mindfulness. You can also say stop if you're done. So how can I help?";
this.emit(':ask',speechOutput,speechOutput);
},
"AMAZON.StopIntent": function () {
var speechOutput = "Goodbye";
this.emit(':tell', speechOutput);
},
"AMAZON.CancelIntent": function () {
var speechOutput = "Goodbye";
this.emit(':tell', speechOutput);
},
Launch Request
The launch request is what gets triggered when we say the skill invocation.
"LaunchRequest": function () {
var speechText = "Welcome to Wally Flow. ";
var repromptText = "For instructions on what you can say, please say help me.";
this.emit(':tell',speechText,repromptText);
}
};
Lambda Handler
The handler is the the part that the lambda actually recognizes and uses. It initializes everything with the constants that we declared above and executes. All lambdas have a handler.
exports.handler = function(event, context, callback) {
const alexa = Alexa.handler(event, context, callback);
alexa.appId = APP_ID
alexa.registerHandlers(handlers);
alexa.execute();
};
Yarn
Yarn is a quick, easy package manager. We will use it to build our deployment package. Go ahead and install it using brew.
brew install yarn
Make sure that you're in the wally flow directory we made earlier, the one that contains our index.js lambda function before continuing. We're going to use yarn to construct build a deployment package.
sudo yarn init
Yarn is now going to ask a series of questions about your deployment package. Go ahead and fill them out for WallyFlow.
question name (wallyflow): WallyFlow
question version (1.0.0):
question description: Wally Flow, Mindfulness with Walabot and Amazon Alexa
question entry point (index.js):
question repository url:
question author:
question license (MIT):
question private:
Alexa SDK
We're going to use yarn to add the alexa-sdk to our deployment package. If you needed to add other packages, you would add them at this time.
sudo yarn add alexa-sdk
Deployment Zip File
Now we're ready to zip up our deployment package. On Mac, we need to zip directly from the terminal as opposed to the context menu to avoid an error in file structure that occurs when doing the latter.
zip -r ../wallyflow.zip *
Create Lambda
To create your lambda, sign in to the AWS Management Console using your AWS credentials.
You want to click Create Function.
For this lambda, choose Node.js 6.10 and lambda_basic_execution role.
Once you create the lambda function, you will arrive at a landing page. You need to do two things here. First, you need to upload the deployment package that we just made. This is done in the Function Code section. Under the drop down menu Code Entry Type select 'Upload a .ZIP file' and upload the zip file of the deployment package.
The next thing that needs to be done is that you need to add an Alexa Skills Kit Trigger to the WallyFlow Lambda. However, this can't be completed until we have an Alexa Skills ID. So, open up a new tab in you browser.
Alexa SkillThe other half of Wally Flow is the Alexa Skill, which is currently in certification for official inclusion into the Alexa Skills store. While the IoT functionality bypasses the need for lambda integration with the use of the TP-Link HS-105, the Alexa Skill with Lambda integration gives more detailed information. Future card functionality will allow the user to customize the maximum still time and minimum delta's directly from their mobile devices and Alexa applications.
The Alexa Skills Kit streamlines the creation of Alexa Skills. Each Alexa skill must have an invocation name; intents, samples, and/or slots; must have the model built; and must have the endpoint saved.
In our case, the invocation is wally flow.
Wally Flow uses a total of 6 intents, 3 custom and 3 built in. Each custom intent must be given a list of defined utterances. Utterances should be as explicit, detailed, and varied as possible. These are phrases and or words that users could say to possibly invoke that intent.
The Alexa Skills Kit converts the information that you give it regarding the invocation name and intents into a JSON file. Its often convenient to edit this file directly, especially when it comes to utterances.
{
"interactionModel": {
"languageModel": {
"invocationName": "wally flow",
"intents": [
{
"name": "AMAZON.StopIntent",
"samples": [
"end",
"stop"
]
},
{
"name": "AMAZON.CancelIntent",
"samples": []
},
{
"name": "AMAZON.HelpIntent",
"samples": []
},
{
"name": "AboutWalabotIntent",
"slots": [],
"samples": [
"define walabot",
"Tell me more about Walabot",
"What is Walabot",
"Tell me about Walabot"
]
},
{
"name": "AboutWallyFlowIntent",
"slots": [],
"samples": [
"Tell me more about Wally Flow",
"Tell me about Wally Flow",
"What is Wally Flow"
]
},
{
"name": "AboutMindfulnessIntent",
"slots": [],
"samples": [
"Tell me more about mindfulness",
"Define mindfulness",
"What is Mindfulness",
"Tell me about Mindfulness"
]
}
],
"types": []
}
}
}
The last thing to be done is to add the lambda arn to the Alexa Skill as the Service Endpoint. Put your ARN in the default region or in an assigned region if you prefer.
Lambda Trigger
Don't forget to go back to your lambda function now that you have your Alexa Skill ID and add the Alexa Skill as a trigger for your Lambda Function.
Comments