OpenHAB 2 and Amazon Echo

Posted by

A year ago I did my first experiments in my house automation together with a Raspberry Pi and openhab. The solution at that time was not satisfactory. I did not find a good, affordable microphone and Google’s voice recognition with the Raspberry PI also didn’t worked very good.
For about a week, I am the owner of an Amazon Echo and I am completely satisfied.

After some searching, I found the following skill to connect the Amazon echo with openHAB 2:

Since I had to fight with the instructions there because of my non-existent experience with the Amazon services, I try to explain all necessary steps a bit more detailed in the following.

It is best to start to setup the environment for the deployment. I did the whole stuff on a Raspberry Pi 2.

The first step is to install nodejs & npm with the following commands:

Here are the instructions for all other available environments:

Possibly, you need to install the built-essentials:

Finally install the node-lambda package:


In order to be able to perform the deployment you have to register to the Amazon AWS .
To be able to create the skill afterwards
Amazon Developer account is required.
Both accounts are free in the basic version.

In the AWS console, you should change your location to Ireland if you are in Europe because Alexa Skills can only have a us-central-1 or eu-west-1 region.
To get the data you need in the later steps, click on the right side on your account name and select My Security Credentials.
On the next page, Access Keys can be used to create an access key. You get the AWS_ACCESS_KEY_ID and the AWS_SECRET_ACCESS_KEY.
You also need the AWS_ROLE_ARN. To create a new role go to the menu item Roles. E.g. you can create one with the name lambda_basic_execution. Select AWS Lambda as AWS Service Roles and select the AWSLambdaBasicExecutionRole in the following selection.
The role ARN is then found in the summary of the role.

Now all the necessary data for the deployment are available.

download openhab-alexa , unzip it and go to the folder.

Rename env_sample in .env and replace the values:
with the respective values.
Also set the value for AWS_REGION to
if you are in Europe.

All the other values can be left as they are.

Now rename the file config_sample.js to config.js.
Here you have to add the adress/IP of openHAB eingetragen and if you need the login data.

After all this is done you can deploy your lambda function with

After successful execution the lambda function should be present in the AWS console. Here you have to set a Alexa Smart Home App trigger with the name openhab.

The next step is to create the Alexa Skill.
Go to the Amazon Developer Account and select Alexa Skill Kit in the Alexa tab and click Add a New Skill.
Use the following settings:
Skill Type: Select Smart Home Skill API
Language: English
Name: openhab

Select Europe (or US) under Configuration and enter the AWS Lambda ARN (it can be found in the overview of the Lambda function).
For the necessary Alexa Account Linking proceed according to the following instructions:

On the next page, select “Show this skill in the Alexa App” and click through to the end.

If everything has worked out you should now find in the Alexa app the created skill with the name openhab.
In order for the openHAB items to be found, they must be provided with a Homekit tag. (see




Lambda > Functions Create a Lambda function Filter Function name openhab-development Actions Description openHAB Alexa Smart Home Skill (development) Runtime Node.js 4.3 Code size 2.9 MB Last Modified yesterday


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.