Amazon Echo Skill for OpenHAB available!

That could work. My objectives with the setup/config process included:

  • Users shouldn’t need modify their OpenHAB items just to use Alexa-HA…
  • Provide a way to map any word or phrase to be used in the voice command to any item/group. This allows you to have many names for the same ‘thing’ in the house.
  • Heavily customize the voice model to what you have in your particular setup, automatically. Alexa-utterances was a big help with that!
  • Avoid creating useless utterances in the model - i.e. for virtual switches like sunset/sunrise, incoming call, etc

Also, as we move to OpenHAB 2.x, the config/discovery concepts become very different (much more powerful). I will continue to brainstorm on how to approach this!

Besides general bug fixes and improvements, I intend to program Alexa-HA to control KODI instances throughout the house. For example:

  • “Alexa, tell OpenHAB to play the movie ‘The Rock’”
  • “Alexa, tell OpenHAB to play the song ‘Magic Carpet Ride’”
  • “Alexa, tell OpenHAB to play the latest unwatched episode of ‘Mr Robot’”
  • And of course play/stop/pause/volume/next/previous/ff/rw/mute will all be supported too.

Similar in functionality to this.

I’m leaning towards using this Node.js module to accomplish it directly in Alexa-HA, as it seems the logic for search could get ‘nasty’ if built using mostly OpenHAB server side rules… Plus I’m not very good at programming in Java!

Wondering if anyone else besides me would use this! :smiley:

1 Like

Variety of updates have been applied to master - tagged release soon to follow. Improvements include:

  • Interaction Model expansion
  • Validation/error handling improvements
  • Documentation refinements
  • New ability to ‘GetMode’ (i.e. for OpenHAB house/lighting/security scenes)

.

Another batch of improvements have been pushed to master:

  • Log audit trails - which IP/Intent/Request/Response/etc
  • Added ‘password’ as an endpoint URL parameter - improved security checks
  • Stub settings for controlling locks & roller shutters
  • Stub settings for checking outdoor Temp/Humidity

Thanks for the tip about echo DOT, I guess it will take a while before it gets availabe for us non premium members. I was so missing the audio cable on the normal echo…

Probably a stupid question, is it possible to make a skill set for openhab that will show up in the alexa app? Then You need to log in to your my.openhab account, and then it will automatically take speech card that are defined for each item as Mike mentioned: Swith myLight [“My Light”] {gpio:pin22} (For scenes we can use the mapping file)

Then we can just say “Alexa open Openhab My light ON”

Were just an idea:)

It should show up in the app, does on my system.

If you do all those steps, but not as default like here : http://lovemyecho.com/2016/03/04/complete-listing-of-alexa-skills-as-of-3416/

Something we can work on in the future? Thinks that a better way then making a binding. I will be glad to help out:)

@skatun - if you are referring to making this an ‘official’ published Alexa Skill for OpenHAB, that is in the pipeline…

The current version of Alexa-HA does, as @sipvoip mentioned, support cards so all Alexa commands/responses show up natively as speech cards in the Alexa App today. Also, your example command works just as you described, once everything is configured of course! :sunglasses:

Best regards,
.

@skatun - not entirely sure I get your suggestion here - please rephrase… What do you mean by ‘not as default’??

In general, Alexa-HA also supports the varying invocation methods mentioned in your link above, so you can say ‘Alexa, open/tell/ask/etc …’ to do what you want. For instance, this is all working for me (with my custom invocation name):

‘Alexa, start Jarvis’ (to start the Skill in dialogue mode)
‘Alexa, open Jarvis’ (to start the Skill in dialogue mode)
‘Alexa, ask Jarvis whats the kitchen temperature’
‘Alexa, tell Jarvis to set the house temperature to 72 degrees’

‘Alexa, play …’ to follow once I get into developing the media controls (play/pause/stop/next/previous commands) as well.

Thanks! I’d really appreciate any and all help with this massive undertaking :slight_smile:

can we now add speak cards to the item definations? Did I miss something along one of these 50 posts?

Swith myLight ["My Light"] {gpio:pin22}

Thats what I ment…

Just PM me and let me know how i can help you.

This has been supported since day 1 :slight_smile: No additional configuration necessary, cards are created in your Alexa App with each voice command. To see how this works in the code, search for ‘response.card’ in index.js.

