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 English (U.S.), English (U.K.), and German languages.
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!