Official Alexa Smart Home Skill for openHAB 2

I have 19 blinds and only set up the STOP for 2 of them where its most useful. Plus an Alexa Routine to make the phrase ‘STOP blind’ work instead of ‘set blind to STOP’. I like your idea though.

I modified to code to make it work with my previous example and added some logging

This line needed the .toString to make it work



Group:String gShutterCommand  "Shutter command group"  // for Alexa STOP command rule

Group OfficeBlind "Office blind" {alexa="Endpoint.EXTERIOR_BLIND"}
    String OfficeShutter_Command "Office shutter command" (OfficeBlind,gShutterCommand) {alexa="ModeController.mode" [supportedModes="STOP=STOP,UP=UP, DOWN=DOWN", autoupdate="false"]} 
    Rollershutter Office_RollerShutter "Office shutter [%d %%]" <blinds> (OfficeBlind,gAllBlinds) {alexa="RangeController.rangeValue" [supportedRange="0:100:10", unitOfMeasure="Percent", actionMappings="Close=100,Open=0,Lower=(+10),Raise=(-10)", stateMappings="Closed=100,Open=1:100"], channel="openwebnet:bus_automation:Screen10:55:shutter" }


rule "STOP command"
    Member of gShutterCommand received command STOP
    val itemName = new StringBuilder()
    itemName.append = ("Shutter_Command", ""))
    logInfo("Blinds", "STOP command sent to "+ itemName )

Blind stops. Log shows:

[INFO ] [clipse.smarthome.model.script.Blinds] - STOP command sent to Office_RollerShutter

You defined the group “gBlindCommand”, I assume you mean “gShutterCommand” - this group is used by

