You could put that together using the echo control binding, it’s similar in how I have the command “turn on/off the fan” work to turn on the ceiling fan by having a rule on the last command channel. You would still have to have a routine with that phrase as the command but you can have it just do nothing, like in my case I have it turn on a dummy switch that’s not bound to anything. Here’s what I have, it’s quick and dirty and I know there are other more complex but more flexible ways of doing this but it works for me and could be adapted for your use pretty easily. A few notes, all of my last command channels are in a group called GAlexa_LastCommand, so I could get capture the command from any echo and my items are defined as such:
String Echo_Kitchen_LastVoiceCommand "Echo Kitchen Last Voice Command" (GAlexa_LastCommand) {channel="amazonechocontrol:echo:echo_account:XXXXXXXXXR:lastVoiceCommand"}
The rule (Jython), which grabs the echo name (the bit between “Echo_” and “_LastVoiceCommand”), to know which room you’re in and acts accordingly.
@rule("Alexa Last Command")
@when("Member of GAlexa_LastCommand received update")
def alexaLastCommandEvent(event):
if str(ir.getItem(event.itemName).type) == "Group":
return
echoName = event.itemName.replace("Echo_","").replace("_LastVoiceCommand","")
echoCommand = event.itemState.toString()
if echoCommand == "turn on the fan":
events.sendCommand(echoName + "FanSpeed_Rules","100")
elif echoCommand == "turn off the fan":
events.sendCommand(echoName + "FanSpeed_Rules","OFF")
In your case, i’d probably do it kind of like this:
TTS item for the echo control binding (defined in the same pattern as LastVoiceCommand)
String Echo_Kitchen_TTS "Echo Kitchen TTS" (GAlexa_TTS) {channel="amazonechocontrol:echo:echo_account:XXXXXXXXX:textToSpeech"}
and rule (i’d add to my existing rule, but for simplicity):
@rule("Alexa Last Command")
@when("Member of GAlexa_LastCommand received update")
def alexaLastCommandEvent(event):
if str(ir.getItem(event.itemName).type) == "Group":
return
echoName = event.itemName.replace("Echo_","").replace("_LastVoiceCommand","")
echoCommand = event.itemState.toString()
if echoCommand == "what's the pool temperature":
# Get value from item here
events.sendCommand("Echo_" + echoName + "_TTS", "Value of your pool item")
This should respond to the command “what’s the pool temperature” with the value of the item you have on the same echo you asked.