Released: Openhab2 Amazon Echo Control Binding (controlling alexa from openhab2)

Tags: #<Tag:0x00007fd30f49dee8> #<Tag:0x00007fd30f49dda8> #<Tag:0x00007fd30f49dbc8>

(Jan) #588

HI @Wirsing84, quick (and potentially silly) question, but how do you linke the spoken Alexa command “aktiviere fensterstatus” to the item that triggers the rule?

(Jason Wiseman) #589


Great job first of all!

I have 12 Echo’s in the house and I really want to get this working . . .

I’m running Synology NAS with Snapshot I’ve gotten your binding from the market place which it’s stating it’s version --> Amazon Echo Control RC3

Here’s the error --> No Account thing created.

I’m in the US and I’m going against site for authentication.

I’m having issues getting accounts/things to initialize and I’ve read through this thread and I’m seeing stuff about US and authentication and stuff about there being a “newer” version than RC3.

Am I running the latest version of the binding? If not, how do I get an updated version of it?

Best, Jay

(Jason Wiseman) #590

The solution to all this was . . .

Download the RC3 JAR and place it in /ADDON’s vs. using the market place to get it.

Rename /cache to /cahce.OLD
Rename /tmp to /tmp.OLD

Start openHAB

You’ll see errors in the log file asking you to enter the characters as they are shown in the image from Amazon binding.

Goto http://openhab:8080/amazonechocontrol/account1/ap/signin

Sign on to your Amazon Account and that’s it . . .

Best, Jay

(Chris) #591

Hi Jan,
actually it wasn’t so clear to me at first, either.

I have this item definition:
Switch AlexaXiaomiFensterstatus “Fensterstatus” (GR_AlexaCommands) [“Switchable”]

Basically, I “turn on” the “switch” named AlexaXiaomiFensterstatus via Alexa. Alexa seems to index the item labels, thus I can say “Alexa, activate Fensterstatus” or “Alexa, turn on Fensterstatus”. Since Openhab is a smart home binding trigger, more semantically correct sentences like “Alexa, what is the Fensterstatus?” don’t work (yet).

I hope that helped?

(Sebastian) #592

You can use alexa routines for that. Explicitly write what you tell alexa and then you can manually set the item you’d like to trigger

(Jan) #593

Hi Chris,
thanks for the swift reply! So the connection from the command to Alexa to the item is via the openhab skill and hence myopenhab cloud service, right? I’m still struggling to get that working, so my hope was you found a different way :wink:
Thanks again,

(Falk S.) #594

… and with the new v3 tagging of the openHAB Skill Amazons Echo may also allow for these kind of questions directly. Have not tried yet …

(Sebastian) #595

Hey Falk,
Can you elaborate on that a bit more? I’m using the hueemulation binding right now, where tagging is used since the begging.
This is how I setup my alexa items:
Tag them with switchable or lightning; this exposes the items to hueemulation binding and makes them searchable via alexa skill; Then search for new items in alexa and add them; then add them to a room or use them in routines.
Generally I only expose proxy items to alexa. Means I use a routine (e.g: Alexa, which windows are open), and associate it with the exposed proxy item. When asking alexa for the routine, the proxy item triggers a rule which then does the functionality asked for in the routine.

(Falk S.) #596

@waitz_sebastian, I am referring to this document.
However, it still seems to be in development state even though you could give it a try (I have not so far).

For hueemulation: i got rid of this months ago to make things easier and I don’t think it would support the new v3 tagging.

(Jason Wiseman) #597

We use our Alexa’s for alarm clocks in bedrooms.

Does anybody know if we can pull alarm settings from the item binding? I don’t see the item but thought I throw this out there.

It would be nice to see set alarm times on the HABPanel display for each room.

Best, Jay

(Jason Wiseman) #598

Re: TTS Syntax Rule

I feel this example below will help everybody to understand the TTS option. Can someone write the RULE that applies to this scenario below?

Here’s a rough cut/paste that I’m looking to see the exact syntax of the rule which I believe will help others also. One question, do we use item or the channel?

rule “Alexa Speak Enjoy the Show”

Switch  Basement_TV_Power  	"Samsung"   	{ channel="samsungtv:tv:3b48c979_4fdd_4a03_9eb8_3685b7fe5bf0:power" } = ON 
Switch 	Basement_Power  	 "Onkyo"     	{ channel="onkyo:onkyoAVR:avr-basement:zone1#power" } = ON
Switch 	Switch_Basement_Light  	 "WeMo"		{ channel="wemo:lightswitch:Lightswitch-1_0-221736K1300F5B:state" } = CHANGED FROM ON TO OFF


String Echo_Basement_TTS       	 "Echo"       	{channel="amazonechocontrol:echo:account1:echobasement:textToSpeech"} = "Folks please enjoy the show"


Best, Jay

(Scott Rushworth) #599

I think your rule would look something like this, but I took a guess at the actual trigger…

rule "Enjoy the show"
    Item Switch_Basement_Light changed from ON to OFF
    if (Basement_Power.state == ON && Basement_TV_Power.state == ON) {
        Echo_Basement_TTS.sendCommand("Folks please enjoy the show")

(Thomas) #600

I installed the Amazon Echo binding today because of the textToSpeech feature. It is fantastic, Thank You!

I have several Dots throughout my home. So far my rules are sending useful textToSpeech responses to two main echo dots in the areas where we tend to spend most of our time.

But some rules are controlled by a voice command (via hue emulation binding) and it would be better if the textToSpeech response was sent only to the nearby Echo Dot that we spoke to. I’ve read through the docs and could not find any examples on how to do this. Is it possible?

  • Thomas

(Adam Menzel) #601

Hi Guys

I have the binding installed & it is working great but I do not get the TTS channel in paperUI & it wont work if I create it manually. TTS is working great on the reminder channel. Any clues as to why it is missing? I am running OpenHAB 2.2.0 with the RC3 of the Binding.

(SiHui) #602

If you are coming from an older binding build you need to delete the things and readd them to pick up new channels.

(Tom) #603

With the TTS, does anyone else get most of the first word cut-off?

If so,what did you do about it? I sort of got around it by adding “Hey, …” to the start of each TTS string.
I guess you can’t add a pause at the beginning.

(Adam Menzel) #604

Thankyou all working now!

(Tommy Sharp) #605

I’ve just upgraded to OH2.3 and thought I’d try this binding… Loaded the things, items etc exactly from the example and changed all the details accordingly.

I get this in my logs and not much is working… I have replaced the serial number shown in my logs as I’m guessing that’s supposed to be private :wink:

2018-06-09 20:10:58.990 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.amazonechocontrol.handler.EchoHandler@4cd91a': POST url '' failed: Bad Request
org.openhab.binding.amazonechocontrol.internal.HttpException: POST url '' failed: Bad Request

Anyone able to give me some tips to try get this working?
It looks like the Amazon Account thing is “online” but not the Alexa thing…


(Thomas) #606

If you are using a Bluetooth speaker paired with your Echo then the speaker is the source of the problem. In this situation a better Bluetooth speaker will solve it.

As a workaround, add a period followed by a space (. ) at the start of your TTS sentence. That will add a very short delay and may be enough time for your speaker to wake up.

(Tom) #607

Thanks for that - a good point about the bluetooth - I’m using a bluetooth adaptor in an old Bose iPod dock.

The dot space ". " didn’t work. The message changed to “dot…rest of text