Official Alexa Smart Home Skill for openHAB 2

No: Official Alexa Smart Home Skill for openHAB 2 - #4 by digitaldan

https://forums.developer.amazon.com/articles/46667/what-tcpudp-ports-does-echo-use.html

I tried to install openhab skill, but it is not visible any more. I am sure a have seen it some days ago.

Any idea what is wrong here?

strange, it is visible when searching for “hue”

Hi guys - ive managed to get Alexa to switch on and off my Onkyo amp (very pleased about that) but changing the volume is a bit of a headache at the moment. Im not sure if its my Alexa commands that are wrong or something with the item file?

Dimmer onkyoVolume "Onkyo Volume" [ "Lighting" ] {onkyo="INCREASE:hometheater:VOLUME_UP, DECREASE:hometheater:VOLUME_DOWN"}

Thats what i have in my items file. Did the same thing more or less for the on off but using the Switchable tag instead of Lighting. Ive tried “Alexa, increase Onkyo Volume by 10%” or “Alexa, set Onkyo volume to 5” or “Alexa, set Onkyo volume to 50”. Any ideas what im doing wrong here?

With lighting the voice command I use is “set lightname to fifty percent” - have you tried that?

Using just a number with the set command it doesn’t seem to like it

The increase command you have above Alexa seems “ok” with but nothing happens

@ptmuldoon @Rob_Pope @Michael_Grossman @dgrubbs_99 @stulandr @Andrew_Pawelski @3DJupp @yves @Newan @Likonaus

For all who did not find any device with Alexa( via Official Alexa Smart Home Skill), I have maybe a solution! See here: Link

Hope this helps!

Edit: updated new information! (21 July)

@Aviram @job @Nerdletics @sihui @digitaldan

For all who did not find any device with Alexa( via Official Alexa Smart Home Skill), I have maybe a solution! See here: Link

Hope this helps!

Edit: updated new information! (21 July)

1 Like

@Celaeno1 brought my on the right track. I had missed a bracket “)” in my items file. After fixing that I have discovered that the following line in my .items file is causing major problems:

//Sonoff touch entrance=en
Switch sHallway_en "Hallway" <dimmablelight> (gHallway, gLights) [ "Switchable" ] { mqtt=">[mosquitto:/sonoff_hallway/gpio/12:command:ON:0], >[mosquitto:/sonoff_hallway/gpio/12:command:OFF:1], <[mosquitto:/sonoff_hallway/button/state:state:MAP(onoff.map)]" }

In particular it is the “<” in

