Amazon Echo Skill for OpenHAB available!

Newbie here.
Just starting to set this up on OH1.
Simple question: I need to troubleshoot and don’t know where the log file is. Can someone please provide some guidance on this?

Thanks,
Randy

Ok - I finally got this up and running on OH1!!!
Many thanks to @d0t for putting this together.

@d0t -Just a quick question. I was able to get the ApplicationID from the Amazon developer Skill Info Screen and the UserID from the Test Screen (while sending out test commands to my Echo Dot). However, I was never able to find the User Password. So I made one up and updated the config.password field in config.js on the Alexa-HA and the HTTPS Endpoint URL (…?password=xxxxx) on the Amazon Developer console. I don’t receive any errors on the Alexa-HA server and the request gets serviced correctly, so I’m assuming it’s ok. Just want to make sure the security is up to par.

Thanks!
Randy

Glad to hear it, Randy! And sorry I didn’t get back to your earlier question before you cracked it on your own :slight_smile:

You have set this up correctly. This password isn’t defined elsewhere, but simply intended as an additional security check to prevent others from being able to issue commands to your Alexa-HA endpoint.

Kindly share any and all thoughts for improvement on our github project’s issue tracker!

Best regards,
.

Thanks again @d0t!
I will certainly share my thoughts for improvement on the issue tracker as I did hit a few snags along the way …

Thanks,
Randy

I have question how does the setup work with lambda ?
If understood It right lambda must then access to the local openhab ? But how will the connection enabled ?

While Alexa-HA has NOT been tested in a Lambda setup, in theory it should work. The connection would be direct to your OpenHAB REST endpoint, which would have to run on port 443 with a valid SSL cert (or upload your self signed cert via the AWS developer console). I would express some concern here about directly exposing your OpenHAB instance to the wild, which is why I prefer to keep as much as possible hosted in my own environment…

Also note @digitaldan and I have done some work with the Amazon Smart Home API as well, but this project has yet to be released. This skill itself runs in Lambda and talks to my.openhab.org. It is designed to work with my.openhab.org, and uses it’s REST endpoints to issue commands to your OpenHAB instance via the cloud. We have ambitions to publish this as the official OpenHAB Skill, but no time frame on that just yet…

Best regards,
.

Alexa-HA wiki has been updated with a few examples of how to deal with custom Rules/Scenes:

Thank you, just what I am looking for !

This looks fantastic. Just got my Echo and working on integrating it with my OH setup. However, while I can usually follow along just fine, I am a bit lost on the Amazon Developer side of things.

1.) Do I need to go ahead and create a new Alexa Skill First? (i.e. to get the config.userId, config.applicationId, etc?).
2.) If yes, Is the Skill Type Custom or Smart Home?

I saw the instructions in the more in depth install doc, but it still seems to be a little our of order, unless I am missing something. I have not ever developed using Amazon kits, at all, so am a bit lost. The landscape is a bit overwhelming. Do I need the free tier AWS to use this as well?

Following steps 3 & 4 in the tutorial mentioned here, is throwing me off a bit as well. Thanks!

Complete the INSTALL steps for your HA controller first. Then continue with the ASK setup below. For quick reference, see steps 3-4 in this tutorial which includes additional details and screenshots.

Hi @shelzmike,

  1. Yes - create your own Skill in the developer portal. You do not need to actually ‘publish’ it to use it on your own devices.
  2. Custom - Alexa-HA was created before the Smart Home API stuff was even available, so these instructions definitely could use some updating :slight_smile:

You do not need any other AWS offerings beyond the Amazon Skills Kit, assuming you have some place to host Alexa-HA on your local network.

Regarding the steps in the tutorial, I understand this is a bit intimidating. Amazon has made this somewhat overly complex for someone to host their own Skills, and a lot of setup also has to be done in the cloud with the same AWS (developer) account so that the skill is available on your Echo(s). You should be fine just re-using everything in the ‘samples’ directory to get start with Alexa-HA, and then circle back and customize/fine tune these once you get things working.

All the best,
.

Yeah, you can say that again. I am shocked at how fragmented it seems to be. I love the idea of having the skill and plan to work on implementing it more when I have time to sit down and focus on it. You have done a great job thus far. I will say that after quite a few hours of head banging, I moved to implement a bridge that works really well.

I think I need to learn more about Skills in general before I can come back and tackle this. I am I guess what you would call a shade-tree developer and am an Principal IT Analyst by trade so am capable, but sometimes there are things that should be precursors to trying to tackle this type of thing. At least in how my mind works - I want to be able to understand what I am doing instead of just copying and pasting until it works. Thanks again. I hope this one become “official” at some point. I just don’t have enough automation yet (about 8 bulbs and outlets really) to justify the time at this point.

