Release Candidate and Support: Amazon Echo Control Binding

Have you got the ascending alarm feature enabled? If yes, then that could cause your problem. If the alarm starts off quiet then it may not have enough time to ramp up to be audible. Disable it per device. The setting for this can be found under General sound settings.

M

It is already deactivated, so this couldn’t be the issue :neutral_face:

Maybe it is some other setup issue of the echo device - I will check…

@m4rk Are you using OH 2.5.0 stable?

I am using 2.4

Thank you, that is interesting. I did not know this.

I have just discovered that the ‘last alexa voice command’ has been added and wow, this solves everything so big pat on the back. It was the main thing missing from my smart setup.

Have just dumped all my routines (just the actions and kept the triggers so Alexa doesn’t say ‘not sure what you meant) from Alexa (always deleting stuff / never reliable would forget to turn a light off etc),
Added 2 rules:
1 to detect change to the string for my 7 echo devices and update 1 proxy item
1 to detect the change of the proxy item and do stuff on a switch/case statement.

Works perfectly every single time!

1 Like

There are now also more possibilities coming from Alexa skill improvements. Recently added is support for v3 tags and in particular in Dec support semantic extensions , Toggle, Range and Mode controllers. You can then create a string item and capture an Alexa command or even get Alexa to convert a spoken command directly to an Action. This can remove the need for Alexa Routines, proxy items and openHAB rules. There even more possibilities with ‘Presets’ and ‘Action mappings’

eg
Here is my Group item definition with v3 tags to create a 3 state switch for my PIR lights which have ON, OFF and CONSTANT modes

Group WestLights "West lights" {alexa="Endpoint.LIGHT"}
    String WestLights_Command "West lights command [%s]" (WestLights) {alexa="ModeController.mode" [supportedModes="ON=ON,OFF=OFF,CONSTANT=CONSTANT", autoupdate="false"], expire="4h,command=NORMAL"}
    Switch WestLights_Switch "West lights switch" <light> (WestLights, gAllLights) {alexa="PowerController.powerState" [category="LIGHT"], channel="openwebnet:bus_on_off_switch:Screen10:13:switch"}

When the command string item changes to ‘constant’ it triggers a rule to run a sequence of ON and OFF’s which the PIR needs to see to get it into constant mode

In the next example for my blinds it shows how I could now enable the use of commands like Open, Close, Raise, Lower without Rules, Routines or other work arounds. I also created the possibility to use a STOP command which is not directly supported by Alexa.

Group OfficeBlind "Office blind" {alexa="Endpoint.EXTERIOR_BLIND"}
    String OfficeBlind_Command "Office shutter command" (OfficeBlind) {alexa="ModeController.mode" [supportedModes="STOP=STOP,UP=UP, DOWN=DOWN", autoupdate="false"]} 
    Rollershutter Office_RollerShutter "Office shutter [%d %%]" <blinds> (OfficeBlind,gAllBlinds) {alexa="RangeController.rangeValue" [supportedRange="0:100:10", unitOfMeasure="Percent", actionMappings="Close=100,Open=0,Lower=(+10),Raise=(-10)", stateMappings="Closed=100,Open=1:100"], channel="openwebnet:bus_automation:Screen10:55:shutter" }

See here for more details:

2 Likes

Get this quite a bit in my logs:

2020-01-10 08:14:24.243 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 
'org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler@128f1c52': POST url 'https://alexa.amazon.co.uk/api/behaviors/preview' failed: Too Many Requests
org.openhab.binding.amazonechocontrol.internal.HttpException: POST url 'https://alexa.amazon.co.uk/api/behaviors/preview' failed: Too Many Requests
at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequest(Connection.java:648) ~[?:?]
at org.openhab.binding.amazonechocontrol.internal.Connection.executeSequenceNode(Connection.java:1193) ~[?:?]
at org.openhab.binding.amazonechocontrol.internal.Connection.executeSequenceCommand(Connection.java:1178) ~[?:?]
at org.openhab.binding.amazonechocontrol.internal.Connection.executeSequenceCommandWithVolume(Connection.java:1169) ~[?:?]
at org.openhab.binding.amazonechocontrol.internal.Connection.textToSpeech(Connection.java:1147) ~[?:?]
at org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler.startTextToSpeech(EchoHandler.java:779) ~[?:?]
at org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler.handleCommand(EchoHandler.java:631) ~[?:?]
at sun.reflect.GeneratedMethodAccessor131.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_201]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_201]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [bundleFile:?]
at com.sun.proxy.$Proxy4448.handleCommand(Unknown Source) [?:?]
at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:74) [bundleFile:?]
at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:48) [bundleFile:?]
at sun.reflect.GeneratedMethodAccessor130.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_201]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_201]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_201]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_201]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_201]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_201]

