Amazon Echo Skill for OpenHAB available!

Dear sir,
Firstly thanks for your post.
But do I have to buy Amazon Echo to use Alexa Skills Kit ?

I’m not sure what you mean? Do you want to build your own echo (that is possible), otherwise I’m not sure if using the skill kit would be worth while. Unless does it work on other Amazon devices?

I read the instruction and it said I must have amazon echo to use amazon skill kits

that’s why I asked
I’m now using raspberry pi 3, Oh2 and alexa via IFTTT as my voice controlling system. But I’m quite annoyed whenever I want to turn on/off something, I have to say “Alexa trigger turn the light on/off” which is pretty long. I want to get rid of the “trigger” word, just “Alexa, turn the light on/off” will be very very awesome!
I encountered this post and it’s exactly what I’m expecting! I hope you guys can help me install it!
@thete Speaking of “build your own echo”, can you suggest me some links which show me how to build my own echo, please? That’s would be great!

I interpret “An Alex-enabled device such as amazon Echo” as any alexa device, not just the echo.
I.e Echo, Dot or "DIY alex with raspberry. "

Regards, S

thanks for your reply
When I’m registering, they ask for my credit card number. I don’t have american express (neither Mastercard nor Visa - sorry I’m just a high school student) so I use automatic credit card generator online : http://credit-card-generator.2-ee.com/
Is that OK? because I’ve been waiting from yesterday to now!


Again, thanks for replying!

since a few days, I finally have my Alexa at home! Yay!
So, I’m about setting her up with OH2 these days. Before I start: is there a due date for a official release of the Alexa skill? I understand, getting my “own” skill gives me more freedom, but still. :wink:

Google is your friend here, this is the first link for googling “Build your own echo”, there are many more: Here

