Smart Home openHAB 2 KNX Alexa Speech Recognition

Smart Home – openHAB 2 KNX Alexa Speech Recognition

In this post I will tell you how to set up a KNX Alexa speech recognition with openHAB 2. You do not have to pay a lot of money like for other KNX products. I will tell you what you need and how to set it up step by step.

You no KNX but a different smart home technology? That is no problem with the Hue Emulation Service you may control or your Z-Wave, Homematic and Zigbee Stuff.

openHAB 2 – KNX Alexa Speech Recognition – Prerequisite

KNX Alexa Speech Recognition – Prerequisite – openHAB 2 Server Set Up

First of all you should follow my post about how to set up a openHAB 2 server. You will find an instruction how to get it running on Windows in the same post. If you pick preferred hardware like a Raspberry Pi you should directly read how to Set Up openHAB 2 on a Raspberry Pi.

KNX Alexa Speech Recognition – Prerequisite – KNX IP Gateway

Of course you will need a KNX installation in your home. If you are lucky and have KNX, you should check if you have a KNX IP Interface or Router installed. If so, you only need to get your IP configuration of the KNX device. I will tell you later in the post how to do that.

You should choose a rooter, if you wan to access your KNX bus with more than one Server. If only openHAB 2 connects to your KNX bus, a IP Interface is all you need.

I have made good  experience with the following KNX Router.

  • Product
  • Photos

Gira 216700 IP Router KNX EIB REG

Last update was in: 23. May 2017 15:24
BUY THIS ITEM
Amazon amazon.com

If you pick a IP Interface. You should go with:

  • Product
  • Photos

ABB Stotz S&J IP-Schnittstelle IPS/S 2.1

Last update was in: 23. May 2017 15:24
BUY THIS ITEM
Amazon amazon.com

If you are not familiar with ETS and programming KNX components, you will need an electrician to install the gateway in your home.

KNX Alexa Speech Recognition – Prerequisite – Amazon Echo

The next gadget you will need is an Amazon Echo Dot or an Amazon Echo. You not need the big version, if you do not want to play music a lot. Even if you pick the dot you may connect via Bluetooth or audio jack to your HiFi Equipment.

  • Product
  • Features
  • Photos

Echo Dot (2nd Generation) - Black

Usually ships in 24 hours & Free shipping
Last update was in: 23. May 2017 15:24

$49.99

BUY THIS ITEM
Amazon amazon.com


  • Product
  • Features
  • Photos

Amazon Echo - Black

Usually ships in 24 hours & Free shipping
Last update was in: 23. May 2017 15:24

$179.99

BUY THIS ITEM
Amazon amazon.com

Connect your Amazon Echo to your network and follow the Set-Up Instruction of the Alexa App.

Advertisement

openHAB 2 – KNX Alexa Speech Recognition – Configuration

After setting up the needed hardware and the basic installation of openHAB 2 you are ready to go with your configuration.

KNX Alexa Speech Recognition – Configuration – KNX IP Gateway

As mentioned above you will need the correct parameter in your KNX IP Gateway or get the data from there if you already own a KNX IP Gateway.

If you own a gateway, ask you electrician to send you the configuration of your gateway. Tell him you need the IP Address he configured in your IP Gateway. If you do not have a gateway you can tell your electrician what kind of configuration he should do.

The images down below might differ a bit, because I have an old ABB IPR/S2.1 Router. But it is out of stock most of the time. So pick your device for example from the recommendations above.

First of all he should set the IP Setting so you will have a fixed IP. It does not make sense to use DHCP, because you always want the same address. Go to your Device and click IP Settings (1). Then choose fixed (2)

Smart-Home-openHAB-2-KNX-Alexa-Speech-Recognition-IP-Gateway-Settings

No you should go to IP address (1). Choose a unique good to remember  IP address for your KNX IP Device (2) e.g. 192.168.5.111 . Put in a Subnet Mask. That should typically be 255.255.255.0 (3). The last Address (Standard Gateway) will be filled with your Router IP (3) e.g. 192.168.5.1.Smart-Home-openHAB-2-KNX-Alexa-Speech-Recognition-IP-Gateway

KNX Alexa Speech Recognition – Configuration – KNX Binding and Configuration

Now you will have to connect your KNX IP Gateway to openHAB 2. First of all go to the PaperUI into the Add Ons. Replace <openHAB_IP> with the IP of your openHAB 2 device.

Scroll down and you will find the KNX Binding (ignore the rectangle around Hue Binding). Click Install on the right side.

openHAB2-Binding-installi

After the installation was successful, the item should show a blue circle in front of the binding and the INSTALL will change to UNINSTALL.

Smart-Home-openHAB-2-KNX-Alexa-Speech-Recognition-KNX-Binding

If you use Windows, simply go to your configuration folder within the Smart Home Designer and open the services folder. Double Click on knx.cfg to open the file.

Smart-Home-openHAB-2-KNX-Alexa-Speech-Recognition-KNX-Config

Now you have to change some lines to connect openHAB 2 to your KNX Bus. Some guys mentioned, that it should work with simply changing the connection type to type=ROUTER.

But in my set up it did not work. I had to put in the IP address that was configured in the KNX IP Gateway. So you will change the following. Replace <KNX_Gateway_IP> with the KNX IP Gateway address from above:

If you are using openHABian you will have to change an additional line . The Local IP (<openHAB_IP>) will be replaced by your openHAB 2 device IP. So this is only optional, if you do not use openHABian leave the line as is.

KNX Alexa Speech Recognition – Configuration – Hue Emulation Service

Call your Addons again (1). Goto Misc (2) and Install (3) the Hue Emulation Service.

Smart-Home-openHAB-2-KNX-Alexa-Speech-Recognition-Hue-Emulation-Install

After you have installed the Hue Emulation Service in openHAB 2 go to.

Click the tab IO. You should see a box wit Hue Emulation. Click Configure and now you have to choose “Pairing Enabled”. Do not forget to SAVE.

Smart-Home-openHAB-2-KNX-Alexa-Speech-Recognition-Hue-Emulation-Enable

KNX Alexa Speech Recognition – Configuration – openHABian KNX Daemon (optional)

If you uses openHABian as I do. You need to do the following. Connect to your Raspberry with Putty like described in the post Smart Home – openHAB 2 Raspberry Pi Installation.

When your are connected call openhabian-config.

You will have to put in your passwort next in the Config will open. Choose Entry 20 to intsall KNX daemon.

Smart-Home-openHAB-2-KNX-Alexa-Speech-Recognition-KNX-openHABian

So you are all ready to go  to set up your openHAB items.

KNX Alexa Speech Recognition – Configuration – Sitemap and Items

Now you have to configure your items to control your KNX installation by speech. We will pick two simple items. A Switch (on/off) and a Dimmer (Percentage Value, On/Off).

Open your Smart Home Designer and add the following lines in your .items file:

Configuration – Sitemap and Items – Groups

Configuration – Sitemap and Items – Items

The simple Tag [ "Lighting” ] will now lead to recognition in the Hue Emulation Service. Save your .items file.

KNX Alexa Speech Recognition – Configuration – Alexa, discover devices

Now tell say “Alexa, discover devices”. It should identify the two new items. You could also use the Alexa app. Goto Smart Home and click Discover Devices.

Here is one Example, how it should look with your items.

Smart-Home-openHAB-2-KNX-Alexa-Speech-Recognition-Alexa-App-Group-Devices

If nothing is discovered, double check your Settings in the Hue Emulation Service by calling this address in your browser.

We will be happy to see your thoughts

Leave a reply

One Smart Home - Your Smart Home Tutorial Blog