Using the “announcement” channel on my 5 echo devices in parallel is not working for me. My assumption was that its working the same way like the Alexa Announcements Feature, e.g. when I say to one echo “Alexa, announce that dinner is ready.” this is played on all my echos in parallel. With sending to one echo like this, e.g.

Echo_Workroom_Announcement.sendCommand("This is an announcement")

the announcement is only played on the echo which is related to the corresponding channel

String Echo_Workroom_Announcement   "Ankündigung"   { channel="amazonechocontrol:echo:account1:echo1:announcement" }

Grouping all announcement channels and sending announcement to the group has the well-known effect of too many API requests

POST url 'https://alexa.amazon.de/api/behaviors/preview' failed: Too Many Requests

What do I have to do to play an announcement on all my echos in parallel?
Regards,
Andy

michi already commented on that in a previous post:

1 Like

Can I control an Alexa item that I can’t get into openhab…
Minds gone blank I’ve done so much reading over the past few days :joy:

Yes, I’m able to control an Amazon Power Outlet in OpenHab that normally only works via alexa.

@Matthy Could you post example rule?
Thanks, didn’t think I was going mad
Or just tell me how, ie what your writing to what channel?

Sorry, I mixed it up: You have to use the Preview Version of the binding to be able to control such devices: Preview and Beta: Amazon Echo Control

1 Like

Perfect

Hi Guys,
Its been a while since I needed support on this binding as things have been working well recently.
After an upgrade to OH 2.5 before Christmas I have been slowly working my way through all the errors in my log files, recently I noticed this one

LOG

020-01-12 09:21:05.771 [vent.ItemStateChangedEvent] - HO_Echo_TTS changed from  to Hello there

==> /var/log/openhab2/openhab.log <==

2020-01-12 09:21:08.493 [INFO ] [control.internal.handler.EchoHandler] - getPlayer fails

org.openhab.binding.amazonechocontrol.internal.HttpException: GET url 'https://alexa.amazon.com.au/api/np/player?deviceSerialNumber=G0911B0592240CX8&deviceType=A4ZP7ZC4PI6TO&screenWidth=1440' failed: Internal Server Error

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

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

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

	at org.openhab.binding.amazonechocontrol.internal.Connection.getPlayer(Connection.java:929) ~[?:?]

	at org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler.updateState(EchoHandler.java:908) ~[?:?]

	at org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler.lambda$3(EchoHandler.java:717) ~[?:?]

	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_201]

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

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_201]

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:1.8.0_201]

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

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

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

This error appear everytime I sendCommand text to my HO_Echo_TTS item, this is associated to my only echoshow device, not sure if the type is relevant here. all of my other echo dots and one echo are working fine without such an error. I am using binding version 2.5.

The spech sent to HO_Echo_TTS is spoken by the device any ideas why I am getting the errors in the log?

Thanks
Paul

I’ve downloaded the latest version from the top of this thread and manually installed it on my OH 2.3 server (Yes. I know. prehistoric). I can connect to amazon.co.uk and can discover all my Echos but when I try to do text to speech I get errors.

Quick question before I go any further - Am I wasting my time trying to get it to work on top of OH 2.3?

Is there a reasonable acceptable way to perform make an announcement like when you say “alexa, announce the dryer is finished”?

I’m trying to use an Echo routine to read multiple temperature values (from multiple Xiaomi sensors).
To do that I created a Switch item that will receive an ON command if Alexa hears a certain phrase.
However, I’m not happy with the value she gets and interprets it.
E.g. the Item is from type Number and has the state “22.31 °C”, so she actually reads this (22.31 C).
Is there a way for her to read “22,3 degree celcius” (comma instead of point) instead?

How is it configured? If Number:Temperature then try just Number without the : part.

It is indeed configured as

Number:Temperature tempLiving "Wohnzimmer [%.1f °C]" <temperature>...

Removing the :Temperature prevents Alexa from adding the letter C (so I’ll add “degree” manually, which is alright), but she’s still using . instead of ,
So I guess I’ll have to manually transform the value from 22.31 to 22,3, right?