@Ruan-Santana, I added two pages to the documentation this morning:
https://docs.triggercmd.com/#/./API/TriggerCommand
https://docs.triggercmd.com/#/./API/ListCommands
Is that what you're looking for?
@Ruan-Santana, I added two pages to the documentation this morning:
https://docs.triggercmd.com/#/./API/TriggerCommand
https://docs.triggercmd.com/#/./API/ListCommands
Is that what you're looking for?
You can use this web page of course, but don't stop there. Check out this list of ways to run your commands on your computers.
The Smart Home version of the Alexa skill and Google Assistant action does the best job of matching your spoken words to your commands.
Smart Home voice assistant skills (Example: "Alexa, turn on calculator") <--Recommended
Original "conversational" voice assistant skills (Example: "Alexa, ask TRIGGERcmd to run calculator"):
Progressive Web App (PWA)
Mobile apps:
Run your commands when things happen in other Internet services:
IoT Smart Home hubs:
Other cool stuff:
You'll need to install this on your Windows box to make it work: https://autohotkey.com
This is my media.ahk autohotkey script:
Gosub, %1%
return
next:
Send {Media_Next}
return
previous:
Send {Media_Prev}
return
pause:
Send {Media_Play_Pause}
return
play:
Send {Media_Play_Pause}
return
stop:
Send {Media_Stop}
return
volup:
Send {Volume_Up}
return
voldown:
Send {Volume_Down}
return
mute:
Send {Volume_Mute}
return
These are the corresponding commands.json entries:
{"trigger":"Mute","command":"start C:\\autohotkeyscripts\\media.ahk mute","ground":"foreground","voice":"mute"},
{"trigger":"Volume Up","command":"start C:\\autohotkeyscripts\\media.ahk volup","ground":"foreground","voice":"volume up"},
{"trigger":"Volume Down","command":"start C:\\autohotkeyscripts\\media.ahk voldown","ground":"foreground","voice":"volume down"},
{"trigger":"Media Next","command":"start C:\\autohotkeyscripts\\media.ahk next","ground":"foreground","voice":"next"},
{"trigger":"Media Stop","command":"start C:\\autohotkeyscripts\\media.ahk stop","ground":"foreground","voice":"stop"},
{"trigger":"Media Previous","command":"start C:\\autohotkeyscripts\\media.ahk previous","ground":"foreground","voice":"previous"},
{"trigger":"Media Play Pause","command":"start C:\\autohotkeyscripts\\media.ahk pause","ground":"foreground","voice":"pause"},
NOTE: You don't need a Play and a Pause because they do the same thing - they just toggle between play and pause.
This is optional, but I'm also using my Raspberry Pi based IR receiver to trigger the above commands with a VCR remote.
I have these entries in my /etc/lirc/lircrc file on the Pi:
begin
prog = irexec
button = KEY_1
config = export HOME=/root ; /root/triggertest.sh play downstairs
end
begin
prog = irexec
button = KEY_2
config = export HOME=/root ; /root/triggertest.sh notepad downstairs
end
begin
prog = irexec
button = KEY_PLAY
config = export HOME=/root ; /root/triggertest.sh "Media Play Pause" downstairs
end
begin
prog = irexec
button = KEY_PAUSE
config = export HOME=/root ; /root/triggertest.sh "Media Play Pause" downstairs
end
begin
prog = irexec
button = KEY_RIGHT
config = export HOME=/root ; /root/triggertest.sh "Media Next" downstairs
end
begin
prog = irexec
button = KEY_LEFT
config = export HOME=/root ; /root/triggertest.sh "Media Previous" downstairs
end
begin
prog = irexec
button = KEY_STOP
config = export HOME=/root ; /root/triggertest.sh "Media Stop" downstairs
end
begin
prog = irexec
button = KEY_UP
config = export HOME=/root ; /root/triggertest.sh "Volume Up" downstairs
end
begin
prog = irexec
button = KEY_DOWN
config = export HOME=/root ; /root/triggertest.sh "Volume Down" downstairs
end
begin
prog = irexec
button = KEY_MUTE
config = export HOME=/root ; /root/triggertest.sh "Mute" downstairs
end
@tim-s, that's right - you could even just change the trigger name and change it back, and it would invalidate the bookmark URL.
@philip-nguyen, there's a similar question here.
These are the high level steps:
I think that should work. Do you know how to do that? Let me know if you get stuck, and where you get stuck. I can look at your script if you paste it here.
It's back up now.
One of my servers went down last night, and Kubernetes didn't handle the fail-over well.
I got an email from my monitoring system while I was sleeping. I'll need to setup something else that will actually wake me up.
I'm sorry about this outage.
@Waldex-Santos, I think this should work:
osascript -e 'delay 60' -e 'tell app "System Events" to shut down'
Some of you might have noticed, when you'd say something like:
Alexa, ask TRIGGER cmd to run notepad on downstairs
You'd get an answer like this:
"Could not find a command with voice word cmd notepad on downstairs, ..."
I fixed that today.
For some reason Alexa started sending the "cmd" part of "TRIGGER cmd" as a prefix in the command name. I actually had to add code to strip that out.
This works in Windows, Mac, Linux, Raspberry Pi. You can list and control your SmartThings devices with the Samsung SmartThings cli (command line interface) tool.
https://github.com/SmartThingsCommunity/smartthings-cli#smartthings-devicescommands-id-command
smartthings.exe devices
──────────────────────────────────────────────────────────────────────────────────────────────────────────────
# Label Name Type Device Id
──────────────────────────────────────────────────────────────────────────────────────────────────────────────
1 Front Door base-contact ZWAVE 5bebe423-f899-486e-9f62-8c63707a9b6c
2 Front Lights switch1 DTH fb132245-8bd0-478d-be4b-ca311ae64656
3 Home Hub SmartThings v2 Hub HUB 9079eb4d-10b4-435d-9a05-b2b9629cb50a
4 Motion Sensor Motion Sensor DTH b8a3a1ab-daac-44fb-a6c9-53bac4382df9
5 Notepad Notepad DTH a83bbda3-d461-44ae-948a-7d8fd13b5799
6 Samsung 7 Series (40) [TV] Samsung 7 Series (40) OCF 01253b2b-71ed-4b74-b7dd-74dd94522d96
7 THERMOSTAT Honeywell TCC 6000 Thermostat VIPER 86b567ac-0da3-4257-9b03-47a3cfc3b469
8 Kitchen Switch Z-Wave Switch DTH e2237460-e3fa-4bf5-8a24-3e6d64f89352
To turn on my Kitchen z-wave switch, I can run a command like this:
smartthings.exe devices:commands e2237460-e3fa-4bf5-8a24-3e6d64f89352 switch:on
SmartThings devices can be controlled with the SmartThings app of course, but this might be useful in scripts - whether you run them remotely via TRIGGERcmd or not.
Alexa Routines now works with the original "TRIGGERcmd" and "TRIGGER command" skills.
This is great because now instead of saying:
Alexa, ask TRIGGERcmd to run notepad on office with parameter russ
You can just say:
Alexa, russ
I just created this video to show how it works: https://youtu.be/rZXfncqXqmA
Also these screenshots show how to set it up in the Alexa app:
@Murilo-Callegari, if you look at the Runs list for your command, it should say "Command ran" if the command actually ran on your computer.
If you're worried the screen still didn't lock even though your "lock screen" command ran, you could have your "lock screen" script also check whether the screen is locked, and send that information to the Runs list using the ~/.TRIGGERcmdData/result.sh script.
Just run ~/.TRIGGERcmdData/result.sh from your "lock screen" script with a status message like "Locked" or "Unlocked" as the parameter when you run result.sh.
You can also have Alexa speak the "Locked" or "Unlocked" result if you add {{result}} to your command's Voice Reply field and use one the Conversational Alexa skills.
This article has more about that.
I actually discovered this when I accidentally said, "Alexa, run calculator."
Apparently if you've already said, "Alexa, ask TRIGGERcmd to run X", then next time you only have to say, "Alexa, run X."
That's awesome. I hope Google Assistant does the same.
Turn monitors off:
powershell (Add-Type '[DllImport(\"user32.dll\")]^public static extern int SendMessage(int hWnd, int hMsg, int wParam, int lParam);' -Name a -Pas)::SendMessage(-1,0x0112,0xF170,2)
Turn monitors on (didn't work for me - see below):
powershell (Add-Type '[DllImport(\"user32.dll\")]^public static extern int SendMessage(int hWnd, int hMsg, int wParam, int lParam);' -Name a -Pas)::SendMessage(-1,0x0112,0xF170,-1)
In my case, the Turn monitors on powershell command didn't work for me. My monitors turned on but then turned right back off for some reason. So instead, I used this script and made this my command line so it effectively presses the Print Scrn button to turn my monitors back on:
wscript d:\scripts\key.vbs PRTSC
@Craig-OK, I've been thinking about this. None of the methods for shortening the Alexa phrase (ifttt or routines) allow for parameters, so I can't think of a good solution besides, just saying the whole thing:
Alexa, ask TRIGGERcmd to run download with parameter Ubuntu server
And that assumes the command with download in the voice field is on your default computer.
Christian, I looked at your voice words for your commands, and tried them. The 2nd one worked well for me, but I had to remove the "ing" from the 1st one before Alexa recognized it.
Your voice word for your computer worked well for me.
One thing I found too is that Alexa understands better if you pause for about 1 second between "run X" and "on Y". So think of it like a comma - run this, on that.
Also I just noticed a bug in the agent when I tested that. I found that if I only change the voice word for the command in commands.json, it doesn't update on the website. I had to change another field for it to update the command's voice word. Oops! I'll try to fix that and post a new version of the agent by tomorrow.
Thank you for testing!
The old Webhook method still works, but now you can use the official TRIGGERcmd service on IFTTT.
Here's a Youtube video showing how to use it.
@sinedrock, please try this, change the voice word to pc, then you can say Alexa, turn off pc.
Then change your routine to use that device.
@joao-vitor-lima, actually your button will look like this, but I see you found it because your second screenshot shows the page.
One thing I don't know yet is whether you've enabled the TRIGGERcmd Smart Home skill to link your Alexa account to your TRIGGERcmd account. You should be able to use this link to do that, or add it under Casa inteligente in the Alexa web app.
https://www.amazon.com.br/VanderMey-Consulting-LLC-TRIGGERcmd-Smart/dp/B07P1MMFRP
If you only enable one of the original non-Smart Home Alexa skills, it won't work. You need to enable the "Smart Home" one.
I'm sorry installing the background service it didn't work. I hope I can figure out why. I have Windows 10 too. I just tried uninstalling and re-installing the background service and it works for me.
Do you see the TRIGGERcmdAgent service listed in you Windows services? If so, maybe you just need to start it, or stop/start it.
When you installed the background service, did you see a "User Account Control" prompt to allow Node.js to make changes to your device? I assume you click Yes to that?
I'd appreciate any clues you can give me to help me reproduce the problem.
Sign up using this URL.
I'll use this to send announcements, like new integrations or new versions of the agent.
Thanks to @Xander for the idea.