OH2 Alexa Binding Announce

Hi I wanted to share a very early version of a native OH2 Binding to connect to the Amazon Alexa Service ( Amazon echo, dot, …). It supports all of the basic commands (on,off, number, percent, open, close, ect…) as well as getting the status of devices. I would love others to help out and test, code, document, whatever. You can find the readme and code at https://github.com/digitaldan/openhab2-addons/tree/alexa/addons/io/org.openhab.io.alexa , I also have a compiled version at https://github.com/digitaldan/openhab2-addons/releases/download/untagged-b5d3356beee8f9b2db2a/org.openhab.io.alexa-2.0.0-SNAPSHOT.jar

Thanks

1 Like

Hm, are you aware that there is already a skill available (done by @d0t), in which he has already put a lot of efforts and is actively maintaining it? What is the difference to your work?

1 Like

I wanted to create a native binding that did not require another service to run. The alexa service can connect directly with openHAB without needing nodejs or other services. The setup also uses the same homekit style tagging, so setting your items up once allows for homekit, hue emulation and alexa support. I guess there is less moving parts and it is easier to configure, which was appealing to me. Right now I’m running OH2, Mosquitto and Ngix, but I would like to reduce that down to just OH2 if possible to keep things simple and manageable. I’m also ok if others prefer the original solution, I’m not planning a PR until others validate this is useful. I’ll post in the other forum my intentions.

1 Like

Ok, thanks, I must admit I am not yet deep enough in the options Amazon offers.
So with your version there is indeed no need to host anything, all you have to enable is remote access through 443 to your runtime? That makes many things easier indeed.
What are the limitations in comparison to a “real” skill, if any?

There are no limitations that I can think of, in fact since the skill only serves one OH2 instance ( ie not a my.opnehab like service) the voice model is constrained to just the users items which gives very accurate voice results. The other solution has this benefit as well. I really don’t want to fragment the user community, it may well be this is just another option for voice basic control, my plan was to keep it simple and only expose the core OH2 functionality (items)

I very much like the approach, especially the tight integration in the OH2 concepts like the tagging.
You might also want to watch these discussions at ESH around voice support - I am not sure how well this can be mapped onto Alexa, but if there are opportunities, we should not miss them.

I did not see that! Will take a look, also check your email, I sent you a PM.

@digitaldan I have been using your Hue emulation binding and really like just asking Alexa directly to do things. It also has no additional server needed. I take it you went this new skills route because of the limitations of the hue emulation? As this is a skill, do you have to ask Alexa to ask to do things?

Hi @xsnrg I also still use the hue emulation binding as my primary voice input. This does not replace that.

With the skills stuff I am also having a hard time asking two people to turn on a light (there’s a joke in there somewhere). So yes with this you have to ask Alexa to ask Jarvis (or whoever) to turn the light on. My thought was that this would compliment the hue emulator binding so you could ask for the status of lights, or to open or close something.

In any case I’m starting to wonder how useful this actually is since there is already a node based app with good momentum.

@digitaldan & @xsnrg - that is a common request for Alexa-HA - to eliminate the ‘Alexa, ask … to …’ similar to the ‘connected home’ supported products. It’s unfortunately NOT entirely possible with a Skills based implementation (AFAIK) today. To address this, Alexa-HA has recently added a new feature in which you can say ‘Alexa, open …’, and then issue many commands in quick succession without having to say ‘Alexa, tell/ask … to …’ repeatedly. Works very well for me; I hope others too!

A key difference here when compared to the ‘bridge’ is that Skills can define custom ‘intents’ (much more than just the natively supported on/off/dim commands), and provide verbal feedback beyond just ‘OK’ for every command. That is not doable today with the ‘connected home’ functionality in Amazon Echo. For instance I can Alexa-HA ask ‘whats my living room humidity’ or ‘give me a status update’, and get a detailed verbal response, which can be handled directly or even custom OH rules.

@Kai - Alexa-HA is definitely being actively maintained/improved currently and going forward; we are excited to get this published as the official OpenHAB skill ASAP! It’s become a passion for me and others - immediate HA control via voice without having to grab a phone/tablet/pc. By making an official Skill available, backed by a private server to handle the ASK/Alexa-HA request processing, it means:

  • Quick action & response from the OpenHAB Server
  • Amongst Amazon Echo users, OpenHAB will have better visibility/adoption
  • Anyone can quickly install the Skill and get started through the Skills page on their Alexa App - minimal setup involved
  • For those who do not have networking expertise (firewalls, port forwarding, ssl certificates, proxies, etc) or the time to set it up, the official Skill will make it straight forward to get going
  • A public IP address is no longer a requirement - my.openhab.org users can be linked to the Alexa userId; my.openhab.org issues commands to their OH server via the my.openhab.org addon
  • Because its open, users always have the option of hosting Alexa-HA internally as well (unlike most other popular Amazon Echo Home Automation Skills out there), and the ability to customize/extend it to their liking
  • No need to expose the server to the wild - it can be abstracted and further secured by a hosted/managed solution.

@digitaldan - as discussed lets merge our efforts into a single Skill/project which everyone can use!

4 Likes

I’m getting a 404 for the compiled .jar download link… Is there another link?

Your right, try this
https://github.com/digitaldan/openhab2-addons/releases/download/1/org.openhab.io.alexa-2.0.0-SNAPSHOT.jar

Will this be available on the latest version of OH1?

Hi,

I believe Dan is focused on OH2 support, so probably not. But you can always use the Amazon Echo HA Bridge for now. Alexa HA, once released as an official echo ‘Skill’ will support both OH1 & OH2.

Best regards,
.

i have had the echo controlling one lamp to test my set up. i have since added new items, all with the same homekit tag, but the echo doesnt recognize them. any way to reset the connection to the echo for it to update the homekit tags with it?

While I personally haven’t used it with OH2, you might try using the Alexa App to ‘forget all devices and groups’ (bottom of the Smart Home page), and then re-run discovery. This should pickup the new devices. Also be sure your item labels are different so they are seen as different devices.

i will try that, thx

That worked, but having another issue…

When discovery in initiated, the echo doesnt find all of the items. i thought maybe i had an error in my items file, such as an extra character which causes a stall in reading the items, but this is not the case. also, the items that are part of a group dont get called except for one of them, agaon i was thinking an error…

i will post the items file later just for verification.

Just a FYI, since we are releasing a real Alexa skill soon, I’m not planning on supporting this going forward (hence why its still in my github rep and not openHAB). Not sure on a eta, but in the meantime I would suggest using the hueemulation binding which can let the echo control openHAB as well (https://github.com/openhab/openhab2-addons/tree/master/addons/io/org.openhab.io.hueemulation) This is officially supported in OH2.

thats actually what im using and had thought i was posting in that thread, sorry. your skill that you are working on sounds promising, just prefer not to have to ASK, adds a bit of a pain to always be making such long requests, just my opinion.