String OfficeShutter_Command "Office shutter command" (OfficeBlind,gShutterCommand) {alexa=...

Thanks I fixed it. I tidied up my posted test code and missed that bit.

Alexa seemed to understand more reliably when I used for the group name something very different from that used for the group member names. Hence the the use of ‘Shutter’ and ‘Blinds’ in the names. I need to test if this really matters a bit more.

Also, I like my item names to give some idea of their type and or function. It makes a bit easier to follow the code for rules.

I was playing a little bit with nested group definitions for the rollershutters in combination with alexa - but it does not behave as expected.

For example, I have two rollershutter groups (including String + rollershutter item) gRS_living1 and gRS_living2. These groups I want to have again combined in another group gLivingroom.

From alexa point of view I want to be able to trigger each single group + to be able to trigger both groups with the global gLivingroom group.

Group  gLivingroom    "Livingroom"      {alexa="Endpoint.Other"}

Group gRS_living1 "Shutter 1" (gLivingroom) {alexa="Endpoint.Other"}
String living1_stop (gRS_living1) ".." {alexa="ModeController.mode"
Rollershutter living1 (gRS_living1) ".." {alexa="RangeController.rangeValue" ..., channel=".."}

Group gRS_living2 "Shutter 2" (gLivingroom) {alexa="Endpoint.Other"}
String living2_stop (gRS_living2) ".." {alexa="ModeController.mode"
Rollershutter living2 (gRS_living2) ".." {alexa="RangeController.rangeValue" ..., channel=".."}

With this setup I do not get groups in the alexa app, I see as devices both rollershutter items and strings: living1 , living1_stop , living2, living2_stop

I expected to see group gLivingroom, gRS_living1 and gRS_living2

Is it possible to create nested groups in combination with alexa tags?

What do you see with just the top level group as endpoint.other? Also, I wonder if clearing the cache would help.

edit… I have a lot of devices but I can see something is not quite right with the Alexa list of devices. For one the web page list is different from the phone app list. I have so much stuff its not easy to spot a pattern but I do see extra ‘Roller shutter’ devices in the phone app and in the web page like this

For web page only I see two extra smart devices too.

Blind groups are clearly identified as groups in browser but not in the phone app. In the phone only you can dig into the devices settings and see if its a group or not. If group then you see SET and Percent options. Type was listed as ‘other’ and not EXTERIOR_BLIND as in item definition.

So, the device lists are a bit of a confusing mess not helped by the different functionality, experience between the browser Alexa web page vs the Alexa phone app

If your question is about having a group endpoint include other group endpoints, then the answer is no. You can model a group item with a defined type as a single endpoint that would control all the items linked to that group. Or you can just setup a group on the Alexa side.

As a side note, you should set your group endpoint with a proper display category (INTERIOR_BLIND or EXTERIOR_BLIND and if using camel case format Endpoint.InteriorBlind or Endpoint.ExteriorBlind).

Group gLivingroom "Livingroom" {alexa="Endpoint.ExteriorBlind"}
Group:String gRS_living_stop (gLivingroom) ".." {alexa="ModeController.mode" ...}
Group:Rollershutter gRS_living (gLivingroom) ".." {alexa="RangeController.rangeValue" ...}

Group gRS_living1 "Shutter 1" {alexa="Endpoint.ExteriorBlind"}
String living1_stop (gRS_living1, gRS_living_stop) ".." {alexa="ModeController.mode" ...}
Rollershutter living1 (gRS_living1, gRS_living) ".." {alexa="RangeController.rangeValue" ..., channel=".."}

Group gRS_living2 "Shutter 2" {alexa="Endpoint.ExteriorBlind"}
String living2_stop (gRS_living2, gRS_living_stop) ".." {alexa="ModeController.mode" ...}
Rollershutter living2 (gRS_living2, gRS_living) ".." {alexa="RangeController.rangeValue" ..., channel=".."}

I managed to remove my spurious roller shutter items and clear up a few other oddities by commenting // out the blind groups and their items. Then on Alexa side >> Forget all, Discover. I removed the commenting // and then ran Alexa Discovery again. now I just see the Blind groups.

They still show as type ‘other’ in the devices settings in the App. Where is the display/endpoint category used? Under devices in the app I only have Echo&Alexa, Lights, Switches, Cameras and All.

Thank you @jeshab!
Your proposal is exactly doing what I have expected :heart_eyes:

With “our” setup it is also possible to say:
item name stop
without creating a routine!

You can also do this to remove routines (a nice little workaround I discovered last night):

Hi, Yes I know. Thanks for the suggestion. In English its more natural to say ‘Stop office blind’. I am not bothered myself but I wanted it work intuitively for others in my house who don’t care for Alexa and would quickly and happily dismiss the tech if Alexa is too picky.

Like I said above you can create a workaround for other items so using your blind as an example:

String Stop "Stop [%s]"	{alexa="ModeController.mode" [supportedModes="office blind=office blind,lounge blind=lounge blind,kitchen blind=kitchen blind"]}    

You can then setup a rule:
Rule Stop when Item Stop receivedCommand then…

Completely removes the need for:

1 Like

OK I get it now. Is there a limit to the number of modes that can be used?

Nice workaround :+1:

No need to go too crazy on this one :slight_smile: We are working to allow ModeController for Dimmer/Rollershutter in the near future removing the need of having a workaround to send commands to these items. The supported modes for these would be hard coded to UP/DOWN/MOVE/STOP for Rollershutter and to INCREASE/DECREASE for Dimmer item type.


Thanks Jeremy,

I will wait then. Currently busy anyway working on moving everything over to openHAB v2.5 and RPi4. :slight_smile:

I dont think so, not that ive found

You’d only need 4 items to control all your rollershutters. Plus, to make it ‘Wifey’ friendly you can map so so many different variations for each command…
such as

String StopThe "Stop The [%s]"	{alexa="ModeController.mode" [supportedModes="office blind=office blind,blind in the office=blind in the office"]} 
String PleaseStopThe "Please Stop The [%s]"	{alexa="ModeController.mode" [supportedModes="office blind=office blind,blind in the office=blind in the office"]}
String OfficeBlindStop "Office Blind [%s]"|{alexa="ModeController.mode" [supportedModes="stop=stop"]} 

stop the office blind, stop the blind in the office
please stop the office blind, please stop the blind in the office
office blind stop

I am using it mainly for scene activation but its uses in this way are limitless, plus its not much code when you use a switch case rule



I am trying to get the Alexa room awareness feature working. So far it doesn’t work with openHAB items but does seem to work with an Amazon smart plug.

e.g. If I try to say " Turn the light ON" I then get Alexa saying " A few things share the name light which one did you want" There is only one light in the group… duh!! But, if I say switch the plug ON then it works and plug switches on.

Has anyone else got room awareness to work with openHAB items?

item definition:

Switch OfficeLight_Switch "Office light" <light> (gAllLights) {alexa="PowerController.powerState" [category="LIGHT"], channel="openwebnet:bus_on_off_switch:Screen10:16:switch"}


To use that feature, you have to use an Alexa group in which you link the relevant echo device.

I am using a group.

Can anyone tell me the syntax I need to use for my rollershutter? I have an RF based shutter I want to either have at 0 or 100 but want to use the language - “open, close, raise, lower” but in either case it just goes from 0 to 100 the shutter doesnt support increments but WAF means she wants to say “raise” or “open” and get the same result - it opens fully - I currently have a routine to do this that I could get rid of if I can get the (lack of) increments set up.

This item seems to only increment by one when using raise or lower:

Rollershutter BR1_Blindtest "Test Blind [%d%%]" {alexa="RangeController.rangeValue" [ca