Release Candidate and Support: Amazon Echo Control Binding

Hi Michael,

I have the following included as an example: # _ and $ in the password.

Regards
Kevin

Some comments/feedback.

Subtitle2 and the ProviderDisplayName seem to provide the same information. E.g. Amazon Music or Pandora. Maybe this depends on the service and there are certain ones that provide unique values.

I was going to try to create a drop down with a few different stations. I donā€™t get any updates to radioStationId. I guess the first question is, should there be? Second, is there an easy way to determine the station IDā€™s to create a list?

I have the same problem here. Mine contains an ! in the password.

I have now tested all the characters, but the seems not the problem. The were corrected passed from the file to the binding and correctly escaped for the login. Have you turned of the 2 Factor authentication? Have you tried the use the autodiscovered thing instead of the file?

Yes the Subtitle2 is depending of the provider. At least for spotify and tuneIn should be a difference between these channels. Have you checked, if your items a bound to the correct channel?

The best way to get the station id is to use a String item for the radioStationId channel and bind it to a Text element in the sitemap (with no mapping defined), or create the defauls in the paperUI. Then you should see the id (only available if you play a tuneIn radio station). But you have to wait for the next polling (up to 60 seconds with the default configuration in the account thing). If you donā€™t want to wait, change the volume from the echo thing in openhab, then an update will be forced and you should see it immediately.

Maybe I found the problem. There was a bug, if the config will be changed after the first initialization. I will provide a new build!

Beta 6 is ready. See first post in this thread to get the link!

Ah that explains the Subtitle2. I donā€™t have Spotify premium, and rarely use TuneIn. Mostly an observationā€¦ just making sure I wasnā€™t missing some details.

That is exactly what I did for the stationId. If it only works with TuneIn, that explains everything though. Is it possible to start a Prime (or Pandora or Spotify) ā€œstationā€ with this channel? Or is it TuneIn only for both read and write?

Only for TuneIn, for controlling spotify you can test this binding: GitHub - astenlund74/org.openhab.binding.spotify-binary: Binary build of the org.openhab.binding.spotify

Hi Michael,

I have downloaded beta 6 and will test tomorrow as its been a long day.

I will let you know the outcome

Regards
Kevin

Success here!

Hi Michael,

I can confirm mine now works as well!!

Thanks

Thankā€™s for testing and reporting of the problem!

Sorry for my first answer with the transformation, this was wrong because transformations can only be used for viewing in a readonly element. I have added now a sample with an Selection element in the sitemap in the first posting of this thread.

1 Like

Beta 7 is ready for download.

It provides a fix for more useful subtitle 2 in case of Amazon Music.
Also a new channel is available to start tracks from Amazon Music in the channel amazonMusicTrackId. It can be used in the same was as the radionStationId channel. But I do not know, if this channel can be used for Amazon Prime songs (I have no prime), would be nice if anyone could test this.

An other feature is starting a playlist, but this is only a prototype because the id of the playlist is required. But my binding can not get this id, because if you starts a playlist, amazon makes a copy of it and creates a player queue. I only get informations about this queue and there is no way to get informations about the original playlist. So you have to use the development tools of the web browser to get the id. I do not know if anybody has the know how, how this can be done. If yes, it would be nice for me to know if it can be used to start a prime queue, because I think this will not work, I have seen in a script, that there is another command for this, but anyway I trial would be nice.

Regards,
Michael

Wow youā€™re really rolling out the releases!

I hope you didnā€™t take my comments as criticism. I was just making sure I understood how everything works.
Iā€™m not going to complain about new features though! Will test and provide feedback as soon as I get some time.

@michi

I have Prime but no AmazonMusic. That is most propably also the reason for this exception:

