How to use Off Command
-
There's a new field called "Off Command" that will allow you to specify a command to run when the parameter is off, which is the case when you set Allow Parameters to true and use one of the TRIGGERcmd Smart Home Alexa skill or Google Assistant action.
If parameters are enabled and this field is filled, Command will run when the parameter is on and Off Command will run when the parameter is off.
The commands will run without " on" or " off" appended to the end. If you want those appended to your command, then leave the Off Command field blank, and use the Command field to run a script that expects on or off as the parameter.
So with this example, you can say, "Alexa, turn off calculator" and calculator will close.
EDIT: So far only the the Windows version is updated to include this feature.
EDIT 2 10/11/2020: Now the Linux and Raspberry Pi versions include this Off Command feature (Example "offCommand": "pkill gedit").
EDIT 3 3/28/2021: I finally updated the Mac version to include this feature. Sorry it took so long. I had some trouble building it.
-
Not working on Pi/Debian, do you have an update link?
-
"(coming soon)"
-
@George-Hatzisymeon, so far I've only done the Windows agent version with this new feature. I'm having some trouble with the Mac version. I'll build the Linux and Pi versions soon and update the post.
-
hola, soy de perú, hace poco conoci esta maravillosa aplicacion , no hablo nada de ingles pero con el traductor estuve intentando para poder entenderlo. ¿cuando estara disponible esta actualización?
-
@Terry-Ap, this is already available in the latest version of the Windows agent. I'm having trouble with the Mac version and I haven't started trying to build the Linux version yet. I hope to finish those soon. Maybe within a couple weeks.
-
Russ - is this working in windows currently or no? i see you said above that it is - but the option is still grayed out for me. I've updated the agent and everything, so just trying to figure out if there's an issue on my end or if it's just not ready.
-
@Rob-Lee, the "Off Command" field is greyed out if "Allow Parameters" is set to false.
Allow Parameters has to be true if you want to use the Off Command field.
I'm glad you asked, because it's not particularly intuitive.
-
On Windows 10. I tried this example and when I asked Alexa to "turn on calculator" it failed. I had to ask "turn Calculator on" for it to work. no biggie there. But when I said "turn Calculator off" it opened another instance of calculator and said as much in reply from my Echo show. What's the issue?
-
@DJ, if you want to do something else when you tell Alexa/Google to turn the virtual device off, you need to populate the Off Command field set Allow Parameters to true.
In this screenshot you'll see I'm closing calculator when Alexa turns the device off.
-
@russ Works like a charm .. a newbee to this.
Now how to send a voice/ text back to my Google Nest Mini. -
@david-jones I am using Cast from Windows. Chasing equivalent for RPi on Raspian.
-
This post is deleted! -
Hi,
I'm trying to set up a command "Turn ON Monitors" and "Turn OFF monitors" for Alexa.
Am I doing something wrong here? Doesn't work.Thank you
-
@David-0, what you show in that screenshot looks correct, assuming nircmd.exe is in that "c:\local apps\nircmd" folder. It's good you quoted the full path because it contains a space.
Do those commands work if you run them locally in a powershell or cmd window? I suppose the monitor on command would be difficult to type if the monitor is off, but you could press the up arrow and delete the two f's and add an n and press enter.
Also, what if you run them from the website, like from your phone? Does that work? If not, you should troubleshoot that before moving on to Alexa (or Smart Things). When you're ready to move on, please check for this page to make sure it shows the "on" Alexa phrase. If it's not there, something is wrong, like maybe your computer isn't your default computer or it doesn't have a voice word set (which you only need to set if it's not your default computer).
I've had pretty good luck with nircmd but some monitors don't respond to nircmd's on/off commands, so you'll want to test the monitor off command manually first.
-
@Russ Hi
Thanks for your continuous support.- Yes, the commands work from the website, triggered from my phone
- I have separated both commands.
- I've changed the "Monitors ON" command to sendkeypress to see if it works better than monitors on.
- Now, Both commands work fine from the website AND from Alexa as well.
- The "Nircmd monitor on" command still doesn't work for some reason (hence I changed to sendkeypress)
- It also doesn't work if I use the "Off Command" option in your Windows App, I apparently have to make 2 separate commands.
Thanks a lot! Sorry for my many questions, I'm just starting with TRIGGERcmd.
Until now, I was using ACC (AssistantComputerControl) and IFTTT in my Alexa routines but as of 31 October, IFTTT won't be available in Alexa anymore in the UK so I needed to switch to something else.
Money well spent on TRIGGERcmd!! -
@David-0 nice job. Good idea using the space to turn the monitor back on.. I'm not sure why nircmd won't do it.
I wonder why the IFTTT Alexa skill is going away in the UK.
-
@Russ Because Amazon are upgrading their API on November 1st. They've been notifying all devs about this but IFTTT being either lazy or stupid, they haven't updated their systems so on November 1st, they will become incompatible with Amazon new API.
-
David, good to know. Also sorry you lost your forum account. I didn't realize it would go away when you disconnected you Google account.
-
fala portuges