TRIGGERcmd
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login
    1. Home
    2. Russ
    • Profile
    • Following 1
    • Followers 42
    • Topics 217
    • Posts 2,601
    • Best 164
    • 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.

    161
    Reputation
    3.8k
    Profile views
    2.6k
    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.
      • 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.
      • 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: 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
    • RE: How can I get feedback that the command was executed remotely?

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

      posted in Mac
      RussR
      Russ

    Latest posts made by Russ

    • RE: Triggers appearing in view runs but not actually triggering.

      Thanks @Leron-Tolmachev .

      posted in Mac
      RussR
      Russ
    • RE: Triggers appearing in view runs but not actually triggering.

      @Leron-Tolmachev, I don't know why the direct from HA path isn't working. I'll see if I can reproduce the issue, but in the meantime I suggest disabling it so you can trigger commands from HA via the Internet. It seems like the connection from the agent to HA isn't working. Maybe I need to add logging to determine that.

      posted in Mac
      RussR
      Russ
    • RE: Triggers appearing in view runs but not actually triggering.

      @Leron-Tolmachev, I'm not sure why it's working via the Internet but not direct from HA.

      Can you try triggering a different command? Like the built-in calculator command?

      Also, if your command has parameters enabled, please try disabling parameters. I'm worried the "on" or "off" parameter is getting tacked on to the end of your command and messing up the command, although I'm not confident in that because if that was the problem, it should happen either way - direct from HA, or via the Internet (via the triggercmd.com cloud system).

      FYI, that "Ignoring duplicate trigger" is saying it got a trigger via triggercmd.com but ignored it because it originally came from HA, and you have the direct HA integration enabled.

      Can you share your command? Or ideally a screenshot from the GUI Editor? I'd like to see if I can reproduce it on my Mac.

      posted in Mac
      RussR
      Russ
    • RE: 1.0.47 not installing, no log

      @Xander, awesome. I'm glad that worked.

      posted in General Discussion
      RussR
      Russ
    • RE: TRIGGERcmd not starting at boot

      @trinib, I can't reproduce the problem with version 1.0.47. For me, within 10 seconds, it always transitions from "Waiting for internet" to the full menu after I re-enable wifi. It get the same result whether I rebooted without wifi or just closed and re-opened the agent without wifi.

      I don't use the background service (aka the TRIGGERcmdAgent windows service). I'll enable that and do more testing, but that shouldn't effect the tray icon because it's only for the foreground agent.

      FYI, the background service is not necessary unless you want to be able to run command while you're logged out. Most people don't need it.

      posted in General Discussion
      RussR
      Russ
    • RE: Triggers appearing in view runs but not actually triggering.

      @Leron-Tolmachev,
      I just realized you're not saying the command doesn't run. So please confirm: the command runs when you trigger it from HA, but it doesn't log "Command ran" in the runs list, correct?

      If so, that's a known issue with sending triggers direct from HA to the agent. The agent doesn't report that the command ran if the trigger came from HA. There wasn't an efficient way to report it because the ID of the command isn't available in this direct local LAN offline context. If you need to see Command ran logged, you should disable the offline HA integration in the agent config.

      HA does still send the trigger to triggercmd.com though (which is logged in the Runs list) so cloud integrations (Zapier, Alexa routines, IFTTT, Make, etc) will still trigger if HA can access triggercmd.com when the command is triggered.

      posted in Mac
      RussR
      Russ
    • RE: Triggers appearing in view runs but not actually triggering.

      @Leron-Tolmachev, if you have parameters enabled, please try turning that off because that might explain why it works when you click the green Trigger button on the triggercmd.com website and it doesn't when you run the command via Home Assistant locally.

      631a206f-abb9-49c6-8cb8-1990e459c8a6-image.png

      If parameters are enabled, Home Assistant will send on or off as the parameter, so " on" or " off" will be appended to the end of your command, which could be producing an invalid command.

      Alternatively you could fill in the Off Command field, and that command will run when you toggle the HA switch off.

      posted in Mac
      RussR
      Russ
    • RE: Triggers appearing in view runs but not actually triggering.

      @Leron-Tolmachev, awesome. Thank you for confirming that works.

      For the offline config, did you generate a long-lived access token from this page?
      http://homeassistant.local:8123/profile/security

      And you pasted that into the that Home Assistant Token field in your Home Assistant Offline Configuration page?

      Also, you can check your ~/.TRIGGERcmdData/debug.log file for clues.

      posted in Mac
      RussR
      Russ
    • RE: Triggers appearing in view runs but not actually triggering.

      @Leron-Tolmachev, good, thank you for confirming that's working.

      If you've enabled the Home Assistant Offline Configuration, please try disabling it, then restart the agent. That should allow the agent to run your commands via the Internet (HA -> triggercmd.com -> agent).

      d2be9cb0-bd1b-4ae8-977b-ff399a7387e9-image.png

      I'm thinking maybe the agent is ignoring the commands from the triggercmd.com server because the offline configuration is enabled but not working yet. It does that to avoid running your command twice - once directly from HA, and again from triggercmd.com.

      If you want to get HA offline to work, please confirm your Home Assistant server is accessible at http://homeassistant.local:8123 from your laptop.

      posted in Mac
      RussR
      Russ
    • RE: Add two commands in a single trigger

      @Carlos-Junior, you could create a script with two commands in it like this:

      taskkill /f /fi "USERNAME eq %USERNAME%" /fi "WINDOWTITLE ne"
      shutdown /s /f /t 0
      

      Then your command would run that script with a command like this:

      c:\scripts\close_all_shutdown.bat
      

      If you don't want to create a script, you can generally run multiple commands with one command line by separating the commands with && like this:

      taskkill /f /fi "USERNAME eq %USERNAME%" /fi "WINDOWTITLE ne" && shutdown /s /f /t 0
      
      posted in Windows
      RussR
      Russ