TRIGGERcmd
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. Russ
    • Profile
    • Following 1
    • Followers 31
    • Topics 194
    • Posts 2118
    • Best 128
    • Controversial 2
    • Groups 1

    Russ

    @Russ

    administrators

    I'm a tech enthusiast with about 30 years experience in IT. Recently I'm also a TRIGGERcmd developer.

    123
    Reputation
    3608
    Profile views
    2118
    Posts
    31
    Followers
    1
    Following
    Joined Last Online
    Website triggercmd.com Location Haslett, MI

    Russ Unfollow Follow
    administrators

    Best posts made by Russ

    • RE: Laptop Battery Management - Automated On/Off Cycle

      @philip-nguyen, there's a similar question here.

      These are the high level steps:

      1. Create 2 commands that just run echo (doesn't matter what), and name them PlugOn and PlugOff.
      2. Setup two Alexa routines - one that turns on your smart plug when the PlugOn command runs, and other that turns it off when the PlugOff command runs.
      3. Create a script. At the beginning of the script, do the following:
      4. Set variable called PLUG_IS_ON with a default value of true.
      5. To make sure the plug is on at first, run the tcmd utility like this: tcmd -t plugon -c (your TRIGGERcmd computer name)
      6. Create a loop that repeats every minute. Inside the loop, do the following:
      7. Check your battery level with BatteryInfoView.exe
      8. When the level is below 30 percent and PLUG_IS_ON = false, run tcmd utility like this: tcmd -t plugon -c (your TRIGGERcmd computer name)
      9. When the level is above 99 percent and PLUG_IS_ON = true, run tcmd utility like this: tcmd -t plugoff -c (your TRIGGERcmd computer name)
      10. Also set PLUG_IS_ON to true when you run plugon, and set it to false when you run plugoff

      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.

      posted in Example Commands
      Russ
      Russ
    • Autohotkey script for Play, Pause, Volume Up/Down, Next/Previous

      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
      
      posted in Windows
      Russ
      Russ
    • RE: New Bookmark option for each trigger

      @tim-s, that's right - you could even just change the trigger name and change it back, and it would invalidate the bookmark URL.

      posted in Announcements
      Russ
      Russ
    • Pass parameters with Alexa routines

      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:
      Alexa Routines
      Edit Routine
      multiple phrases
      triggercmd custom

      posted in Alexa
      Russ
      Russ
    • smartthings-cli

      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.

      posted in Example Commands
      Russ
      Russ
    • Turn monitors on and off

      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
      
      posted in Windows
      Russ
      Russ
    • Alexa bug fixed

      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.

      posted in Announcements
      Russ
      Russ
    • RE: Avoid saying 'with parameter' when passing arguments via Alexa?

      @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.

      posted in Alexa
      Russ
      Russ
    • How TRIGGERcmd came to be

      It all started when my house got robbed. I was frustrated by my cheap video cameras because I had video of the thief coming and going, but the quality was too low to provide many useful clues. The police probably could have identified the bad guy sooner if I'd had better video.

      On my low res cameras I could see this guy leaving my house with my headphones, bike, hat, shoes, clothes, and a backpack full of valuables. He tracked mud all over my house and even took the time to take a shower. 😡
      Thief

      Here he is in the backyard, hiding from my camera before he snuck around and disconnected it. You can see the resolution is not very good.
      Thief on his way in

      So I went on a tech shopping spree and upgraded my video surveillance system to HD and invested in a Samsung SmartThings based alarm system with presence sensors, motion sensor, door sensors, and a device that sounds the alarm if someone disconnects a camera. The thief disconnected a camera before he broke in, so I figured that device was worth installing.

      One downside of an alarm system is the false alarms. Just last night I had one when I got back home from the bar after midnight. I don't drink, but I was hanging out with my kickball team after our game (we lost). To quickly turn off the alarm I setup a secret light switch that turns off my alarm when you flip it. At first I couldn't find a way to do that with a SmartThings SmartApp, so I used an IFTTT trigger.

      I'd heard of IoT (internet of things) before all this, but I thought it was a marketing fluff (which it is), so I wasn't too interested, but using SmartThings and IFTTT for practical purposes piqued my interest and got my geek juices flowing. However, I realized one THING was missing from IoT - it was my PC.

      About a year prior, I had published a few games, but I was looking for something else to build because I was spending too much time on these games and they weren't making me any money. A couple of them have been downloaded around 5000 times on the Amazon app store,
      Amazon Apps list 5-20-2017

      ... but my ad revenue is still less than $200 even though my games have served over 1.1 million ads.

      AdRevenueVsPageViews

      So I was looking for a non-game idea that's not too ambitious because I wanted to be able to finish it.

      In my research I found Sails.JS which introduced me to websockets, which I thought was super cool because it lets the client interact with the server instantly. That's why modern real-time chat apps use it. While testing various websocket clients and servers I learned that Node.JS can run javascript code as a client and/or as a server. The Sails.JS server runs on Node.JS and has a javascript module for the client. This Sails.JS client module usually runs in the browser, but it can also run in other client apps, like the TRIGGERcmd agents.

      When I learned about Electron, the TRIGGERcmd idea started to form. Electron adds a GUI to Node.JS to produce a cross-platform GUI application. It's based on Google's open-source Chromium project, which is the core of Chrome. The Raspberry Pi version is the only version of the TRIGGERcmd agent that doesn't use a GUI and therefore doesn't use Electron - it just uses Node.JS.

      After the basic application and agents were ready, I wrote an integration with Alexa so you can use your voice to trigger commands. My best, most helpful user, @Christian-Robinson found TRIGGERcmd via the Alexa Skills store. He was actually looking for a way to run commands on his computer with Alexa.

      I wrote another integration with Zapier so you can trigger commands based on various events like a new gmail emails, new files in dropbox, new posts on slack or facebook, etc... Zapier also has scheduler, so you could trigger a command once per day or something. Zapier works like IFTTT. It has some advantages over IFTTT but it's not as well known. IFTTT also wants $2,388 per year to integrate, which is way too much for me at this point. Edit 5/28/17: Now you can use IFTTT to trigger commands via their free Maker service. Zapier won't publish the integration until I get at least 10 users, so you could help me out by trying TRIGGERcmd with Zapier.

      I also wrote an integration with SmartThings. Until Samsung approves it, you'll have to install it using their developer console. The TRIGGERcmd SmartApp lets you add virtual SmartThings switches for TRIGGERcmd commands you select. Then you can flip one of those virtual switches either manually in the SmartThings app, or automatically based on some event like motion sensed, a door opened, a temperature reached, switch flipped, etc... When you flip the virtual switch associated with your TRIGGERcmd trigger, it triggers the command, and immediately flips off.

      I added the ability to run commands remotely by running a command, then when while I was setting up my Raspberry Pi Zero W to run remote commands when I press buttons on an old VCR remote, I realized it's actually faster to just run a curl command that hits the REST API directly.

      Finally, I added Paypal integration so maybe someday TRIGGERcmd will make me some money, or maybe it will at least stop costing me money. You can use it without subscribing if don't want to run more than one command per minute. At this point the Alexa, Google Assistant, Zapier, and SmartThings integrations don't have that limitation. Nor does the command-line (or curl) method of triggering commands.

      I hope you like TRIGGERcmd as much as I do, and I hope you post your questions, bug reports, use cases etc. on the forum.

      posted in Blog
      Russ
      Russ
    • RE: Shutdown PC not working

      @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.

      posted in Windows
      Russ
      Russ

    Latest posts made by Russ

    • RE: Javascript error on install of TRIGGERcmdAgent

      @Ruben-Ortiz, I replied here.

      posted in General Discussion
      Russ
      Russ
    • RE: Javascript error when I try install TRIGGER

      @Ruben-Ortiz, can you look for this path instead?

      C:\Users\Andres\.TRIGGERcmdData
      

      That's the path I see in your screenshot. Your username is Andres (not trent), so that's the path instead.

      posted in General Discussion
      Russ
      Russ
    • RE: Intermittent results

      @karnold69, thanks for this info. I'm glad you've got it narrowed down. If you figure out the specific cause I'll be curious.

      posted in General Discussion
      Russ
      Russ
    • RE: Intermittent results

      @karnold69, thank you for that info. That narrows it down.

      The message from Alexa to the TRIGGERcmd server seems to be working fine, and the message from the TRIGGERcmd server to the agent running on your computer seems to have worked too, because we're seeing the "Command ran" message come back from the agent.

      I suggest for the next troubleshooting step, you could add a log to your script, assuming you're running a script to talk to your X10 devices. Would you mind sharing your script or command here?

      Assuming it's a Windows batch script, you could add a line like this to your script to add a line to a log file each time the command runs:

      echo "Script ran with param %1" >> c:\scripts\x10_log.txt
      

      Does it run fine if you run it manually from a Windows cmd prompt?

      posted in General Discussion
      Russ
      Russ
    • RE: how to cancel

      @june-david, I cancelled your subscription for you.

      posted in General Discussion
      Russ
      Russ
    • RE: Intermittent results

      @karnold69, thank you for reporting it. You're the first to report it so far. My customer base has grown, so it's possible my servers are getting overloaded at certain times.

      To help narrow down the problem, this info might help:

      When it happens, do you get a "Command ran" entry in the runs list for the command?

      Which method are you using to trigger the commands? For example, is it the Alexa TRIGGERcmd Smart Home skill?

      If you give me a specific time when it failed, that might help too.

      posted in General Discussion
      Russ
      Russ
    • RE: paypal "hosted button ID" integration with triggercmd

      @hehaha, good. I'm glad you got it working. And no, no Venmo, only PayPal.

      posted in Raspberry Pi
      Russ
      Russ
    • RE: paypal "hosted button ID" integration with triggercmd

      @hehaha, I'm not sure why it's not showing up in your button code. I just created a test button and it does show up in mine.

      <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
      <input type="hidden" name="cmd" value="_s-xclick">
      <input type="hidden" name="hosted_button_id" value="5JHS4U8KM4QX8">
      <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
      <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
      </form>
      

      Another way to see the button ID is to expand the button using the arrow on the left, or the Action pulldown on the right.

      c8170af8-d8f2-4980-b3c9-f0cd423e1f45-image.png

      Maybe your button settings are different from mine. Did you create a "Buy Now" button?

      68343b0b-a913-4efe-a29f-f24d30771583-image.png

      posted in Raspberry Pi
      Russ
      Russ
    • RE: Manually set Params

      @Robbie-Hoskins, if you leave the Off Command field blank, the command in the Command field will run with on or off as the parameter depending on whether you say "turn on" or "turn off."

      If you don't want to use the on/off parameters, you could fill in the Off Command field. Then it will run the command in the Command field when you say "turn on" and the command in the Off Command field when you say "turn off."

      Here's an example where I'm running two completely different commands for on and off.

      89ca17b5-100e-4ec0-8c37-07c9862e1408-image.png

      I hope this answers you question, but I'm not sure.

      posted in Instructions
      Russ
      Russ
    • RE: Warzone

      @Arnold-Martinez-Castillo, I don't have Call Of Duty Warzone, but I did figure it out for World of Warcraft, so I think you could the same method to find the .exe file, and run it directly.

      I opened Task Manager's Details tab and sorted by the CPU column, then I opened World of Warcraft from the Battle.net app. The top CPU user was Wow.exe.

      e7f4d927-3970-4155-b3a2-bfffa228ac2a-image.png

      I right-clicked Wow.exe and clicked Open file location.

      ddc7c038-6f8c-49f6-9b28-d221923b9d36-image.png

      That showed me the full path to Wow.exe.

      bb5ac33b-36a9-471a-9c9e-18890bb04faf-image.png

      Now I can launch it with this command:

      "C:\Program Files (x86)\World of Warcraft\_retail_\Wow.exe"
      

      9067d346-4f9c-4e28-9d39-985ec887e37c-image.png

      posted in Blog
      Russ
      Russ