So my suggestion is that we extend the current item defination to :
itemtype itemname [“labeltext”] [] [(group1, group2, …)] [{bindingconfig}][#speech text, speech text 2#]

and that the index.js read the items file and automatically add those speech tags

similiar can be used in groups:

Group KitchenLight #Kitchen Lights#

What is going to be tricky is to figure out what speech command each item type can have. Then we need to read the sitemap to find out if this should be overwritten by mappings i.e switch item=lamp1 mappings=“ON=Hello,OFF=Shut up” or switch item=lamp1 mappings=“ON=An,OFF=Aus” For those german speaking.

Then we could say Alexa, ask openhab lamp1 hello which will also be equal to the long version alexa, ask openhab to turn lamp1 hello(ON/AN…)

The question is rather how can we make it as easy as possible for the user to add speech cards to their items, and it should have several acronym and also support all supported languages such as english spanish and german.

For the user it will then be easy to set it up.

  • Step 1: Open the alexa app, add the openhab skill(better if it becomes native like wink etc), type in your username and password(same as for my.openhab)

  • Step 2: Add non default cards in your items file

  • Step 3 activate the plugin in your config file and play around…

Currently the index.js add default cards for switch items and temperature as I can read out from the index.js file but only for english and also only 1 acronym. Still havent figured out how index.js handle scenes, but it seems like it take the group names and uses that.

1 Like

@skatun - thanks for all the thoughts/suggestions here!

I will explore options for how to include the Alexa HA configuration within the OpenHAB items definition. Problem is Alexa-HA is not an OpenHAB binding per say, and the additional item details (i.e. binding config parameters) are not accessible via REST, which might make this more trouble than what its worth.

Regarding multiple language support, Amazon Echo has not announced any plans to support other languages in the near future. We will revisit how to handle multiple languages once the device can handle it.

To my knowledge, all of the ‘connected home’ supported devices suffer the same limitation - they can’t reply back with anything other than ‘OK’ once the command is issued. This is why I’ve taken the ASK approach, so the interactions can be heavily customized. I envision the following in the future for the ‘official’ OpenHAB skill:

  1. Enable the OpenHAB Skill in Alexa App
  2. Link your Skill to the my.openhab.org user account
  3. On my.openhab.org, provide a config page for various Alexa options (such as new device approvals!)

AlexaHA would then use my.openhab.org as a proxy for issuing REST commands to your OpenHAB server.

Brainstorming further on this!

Another batch of improvements have been pushed to the master branch. ALL - if you have an Amazon Echo please help to test and provide feedback!

Highlights include:

  • Ability to run many commands at once (i.e. after saying ‘Alexa, start OpenHAB’ you can now issue many commands in quick succession without having to say ‘Alexa … OpenHAB’ repeatedly)
  • Major overhaul of the code base which improves readability and reduced the # of lines of code throughout
  • Various documentation refinements
  • Improved validation

i’d love to see this.

i always wanted to try this Skill, but i’m behind a double-NAT connection. my ISP doesn’t provide public IP (sucks).

keep up the great work.
i’m following this thread

EDIT:
anyway, have you seen this:

That skill uses Kodi-addon that allows Kodi to be controlled by Alexa. I don’t know how it works, but the skill doesn’t require public IP to be accessible from outside.

Have you checked out the ifttt webpage? Maybe we can do a similiar approach, that you link up your openhab account,

then you select the openhab item, could hold down ctrl to add several items

Then you set direction either input or output

If output then you type in what alexa should say:

Temperature in hallway is {hallwayTemperature}

and finally we create the trigger word:

What is the temperature.

Just another way to do it, without messing with the item files.

@Farhanito - Thanks! I’ve personally never heard of ISPs not providing a public IP, but of course some use dynamic IP addresses that regularly change. Try visiting whatismyip.com regularly to see what it is and how frequently it changes. You might be able to get this working by using a Dynamic DNS provider, and some firewall port forwarding and static routing to get through the double NAT. Painful though, I know :slight_smile:

I hadn’t seen HTPC_Alexa_Skill - thanks for pointing this project out. After skimming the code, it seems they use their custom KODI add-on to establish a websocket to an EC2 cloud based service which they host, which facilitates the communication. Since its not officially published yet, the setup involves configuring a custom ASK to run on AWS Lambda. I have purposely avoided that because I don’t want my Home Automation configuration (including endpoint/passwords/etc) out there - rather keeping as much as possible internal…

The pattern they are using here is somewhat similar to what we will need to do (minus Lambda), complete with code examples. Nice :slight_smile:

(i.e. Alexa Command > ASK > my.OpenHAB.org endpoint (cloud) > my.OpenHAB.org add on (your server))

@skatun - I have glanced but haven’t signed up or used IFTTT. Guess its time for me to get familiar with their UI/UX :slight_smile:

Thank you much!

Trust me there is :slight_smile:
Both WAN and LAN ip of my router are Private. Thanks to my.OpenHAB i can reach my home from outside.

About keeping everything internal, i’m 100% agree with you.