Official Alexa Smart Home Skill for openHAB 2

Thank you for your help.

Best regards,
Davor

1 Like

My previous point was a supposition if Amazon had included the “Stop” action semantic extension. I was just thinking ahead :smile: There is no way around the recommendation I provided earlier right now.

So based on this use case, I am considering expanding the item type support for ModeController to Rollershutter (UP/DOWN & STOP/MOVE) and Dimmer (INCREASE/DECREASE). This will not resolve the issue for the missing action but would give a better control of these item type abilities.

The only issue here is that you cannot combine range & mode controllers under one single item, the same way than PowerController and BrightnessController. I just tested it and it silently fails on the Alexa side to recognize the item. So if you want to have numerical control along with using the item type commands, you would still need to use a proxy item as well. If you only care about specific positions, you can add them as modes and even give them a name.

I just want to be clear the example below will not work with the current live skill. I just wanted to know if this is something that you might consider using with your binding? I am trying to determine if I should make the change or not. With this definition, you would only have to setup a routine to send “STOP” directly to your item without the need of a proxy item.

Rollershutter Blind "Blind" {alexa="ModeController.mode" [category="INTERIOR_BLIND", friendlyNames="@Setting.Opening", supportedModes="0=@Value.Close,50=Half:Fifty Percent,100=@Value.Open,UP=Up,DOWN=Down,STOP=Stop,MOVE=Move", actionMappings="Close=0,Open=100,Lower=DOWN,Raise=UP", stateMappings="Closed=0,Open=100"]}

It is possible to get the state with a hack. (Whether you call this possible or not probably depends on how much of a hack you think this is.) Set up a proxy item that as a temperature, and copy the real item’s value into that proxy item (must translate into a reasonable temperature range). Alexa can query temperature. So, for example, I have my garage door set up where “garage temperature” 0 means closed, and 100 means open. This works fine, but Alexa will say “the garage door temperature is 0”. As long as you are okay with that, you can get the state of almost anything you want.

I guess I am just trying to limit the level of complexity :smile: There is certainly other ways to implement this as you mentioned.

If you get me going, you can actually set any numerical items as a RangeController or switch items as ToggleController and you would get the state back on voice request. I am just concerned that it might add to the complexity of configuring a simple light item. But maybe I should have mentioned it in the end. Thanks for keeping me honest! :smile:

Switch Light "Light" {alexa="ToggleController.toggleState" [category="LIGHT", friendlyNames="Switch"]}

Dimmer Dimmer "Dimmer" {alexa="RangeController.range" [category="LIGHT", friendlyNames="Level", unitOfMeasure="Percent"]}

As a side note, you could use the new metadata label Door with your garage door item and you wouldn’t need any hacks to request its current status :+1:

1 Like

With Sdomotica and my integration for BTicino stop works fine.


Bye
Sandro

Hi Jeremy, Yes I would consider using your suggestion…If I understand correctly when using mode controller I would not be able able to command to any position but only to predefined positions(presets). Is it not possible to use both range controller and mode controller in a group definition?

With the mode controller I would then define preset positions and STOP would work but using Alexa routine. How would MOVE work? Which direction would it move, UP/DOWN? I quickly tried mode controller but the item was not discovered. After your reply I now know why… Rollershutter type is not supported.

The binding I am using is BTicino/OpenWebNet for BUS controlled blinds, lights, thermostats, switches and much more. It is currently and actively being developed further. As I am not an expert I asked the developer @massi et al to take a look over here. Maybe you guys could work together and be more effective than getting ideas from lesser mortals like me :grin: I hope that is OK with you.

The skill return rightly UP/DOWN/STOP, the solution should be find in the bindings for translate it.
Bye
Sandro

Your understanding is correct on all these points. You can’t use both range and mode controller on the same item. You can at the group level but you would have to use two different items which means using a proxy item.

The MOVE command is not related to the binding but to the item type Rollershutter. So it’s up to the binding you are using to handle the command. If it doesn’t, it shouldn’t be added as supported mode. That command is more suited for a curtain where you would use MOVE & STOP to control it. I will most likely have different examples & metadata labels based on the windows covering type.

Anyway, I am planning to make the change I proposed. Amazon provided additional display categories and added a new garage door ability that allows user to use a pin code to open by voice, the same way than a lock. For this implementation, they are requiring a ModeController interface. So the item type support for that controller will also need to be extended to ON/OFF commands (Switch & Dimmer).

