KNX Integration & Alexa

Hi everyone,
im pretty new to this so please be patient.
I have a KNX System at home which is currently controlled via a proprietary solution called “easy-master” https://hmi-master.at/ which is a pretty cool system (e.g. automatic calculation of Azimut based on location etc) in terms of preconfigured logics etc, but lacks some “smart features” which came up recently (IFTTT, Google Home). However, it does support Alexa voice commands to control KNX components, but it seems unstable and the Alexa “function” is deactivating itself for some reason (might have to do something when manually controlling components via the iOS App interface?)

I have installed now openhabianpi on the raspberry pi 3 and setup the webservice for controlling it via the app, the KNX, Alexa and network binding etc. I have successfully managed to control one of the KNX groups via dimmer and switch in the basic UI and in the iOS app.
But, how do I integrate Alexa for voice commands to the KNX groups? I really don’t understand how this is working. I see many Alexa “functions” like “start” or “lbuetooth” but nothing like “voice control”. So how do i link a distinct voice command to toggle/dim a group of KNX lights?

In addition it would have been nice to integrate some kind of “presence detection” via the presence of my phone in the WIFI network, i have followed some guide on that and when toggling on/off wifi on my iphone this is correctly represented in the basic UI, but i somehow cannot link it to the KNX device. It should work like: if one of the devices defined in a group is present- manual switching of components should be possible. If all devices defined in that group KNX devices like lights, power plugs etc should turn off automatically.

I’m also confused by the terminology a lot as the KNX software “ETS” uses very different terms compared to openhabian.

Thank you very much for your help!

  • Platform information:
    • Hardware: Raspberry PI 3
    • OS: OpenhabianPi
    • Java Runtime Environment: which java platform is used and what version
    • openHAB version: 2.4

In openHAB, all your devices are represented as Items. These Items need to be exposed to Alexa following the instructions here. The good news is Alexa will be completely oblivious to the fact that you are controlling KNX so anything you can control through openHAB will be controllable through Alexa.

You will need Rules for this. See Generic Presence Detection for a way to do presence detection using more than one sensor, which can be handy.

Then you would have a Rule that get’s triggered when Presence (using the Item name from the tutorial) turns OFF to then send the OFF command to all the Items linked to your KNX devices that you want to turn OFF.

The best place to start is the Concepts section of the docs.

The biggest thing to realize with openHAB is that the concepts are technology agnostic. Once you have the KNX binding correctly configured and Items created and linked to your Things, you are in openHAB world and no longer in KNX world.

Since you are getting started, a quick read through How to get started (there is no step-by-step tutorial).

Hi Rich,
thanks for your help! I tried to follow your instructions, however i was not able to “see” any of my “Things” in the openhab webservice, which is the prerequisite to control it via Alexa, as far as i understood. (I did make the “thing” reachable in the configuration of the webservice though). So Alexa did not find any device when initiating a search for devices.

Now i tried to begin from scratch and have deleted everything, however now I’m getting an “Error 500” which i can’t explain. This is really much more difficult to setup as i expected, im not sure where to go from this point now

Items, not Things are the prerequisite. As documented is several of the links I provided above, Things have Channels. Items link to Channels. Everything else in OH operates on Items. Therefore Alexa works on Items, not Things.

When you see strange errors like this, Clear the Cache if the first step.

OK i almost gave up… i still keep getting that weird 500 error despite clearing the cache, the control panel in the Paper UI is showing up extremely slow (if at all) and i dont know how to link the “Switch channel” of one of my KNX devices (light) to the Echo devices (items).

Is it of importance that i want to control a “group” of KNX lights? So i have grouped them via the ETS software so that i can control all three lights together.

You need to focus on the problem first. Then worry about the other stuff. Are there errors in the logs?

Hi Rich,
thanks for your patience, but i do not see whats my primary problem :smiley:

Please find attached some strings from the log, it seems that it is concerning the cloud thing? I have tested the cloud connection on my iphone, the switch is working correctly, both when connected to the wifi and cellular network only.

Also: the control panel in the paper UI shows up after some time, but i don’t know why it takes such a long time.
Am i looking to the right log or do you wanna see the events log too?

==> /var/log/openhab2/openhab.log <==
2019-06-03 19:25:31.819 [WARN ] [io.openhabcloud.internal.CloudClient] - Jetty r equest 2747173 failed: null
2019-06-03 19:25:31.824 [WARN ] [io.openhabcloud.internal.CloudClient] - Respons e Failure: null
2019-06-03 19:25:48.036 [WARN ] [io.openhabcloud.internal.CloudClient] - Jetty r equest 2747178 failed: null
2019-06-03 19:25:48.042 [WARN ] [io.openhabcloud.internal.CloudClient] - Respons e Failure: null
2019-06-03 19:25:49.582 [WARN ] [io.openhabcloud.internal.CloudClient] - Jetty r equest 2747262 failed: null
2019-06-03 19:25:49.588 [WARN ] [io.openhabcloud.internal.CloudClient] - Respons e Failure: null
2019-06-03 19:25:51.245 [WARN ] [io.openhabcloud.internal.CloudClient] - Jetty r equest 2747265 failed: null
2019-06-03 19:25:51.252 [WARN ] [io.openhabcloud.internal.CloudClient] - Respons e Failure: null
2019-06-03 19:25:53.856 [WARN ] [io.openhabcloud.internal.CloudClient] - Jetty r equest 2747271 failed: null
2019-06-03 19:25:53.863 [WARN ] [io.openhabcloud.internal.CloudClient] - Respons e Failure: null

==> /var/log/openhab2/openhab.log <==
2019-06-03 20:32:14.647 [WARN ] [io.openhabcloud.internal.CloudClient] - Jetty request 2771307 failed: null
2019-06-03 20:32:14.652 [WARN ] [io.openhabcloud.internal.CloudClient] - Response Failure: null
2019-06-03 20:33:09.250 [WARN ] [io.openhabcloud.internal.CloudClient] - Jetty request 2771456 failed: null
2019-06-03 20:33:09.256 [WARN ] [io.openhabcloud.internal.CloudClient] - Response Failure: null

Warnings are usually not something that you have to worry to much about. Have you restarted openHAB since clearing the cache? If not, stop OH, clear the cache, then start it again.

can you tell me the exact command for it? the ones on the link you provided to not work

If those commands don’t work then there is probably something wrong with your installation in the first place. If you are running openHABian then these commands should work. If you installed OH using apt these commands should work.

if i type
sudo openhab-cli stop
i get this:
A systemd service configuration exists…
Use ‘sudo /bin/systemctl stop openhab2.service’ to stop an openHAB service
Stopping any instance of openHAB…

ok sorry, forget my last message, i cleared the cache once again and for now the error has stopped showing up :slight_smile:
how do i link now the channels of one knx device with alexa?

This question and the lack of the little “1” next to all of the links indicates that you have not opened or read any of the links I provided for you. I’m happy to help but I’m not inclined to retype in articles that I and others have spent hours writing which, if you read them, will answer your questions and set you up to be successful in all of you future endeavors with OH in the future.

Please read and follow at least the last link I provided in post 2 above, including reading the articles that post links to.

Then read the first link I provided in post 2 above which tells your everything you need to know to connect openHAB Items so they can be controlled by Alexa.