Dynamic Replies from Alexa via TRIGGERcmd?
-
Heyho,
Im back after a long time
I have a question. Is it possible for Alexa to talk to me when i run a specific voice line?
Like lets say i tell Alexa to run smth, which is starting a script on my pc. Can triggercmd "read" a value string from the script it ran and make Alexa say that line?
Or is it not currently possible to make alexa talk back dynamically?
Thanks!
Furkan
-
@furkan-cevik, this field works with the original TRIGGERcmd and TRIGGER command skills work with this Voice Reply field:
You say something like, "Alexa, ask TRIGGERcmd to run Script"
And when your script runs, it needs to run the sendresult.bat or sendresult.sh script in the .TRIGGERcmdData folder which is in your user's home folder, like this:
Linux:
~/.TRIGGERcmdData/sendresult.sh hello
Windows:
%USERPROFILE%\.TRIGGERcmdData\sendresult.bat hello
One thing you might want to try is running an Alexa Routine that uses a custom action that uses the TRIGGERcmd (not TRIGGERcmd Smart Home) skill. You just have it say, "ask TRIGGER C M D to run script" for you.
Under "When this happens" you can pick one of your TRIGGERcmd Smart Home devices as the Routine trigger.
That way you can still trigger it using the TRIGGERcmd Smart Home skill.
-
@russ ill try it later, ty.
-
@russ Hey Russ,
im currently trying to understand how your SendResult.bat works.
I currently cant find out where the script get the info for these 2 Variables:
-F computer_id=%TCMD_COMPUTER_ID% -F command_id=%TCMD_COMMAND_ID%
To be exact, its these 2:
- %TCMD_COMPUTER_ID%
- %TCMD_COMMAND_ID%
Im asking this to try/know if I can just run this script on my PC to see if alexa will talk back or not, or am i forced to try it with the skill?
Thanks!
-
@russ ok, i tried now the normal way, its still not really working.
I made a .bat Script which is just opening 2 Programs for testing purposes:
This is the command in TRIGGERcmd:
I also configured it the way you said with the Routine to call it easier:
Made a Routine:
I say: "Alexa, test"
Enabled the option "What i say" to: "Ask Trigger C M D to to run Firefox".With this i can run the routine by just saying "Alexa, test".
The inital start works, its starting Firefox and Edge like in the script, but as voice reply, Alexa only says "reply" and not "Say my name furkan" like i put in the script. Like its instantly saying back "result", without waiting for the script to finish.
This is the results.log file call, if needed:
{"data":[{"name":"Firefox","voice":"firefox","voiceReply":"{result}","allowParams":false,"user":"5ee920d8b6af0700198b05d2","computer":"6206f1048f469b001ac34fa8","switch_is_on":false,"runCount":5,"createdAt":"2022-02-12T13:05:52.286Z","updatedAt":"2022-02-12T13:11:20.628Z","lastResult":"Say My name Furkan","id":"6207b0b028bc10001afaec9e"}],"message":"Command result updated successfully."}
PS: I use Alexa in German, if that matters.
What am i doing wrong? Thanks Russ!
-
@furkan-cevik you need the skill enabled for Alexa to see TRIGGERcmd devices. I also believe you need a routine created to see and reply to a TRIGGERcmd device trigger.
-
@tuicemen Hey,
i have the triggerCMD Skill enabled.
Like im also to call my script sucessfully, thats not the problem. The problem is that i dont get the configured voice response back.
But i "found" my mistake, kinda.
Russ said in this entry, i need to use {result}, but here:
https://www.triggercmd.com/forum/topic/332/smart-reply-for-voice-with-parameters/3
It says to use {{result}}
I switched it to that, and now my Alexa says "No Result" everytime, even tho I have a configured Result:
-
@furkan-cevik I found my mistake.
It took too long to run my .bat file.
I read now on other topic, that it has only 4-5sec time to get a result. If it takes too long, it says "No Result".
@Russ Is it possible to increase this? I wanna run some api calls and get these as voice reply, but these could take a bit to call.
Thanks!
-
@furkan-cevik the time out is on the Alexa side. @Russ had suggested away arround this obstacle using routines and a second script. I can't seem to find that thread right now. I'll post a link to it if/when I find it.
Update: here is the link
https://www.triggercmd.com/forum/topic/2015/feedback-on-triggers/5 -
@Furkan-Cevik, I created this article to clarify the process.
Also you're right, I meant {{result}} not {result}. I corrected my post.
@tuicemen fyi
-
@russ Thanks Russ!
-