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

Tags: #<Tag:0x00007f01493692b8> #<Tag:0x00007f0149369178> #<Tag:0x00007f0149369038>

(Nicolas) #1396

Any idea how I can install the binding manually? I’m not familiar with it. I downloaded the Jar file.

(Oliver) #1397

Thank you for your answer. This helps a lot!
New channels, of course would be great, but I think I get my things work now.

Thank you for your great work!

(Nicolas) #1398

Hi @michi ,
is it possible to install the latest version of the binding via PaperUi?

(Michael) #1399

Yes but just with a workaround.
You need to create a routine with your text and some random event like switching ON something. Save this routine and the remove the random event so you got an empty routine.
This will prevent Alexa from answering.
But remember that some texts are supported for routines or not recognized correct.

(Michael) #1400

The latest stable release but not any of the beta releases.
You need to place them inside the addons folder of your openHAB installation.

If openHAB doesn‘t use this addon you‘re able to check what binding is used with the Karaf console.
Place the beta in your addons folder and then open your Karaf console.
Enter bundle:list and check the result.
If there are two Alexa bundles use bundle --help to check how to disable/uninstall the old one and how to activate the beta.

(Andrew Pawelski) #1401

I would prefer not to as well but my air conditioner can only be done that way - do you know if it would be possible via the API? I’m guessing if it was or was easy you would have already done it.

(Michael Geramb) #1402

This works with the openHAB Alexa Skill out of the box. The binding is not needed for this.

(Mr. Wiseman) #1403

I’m running on the Synology platform also and I’m running OH 2.3.001 version along with Michael’s Beta 10 Echo version (manually installed in the ADD-ON directory) without any issues. I have 12 Echo’s (tower and dot’s) and all tied to the rules. I’m also using Alexa routines.

Best, Jay

(Matthieu Lauzon) #1404


Would it be possible to add something to be able to act on alarm start/stop. And know the time of theses

And be able to create alarm from this binding to the alexa app.

(Michael) #1405

Please have a look at post #1377 in this thread.

It´s currently only possible to get this information as json within a rule.
But i´m not sure if it´s really json, the result looks like plain text.

@michi Could it be that the result from
is just text in json format and not a real json?
As i´m not able to parse this correctly in a rule for json.

(Markus S.) #1406

Hi Michael.
I get “bad requests” when I send TTS commands to 5 or 6 Echos at the same time in a rule. A part of the commands doesn’t work, but the rest is okay. Is there a solution for this problem?
Thanks and greetings,

(Mr. Wiseman) #1407

Thank you Rainer15 for this! I made a few modifications with a HUE Bulb, only runs between 4 - 7 am, offset of 45 seconds and less logging during those checks.

