Thanks @michi - I use a motion sensor in the bathroom to play lounge music on my echo when something moves in the room. Unfortunately, I can no longer listen to my Flash briefing because the motion sensor always interferes when I don’t intercept it. So there is probably no way to solve the problem at the moment?
I use jython rules, but here’s how I do it to operate my fans by just saying “turn on (or off) the fan” from a room. It can be adapted pretty easily to do whatever you want based on the echo name and command, as is pretty simple so should be easily converted to old style rule syntax. My echo devices are all set up with this format:
String Echo_Bedroom_LastVoiceCommand "Echo Bedroom Last Voice Command" (GAlexa_LastCommand) {channel="amazonechocontrol:echo:echo_account:xxxxxxxxxx:lastVoiceCommand"}
@rule("Alexa Last Command")
@when("Member of GAlexa_LastCommand received update")
def alexaLastCommandEvent(event):
#ignore groups
if str(ir.getItem(event.itemName).type) == "Group":
return
#get "room" name, i.e. Echo_Bedroom_LastVoiceCommand becomes Bedroom
echoName = event.itemName.replace("Echo_","").replace("_LastVoiceCommand","")
echoCommand = event.itemState.toString()
if echoCommand == "turn on the fan":
events.sendCommand(echoName + "_Fan_Speed_Dimmer","100")
elif echoCommand == "turn off the fan":
events.sendCommand(echoName + "_Fan_Speed_Dimmer","OFF")
Edit:
I also needed to create dummy “turn on the fan” and “turn off the fan” routines so Alexa wouldn’t complain that it didn’t know what to do. Mine just have a switch called “AlexaDoNothing” that isn’t linked to anything that the routine just toggles on and off, but you can have it do anything you want like say something.
Wow!
That’s just great!
I hope i will be able to adapt! I’ll give it a shot in the near future!
At the moment i have a CPU load issue i have to identify …
Should have tried working it out really before asking the questions - was just being lazy!!
Here is the ‘converted’ code:
rule "Amazon Echo Last Command"
when
Member of GAlexa_LastCommand received update
then
logInfo("amazonEcho.rules","Last Command triggered!" + triggeringItem.name)
//get "room" name, i.e. Echo_Bedroom_LastVoiceCommand becomes Bedroom
var echoName = triggeringItem.name.split("_").get(1)
var echoCommand = triggeringItem.state.toString()
logInfo("amazonEcho.rules","echoName: " + echoName + ", echoCommand: " + echoCommand)
end
have changed the .relace functions with .get as all my devices are set up as Echo_PlaceName_Command so .get(1) seems a bit easier to me than replacing the ‘Echo’ and the ‘Command’ parts.
You are using an old version of the binding (Maybe the 2.4 released one). The callstack shows, that the StateDescriptionProvider makes an REST call.
Please update to the version in this thread.
I am trying to configure the echo dot. I have amazon echo account configured. Through paper UI if I switch on the flash briefing and select the echo device it starts playing. However, there is a weird behaviour in terms of items and sitemap. I have never been able to get it working. Also my echo device does not show online at all below is the snapshot, before this my thing configuration
I have all my echos (12) TTS in a group called gEchoTTS. When I want to send a TTS message to that group, I get:
2019-11-20 08:55:48.651 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler@ce4cab': POST url 'https://alexa.amazon.com/api/behaviors/preview' failed: Too Many Requests
org.openhab.binding.amazonechocontrol.internal.HttpException: POST url 'https://alexa.amazon.com/api/behaviors/preview' failed: Too Many Requests
at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequest(Connection.java:654) ~[?:?]
at org.openhab.binding.amazonechocontrol.internal.Connection.executeSequenceNode(Connection.java:1472) ~[?:?]
at org.openhab.binding.amazonechocontrol.internal.Connection.executeSequenceCommand(Connection.java:1457) ~[?:?]
at org.openhab.binding.amazonechocontrol.internal.Connection.executeSequenceCommandWithVolume(Connection.java:1448) ~[?:?]
at org.openhab.binding.amazonechocontrol.internal.Connection.textToSpeech(Connection.java:1421) ~[?:?]
at org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler.startTextToSpeech(EchoHandler.java:784) ~[?:?]
at org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler.handleCommand(EchoHandler.java:631) ~[?:?]
at sun.reflect.GeneratedMethodAccessor94.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) [102:org.eclipse.smarthome.core:0.10.0.oh240]
at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [102:org.eclipse.smarthome.core:0.10.0.oh240]
at com.sun.proxy.$Proxy151.handleCommand(Unknown Source) [191:org.openhab.binding.amazonechocontrol:2.5.0.-2019-09-12]
at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:75) [109:org.eclipse.smarthome.core.thing:0.10.0.oh240]
at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:49) [109:org.eclipse.smarthome.core.thing:0.10.0.oh240]
at sun.reflect.GeneratedMethodAccessor93.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) [102:org.eclipse.smarthome.core:0.10.0.oh240]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [102:org.eclipse.smarthome.core:0.10.0.oh240]
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) [?:?]
No, and it can not supported. Only devices which you find in the routines configuration in the alexa app as as a selection option can be used.
Alexa Auto seem to be a “add-on” and not a real device.