Timo Korinth

2 Meter, 2 Mark

by Timo Korinth

Using Alexa to control a local Raspberry Pi

Here’s how to use Alexa to securely control a Raspberry Pi running on your local network using Amazon Lambda, AWS IoT, MQTT and Node-RED.

If you would like to control your smart home or other devices on your local network with Alexa you are depending on available Alexa Skills on the Amazon App Store. If there is no Skill for your device or the available Skill is not good enough, you are lost (that’s currently the case in Germany). Here’s a way to get full control and flexibility for your smart home using Alexa and a local Raspberry Pi.

The whole idea is based on the fantastic videos of Kurt Braun (especially “Voice Control of Raspberry Pi using Alexa Node-RED & AWS IoT MQTT” & “Amazon Web Services (AWS) IoT MQTT Node-RED Raspberry Pi & PLC“) and some other good resources: e.g. Using Alexa Skills Kit and AWS IoT to Voice Control Connected Devices.


To establish an easy and secure communication between the different services we use the following architecture:

User <-> Alexa <-> AWS Lambda <-> AWS IoT <-> Raspberry Pi

The communication between AWS IoT and the local Raspberry Pi is based on MQTT so you do not need to host your own https service to communicate directly with AWS Lambda. The communication between your Alexa Skill (in AWS Lambda) and AWS IoT is secure and very easy to do. You can think of the IoT thing as a “bridge” to your local device (e.g. Raspberry Pi).


First create a “thing” representing your physical (local) device:

  1. Log into AWS IoT Console
  2. Create a new “thing”
  3. Interact with your “thing” (and copy the Rest API Endpoint for later use) and click on “connect a device”
  4. Download the connection kit and unzip it to your device. If you are using a Raspberry Pi unzip the content to the users root directory:

Create Alexa Skill in AWS Lambda

Create a new Alexa Skill (Alexa Skill Kit) and use the AWS SDK to communicate with your AWS IoT thing. You can download my sample project here: Alexa-Skill-Fernseher. Basically you use the AWS.IoTData Service to communicate with your virtual device:

var iotData = new AWS.IotData({endpoint: config.IOT_BROKER_ENDPOINT});
var topic = "/fernseher";

var params = {
    topic: topic,
    payload: payload,
iotData.publish(params, (err, data) =&amp;amp;amp;amp;gt; {
    if (!err){
        this.emit(':tell', tell);

You can now define a MQTT topic (like “/fernseher”) and use this endpoint to push messages to the AWS IoT “thing” (which will forward it to your real device).


In my case I use Node-RED on my device (a Raspberry Pi 2) to react on any MQTT message pushed to the topic (e.g. “/fernseher”). So I have the flexibility on the client side to do whatever I would like to do. In my sample project I react on the MQTT payload to turn on / off my tv and change channels or the volume via a Node-RED harmony node.

To establish the connection to the AWS IoT thing via MQTT you can use the MQTT-Node in Node-RED. Important: Make sure to change the default port to 8883! Create a new server (use the endpoint url from the interact page) and provide the path to the certificates:

by Timo Korinth

Yarn vs. NPM

There’s a new rising star in the world of package managers: Yarn (by Facebook).

It promises some cool features (especially in comparison to NPM):

  • Ultra fast / Optimized network performance
  • Offline mode / Caching of packages

This sounds good so I tested it with a new Angular 2 application (created with Angular CLI). Unsurprisingly Yarn with cached packages beats them all, but the “normal” first run of Yarn was noticeable slower than the good old NPM install.

I’ve created a short video to show you the results:

by Timo Korinth

World Usability Day 2016

Yesterday was “world usability day 2016” and we were very proud to celebrate it at the “Dortmunder U” with tons of interesting talks and discussions about UX, usability & the future of our digital world. I was especially happy as this event took place in my hometown at this history-charged place.

Martin Hoppe and I talked about 3D in current business applications and how to integrate 3D models in existing applications. We tried to cover all the interesting topics like unity 3D, WPF & HTML Integration, CAD models and HoloLens:


See our slides (in german): Was bringt 3D?

Thanks to everyone who made this possible and hope to see you all next year at the same place!