Release Candidate and Support: Amazon Echo Control Binding

BETA 15 Released

New beta version available. I have provided now two channels to start music from every music provider, including spotify.

You can select the provider in playMusicProvider channel (Use paperUI or create a mapping or rule) and provider the normally spoken text as input for the playMusicVoiceCommand channel (e.g. Yesterday from the beatles)

Please note, that the new channels are not support for audio group devices - this is a limitation in the used amazon API.

And I hope, that I have fixed the bug where the state update stop working after some days.

Regards,
Michael

Habe you got ä Solution for My Problem. The Echo plus is configured like My two other Echo Dots.
when i Change the Volumen in OH the Echo Change the Volume. After that the Slider change back to Zero every time. The Echo still is on the Level i changed to.

Daniel

No, because there is no special handling for the different devices. Technical, the are the same. I know this behavior only from audio groups, because the have no absolute volume level. Please check if the serial number of your echo plus is the one of the device. And maybe you check if the alexa website shows the correct volume, so that we know if it works there.

Is there any other user who own an echo plus?

Regards,
Michael

Hi Michi. You are right… The plus was in ä room Group. When i delete IT from the Group the Sound Level will Show in the right way. Thx.
But the the Two dots Belong to the same group and the volume level is shown correct

Hi Michael.
After installing Beta 15 i get this warning and error:

2018-05-01 00:55:32.849 [WARN ] [mazonechocontrol.internal.Connection] - Parsing json failed {}

com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 8 column 1 path $

	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:224) [22:com.google.gson:2.7.0]

	at com.google.gson.Gson.fromJson(Gson.java:887) [22:com.google.gson:2.7.0]

	at com.google.gson.Gson.fromJson(Gson.java:852) [22:com.google.gson:2.7.0]

	at com.google.gson.Gson.fromJson(Gson.java:801) [22:com.google.gson:2.7.0]

	at com.google.gson.Gson.fromJson(Gson.java:773) [22:com.google.gson:2.7.0]

	at org.openhab.binding.amazonechocontrol.internal.Connection.parseJson(Connection.java:546) [242:org.openhab.binding.amazonechocontrol:2.2.0]

	at org.openhab.binding.amazonechocontrol.internal.Connection.getEnabledFlashBriefings(Connection.java:748) [242:org.openhab.binding.amazonechocontrol:2.2.0]

	at org.openhab.binding.amazonechocontrol.handler.AccountHandler.updateFlashBriefingProfiles(AccountHandler.java:591) [242:org.openhab.binding.amazonechocontrol:2.2.0]

	at org.openhab.binding.amazonechocontrol.handler.AccountHandler.addFlashBriefingProfileHandler(AccountHandler.java:175) [242:org.openhab.binding.amazonechocontrol:2.2.0]

	at org.openhab.binding.amazonechocontrol.handler.FlashBriefingProfileHandler.initialize(FlashBriefingProfileHandler.java:97) [242:org.openhab.binding.amazonechocontrol:2.2.0]

	at sun.reflect.GeneratedMethodAccessor72.invoke(Unknown Source) ~[?:?]

	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]

	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]

	at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [109:org.eclipse.smarthome.core:0.10.0.b1]

	at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [109:org.eclipse.smarthome.core:0.10.0.b1]

	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]

	at java.lang.Thread.run(Thread.java:748) [?:?]

Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 8 column 1 path $

	at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:385) ~[?:?]

	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:213) ~[?:?]

	... 18 more

and

2018-05-01 00:55:32.879 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.initialize()' on 'org.openhab.binding.amazonechocontrol.handler.FlashBriefingProfileHandler@xxx': java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 8 column 1 path $

For Info.

Hi @michi,
thank you for this great binding! Now I can send any text to my Echo Dot via MQTT and openHAB by sending it as topic openHAB/in/RenesEchoDot_Erinnere/command.

There is only a small issue: German umlauts are not transferred correctly. For example my text is “Heute müsst Ihr an folgendes denken”. The Alexa App on my phone shows the umlaut as a question mark in a black square and the Dot does not read it, instead it spells the word and omits the umlaut.

This does not happen when I trigger a reminder in a rule using RenesEchoDot_Erinnere.sendCommand. In this case the app shows everything correctly and the Dot reads everything including umlauts correctly.

So I guess it is a problem with the MQTT binding as described by others here Incorrect character encoding in MQTT binding? and not the AmazonEchoControl binding.

Has anyone seen Java out of heap space issues after using this binding? It works great but after about 8 days, I start getting heap space errors and have to restart openhab.

I am fairly certain it started when I enabled this binding. I am going to remove it for a couple weeks to see if the issues go away, but thought I would throw this out in case others are seeing something similar.

Hello,
can you turn on the debug level trace and sent me the log in a private message?
Thanks for you help!
Regards, Michael

Hi Rene,
I agree with you, this seem to be a bug in the MQTT binding.
Best regards,
Michael

Hi Michael. I don’t know the correct command of debug and also not to stop it. Can you help me?
Thanks,
Markus

https://docs.openhab.org/administration/logging.html#defining-what-to-log

log:set TRACE org.openhab.binding.amazonechocontrol to turn it on,
log:set DEFAULT org.openhab.binding.amazonechocontrol to turn it off.

Cool, thanks.

For now I did a workaround / dirty hack: before sending the text via MQTT I replace all umlauts with their transliteration, eg. “ü” is replaced by “ue”. This works as these characters are received correctly by the MQTT binding and Alexa knows that “fuer” is pronounced the same way as “für” :slight_smile:

However, this can only be a hack for the moment until the bug is fixed in the MQTT binding.

Regards,
René

BETA 16
See the top most posting of this thread!

I have added a new channel to start the ‘good morning news’. And I have added a new tutorial for a rule to start music on you favorite music provider in the readme.

3 Likes

Many thanks again for your keeping on developing the binding. Works like a charm.

1 Like

Not sure what ive done - I removed my two excho dots and my amazon account and then uninstalled the market binding, reinstalled then re added my amazon account which is online but now the echo dots are not being discovered?

Hi Andrew,

What you can try:

  1. Go to PaperUI Inbox and select and click on “Show ignored”. Maybe they are show there
  2. Try to restart openHAB. Maybe my binding thought, that they are already discovered
  3. Try to create them manually, you only have to select the account device as bridge and enter the serial number which is shown in the alexa app

Regards,
Michael

Ok…
after a restart of openHab the problem still exist…
the volume of the plus didn’t show the correct level :frowning:

Hello,
me as an owner of six echos would like to be able to send the “stop” command via OpenHAB.
This would be my most wanted feature.

But thanks for the awesome work @michi

I actually tried all 3 of those and yes I can create manually and the dot comes online. I just thought it odd I had to do that as previous versions it’s worked as per the doco.

Looking closer at the echo channels some of the new ones are not there so I must be doing something wrong or there’s some sort of cache?

Thanks
Andrew