For those who want a valid cert, take a look at https://letsencrypt.org/ ,
Free and working well so far for me.

Regards S

1 Like

Thanks for reporting this, @Seaside!

I’ve setup the Alexa-HA server, yet when calling it locally, I get an error:

TypeError: app.customSlotTypes is not a function at Object.handle (/home/tesla/node_modules/alexa-app-server/index.js:131:81) at next_layer (/home/tesla/node_modules/express/lib/router/route.js:103:13) at Route.dispatch (/home/tesla/node_modules/express/lib/router/route.js:107:5) at /home/tesla/node_modules/express/lib/router/index.js:195:24 at Function.proto.process_params (/home/tesla/node_modules/express/lib/router/index.js:251:12) at next (/home/tesla/node_modules/express/lib/router/index.js:189:19) at next_layer (/home/tesla/node_modules/express/lib/router/route.js:77:14) at next_layer (/home/tesla/node_modules/express/lib/router/route.js:81:14) at Route.dispatch (/home/tesla/node_modules/express/lib/router/route.js:107:5) at /home/tesla/node_modules/express/lib/router/index.js:195:24 at Function.proto.process_params (/home/tesla/node_modules/express/lib/router/index.js:251:12) at next (/home/tesla/node_modules/express/lib/router/index.js:189:19) at next (/home/tesla/node_modules/express/lib/router/index.js:166:38) at SendStream.error (/home/tesla/node_modules/serve-static/index.js:74:37) at emitOne (events.js:96:13) at SendStream.emit (events.js:188:7) at SendStream.error (/home/tesla/node_modules/serve-static/node_modules/send/lib/send.js:147:51) at SendStream.onStatError (/home/tesla/node_modules/serve-static/node_modules/send/lib/send.js:248:48) at /home/tesla/node_modules/serve-static/node_modules/send/lib/send.js:320:26 at FSReqWrap.oncomplete (fs.js:111:15)

What have I missed in the installation instructions?

Hi ,

one short question have someone the alexa ip’s ?
And an example for the iptables rules which blocking all other requests to the alexa-ha ?

Hey airmax,

What do you mean exactly by ‘calling it locally’? Have you setup the Skill in the Amazon developer portal following the AlexaHA examples, and are are using an Alexa device to issue the commands?? I’ve personally never run into this error in the past, and need some further details to help diagnose…

Hi @the.neon,

I actually started to wire in some basic filtering based on IP address into Alexa HA’s code base, but there is no guarantee the Amazon Echo server IP addresses will remain the same. What you could do is add some logging around here to print the request IP, track it over time, and add then the desired firewall/IPTables rules to accept only the expected addresses. This approach is prone to breaking though as Amazon changes things and expands the servers/IPs handling Echo requests! I would also recommend filtering the requests at the network firewall/gateway level if possible, rather than the local system IP tables only!

These IP’s will likely also vary by region, and I don’t think its possible to compile a complete list of them today…

Can someone explain to me what benifits this would have over Hue Emulation which is fast and efficient to set up and requires no external port or installations?

I’m not being snarky, it’s a genuine question as if it has some value for me I might move across once it is released in OH2.

All good, and no ‘snarkiness’ perceived :slight_smile: First off both can be used at the same time and are not mutually exclusive. Alexa HA has been built as a custom Skill (via the Amazon Skills Kit), which means it can do a lot more than just switch/dim items. The key benefits include:

  • Ability to provide customized feedback (i.e. have your Echo(s) speak customizable responses to commands)
  • Ability to issue the same commands more naturally in a variety of ways
  • Each item known to OpenHAB can have custom controls (i.e. ‘change the office lights to blue’)
  • Display custom ‘cards’ in the Alexa App
  • Ability to ‘ask’ for device/sensor states and get a verbal response (i.e. ‘what is my kitchen humidity?’… ‘your kitchen humidity is currently 47%’)
  • Semi-crude but working support of text-to-speech announcements by pairing an Echo over bluetooth with your OpenHAB server
  • The next major step in advancing this is state management - for instance being able to verbally set a timer to turn off all lights in 30 minutes.

Alexa HA certainly requires more work to setup and get going today, but is much more extensible IMHO!

.

Thanks Mike,

This is very cool but it’s something that I don’t require(I have a simple setup) so I will stick with my current implementation.