TRIGGERcmd
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login
    1. Home
    2. Russ
    • Profile
    • Following 1
    • Followers 42
    • Topics 227
    • Posts 2,652
    • Best 167
    • Controversial 6
    • Groups 1

    Russ

    @Russ

    administrators

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

    165
    Reputation
    3.8k
    Profile views
    2.7k
    Posts
    42
    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
      RussR
      Russ
    • List of ways to trigger your commands

      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

      • "TRIGGERcmd Smart Home" Alexa skill
      • "TRIGGERcmd Smart Home" Google Assistant action

      Original "conversational" voice assistant skills (Example: "Alexa, ask TRIGGERcmd to run calculator"):

      • Original Alexa skill
      • Original Google Assistant action (deprecated)

      Progressive Web App (PWA)

      • https://app.triggercmd.com

      Mobile apps:

      • Apple App Store: TRIGGERcmd
      • Google Play Store: TRIGGERcmd (supports widgets)
      • Amazon App Store: TRIGGERcmd

      Run your commands when things happen in other Internet services:

      • Zapier - create a "Zap" that runs your command when something happens on one of their 1500+ supported apps.
      • Make - create "scenarios" that run commands on your computers.
      • IFTTT - If This Then run a command, or if a TRIGGERcmd command runs, run an IFTTT applet.
      • Microsoft Power Automate (aka Flow) - run commands when things happen in Office 365 and other services.
      • Pipedream - build workflows that run your commands.

      IoT Smart Home hubs:

      • Home Assistant - Flip virtual HA switches to run your TRIGGERcmd commands.
      • Samsung SmartThings - Create virtual switches for each command, then flip the switches to run them. (Not working as of 6/21/2025)
      • Homey - Use the ‘run command’ flow action.
      • Hubitat - Trigger a command like you'd flip a switch.
      • Node-RED - Run commands using an "http request".
      • HomeKit - Use the homebridge-http-switch plugin with a bookmark URL.

      Other cool stuff:

      • Run an Alexa routine - when one of your TRIGGERcmd commands runs.
      • Google Assistant routine (aka automation) - use one of your TRIGGERcmd commands as a "starter" to run your routine when the command runs, or run one of your commands as a routine's "action." Either way, you must use the google automations script editor, not the Home app.
      • Local stdio MCP - Run commands from local AI LLM chat tools like Claude Desktop or VS Code. Use the "MCP Tool Description" field of each command to tell the LLM what the command does, and how to use the parameters.
      • Online Streamable HTTP MCP - Same as above but for online AI tools like Mistral AI.
      • Bookmarks - Create and share URL's that run your commands without authentication. You can set an optional timeout to make bookmark URL's expire. People can also scan your bookmark's QR code to run the command.
      • iOS shortcut - Use the iOS Shortcuts app to run your commands with Siri.
      • REST API - Use curl or other client to call the TRIGGERcmd API.
      • tcmd - Command line tool written in Go.
      • Tasker - Tasker is an Android app for automating things with your phone.
      • Slack app - Run your commands with Slack "slash" commands.
      • Powershell - Run a command on a computer across the Internet from your powershell script.
      • Roku channel - Run a command from your Roku.
      • Unity - Run a command from a Unity game or utility you made.
      • Streamdeck - Configure a Streamdeck button to run a command on a remote computer.
      • Python - Run a command on a remote computer from a python script.
      • Paywall URL's - Similar to bookmark URL's, you can also charge people via Paypal to run your commands.
      posted in Instructions trigger methods
      RussR
      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
      RussR
      Russ
    • RE: internal server error

      @Micael-Sousa, good to know. I'm glad you figured this out.

      posted in Alexa
      RussR
      Russ
    • RE: Doc Api

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

      posted in API
      RussR
      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
      RussR
      Russ
    • RE: Shutdown não funciona no mac

      @Waldex-Santos, I think this should work:

      osascript -e 'delay 60' -e 'tell app "System Events" to shut down'
      
      posted in Mac
      RussR
      Russ
    • RE: Triggercmd smart home not reachable

      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.

      posted in Google Home
      RussR
      Russ
    • Hubitat integration

      @Royski created this Hubitat integration that works just like the SmartThings integration.

      His write up is here, on the Hubitat community forum:
      https://community.hubitat.com/t/release-triggercmd-for-hubitat/22715

      The code and instructions are here:
      https://github.com/rvmey/HubitatTRIGGERcmd

      Here's quick video showing it working:
      https://youtu.be/V90B7jbEYxI

      posted in Instructions
      RussR
      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
      RussR
      Russ

    Latest posts made by Russ

    • RE: Operation on VMware virtual PCs

      @hondaru2004, here's a powershell script that will create a new computer in your TRIGGERcmd account. It assumes you installed the agent on the master PC you cloned because it uses the token.tkn file from that install for authentication. It writes the computer ID and computer name to the config files in the user's home directory. I hope this helps.

      # === Configuration ===
      $urlprefix = "https://triggercmd.com"
      $computername = $env:COMPUTERNAME
      
      # Read token from TRIGGERcmd token file
      $tokenPath = Join-Path $env:USERPROFILE ".TRIGGERcmdData\token.tkn"
      
      if (Test-Path $tokenPath) {
          $token = Get-Content $tokenPath -Raw | ForEach-Object { $_.Trim() }
          Write-Host "Token loaded from: $tokenPath" -ForegroundColor Green
      } else {
          Write-Host "Error: Token file not found at $tokenPath" -ForegroundColor Red
          Read-Host "Press Enter to exit"
          exit 1
      }
      
      # === Perform the POST request ===
      Write-Host "Making API request..." -ForegroundColor Green
      
      $headers = @{
          "Authorization" = "Bearer $token"
          "Content-Type" = "application/x-www-form-urlencoded"
      }
      
      $body = "name=$computername"
      
      try {
          $response = Invoke-RestMethod -Uri "$urlprefix/api/computer/save" -Method POST -Headers $headers -Body $body
          
          # === Display the full response ===
          Write-Host "`nAPI Response:" -ForegroundColor Yellow
          $response | ConvertTo-Json -Depth 10 | Write-Host
          
          # === Extract and save the ID ===
          $computerId = $response.data.id
          
          if ($computerId) {
              # Save ID to TRIGGERcmd config file
              $computerIdPath = Join-Path $env:USERPROFILE ".TRIGGERcmdData\computerid.cfg"
              $computerNamePath = Join-Path $env:USERPROFILE ".TRIGGERcmdData\computername.cfg"
              
              # Ensure the directory exists
              $triggerCmdDir = Split-Path $computerIdPath -Parent
              if (!(Test-Path $triggerCmdDir)) {
                  New-Item -ItemType Directory -Path $triggerCmdDir -Force | Out-Null
              }
              
              # Save ID to file
              $computerId | Out-File -FilePath $computerIdPath -Encoding ASCII -NoNewline
      
              # Save computer name to file
              $computername | Out-File -FilePath $computerNamePath -Encoding ASCII -NoNewline
              
              Write-Host "`nExtracted ID: $computerId" -ForegroundColor Cyan
              Write-Host "ID saved to: $computerIdPath" -ForegroundColor Green
              Write-Host "Computer name saved to: $computerNamePath" -ForegroundColor Green
          } else {
              Write-Host "`nError: Could not find ID in response" -ForegroundColor Red
          }
          
      } catch {
          Write-Host "`nError making API request:" -ForegroundColor Red
          Write-Host $_.Exception.Message -ForegroundColor Red
      }
      
      Write-Host "`nRequest completed." -ForegroundColor Green
      

      Run the script with a command like this:
      powershell -ExecutionPolicy Bypass -File .\change_tcmd_id.ps1

      posted in General Discussion
      RussR
      Russ
    • RE: Opening in a particular Window size

      @JRSF-Home

      Think script worked pretty well for me. It does something similar to your use-case. It opens a Youtube video in a new Chrome window in a specific location on the screen, with specific dimensions, and presses the Like button.

      It uses a Chrome dev tools console command to find the like button and click it.

      "C:\Program Files\Google\Chrome\Application\chrome.exe" --new-window https://www.youtube.com/watch?v=1I9qC0Zo_PM
      timeout 4
      REM x y width height
      nircmd win setsize stitle "Allow friends to control Spotify" 200 100 800 1000
      nircmd win activate stitle "Allow friends to control Spotify"
      
      REM open dev tools
      nircmd sendkeypress F12
      timeout 3
      
      REM type document.querySelector('like-button-view-model button[aria-label*="like"]').click()
      nircmd sendkeypress d o c u m e n t 0xBE q u e r y Shift+s e l e c t o r Shift+0x39 0xDE l i k e 0xBD b u t t o n 0xBD v i e w 0xBD m o d e l spc b u t t o n 0xDB
      nircmd sendkeypress a r i a 0xBD l a b e l Shift+0x38 0xBB Shift+0xDE l i k e Shift+0xDE 0xDD 0xDE Shift+0x30 0xBE c l i c k Shift+0x39 Shift+0x30 
      
      REM press enter 
      nircmd sendkeypress 0x0D
      timeout 1
      
      REM close dev tools
      nircmd sendkeypress F12
      

      It's a little low-tech because it simulates a lot of key presses. There's probably a better way using puppeteer or selenium but this works if you don't care.

      posted in General Discussion
      RussR
      Russ
    • RE: Opening in a particular Window size

      @JRSF-Home, I see what you're trying to do and why.

      Here's a long command line that uses && to combine multiple commands into one:

      "C:\Program Files\Google\Chrome\Application\chrome.exe" --new-window https://triggercmd.com && timeout 5 && nircmd win activate stitle "TRIGGERcmd: Remotely run" && nircmd win setsize stitle "TRIGGERcmd: Remotely run" 800 100 500 500
      

      It opens triggercmd.com in a new Chrome window, waits 5 seconds, then resizes and positions the window.

      Personally, instead of that super long command line I would create a .bat file like this and have TRIGGERcmd run the .bat file.

      "C:\Program Files\Google\Chrome\Application\chrome.exe" --new-window https://triggercmd.com
      timeout 5
      nircmd win activate stitle "TRIGGERcmd: Remotely run"
      nircmd win setsize stitle "TRIGGERcmd: Remotely run" 800 100 500 500
      

      The nircmd win command parameters aren't super intuitive, but you can see how I had it find the Chrome window by the "TRIGGERcmd: Remotely run" text that the Chrome window's title starts with.
      https://nircmd.nirsoft.net/win.html

      I know you also want to click a button on the page. I'm looking into how to run a command like this in the Chrome console using the keyboard so you could have nircmd do that part too:

      document.querySelector('#yourButtonId').click();
      

      Please try the script or command though. It worked for me.

      This shows how I simulated clicking the Sign In button on the triggercmd.com login page using this method. Now I just need to figure out the series of keystrokes to automate it with nircmd.

      37c540f7-2496-4c5e-bb47-93830d5d8db6-image.png

      posted in General Discussion
      RussR
      Russ
    • RE: Opening in a particular Window size

      @Xander, got it. Sorry I thought you were suggesting he use Chrome to launch a shortcut. I get your original meaning now.

      Just so it's clear to OP, he could put start c:\path\to\shortcut.lnk in the Command field or include it in his script that TRIGGERcmd could run for him. Example:

      start C:\Users\russe\Desktop\Claude.lnk
      

      Then if he pre-configured the Run field of that .lnk shortcut, he could make it open Maximized.

      870d6398-667f-48d1-a855-aebe81f945c5-image.png

      As for OP's 3rd request - to click a button within that window, I'd ask ChatGPT. Just asked it "how to click a button on a web page with a script." here:
      https://chatgpt.com/share/68fe7888-36f8-8004-9c72-e7c6385f927b

      posted in General Discussion
      RussR
      Russ
    • RE: MacOS - A JavaScript error occurred in the main process

      @Simon thanks again for reporting the error. I'll see if I can reproduce it. It looks like it's in the Home Assistant integration. Sorry about the trouble.

      EDIT: I see from your screenshot that this.computer_name was null for some reason, so I added code to prevent a crash when that happens. I'll produce a new version soon.
      https://github.com/rvmey/TRIGGERcmd-Agent/commit/b54e988e7d251105bc6faa8c3fa6a5240644cbef

      EDIT2: Done - please upgrade to the current version (v1.0.52) to avoid that error in the future.

      posted in General Discussion
      RussR
      Russ
    • RE: Opening in a particular Window size

      @Xander, I thought by "shortcut" he was talking about a Windows shortcut like I screenshotted above, not a TRIGGERcmd shortcut. I think he wants to create a TRIGGERcmd command that makes sure the app (maybe Chrome?) launches maximized, starts with a particular zoom % (Chrome can be zoomed).

      Assuming it's Chrome, I have my script launch it maximized, then effectively type CTRL 0, then CTRL + once or twice to adjust the zoom.

      Here's a list of parameters Chrome takes, but none of them are the zoom level, so you'd have to simulate key presses with nircmd or an AutoIT script or similar.
      https://peter.sh/experiments/chromium-command-line-switches/

      posted in General Discussion
      RussR
      Russ
    • RE: Opening in a particular Window size

      @Xander, I'm finding that only some executables, like notepad.exe support starting them maximized, minimized or normal. If make a shortcut (.lnk file) that targets one of those executables, you can specify it in shortcut settings.

      a2d4e89a-cd64-4c15-af70-988ffaabd8ab-image.png

      posted in General Discussion
      RussR
      Russ
    • RE: How to run commands from Home Assistant

      @rdaraujo, yes, it runs the commands locally without the 1 command per minute limit even if you're not subscribed.

      posted in Home Assistant
      RussR
      Russ
    • RE: Opening in a particular Window size

      @JRSF-Home, I asked ChatGPT about #1 because I remembered it's possible to launch an app minimized or maximized with the start command:
      https://chatgpt.com/share/68fcce56-9d20-8004-9046-8a96869e1b9f

      I suggest looking at AutoHotKey or AutoIT to automate the clicks.

      posted in General Discussion
      RussR
      Russ
    • RE: MacOS - A JavaScript error occurred in the main process

      @Simon, it just happened to me too. I have a bug in the 1.0.50 mac version. Sorry about that. I'm working on it now. Thank you for reporting it.

      EDIT: @Simon, I just posted a new mac version of the agent (1.0.51) that fixes this bug.

      posted in General Discussion
      RussR
      Russ