Integrated Alexa and LIFX Bulb
This project uses the DragonBoard™ 410C Development Board from Arrow Electronics integrated with Alexa Voice Services and LIFX light bulbs using Amazon skills kit. The integration is designed to allow the users to turn on or off the LIFX bulb as well as change the bulb’s color via voice commands (e.g., “Alexa, tell DragonBoard 410c to turn the color to green”).
Objective
Using the DragonBoard 410c, the objective of this project is to get familiar with Amazon’s Alexa voice services, Amazon skills kit, and AWS Lambda Functions.
Project Details
- Creator: Tushar Chugh - Student, Carnegie Mellon University and Former Interim Engineering Intern, Qualcomm Technologies, Inc
- Project Name: Integrated Alexa and LIFX Bulb
- Type of Project: Demonstration
- Project Category: Alexa Voice Service, Embedded, IoT, Smart Home
- Board(s) used: DragonBoard 410c
- Difficulty level: Advanced
Resources
While instructions might be made available in other formats at a later time, the following RSS URL can be used to guide you through the entire building and software installation process.
RSS URL
Additional Resources
- LIFX http api
- Creating a deployment package for AWS lambda function
Build / Assembly
- Link to GitHub Repository
- Setup for LIFX app (not required for the demo but can be useful)
- Download LIFX app from the market place
- If the bulb is already paired, reset the bulb and then pair it up with your phone
- Follow the instructions in the app and complete the setup
- Make sure that you have claimed the device
- Get the private token
- Register with LIFX as a developer for Beta HTTP API’s
- Go to https://cloud.lifx.com/settings to get your token. If it doesn’t work then use the URL from https://api.developer.lifx.com/docs/authentication
- Clone the code
- Setup AWS Lambda Function
- Go to https://console.aws.amazon.com/lambda/
- Click on ‘create a lambda function’
- Skip
- Configure triggers -> alexa skills kit, next
- Give some name and description
- Runtime python 2.7
- Compress requests-2.11.1.dist-info, requests and dragonboard.py to dragonboard.zip
- Code copy entry -> upload a .zip file
- Handler: dragonboard.lambda_handler
- Create rule (lambda_basic_execution)
- Next -> Complete Function
- In dragonboard.py paste the token obtained from LIFX
- Setup Alexa skills kit
- Go to https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit
- Click on ‘create a skill now’ (you will need to sign in with your amazon account)
- Click on ‘add a new skill’ button
- On skill information tab, give invocation name as ‘dragonboard’ and a name of your choice
- Go to interaction mode tab, first add custom slot type from ‘custom_slot_types.txt’
- e.g: Type: LIST_OF_COLORS Value: red green blue orange pink white yellow violet cyan
- Copy the content of intent_schema.json and sample_utterance.txt as is
- Go to configuration tab, select Lambda ARN (you can get this ARN on the top of ‘Lamda function’ which was created in the previous section
- Go to test tab: Sample utterance->Enter Utterance->Alexa tell DragonBoard 410c, I am feeling blue
- You should see the bulb change the color and the result in Lambda response
Usage Instructions
- Alexa, tell {App Name} that I am feeling {Color}, where we need to use app name to invoke Alexa.
- Alexa, tell DragonBoard 410c I am feeling blue. (see supported list of colors here)
- Alexa, tell DragonBoard 410c to turn on/off.
- Alexa, tell DragonBoard 410c to turn the color to green.