Release Candidate and Support: Amazon Echo Control Binding

Thanks for reporting, I have fixed this bug now. Maybe this is the reason, that you see not “Amazon Music Track Id”. You can download BETA 8 from the first posting :slight_smile:

Hi, is there anybody who owns an echo show and want support me with some informations? Regards, Michael

Hi Michael,

just tested Beta 8 but still the exceptions. I replaced the file and restarted openhab.

2018-01-22 21:16:37.359 [INFO ] [mazonechocontrol.handler.EchoHandler] - getMediaState fails: {}
com.google.gson.JsonSyntaxException: java.lang.NumberFormatException: Expected an int but was 1516652094775 at line 1 column 19992 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.initializeChild(AccountHandler.java:111) ~[?:?]
	at org.openhab.binding.amazonechocontrol.handler.AccountHandler.updateDeviceList(AccountHandler.java:376) ~[?:?]
	at org.openhab.binding.amazonechocontrol.handler.AccountHandler.refreshData(AccountHandler.java:305) ~[?:?]
	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 1516652094775 at line 1 column 19992 path $.timeLastShuffled
	at com.google.gson.stream.JsonReader.nextInt(JsonReader.java:1164) ~[?:?]
	at com.google.gson.internal.bind.TypeAdapters$7.read(TypeAdapters.java:243) ~[?:?]
	... 20 more

Best regards
Timmi

Hi Michi.
Sure. How can I help?

Thank’s for reporting!
Looks to be the same. I’ can’t understand this, because I have changed the timeLastShuffled from int to long. I will try to remove it in the next build, because I do not need the value. But give me some time, I’am currently preparing a new beta with new features.
Regards, Michael

Don’t worry. take your time.

Hi Michi, very very new dabbler of home automatization with OpenHab here, I have a house fully controlled by Alexa, all my light switches are cheap Chinese Jaevoo switches and smart plugins, I can control almost everything and I’m very happy, but I would love to control everything from Siri too, so I needed a bridge, and I think Openhab can be it, and your Binding could be the best solution, it works great to control Alexa, do you think you will implement control of Alexa smart home devices thru Alexa web page? Alexa Routines?

My final objective is installing HomeKit Bridge and use Siri in Spanish (my native language) to control Alexa in English; do you think this would be possible?

Thanks man ! your work is GREAT!

@michi Awesome - works like a charm. Had to read the thread to understand the Bluetooth connection syntax(context). Have TuneIn working (as a note if a channel isnt available at the moment Alexa tells you :wink: ).

I will look at your code and see if i can extend but the community would benefit the most from:
'
Visual/TTS notifications - have hopes the Alexa skill binding would have but doesnt look like its making progress.

I currently use my SONOS and hue bulbs to alert/advise when things are happening but the family has quickly gotten used to Alexa being the voice of the house i.e. instead of SONOS saying “The garage door has opened” or “Take the trash to the curb” would be more appropriate for the Echo’s to do so (and cheaper i.e. $30/50 each vs $150-$500)

Do you have this on Github or similar?

1 Like

Hi Gordon_Geist,

Would be nice to get some support in development :smile:

This is my forked repository:
https://github.com/mgeramb/openhab2-addons

There is already an open pull request:
https://github.com/openhab/openhab2-addons/pull/3087
I’am currently working on a dynamic selection of amazon playlists, if this work is finished, I will remove the Work In Progress flag and hope the it will be accepted.

Regards,
Michael

1 Like

Hi Luis, I know that this would be possible, but it is also a lot of work and have no high priority for me. How to you control your Jaevoo switches? Exist there a homeautomation skill for alexa?
Regards,
Michael

Tthanks for your answer Michi, yes I control the switches and smart plugins through Alexa with Tuya Smart skill, with direct control of the smart things and control over scenes, both perfectly working in Alexa. there is a HomeKit binding already to control openhab from Siri, so, with your binding, I would be able to control Alexa from Siri, that would be awesome. The Jaevoo smart switches are cheap, work great and you need zero DIY work, if openhab could control Alexa smart home devices it would be a boom for openhab community.

Im not sure about this question, maybe lost in translation? (Exist there a homeautomation skill for alexa?) as I already told you, I use TUYASMART skill and EWELINK skill to control every smart thing in my house, 11 Light switches, Amplifier and speakers, Garage Door locks, power to my external cameras, etc.

I’am not sure if this is the perfect way. Maybe you can use the http api to control your Tuya devices. This seems to be possible: https://docs.tuya.com/en/cloudapi/cloud_access.html
Or anybody write a binding for it…

Not sure if it is a good idea. I found a way to send text notification and have it speaking by alexa with adopting “create reminder” put request. Just change to “reminderLabel” and “originalTime” in the PUT request. Not prefect as it seems only accept the future time. If there a way to calibrate the originalTime happening on next second, i think it will still be a good way to let alexa to report some home status.

{“type”:“Reminder”,“status”:“ON”,“alarmTime”:1516861200000,“originalTime”:“14:23:00.000”,“originalDate”:“2018-01-25”,“timeZoneId”:null,“reminderIndex”:null,“sound”:null,“deviceSerialNumber”:“XXXXXXXXXXXXXXXX”,“deviceType”:“XXXXXXXXXXXXXX”,“recurringPattern”:null,“reminderLabel”:“I’m so happy”,“isSaveInFlight”:true,“id”:“createReminder”,“isRecurring”:false,“createdDate”:1516861167418}

Hi, that‘s funny. I have implemeted this yesterday in my binding. Works fine if the remindLabel is short. I also found a way to activate the alarm of the alarm clock. I will provide a new beta wirh these features at weekend. Reards, Michael

A week with this under heavy use through sitemap and ios app and no issues to report. i tuned the polling interval down to 30 seconds and the alexa ios app started being sluggish on the smarthome screens so back up to 60 seconds. not sure why there would be an interaction between the two but changed back to be safe.

Hi Gordon_Geist,
I’don’t know what’s the problem with the ios app. I have talked already with @Kai if I do something wrong in my binding, because I update all channel’s in the polling interval, regardless I the value changes or not. But this seem to be correct, anyway a saw the the ios app updates the album art image on ever update, regardless if there was an change in the url. I’am not sure yet, maybe I open an bug for this, but than I want know more about this behavior.
Regards,
Michael

Beta 9 with a lot of new features is available!

Thanks to all users which have helped me to provider the new features!

In the next time, I will only provider new version if bugs are reported which I can fix, no new features are planned in the moment, because I will use my time now to do the necessary steps to be part of the next openHAB release.

1 Like

Hi Michael,

Excellent job, installed and testing beta 9, one question (apologies if Ive missed this in an earlier post) but how do you trigger the “Remind” and “PlayAlarmSound” options from OH?.

Regards

Hi Michael,

I just installed the new beta 9. I also removed my Echos before in PaperUI. I would expect to see the “remind” and “playAlarmSound” in the PaperUI. But is is not visible. Is this expected?

Best regards
Timmi

1 Like

I was able to get the reminder to work by putting the line below in a rule:

Echo_Living_Room_Remind.sendCommand("Hello This is a test")