AlexaPi MQTT Smart Hub, cheap and easy to use smart hub for DIY home automation.
- Small footprint, affordable and low power consumption with Raspberry Pi at the core.
- Amazon Alexa Voice Service integration allows for voice commands for all of your things.
- MQTT communications means low data consumption, real time data and easy to implement on your things big and small.
- Node-Red logic engine allows you to easily extend the functionality of your system from bridging data sources or calculating and sending alerts, emails, or tweets.
- Node-red web based user interface.
- IFTTT integration for even more extensibility.
The AlexaPi MQTT Smart Hub is a solution for creating an extensive, customizable and affordable home automation system without getting you locked into a proprietary ecosystem. The Raspberry Pi can easily run the Alexa Voice Service, MQTT broker and Node-Red among other things.
The Alexa voice service extends your hub with full voice command integration. The voice service makes your Raspberry Pi function much like the Amazon Tap. You must hold down a button while speaking, voice trigger is not allowed per the TOS.
Node-Red is an easy to use logic engine to handle automating alarms, bridging data, or sending alerts. You can also install the Node-red-dashboard module to achieve a web based UI that you can use on any web browser, even your phone.
IFTTT can do a lot of thing however, for the most part in this example we use IFTTT to bridge Alexa to Adafruit.io's cloud MQTT broker. Node-Red then bridges this data to our local MQTT on the pi, this method is more secure than opening our local MQTT up to the internet.
Lets get started by Installing Alexa Voice Service on the Raspberry Pi
Novaspirit Tech has an excellent 10 minute video on installing the Alexa Voice service with a project on github. This is not the only way to do it but might be easier for newer users.
Here is a summation of the steps.
sudo apt-get install git
git clone https://github.com/novaspirit/AlexaPi
Go sign in or sign up for an Amazon Developer account
Select Alexa Voice Service
Register new product Type –> device
Enter Device TypeID and Display Name, it is critical that you remember the spelling and punctuation for these.
Create new Security Profile
Go to Web Settings –> Edit –> Add another: Allowed Origins http://Localhost:5000
Add another: Allowed Origins http://<Your device local IP address>:5000
Add another: Allowed Return URLs http://Localhost:5000/code
Add another: Allowed Return URLs http://<Your device local IP address>:5000/code
Go to the Security profile Get your keys. Run setup.sh and enter the Device Type ID Display Name and security keys at the prompts.
To run the voice service type in the AlexaPi directory.
You will also want to connect a button between pin 6 and 12. I soldered the button on some header pins and plugged it in.
Upgrade Node-red To the Latest Version and Install node-red-dashboard
You can use node-red as is but the latest node-red-dashboard has a lot of nice features so we need to upgrade.
For more detail: AlexaPi MQTT Smart Hub