I have an idea to enable more natural language commands without the use of the popular workaround using Alexa routines and a proxy item. The problem with routines is that the devices used in the routine get lost after every ‘Forget’ and ‘Discover’ devices operation. That is annoying.

Idea:

  • Use mode controller and string item type with action mappings
  • Update string item with Alexa command to string item
  • Use openHAB rule to run real command depending on string item

I have not tested if it works yet!! Would the voice command for the mode controller be executed as follows ‘Alexa, set Office blind to stop’ ?

If it works then it opens up the possibilty to voice commands for varied device types using rules.
eg My outside lights can be in one of three states:

  • ON with PIR
  • OFF
  • 4hrs constant ON and then PIR. This is activated by a rapid On/Off/On/Off/On to set this mode.

I could action map the above to a String type item with values: ON, OFF, CONSTANT and use a rule to execute the necessary commands to achieve that.

:upside_down_face:

You can be as creative as you want :smile: That was the main reason why we made all the customization part of the Alexa Skill API available to the users. But ultimately, our goal is also to make it simple for the standard users so they can just model their existing device to use with Alexa.

Correct. The “Stop” routine would basically mimic that command.

1 Like

I thought I was a standard user :grin:

Hi,
I am trying to test my idea but I have a problem I don’t understand
Only the Command ‘set Test to Delicate’ works and the item is updated with the string ‘Delicate’. The other commands don’t work for me, but its copied from the examples! It seems I need the @Value.xyz part for it to work. Knits doesn’t work but Delicate does.

String TestString "Test" {alexa="ModeController.mode" [supportedModes="Normal=Normal:Cottons,Delicate=@Value.Delicate:Knits"]}

Did you configure your regional settings? The issue here is that the text-based names need to be localized compared to asset ids that are already on the Alexa side. If it doesn’t match the one from your Amazon account, none of these names will be recognized.

Hello!

I have one more question regarding Alexa OpenHAB skill. I have a number item that is connected to sitemap’s selection widget. It’s used as scene selector (night mode, movie mode…). Is it possible to trigger specific mode via Alexa using just this item (and if it is, how), or it’s necessary to use proxy switch items, one for each mode?

Best regards,
Davor

You should use the ModeController interface and set the supportedModes parameters based on your sitemap mapping for that item.

1 Like

Thank you. That’s exactly what I was looking for.

Best regards,
Davor

Yes regional settings are set via paperUI. Language = English.
However, I use German .de Amazon and country is set to Austria. Amazon language option is also set to English. English Alexa commands work fine.

Could using .de Amazon be the reason?

And which region/country?

I don’t believe that the location of your Amazon account is a factor here. However, what language/country are your echo devices set to? You should have access to that information under the device settings in the Alexa app.

I suspect a mismatch between the two.

I don’t know if is alexa binding related but I have a problem with two rollershutter with semantic configuration.
my conf is
items:

Rollershutter	 Sala_Shutter1   	"finestra uno"   	<rollershutter>	(FamilyRoom, gShutter)  {channel="knx:device:2c7bfaf5:A", alexa="RangeController.rangeValue" [category="INTERIOR_BLIND", friendlyNames="@Setting.Opening", supportedRange="0:100:10", unitOfMeasure="Percent", actionMappings="Close=100,Open=0,Lower=(+10),Raise=(-10)", stateMappings="Closed=100,Open=0:99"]}
Rollershutter    Sala_Shutter2      "finestra due"      <rollershutter>	(FamilyRoom, gShutter)  {channel="knx:device:2c7bfaf5:b", alexa="RangeController.rangeValue" [category="INTERIOR_BLIND", friendlyNames="@Setting.Opening", supportedRange="0:100:10", unitOfMeasure="Percent", actionMappings="Close=100,Open=0,Lower=(+10),Raise=(-10)", stateMappings="Closed=100,Open=0:99"]}

when I say “alexa rise/down finestra 2”, it rise/down “finestra uno”. I tested a lot of time and controlled last command every time and alexa everytime correctly understand it.
Most strange is that if I say “alexa close/open finestra 2” it correctly close or open “finestra 2”.

I just tested on my end with two blinds called “Bind 1” and “Blind 2” without any issues. Maybe you should rename your item label to use a number instead of a word. Alexa language processing should be able to match numbers in your language. And make sure to trigger the Alexa discovery process once you make these changes.

1 Like