If you use the Hue Emulator (what I have ended up doing, as you run into problems if you try to set up your own skill (i.e. Literals not being supported in the English UK region, and in america soon). This can be found in the misc add-ons area of paper ui, or just add hueemulation to the misc= part of addon.cfg. Don’t get it confused with the normal hue binding. Once installed just go to services->io->hue emulation and enable pairing and maybe tell it the main network ip address of the computer openhab is running on. You then don’;t need to say a trigger word at all. You will probably need to get your echo to rescan your devices (then disable pairing in the hue emulator config).

1 Like

Oh again thanks for your support. @thete
Yes indeed I don’t live in neither England nor USA so setting my skill might be impossible. :frowning:
Just to clarify your statement, I’ve already installed hue emulation in paper UI and finished configuring as the instruction said: https://github.com/openhab/openhab2-addons/tree/master/addons/io/org.openhab.io.hueemulation
Here are some really noob questions, I hope you or anyone knows can answer and help me, please:

  1. What kind of devices can Hue Emulation discovered?
  2. So now I need to add tags to my .item file and get the Hue Emulation to discover my items, right?
  3. After all those steps above, I dont need to use IFTTT service to connect openhab to alexa anymore, right? (I mean if I reach this stage, I just merely need to say a command without any silly trigger words like “Alexa trigger
” but only “Alexa,turn the 
 on/off”. Is that right? Any example commands for Alexa to control devices using Hue Emulation + OH2?)
    If you’re pleased, maybe we need to take some steps back-up. Could you elaborately show us (for beginners just like me, of course) your method to set up your system include Alexa+Hue Emulation to control openhab items (assumed that we’ve already successfully set up our own echo from the link you gave) ?

I’m really struggling to get this working, mostly because I’m not sure where the parameters I need are hiding.

On top of this I’m attempting to get it to work with OH2 (on a Pi) with Node.js hosted on IIS as that’s currently occupying port 443 (and I’m a MS guy at heart).

I’ve got node.js running with nodeiis as proved here: https://robpope.co.uk/node/helloworld/hello.js

After some fun and games I’ve installed alexa-ha, alexa-ha-server and request via npm, but I’m not sure I’ve got the directory structure right.

Whereas most people are pointing their Alexa Skill at https:///alexa-ha/api I’m not sure this is working for me as my api directory only has server.js inside it.

Any pointers would be greatly appreciated

I’ve now moved on a step. I’d missed the very important step (being new to node it caught me by surprise) of running this from a command prompt:
node server.js

I can now access the test page by calling http://localhost:8080/alexa/Openhab-Alexa (not /api/Alexa-HA/ as I’ve changed the config file)

Now I’m seeing that an invalid password is being supplied in the test. Baby steps


I feel that I’m close, but don’t want to spam up this thread with my issues so will leave it at this.

I can now access the Alexa Tester page at https:///alexa/alexa/Alexa-HA

In config.js I have:

  • I have set the config.password parameter to “abcd123” and the endpoint to https:///alexa/alexa/Alexa-HA?password=abcd123
  • I’ve set config.userId to match “userId” in the developer test screen (It starts amzn1.ask.account. not amzn1.echo-sdk-account. as per the example)
  • I’ve set config.applicationId to match the skill ID in the developer portal (again it is slightly different to the example)

When I send a request from the developer portal I see the following in the node.js log (I’m running interactively)
preRequest fired
undefined - 2017-01-25T22:08:30Z - AWS ASK IntentRequest received: EdwRequestId
.514f97b7-279f-4ca3-b371-30b866d5319f / SessionId.5aa8f027-1143-4c3a-8030-d7e32c
be9633
undefined - 2017-01-25T22:08:30Z - ERROR: Invalid password in request: undefined

Why is it saying invalid password? Is there something I’m missing, or is my endpoint meant to differ from the tester page? Is there any additional logging I can enable or is it something simple I’m missing?

The error verbage seems odd, but I believe both the userid and the
applicationid should come from the tester page.

When switching to actual echo testing, both values will again change.

I have a feeling that my issue is with request, which I’ve installed via npm and logs to the console if I add a line in request.js.

I added the “gotcha” log into the following section of alexa-app-server’s index.js. Any ideas why it could fail on a Windows Server?

				self.express.post(endpoint,function(req,res) {
					if (config.verify && !req.verified) {
						res.status(401).json({ status: 'failure', reason: er });
					}
					var json = req.body, response_json;
					// preRequest may return altered request JSON, or undefined, or a Promise
					Promise.resolve( typeof config.preRequest=="function" ? config.preRequest(json,req,res) : json )
						.then(function(json_new) {
							if (json_new) {
								json = json_new;
							}
							return json;
						})
						.then(app.request)
						.then(function(app_response_json) {
							response_json = app_response_json;
							return Promise.resolve( typeof config.postRequest=="function" ? config.postRequest(app_response_json,req,res) : app_response_json )
						})
						.then(function(response_json_new) {
							response_json = response_json_new || response_json;
							res.json(response_json).send();
						})
						.catch(function() {
							console.log('gotcha');
							res.status(500).send("Server Error");
						});
				});

I’m a german native speaker. What do I need to do, to communicate in german with my echo? Is it “just” to translate the utterances?

1 Like

During my researches in the code (index.js, config.js, helper.js), I found some places where translation needs to be done. I’m no programmer so it seems to heavy for me, not to break the code.
In german echo skills there are LITERALS not supported, which means the LITERALS should be substituted by Custom Slots, isn’t it? Regarding to the docs this should be possible.
A further question: in the code there are roller shutter mentioned, but never used for the utterances. This let me realize, that the Action is just ON or OFF at the moment. Do you plan to extend the Actions by at least UP and DOWN.
In german language there are synonyms for ON like ein and an, even UP (auf, rauf, hoch) and DOWN (zu, runter) have synonyms. Is it possible to have a mapping from more synonyms to one single Action?
I mean
auf or raus or hoch means Action UP
ein or an means Action ON

Besides of all my thoughts, thank you so much for your great work and I’m looking forward to speak with my echos in german (soon?) :wink:

If you decide to support a german version as well, I could support you with the regarding texts. Just let me know 
 unfortunately that’s all what I’m able to do.

2 Likes

From what I read here
https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/steps-to-create-a-smart-home-skill

and looking at the diagram here
https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/overviews/understanding-the-smart-home-skill-api

I think the skill should react on the german utterances from the referecene
https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/smart-home-skill-api-reference

At least I’m quite sure that this translations don’t have to be done in the code.
My echo dot is just on it’s way and I’m curious to see who to get the skill working with german.
Perhaps someone may confirm, if I’m right, or what exactly has do be done, to get it working with german. I think I should be able to contribute to the code if necessary.

Thanks

Someone posted a few videos on youtube to show the integration of amazon echo in openhab witch german language.

But I don’t know how he did it exactly.

I am still waiting for my echo. :slight_smile:

He doesn’t use this Echo skill, but the HUE emulation (New Binding: Hue Emulator - Amazon Echo integration). You can see this because he says “schalte AN” to the rollershutter. This is some kind of workaround, because the HUE emulation doesn’t officially support rollershutters (“fahre hoch”, “fahre runter”).

How he did this exactly is mentioned here (also in german
):

http://onesmarthome.de/smart-home-openhab2-sprachsteuerung-konfiguration/

Is there any chance to skip the Nginx instance and connect the NodeJS application to myopenhab.org instead which is linked to the local oh instance anyway?