rule "Guest Bedroom Echo Alarm controling HUE bed side table light"
		Time cron "45 0/1 4-7 * * ?"		// run every 45 secs between 4 - 7 am
		// read Alexa notifications - alarm, reminders, timers
		// logInfo("ECHO", "Echo reading notifications set")		

        	var String json = sendHttpGetRequest("http://openhab.XXXXX:8080/amazonechocontrol/account1/PROXY/api/notifications")
        	// get number of notifications read
        	var String length = transform("JSONPATH", "$.notifications.length()", json)
			if (json !== null && length !== null){

	        	// logInfo("ECHO", json)
	        	// logInfo("ECHO", "-----------")
	        	// logInfo("ECHO", "Number of notifications found: " + length)
	        	var i = 0
	        	var String status
	        	var String deviceSerialNumber
	        	var String type
	        	var String alarmtime = "NULL"
	        	var String alarmdate = "NULL"
	        	var int count = Integer::parseInt(length)
	        	// for all notifications, identify ...
	        	while(i <= (count - 1)) {
	            	status = transform("JSONPATH", "$.notifications[" + i +"].status", json)
	            	deviceSerialNumber = transform("JSONPATH", "$.notifications[" + i + "].deviceSerialNumber", json)
	            	type = transform("JSONPATH", "$.notifications[" + i + "].type", json)
	            	// logInfo("ECHO", "Count: " + i)
	            	// logInfo("ECHO", "Notification status: " + status)
	            	// logInfo("ECHO", "Device serial number: " + deviceSerialNumber)
	            	// An ALARM that is ACTIVE and belongs to the GUEST BEDROOM echo device
	            	if (type == "Alarm" && status == "ON" && deviceSerialNumber == "G090LF09715401NW") {
	                	alarmtime = transform("JSONPATH", "$.notifications[" + i + "].originalTime", json)
	                	alarmdate = transform("JSONPATH", "$.notifications[" + i + "].originalDate", json)
	                	logInfo("ECHO", "Guest Bedroom Alarm found: " + alarmtime + " " + alarmdate)
	                	i = count 	// only the first one is considered - exit while loop
	            	i = i + 1
	        	// An active alarm has been found
	        	if (alarmtime != "NULL") {
	            	var DateTime setAlarmTime = new DateTime(alarmdate + "T" + alarmtime)
	            	// logInfo("ECHO", "Guest Bedroom set alarm time used for Hue control: " + setAlarmTime.toString)		// uncomment this one to determine what alarm time was used
	            	if (now.isBefore(setAlarmTime) && now.plusMinutes(20).isAfter(setAlarmTime)) {
	               	 logInfo("ECHO", "Guest Bedroom Alarm is within 20 minutes range")
	                	if (now.isBefore(setAlarmTime) && now.plusMinutes(15).isAfter(setAlarmTime)) {
	                    		logInfo("ECHO", "Guest Bedroom Alarm is within 15 minutes range")
	                    		if (now.isBefore(setAlarmTime) && now.plusMinutes(10).isAfter(setAlarmTime)) {
										logInfo("ECHO", "Guest Bedroom Alarm is within 10 minutes range")
										GuestBedLamp_Dimmer.sendCommand(new PercentType(80))			// 80%
										GuestBedLamp_ColorTemp.sendCommand(new PercentType(100))		// Full White
	                    		} else {
										GuestBedLamp_Dimmer.sendCommand(new PercentType(50))			// 50%
										GuestBedLamp_ColorTemp.sendCommand(new PercentType(100))		// Full White
	                	} else {
										GuestBedLamp_Dimmer.sendCommand(new PercentType(30))			// 30%
										GuestBedLamp_ColorTemp.sendCommand(new PercentType(100))		// Full White

Best, Jay

(Matthieu Lauzon) #1408

Can I call this adress from homeseer ? If my openhab server is on the serve pc as Homeseer?

(Michael) #1409

I had the same issue when sending too many commands to the binding or more precisely the binding to the Amazon servers.
My only solution was a group with every echo as a member or use GroupItem Methods to build something like a dynamic group.
I don´t know why but this works…

I also noticed that sending commands too fast will end in bad request errors.
For example: Triggering a rule with only one TTS command multiple times one after the other.

This shouldn´t be a problem.
I already called this address from other machines than openHAB where the binding is running.

(JustAProgrammer) #1410

I’m getting this Error currently:

org.glassfish.jersey.server.internal.process.MappableException: org.openhab.binding.amazonechocontrol.internal.HttpException: GET url '' failed: Bad Request

	at org.glassfish.jersey.server.internal.MappableExceptionWrapperInterceptor.aroundWriteTo( ~[?:?]

	at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed( ~[171:org.glassfish.jersey.core.jersey-common:2.22.2]

	at org.glassfish.jersey.message.internal.MessageBodyFactory.writeTo( ~[171:org.glassfish.jersey.core.jersey-common:2.22.2]

	at org.glassfish.jersey.server.ServerRuntime$Responder.writeResponse( [172:org.glassfish.jersey.core.jersey-server:2.22.2]

	at org.glassfish.jersey.server.ServerRuntime$Responder.processResponse( [172:org.glassfish.jersey.core.jersey-server:2.22.2]

	at org.glassfish.jersey.server.ServerRuntime$Responder.process( [172:org.glassfish.jersey.core.jersey-server:2.22.2]

	at org.glassfish.jersey.server.ServerRuntime$ [172:org.glassfish.jersey.core.jersey-server:2.22.2]

	at org.glassfish.jersey.internal.Errors$ [171:org.glassfish.jersey.core.jersey-common:2.22.2]

	at org.glassfish.jersey.internal.Errors$ [171:org.glassfish.jersey.core.jersey-common:2.22.2]

	at org.glassfish.jersey.internal.Errors.process( [171:org.glassfish.jersey.core.jersey-common:2.22.2]

	at org.glassfish.jersey.internal.Errors.process( [171:org.glassfish.jersey.core.jersey-common:2.22.2]

	at org.glassfish.jersey.internal.Errors.process( [171:org.glassfish.jersey.core.jersey-common:2.22.2]

	at org.glassfish.jersey.process.internal.RequestScope.runInScope( [171:org.glassfish.jersey.core.jersey-common:2.22.2]

	at org.glassfish.jersey.server.ServerRuntime.process( [172:org.glassfish.jersey.core.jersey-server:2.22.2]

	at org.glassfish.jersey.server.ApplicationHandler.handle( [172:org.glassfish.jersey.core.jersey-server:2.22.2]

	at org.glassfish.jersey.servlet.WebComponent.serviceImpl( [169:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]

	at org.glassfish.jersey.servlet.WebComponent.service( [169:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]

	at org.glassfish.jersey.servlet.ServletContainer.service( [169:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]

	at org.glassfish.jersey.servlet.ServletContainer.service( [169:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]

	at org.glassfish.jersey.servlet.ServletContainer.service( [169:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]

	at com.eclipsesource.jaxrs.publisher.internal.ServletContainerBridge.service( [20:com.eclipsesource.jaxrs.publisher:]

	at org.eclipse.jetty.servlet.ServletHolder.handle( [85:org.eclipse.jetty.servlet:9.4.11.v20180605]

	at org.eclipse.jetty.servlet.ServletHandler.doHandle( [85:org.eclipse.jetty.servlet:9.4.11.v20180605]

	at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle( [186:org.ops4j.pax.web.pax-web-jetty:7.2.3]

	at org.eclipse.jetty.server.handler.ScopedHandler.handle( [84:org.eclipse.jetty.server:9.4.11.v20180605]

	at []

	at org.eclipse.jetty.server.handler.HandlerWrapper.handle( [84:org.eclipse.jetty.server:9.4.11.v20180605]

	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle( [84:org.eclipse.jetty.server:9.4.11.v20180605]

	at org.eclipse.jetty.server.session.SessionHandler.doHandle( [84:org.eclipse.jetty.server:9.4.11.v20180605]

	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle( [84:org.eclipse.jetty.server:9.4.11.v20180605]

	at org.eclipse.jetty.server.handler.ContextHandler.doHandle( [84:org.eclipse.jetty.server:9.4.11.v20180605]

	at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle( [186:org.ops4j.pax.web.pax-web-jetty:7.2.3]

	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope( [84:org.eclipse.jetty.server:9.4.11.v20180605]

	at org.eclipse.jetty.servlet.ServletHandler.doScope( [85:org.eclipse.jetty.servlet:9.4.11.v20180605]

	at org.eclipse.jetty.server.session.SessionHandler.doScope( [84:org.eclipse.jetty.server:9.4.11.v20180605]

	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope( [84:org.eclipse.jetty.server:9.4.11.v20180605]

	at org.eclipse.jetty.server.handler.ContextHandler.doScope( [84:org.eclipse.jetty.server:9.4.11.v20180605]

	at org.eclipse.jetty.server.handler.ScopedHandler.handle( [84:org.eclipse.jetty.server:9.4.11.v20180605]

	at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle( [186:org.ops4j.pax.web.pax-web-jetty:7.2.3]

	at org.eclipse.jetty.server.handler.HandlerWrapper.handle( [84:org.eclipse.jetty.server:9.4.11.v20180605]

	at org.eclipse.jetty.server.Server.handle( [84:org.eclipse.jetty.server:9.4.11.v20180605]

	at org.eclipse.jetty.server.HttpChannel.handle( [84:org.eclipse.jetty.server:9.4.11.v20180605]

	at org.eclipse.jetty.server.HttpConnection.onFillable( [84:org.eclipse.jetty.server:9.4.11.v20180605]

	at$ReadCallback.succeeded( []

	at []

	at$ []

	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask( [87:org.eclipse.jetty.util:9.4.11.v20180605]

	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce( [87:org.eclipse.jetty.util:9.4.11.v20180605]

	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce( [87:org.eclipse.jetty.util:9.4.11.v20180605]

	at [87:org.eclipse.jetty.util:9.4.11.v20180605]

	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ [87:org.eclipse.jetty.util:9.4.11.v20180605]

	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob( [87:org.eclipse.jetty.util:9.4.11.v20180605]

	at org.eclipse.jetty.util.thread.QueuedThreadPool$ [87:org.eclipse.jetty.util:9.4.11.v20180605]

	at [?:?]

Caused by: org.openhab.binding.amazonechocontrol.internal.HttpException: GET url '' failed: Bad Request

	at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequest( ~[?:?]

	at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequestAndReturnString( ~[?:?]

	at org.openhab.binding.amazonechocontrol.internal.Connection.getMusicProviders( ~[?:?]

	at org.openhab.binding.amazonechocontrol.internal.statedescription.AmazonEchoDynamicStateDescriptionProvider.getStateDescription( ~[?:?]

	at org.eclipse.smarthome.core.thing.internal.ChannelStateDescriptionProvider.getDynamicStateDescription( ~[?:?]

	at org.eclipse.smarthome.core.thing.internal.ChannelStateDescriptionProvider.getStateDescription( ~[?:?]

	at org.eclipse.smarthome.core.thing.internal.ChannelStateDescriptionProvider.getStateDescriptionFragment( ~[?:?]

	at org.eclipse.smarthome.core.internal.service.StateDescriptionServiceImpl.mergeStateDescriptionFragments( ~[?:?]

	at org.eclipse.smarthome.core.internal.service.StateDescriptionServiceImpl.getStateDescription( ~[?:?]

	at org.eclipse.smarthome.core.items.GenericItem.getStateDescription( ~[?:?]

	at ~[?:?]

	at ~[?:?]

	at ~[?:?]

	at$0( ~[?:?]

	at$3$1.accept( ~[?:?]

	at java.util.HashMap$KeySpliterator.tryAdvance( ~[?:?]

	at$WrappingSpliterator.lambda$initPartialTraversalState$0( ~[?:?]

	at$AbstractWrappingSpliterator.fillBuffer( ~[?:?]

	at$AbstractWrappingSpliterator.doAdvance( ~[?:?]

	at$WrappingSpliterator.tryAdvance( ~[?:?]

	at java.util.Spliterators$1Adapter.hasNext( ~[?:?]

	at ~[?:?]

	at ~[?:?]

	at ~[?:?]

	at ~[?:?]

	at org.glassfish.jersey.message.internal.ReaderWriter.writeTo( ~[?:?]

	at org.glassfish.jersey.message.internal.AbstractMessageReaderWriterProvider.writeTo( ~[?:?]

	at org.glassfish.jersey.message.internal.InputStreamProvider.writeTo( ~[?:?]

	at org.glassfish.jersey.message.internal.InputStreamProvider.writeTo( ~[?:?]

	at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.invokeWriteTo( ~[?:?]

	at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.aroundWriteTo( ~[?:?]

	at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed( ~[?:?]

	at org.glassfish.jersey.server.internal.JsonWithPaddingInterceptor.aroundWriteTo( ~[?:?]

	at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed( ~[?:?]

	at org.glassfish.jersey.server.internal.MappableExceptionWrapperInterceptor.aroundWriteTo( ~[?:?]

	... 53 more

And can someone share their .sitemap for all Bluetooth Items? not quite sure how I should use them!
I can see all bluetooth Devices under:
But I’m not able to see any of those under:
within the bluetoothMAC section

(Michael Geramb) #1411

New Beta 2.5 (2) Release

This version supports new channels for the next reminder, alarm and timer event.
It fixes a problem with wrong character encoding for french sites and I’am proudly to present:


Download from the top most posting

(Michael) #1412

Thanks for your work.

How do we use the SSML with openHAB?

(Andrew Pawelski) #1413

Have you tried the SSML documentation from the post above?

(Michael) #1414

I tried to add <break> to a TTS but Alexa just says the word break instead of doing a break.
When addind <speak> before and </speak> after the text with a <break Alexa just says the part before break and not part after break.

Doesn´t work:
echo_TTS.sendCommand('Dies ist <break> ein Test.')

Stops at the break:
echo_TTS.sendCommand('<speak>Dies ist <break> ein Test.</speak>')

echo_TTS.sendCommand('<speak>Dies ist <break/> ein Test.</speak>')

Some tags need to be closed directly with a /> at the end.
This isn´t clearly described in the Amazon docs.

Some things like <amazon:effect name=”whispered”></amazon:effect> doesn´t work at all.

(Michael Geramb) #1415

This works for me:
<speak>I want to tell you a secret.<amazon:effect name="whispered">I am not a real human.</amazon:effect>.Can you believe it?</speak>