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!
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!
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”
@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!
@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
This has been supported since day 1 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.
@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:
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
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.
@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
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