As a parent sometimes you want to know if your kids are asleep in their rooms from anywhere in the house. Wouldn't it be great if you could just ask Alexa?
This project uses Walabot target tracking as a non-creepy way (no cameras or microphones) to check on the kids and see if they're in bed or up and about. Connecting it up to a home automation system and throw in a custom Alexa skill and you can check on them from any room in the house. Throw in an Arduino and you can either wake them up or warn them that it's time to settle down to sleep!
Project Demonstration VideoHow It WorksA custom skill connects the Echo to Node-Red while a Python TCP program in turn connects the Walabot. Node-RED can send on commands to the Arduino alarm device.
Walabot is a programmable 3d sensor perfect for DIY electronics projects. Walabot is a new kind of 3D imaging sensor. It uses radio frequency and will reveal all kinds of things hidden in the world around you. It is handheld, programmable, and the SDK contains a variety of imaging capabilities. The Walabot API will enable you to build your own custom applications.
Node-RedNode-Red is a browser based tool to let you quickly and easily construct your own logic of handling various IoT devices, including subscribing the TCP messages, listening to Alexa requests, reading and writing to Databases, publishing to MQTT brokers and responding to HTTP requests. It also allows you to define specific functions written in JavaScript to provide complex logic operations, while using a visual, easy to use, drag-and-drop user interface to link different components and logic together.
Node-Red is a very light weighted run time built on top of Node.js, taking full advantage of its event-driven, non-blocking model of operation.
For this application no special nodes need to be installed, out of the box Node-RED can create a HTTP end-point for creating web services.
The Alexa Skills Kit (ASK) is a collection of self-service APIs, tools, documentation, and code samples that makes it fast and easy for you to add skills to Alexa. ASK enables designers, developers, and brands to build engaging skills and reach customers through tens of millions of Alexa-enabled devices. With ASK, you can leverage Amazon’s knowledge and pioneering work in the field of voice design.
Quick start steps- Install Node.js
- Install Node-RED
- Install Python 3.6.X
- Setup a MQTT broker
- Install the Walabot SDK
- Download and install the Python Walabot to TCP socket connector.
- Setup Node-RED Walabot Flow
- Setup Node-RED Alexa HTTP endpoint handler Flow
- Setup custom Alexa skill
- Setup Arduino end device
Install NodeJS https://nodejs.org/en/
Step 2Install Node-RED https://nodered.org/docs/getting-started/installation
Step 3Install Python3 https://www.python.org/
Step 4Install a MQTT broker of your choice, here are some suggestions.
https://www.hivemq.com/ or http://mosquitto.org/
Step 5Install the Walabot SDK https://walabot.com/getting-started
Step 6Download the Python connector code.
https://github.com/rondagdag/smart3DSensorForAlexa
Download and Extract the zip file. Execute the Walabot.py program from the command line, append the desired port.
python
Step 7Import the Node-Red Walabot Code from here.
The flow parses the XYZ corrdinate data and presents it for your aditional logic and handling. In this case we also send a timestamp when ever the location data updates.
Step 8Import the Node-RED Alexa endpoint flow from here.
Please note, running this flow on your local machine has some challenges due to Alexa needing HTTPS and certificates. Running this on IBM Bluemix is an easy work around as Bluemix will handle the certificates and it just works.
The flow handles parsing and sorting the requests from Alexa, it returns responses and executes commands. In this case we check to see the last time the walabot registered a movement and returns the number of minutes or hours since movement was seen. If movement was < than 30 minutes the kids are declared as "up". Aditional inject nodes are used to simulate last movement timestamps.
Here are two links to help with creating alexa skills to connect do Node-RED. https://nathan.chantrell.net/20160328/amazon-echo-alexa-skills-kit-integration-with-node-red/
Here is an excelent 11 minute video on how to create a custom Alexa Skill using Node-Red on IBM Bluemix. This video is quick and shows how easy it can be to create a Node-RED Alexa skill.
Step 9Configure the custom Alexa skill. For more information be sure to watch the video above. There are a lot of resources for learning to build your first alexa skill, you can start by reading the Alexa Skills Kit Documentation.
Intents:
{
"intents": [
{
"intent": "QueryIntent"
},
{
"intent": "CommandIntent"
}
]
}
Utterances:
QueryIntent for a status report
QueryIntent for status
QueryIntent are the kids up
QueryIntent are the
QueryIntent are the kids awake
QueryIntent are they moving
QueryIntent are the kids moving
CommandIntent wake them up
CommandIntent wake the kids up
CommandIntent get the kids up
CommandIntent get up the kids
CommandIntent wake up the kids
CommandIntent get them up
CommandIntent wake them up
Step 10The Arduino code is a derivative of this project, watch the video and check the video description for more information.
Download the Arduino sketch found below in the project. The configuration of the sketch is all done in the configuration section.
That's about it! Enjoy and expand on your new custom 3D imaging enhanced Alexa skill!
Amazon skill id = 4668ee6b-cb39-4134-9f02-70b04c15c36a
Comments