Official Alexa Smart Home Skill for openHAB 2

myopenhab
homekit
alexa
Tags: #<Tag:0x00007f0e90034120> #<Tag:0x00007f0e9a103380> #<Tag:0x00007f0e9a103100>

(Dan Cunningham) #1

–Updated 5/31/2018, added new Languages and Regions –

I am pleased to announce that the openHAB 2 Alexa Smart Home skill has been certified by Amazon today and is now live. This skill allows you to connect your openHAB setup through the myopenHAB.org cloud service to Amazon Alexa. With this skill you can control items that respond to on/off and numeric commands as well as limited support for thermostats. The skill is supported for the following languages and regions:

English (UK)
English (US)
English (CA)
English (AU)
English (IN)
French (FR)
German (DE)

Some sample commands are:

Alexa, turn on Kitchen Light
Alexa, turn off Bedroom
Alexa, set Lights to 80 percent
Alexa, brighten Living Room
Alexa, dim Bedroom
Alexa, dim Kitchen by 20 percent
Alexa, brighten Great Room by x percent
Alexa, turn Bedroom light red
Alexa, set Thermostat to 22 degrees
Alexa, decrease Thermostat by 2 degrees
Alexa, increase Thermostat by 1 degrees
Alexa, decrease Thermostat
Alexa, what is Thermostat set to?
Alexa, what is Thermostat temperature?

Items that you wish to expose to Alexa will need to be tagged to identify what type of device Alexa will see them as. See http://docs.openhab.org/addons/io/homekit/readme.html for more information. Lighting, switchable and thermostat tags are currently supported (although not limited to those types of items). Thermostat control must use the Homekit style grouping to associate temperature, mode and set point, see the Homekit binding ReadMe above.

Some examples of tagged items are:

Switch KitchenLights "Kitchen Lights" <light> (gKitchen) [ "Lighting" ]
Dimmer BedroomLights "Bedroom Lights" <light> (gBedroom) [ "Lighting" ]

Group gDownstairsThermostat "Downstairs Thermostat" (gFF) ["Thermostat","Fahrenheit"]
Number DownstairsThermostatCurrentTemp "Downstairs Thermostat Current Temperature" (gDownstairsThermostat) [ "CurrentTemperature" ]
Number DownstairsThermostatTargetTemperature "Downstairs Thermostat Target Temperature" (gDownstairsThermostat) [ "TargetTemperature" ]
String DownstairsThermostatHeatingCoolingMode "Downstairs Thermostat Heating/Cooling Mode" (gDownstairsThermostat) [ "homekit:HeatingCoolingMode" ]

To install the app, add the openHAB skill through the Alexa application on your smartphone or web browser. Follow the prompts to connect the app to your myopenHAB.org account, then allow it to discover your devices.

Thermostat control is currently limited until we have a more complete ontology for tagging. There are a few caveats to keep in mind. First is that we assume temperatures are in Celsius unless the thermostat tagged group also contains the tag “Fahrenheit” (shown above). This is a temporary configuration and will hopefully change in the future. Second is that the Alexa skill expects the thermostat mode item (“homekit:HeatingCoolingMode”) to conform exactly to the strings “OFF, HEAT, COOL, AUTO, heat-cool” or “0,1,2,3”. Again this is a temporary restriction until a more complete solution is developed.

If you’re curious about the code running this skill or wish to contribute to its functionality, you may find it at https://github.com/openhab/openhab-alexa contributors are always welcome!

Thanks to everyone who helped out, keep up the good work!
Dan-


Official Openhab skill for Alexa amazon echo available!
Amazon Echo Skill for OpenHAB available!
Myopenhab.org - ONLINE - But Nothing Else Showing (OH2)
Set startsettings or change current settings for Items (Color, brightness) with command
Sign in issue on Alexa
Voice commands to alexa don't operate dummy switches
Getting basics to work (denon, myopenhab, Alexa)
Voice commands to alexa don't operate dummy switches
Alexa alarm
How to configure Zwave Devices with Alexa?
Alexa Integration Not Working
How do I get OpenHAB2 to work with my Alexa
Alexa, control Heating
Amazon Echo - Alexa don't find any devices
Insteon skill missing in Alexa
Alexa is unable to find any items
Rules are not working
Performance of HUE Rules with RPI 3
Milight item definitions with Alexa
New to OpenHab - How do I fix my wish (Gardena Binding + Alexa file based)
GUI for Alexa and OpenHab
Amazon Dot (Alexa) not finding devices
Complete list of ALL supported english/german voice commands of "Official Alexa Smart Home Skill for OH2"?
First time with OpenHab2 Help needed
Problem with Alexa Skill/Homematic 105155 Funk Heizkörperthermostat
Alexa Smart Home Skill - No devices found - Solution
Alexa won’t find any devices
OpenHab2 - Alexa (Echo) - Phillip Hue Farbe
openHAB, Alexa and Z-Wave: Thermostats
TargetTemperature does not work with Amazon Echo
ALEXA vs. Eurotronic Comet DECT for Fritz!BOX
Help in configuration openhab 2
[proposal] comparison of voice assistants
Alexa with openhab
Amazon Echo items
OpenHab Alexia
Echo dot not showing items of sony bravia android tv
(Paul Muldoon) #2

This is fantastic. I had been holding out on integrating Alexa with the Hue Emulation and will add this Skill later this evening.

My 6yr old already likes to say “Alex, play KidsBop” all day anyway, so this will just make my wife go crazy when my son starts messing with the lights too :slight_smile:

Is it possible to also control other items besides Lights? I have Zwave Switch for a ceiling fan and anything regarding Door Locks, Garage Doors, etc?


(Alex) #3

Very nice, thank you! Are there any big advantages over an existing Hue Emulation setup?


(Dan Cunningham) #4

Thermostat control, easier setup (maybe?) are two advantages, and hopefully as Amazon expands the Smart Home Skill api, we can take advantage of it.


(Alex) #5

Sounds great! I will give it a try this weekend.


(SiHui) #6

Works right out of the box!!! Thx a lot for this amazing new skill :heart_eyes:


(SiHui) #7

Sure, just tag those On/Off switches with “Lighting” and you are good to go …


(Nathan Stratton) #8

Any way to use this without myopenhab?


(Andrey) #9

Can I add those tags to items created in PaperUI?


(Dan Cunningham) #10

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.


(Dan Cunningham) #11

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”.


[Solution Added] List of items added by PaperUI in Openhabian for Alexa tagging
[SOLVED] Easy Way to link alexa to openhab
(Paul Muldoon) #12

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?


(Dan Cunningham) #13

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.


(Dan Cunningham) #14

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.


(Paul Muldoon) #15

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"
  ]
}

(Dan Cunningham) #16

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


(Paul Muldoon) #17

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"
  ]
}

(Martin) #18

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” ]”.


(rooflz) #19

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.


(Dan Cunningham) #20

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