Official Alexa Smart Home Skill for openHAB 2

Yes, the code is setup for self deployment, but this is very complicated due to the Alexa + oAuth + lambda environment. The Readme explains how to do this and references two Amazon docs which explain how to setup a Home Skill.

Unfortunately I don’t think the PaperUI has tag editing yet, but you can add tags via the rest api, goto the rest interface at http://yourhost:8080/doc/index.html and click on “items”, under that click on “PUT /items/{itemname}/tags/{tag}”, Enter the item name (case sensitive!) and tag name (also case sensitive!) and then click “try it out”.

5 Likes

I must be doing something wrong.

I enabled the Skill in the Alexa app and linked my myopenhab account. I also added [“Lighting”] to each of my lights in my items file and have those lights accessible in myopenhab as well but can’t seem to discover any devices.

sample of my items files

Color  FF_Light_FamilyLeft 			"Family Left"			(FF_Family, Lights, gdashboard)		["Lighting", "iss:room:FamilyRoom", "iss:type:DevRGBLight"]			{ channel="hue:0210:00178824e7e9:10:color" }
Color  FF_Light_FamilyRight 		"Family Right"			(FF_Family, Lights, gdashboard)		["Lighting", "iss:room:FamilyRoom", "iss:type:DevRGBLight"]			{ channel="hue:0210:00178824e7e9:11:color" }

I also tried with just [“Lighting”] removing the iss imperihome info but was also unable to discover them.

Any thoughts?

Also… on a side note. With already having Hue connected to Alexa, I assume you may end up with duplication and may need to decide what you want to include via the OpenHab skill vs the Hue Skill?

what is returned when you hit https://home.myopenhab.org/rest/items/FF_Light_FamilyLeft in your browser?

Yes, you will have multiple values, while you can delete those from the Alexa interface, I seem to remember they may get magically added back in due to automatic discovery.

Also I have noticed that if you have a large amount of items Alexa will say it does not find any, but if you go back to the Alexa app and look, it actually has found all of them.

This is what I get and I think its all looks correct?

{
  "link": "https://home.myopenhab.org/rest/items/FF_Light_FamilyLeft",
  "state": "82,55,100",
  "type": "Color",
  "name": "FF_Light_FamilyLeft",
  "label": "Family Left",
  "tags": [
    "Lighting",
    "iss:room:FamilyRoom",
    "iss:type:DevRGBLight"
  ],
  "groupNames": [
    "FF_Family",
    "Lights",
    "gdashboard"
  ]
}

Its a bug, I checked the code and we are adding Switch and Dimmer as accepted types but not Color. I just added https://github.com/openhab/openhab-alexa/issues/13

Ok.

I’m still struggling though. I’ve added [“Lighting”] to my remaining zwave switch light items and added them into myopenhab as well, but can’t find any devices in the app.

This is my Kitchen Light. Unsure if matters either, but I’m trying via an Android device. So unsure if anyone with IOS may see different results?

{
  "link": "https://home.myopenhab.org/rest/items/FF_Light_KitchenEating",
  "state": "ON",
  "type": "Switch",
  "name": "FF_Light_KitchenEating",
  "label": "Kitchen Eating",
  "tags": [
    "iss:type:DevSwitch",
    "Lighting",
    "iss:room:Kitchen"
  ],
  "groupNames": [
    "Lights"
  ]
}

I am still struggling with this “[ “Lighting” ]” notation.

I want to use the hue emulation side by side with the new alexa skill and would like to indicate which item should be handled by the hue emulation and which by the alexa smart home skill.

Is this possible?

Something like “[ “Lighting@hue” ]”.

1 Like

Thanks to the information in this thread setup was a breeze. This is awesome and your work is very much appreciated. This is much better than using IFTTT.

I’ll admit I didn’t fully read your first post and thought CurrentTemperature was a supported tag. Spent a bit of time confused, then ended up looking through the code and it appears that during discovery that tag is ignored. Was hoping I could ask Alexa the current temperature/humidity in different parts of my house. Is this something that is planned? I’m not familiar enough with Alexa and the API provided to understand the feasibility/scope of that work.

It’s not currently, but is something we should consider.

Unfortunately this is not supported using the current Home Skill API. If it does become possible I would love to add it.

I take that back, I guess Amazon added that into the API while we were in review ( 3 months!!!), this should be trivial to introduce, i’ll open a bug.

1 Like

This will make me very happy if it’s introduced. Being able to ask the house what temp various rooms are will make my wife happy when she’s worrying about the kids room temps.

The rest of this skill is fantastic to see and will certainly come in useful. Thanks for all the hard work.

FYI this looks to be US only, so we can put it in, but German and possibly UK users may have to wait until Amazon adds this update to their regions.

Or at the openHAB Documentation site:

http://docs.openhab.org/addons/io/homekit/readme.html

Right, thats a better place to go. I have updated the original post. Thanks :slight_smile:

1 Like

This works great for me. Thank you.

As many others I’m waiting for support for rollershutter-items.
If I tag them as “Lighting” it works a little bit with quirky sentenses… What is your best practice for the moment?

And only the Label of the item is recognized as triggerword for alexa.
Is it possible to add different variations for a single item?
(In our house one person calls it “Library”, the other “Music Room” and the third says “Piano Room” for the same light.)

And last but not least: Is it possible to redirect Strings via Alexa to openHAB?
I would like to say “start scene decoration” and get ‘decoration’ as new state to an item.

Roller shutter support has been added, its just not deployed yet. I hope to push that out in the next few days after we get some usage on the code. This would work like a dimmer, so on/off, increase decrease, or set it to a percent like “Alexa set window to 80%”

No this is not possible with the Alexa Smart Home api, only off/on, +/-, % and temperature control.

2 Likes

As a workaround use a dimmer item and a rule:

items:

Rollershutter your_shutter_item ...
Dimmer your_shutter_item_Alexa "shutter" ["Lighting"]

rule:

rule "Shutter Alexa" 

when   
	Item your_shutter_item_Alexa received update
then
	your_shutter_item.sendCommand(your_shutter_item_Alexa.state.toString)
end
3 Likes