<[mosquitto:/sonoff_hallway/button/state:state:MAP(onoff.map)

Even commenting out by either “//” or “*/… */” does not help.

Is there any MQTT specialist out there who could give me a hand on getting this right. It works perfectly, however Alexa does not discover any devices (except for hue bulbs) when this line is in my .items file. As soon as I remove this line (or at least the “<”), Alexa is able to discover devices but then the switch works only in one direction.

the only explanation that I can think of is that the incoming (transformed) state is either empty or null.
how does you onoff.map file look like?
have you checked if the state gets updated correctly? (remove the [ “Switchable” ] tag from the mqtt item for testing)

The onoff.map looks like this:

1=ON
0=OFF
ON=1
OFF=0

It works like a charm, however Alexa does not discover devices. As soon as I remove it, Alexa finds all my devices.
Removing [ “Switchable” ] does not change anything.

clarification: as soon as you remove the entire Switch item line or only the inbound configuration of the mqtt part?

1 Like

As soon as I remove the “<” in

Switch sHallway_en "Hallway" <dimmablelight> (gHallway, gLights) [ "Switchable" ] { mqtt=">[mosquitto:/sonoff_hallway/gpio/12:command:ON:0], >[mosquitto:/sonoff_hallway/gpio/12:command:OFF:1], <[mosquitto:/sonoff_hallway/button/state:state:MAP(onoff.map)]" }

So, when it looks like this

Switch sHallway_en "Hallway" <dimmablelight> (gHallway, gLights) [ "Switchable" ] { mqtt=">[mosquitto:/sonoff_hallway/gpio/12:command:ON:0], >[mosquitto:/sonoff_hallway/gpio/12:command:OFF:1], [mosquitto:/sonoff_hallway/button/state:state:MAP(onoff.map)]" }

Alexa is able to discover devices but the switch of course does not work properly anymore.

In theory:
this is an invalid configuration (without a direction for the 3rd config part)
this means that OH2 will disregard the entire line and throw an error in your log file (does it do that?)
Note: Maybe OH2 is parsing the file (top to bottom), getting stuck on this wrong config and doesn’t continue to load further the items file… so… maybe something else below this line is the real problem (maybe… :slight_smile:)

I don´t think it is something below that. As soon as I remove the inbound sign (<) or the entire line, Alexa discovers everything.

I can confirm this link is the answer to alexa discovering items! thanks again @Celaeno1

@Likonaus

By the way, is your mqtt command correct? Shouldn’t it be:

Switch sHallway_en "Hallway" <dimmablelight> (gHallway, gLights) [ "Switchable" ] { mqtt=">[mosquitto:/sonoff_hallway/gpio/12:command:ON:1], >[mosquitto:/sonoff_hallway/gpio/12:command:OFF:0], <[mosquitto:/sonoff_hallway/button/state:state:MAP(onoff.map)]" }

…and your icon = “dimmablelight”, but your command is ON/OFF. Maybe you need icon “light”?

Question: I use Alexa in german.

How do I tell Alexa in german: OFF, HEAT, COOL, AUTO, heat-cool.

I tried:

AUS = OFF, nothing happend
HEIZEN, HITZE, WARM, WAERME, WAERMER = HEAT, nothing happend
KUEHLEN, KUEHLER, KALT, KAELTE, = COOL, nothing happend
AUTO, AUTOMATISCH, AUTOMATIK = AUTO, → Alexa set Temperature to 1 (OK?? AUTO = 1 ??)

I also tried: BOOST, KOMFORT, MANUELL, MANU, ECO, ECONOMIE, MODE 0,1,2,3, MODUS 0,1,2,3: nothing happend

What do I have to tell Alexa in german? Are the english commands executed at all??

Or do I have to tell: 0,1,2,3 ??

Where do I get a complete list of ALL supported german commands of “Official Alexa Smart Home Skill for OH2”?

Is there also a complete list for english commands at all?

Thank you for pointing that out. I did that on purpose. Since I am a beginner, it was the easiest way to have the light in the switch itself illuminated when the lights are off. Thus, the switch can be seen in dark.

@Likonaus

Have you tried this? (without the spaces?)

Switch sHallway_en "Hallway" <dimmablelight> (gHallway, gLights) [ "Switchable" ] { mqtt=">[mosquitto:/sonoff_hallway/gpio/12:command:ON:0],>[mosquitto:/sonoff_hallway/gpio/12:command:OFF:1],<[mosquitto:/sonoff_hallway/button/state:state:MAP(onoff.map)]" }

I have tried this as well. Since I am mostly using the command line on my Raspberry to write code, I found out that if I write the MQTT code in the way I posted above, the code immediately following the MQTT line turns green which means it is kind of commented out. If I alter the order of the MQTT, then everything works fine. Here is the “new” code:

Switch sHallway_br "Hallway br" <dimmablelight> (gHallway, gLights) [ "Switchable" ] { mqtt="<[mosquitto:/sonoff_hallway/button/state:state:MAP(onoff.map)], >[mosquitto:/sonoff_hallway/gpio/12:command:ON:0], >[mosquitto:/sonoff_hallway/gpio/12:command:OFF:1]" }

Please observe the order of the “<” brackets. In previous post it was “>><”, now it is “<>>”.
Maybe the “<” bracket also serves as a kind of comment character like “//” or “//” ?