rg.eclipse.smarthome.core.items.ItemNotFoundException: Item 'Echo_OG_Room_AmazonMusic' could not be found in the item registry
	at org.eclipse.smarthome.core.internal.items.ItemRegistryImpl.getItem(ItemRegistryImpl.java:70) [109:org.eclipse.smarthome.core:0.10.0.b1]
	at org.eclipse.smarthome.ui.internal.items.ItemUIRegistryImpl.getItem(ItemUIRegistryImpl.java:724) [155:org.eclipse.smarthome.ui:0.10.0.b1]
	at org.eclipse.smarthome.ui.basic.internal.render.SwitchRenderer.renderWidget(SwitchRenderer.java:55) [215:org.eclipse.smarthome.ui.basic:0.10.0.b1]
	at org.eclipse.smarthome.ui.basic.internal.render.PageRenderer.renderWidget(PageRenderer.java:172) [215:org.eclipse.smarthome.ui.basic:0.10.0.b1]
	at org.eclipse.smarthome.ui.basic.internal.render.PageRenderer.processChildren(PageRenderer.java:137) [215:org.eclipse.smarthome.ui.basic:0.10.0.b1]
	at org.eclipse.smarthome.ui.basic.internal.render.PageRenderer.processPage(PageRenderer.java:100) [215:org.eclipse.smarthome.ui.basic:0.10.0.b1]
	at org.eclipse.smarthome.ui.basic.internal.servlet.WebAppServlet.service(WebAppServlet.java:179) [215:org.eclipse.smarthome.ui.basic:0.10.0.b1]
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:848) [88:org.eclipse.jetty.servlet:9.3.22.v20171030]
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:584) [88:org.eclipse.jetty.servlet:9.3.22.v20171030]
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71) [191:org.ops4j.pax.web.pax-web-jetty:6.0.7]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [87:org.eclipse.jetty.server:9.3.22.v20171030]
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) [85:org.eclipse.jetty.security:9.3.22.v20171030]
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226) [87:org.eclipse.jetty.server:9.3.22.v20171030]
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180) [87:org.eclipse.jetty.server:9.3.22.v20171030]
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:284) [191:org.ops4j.pax.web.pax-web-jetty:6.0.7]
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512) [88:org.eclipse.jetty.servlet:9.3.22.v20171030]
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) [87:org.eclipse.jetty.server:9.3.22.v20171030]
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112) [87:org.eclipse.jetty.server:9.3.22.v20171030]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [87:org.eclipse.jetty.server:9.3.22.v20171030]
	at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80) [191:org.ops4j.pax.web.pax-web-jetty:6.0.7]
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134) [87:org.eclipse.jetty.server:9.3.22.v20171030]
	at org.eclipse.jetty.server.Server.handle(Server.java:534) [87:org.eclipse.jetty.server:9.3.22.v20171030]
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:333) [87:org.eclipse.jetty.server:9.3.22.v20171030]
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251) [87:org.eclipse.jetty.server:9.3.22.v20171030]
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:283) [79:org.eclipse.jetty.io:9.3.22.v20171030]
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:108) [79:org.eclipse.jetty.io:9.3.22.v20171030]
	at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93) [79:org.eclipse.jetty.io:9.3.22.v20171030]
	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303) [90:org.eclipse.jetty.util:9.3.22.v20171030]
	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148) [90:org.eclipse.jetty.util:9.3.22.v20171030]
	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136) [90:org.eclipse.jetty.util:9.3.22.v20171030]
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671) [90:org.eclipse.jetty.util:9.3.22.v20171030]
	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589) [90:org.eclipse.jetty.util:9.3.22.v20171030]
	at java.lang.Thread.run(Thread.java:748) [?:?]

It would be very nice to use also the Amazon Prime Music playlists.
Let me know how I can help.

Best regards
Timmi

No, I think this looks like configuration issue. Please check I the sitemap entry have the correct Item name and correct type. Then check, if the Item have the correct channel. Check if you have correctly copied the new binding to the addon directory and removed the old one. Try to restart openHAB. Have you defined the thing in PaperUI or in files? Maybe you have to recreate the thing.
Regards, Michael

Hi Michael,

yes your are right. This was my mistake with the item name.
Iā€™m was creating the things through PaperUI and I deleted them this morning.
Openhab was restarted as well.

Here is another exception I can see in my logs.

2018-01-20 10:36:56.047 [INFO ] [mazonechocontrol.handler.EchoHandler] - getMediaState fails: {}
com.google.gson.JsonSyntaxException: java.lang.NumberFormatException: Expected an int but was 1516440105348 at line 1 column 28140 path $.timeLastShuffled
	at com.google.gson.internal.bind.TypeAdapters$7.read(TypeAdapters.java:245) ~[?:?]
	at com.google.gson.internal.bind.TypeAdapters$7.read(TypeAdapters.java:235) ~[?:?]
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:129) ~[?:?]
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:220) ~[?:?]
	at com.google.gson.Gson.fromJson(Gson.java:887) ~[?:?]
	at com.google.gson.Gson.fromJson(Gson.java:852) ~[?:?]
	at com.google.gson.Gson.fromJson(Gson.java:801) ~[?:?]
	at com.google.gson.Gson.fromJson(Gson.java:773) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.Connection.getMediaState(Connection.java:480) ~[?:?]
	at org.openhab.binding.amazonechocontrol.handler.EchoHandler.updateState(EchoHandler.java:353) ~[?:?]
	at org.openhab.binding.amazonechocontrol.handler.AccountHandler.refreshData(AccountHandler.java:322) ~[?:?]
	at org.openhab.binding.amazonechocontrol.handler.AccountHandler.lambda$1(AccountHandler.java:201) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?]
	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.NumberFormatException: Expected an int but was 1516440105348 at line 1 column 28140 path $.timeLastShuffled
	at com.google.gson.stream.JsonReader.nextInt(JsonReader.java:1164) ~[?:?]
	at com.google.gson.internal.bind.TypeAdapters$7.read(TypeAdapters.java:243) ~[?:?]
	... 18 more

Beside that I donā€™t see any informations in the ā€œAmazon Music Track Idā€ if Iā€™m playing my prime music playlist for example. Not sure if this is expected.
Best regards
Timmi

Michael,
I had time to install and try out the AmazonEchoControl Binding this weekend. I have 4 echo dots and 1 echo spot. The binding automatically found the dots, but not the spot. I was able to install it manually though. Everything is working great. I was able to use the drop down menu you created to play tunein music. I am playing around with it to see if I can play Amazon Prime stations. Not able to so far. Thanks for all your work in creating this binding!