• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
TRIGGERcmd
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
  1. Home
  2. Strahan
  • Profile
  • Following 0
  • Followers 0
  • Topics 6
  • Posts 13
  • Best 0
  • Controversial 0
  • Groups 0

Strahan

@Strahan

0
Reputation
538
Profile views
13
Posts
0
Followers
0
Following
Joined Nov 10, 2017, 6:34 AM Last Online 8 days ago

Strahan Unfollow Follow

Latest posts made by Strahan

  • Having issues with TC launching a batch

    Hi!

    I'm having an annoying issue. I made a system I call HomeCenter which lets me manage smart home / home automation stuff. One of the functions is tracking laundry cycles, so when I start a load I press a button and a DB record gets entered then all the HomeCenter clients poll it every few minutes and if the time logged + duration for the cycle selected has passed, it plays an alarm. It's very loud and obnoxious so I don't miss it, lol. I wanted to be able to tell it to shut up though without using one of the HomeCenter PCs or tablets, because this morning I laid back down to snooze a bit and the alarm went off. It was a drying load, so it didn't matter if I went and handled it immediately so I just wanted HC to shut the hell up so I could sleep but as I didn't have my phone I had to get up and go to the kitchen to close out the alarm.

    So I decided I need to write a batch file that will delete the record from the DB via an Alexa voice command. So I fired up my TriggerCMD GUI editor and added a new record:

    Trigger: laundrydone
    Command: c:\misc\laundrydone.bat
    Off command: N/A
    Ground: foreground
    Voice: laundrydone
    Voice Reply: N/A
    Allow Parameters: false

    I then made the batch:

    @echo off
    sql homecenter "delete from activeitems where action = 8192" /u service.triggercmd.homecenter /p (pwd) /h lioth.mydomain.com /l laundryreset.log
    

    I opened the HomeCenter page and clicked Laundry, Started Wash Cycle - Clothes. I then fired up SQLyog and checked:

    SELECT * FROM activeitems;
    
    ID: 09d10a5d-ddb9-4eae-9e3e-17f6e6416cad
    action: 8192
    dtstarted: 2025-08-10 10:37:29
    flags: 0
    startedby: fe5303f8-0716-42cb-ade3-0a6023be87d9
    

    Cool. So I said Alexa, turn on laundrydone. She said OK. I do SELECT again, and I still see my row. So I open command and go to c:\misc and run laundryreset.bat. Do another SELECT and now there are no results. So the batch file works. Next I clicked start load again to obtain data then went to the TriggerCMD GUI editor, found laundrydone and clicked the play button. SELECT'd and I still have data. I do a very similar thing for my health tracking database. I can say "Alexa, turn on diet Pepsi" and it will use loghealth.bat to add that to my daily food log (I'm diabetic so I watch what I eat carefully). So I compared the two since TC has no issue with loghealth:

    C:\Misc>cacls loghealth.bat
    C:\Misc\loghealth.bat NT AUTHORITY\SYSTEM:(ID)F
                          BUILTIN\Administrators:(ID)F
                          BUILTIN\Users:(ID)R
                          MYDOMAIN\strahan:(ID)F
    
    
    C:\Misc>cacls laundryreset.bat
    C:\Misc\laundryreset.bat NT AUTHORITY\SYSTEM:(ID)F
                             BUILTIN\Administrators:(ID)F
                             BUILTIN\Users:(ID)R
                             MYDOMAIN\strahan:(ID)F
    

    Well, that looks fine. So I tried modifying the batch file:

    @echo off
    echo WTF is wrong with you>log.txt
    sql homecenter "delete from activeitems where action = 8192" /u service.triggercmd.homecenter /p (pwd) /h lioth.mydomain.com /l laundryreset.log
    

    Hit the play button in TC GUI, log.txt never appeared. What should I check next?

    posted in General Discussion
    S
    Strahan
    8 days ago
  • Any idea why this batch is failing to run?

    Hi. Ever since IFTTT and Alexa stopped working, I started making a bunch of TriggerCMD triggers to fill in the void. I made a website to log health data (calories eaten, exercise done, etc). So I made a batch file:

    @echo off
    echo %1 %2 %3 %4 %5 >>log.txt
    if "%1"=="med" goto :medication
    if "%1"=="bedtime" goto :bed
    c:\misc\wget.exe "https://mysite.com/index.php?m=api&sm=food&food=%1"
    goto :eof
    
    :medication
    if "%2"=="fi8" c:\misc\wget.exe "https://mysite.com/index.php?m=api&sm=insulin&type=fast&amt=8"&goto :eof
    if "%2"=="fi10" c:\misc\wget.exe "https://mysite.com/index.php?m=api&sm=insulin&type=fast&amt=10"&goto :eof
    if "%2"=="fi12" c:\misc\wget.exe "https://mysite.com/index.php?m=api&sm=insulin&type=fast&amt=12"&goto :eof
    if "%2"=="fi14" c:\misc\wget.exe "https://mysite.com/index.php?m=api&sm=insulin&type=fast&amt=14"&goto :eof
    if "%2"=="fi18" c:\misc\wget.exe "https://mysite.com/index.php?m=api&sm=insulin&type=fast&amt=18"&goto :eof
    if "%2"=="li50" c:\misc\wget.exe "https://mysite.com/index.php?m=api&sm=insulin&type=long&amt=50"&goto :eof
    if "%2"=="night" c:\misc\wget.exe "https://mysite.com/index.php?m=api&sm=nightmeds"&goto :eof
    
    c:\misc\wget.exe "https://mysite.com/index.php?m=api&sm=meds&mid=%2&units=%3"
    goto :eof
    
    :bed
    echo %2 >>log.txt
    

    I have a bunch of commands. Here is a sample:

    Trigger: diet pepsi
    Command: c:\misc\loghealth.bat dpepsi12
    Off command: (greyed out)
    Ground: foreground
    Voice: diet pepsi
    Voice reply: (empty)
    Allow parameters: false
    

    This works great. I say "Alexa, turn on diet pepsi" then check my health site and it has logged a can of Diet Pepsi. I also track my bedtime/getting up times so if I feel drug out I can look at my health site and be like well yea, I slept 5 hours 12 minutes no doubt heh. I wanted to leverage the on/off ability, figuring I'd say "Alexa turn on bedtime" to mark myself asleep and turn off to mark awake:

    Trigger: bedtime
    Command: c:\misc\loghealth.bat bedtime on
    Off command: c:\misc\loghealth.bat bedtime off
    Ground: foreground
    Voice: bedtime
    Voice reply: (empty)
    Allow parameters: true
    

    However, neither on nor off works. I added the echo to log.txt lines and I never even get a log.txt, so it's not firing the batch at all.

    Any idea why? Thanks!

    posted in Windows
    S
    Strahan
    Nov 27, 2023, 3:47 PM
  • How do I subscribe?

    Hi. I used TriggerCMD a couple years ago but my need for the functionality was abated so I stopped using it. I now have need again, so I installed the agent. Plugged in my token it said I need to resubscribe. So I went to the site's control panel and I can't find anywhere that one does this.

    Can you point me in the right direction? Thanks!

    posted in General Discussion
    S
    Strahan
    Jan 10, 2021, 6:05 PM
  • RE: Backup settings

    Thanks. Only outbound? That's curious. So when I use my IFTTT webhook trigger with Alexa to turn my bedroom fan on, it doesn't send a packet to my agent from your system to let it know to activate?

    posted in General Discussion
    S
    Strahan
    May 22, 2019, 3:06 AM
  • RE: Backup settings

    Thanks!

    PS: The reason I have to rebuild the machine is it was compromised. I implemented IP filters on my firewall so only my cellphone and family systems can access my server. The communications from your service; is there an IP range I can use to whitelist it?

    posted in General Discussion
    S
    Strahan
    May 19, 2019, 11:47 PM
  • Backup settings

    Hi. I need to reformat the machine I have TRIGGERcmd installed in. Where does it save its settings so I can back it up? I'd rather not have to recreate all the triggers. Thanks.

    posted in General Discussion
    S
    Strahan
    May 19, 2019, 1:59 PM
  • RE: Can't get things to trigger

    This is a bit late, lol, but thanks. Got that all working now so I can be in bed and say "alexa, trigger windy 15" and have my fan turn on for fifteen minutes only. So nice 🙂 Used to be I could turn it on with Alexa but it would run until I turn it off, so I'd fall asleep and wake up frozen hehe.

    Thanks!

    posted in General Discussion
    S
    Strahan
    Nov 25, 2018, 5:53 PM
  • Can't get things to trigger

    Hi. I want to be able to lie in bed and say "alexa, trigger fan 15" and have it run a batch that will turn the fan in the bedroom off in fifteen minutes. But just to start simple, I made a batch file that just plays a WAV file so I can test the connectivity. Installed TriggerCMD agent on my pc named "Zaranth". As that's a mouthful and i was afraid Alexa may interpret the weird word oddly, I set voice trigger for that PC to game as it's my gaming rig. I created a command "noisy" that runs \misc\triggercmd\noise.bat. If I hit the green "trigger" button for that command when viewing the list of triggers, it works perfectly.

    So I said "alexa, ask trigger c m d to run noisy on game" (figured I'd make sure it worked native before throwing IFTTT into the mix). No dice. It won't see it, said it cannot find that command. I can't figure out what's wrong. Any idea?

    https://www.youtube.com/watch?v=rgMJyKXx1zQ

    posted in General Discussion
    S
    Strahan
    Nov 1, 2018, 5:44 AM
  • RE: Voice words / parameters

    Thanks. The generic usage method looks fine. I wouldn't think that a movie or whatever specific parameter would really be necessary; the people creating their commands will know what kind of input to expect and will handle it accordingly.

    I guess for now I'll just make "codewords" that do specific functions, heh. That'll work for now. Thanks again!

    posted in General Discussion
    S
    Strahan
    Nov 28, 2017, 12:59 AM
  • Voice words / parameters

    Hi! I just bought an Echo tonight, and the deciding factor was that I could control my PC when I Googled and saw your program. I've been playing with it, it's cool. However, I have one snag. I wanted to be able to launch videos from it, so I created a trigger "Die Hard", command was the path and filename of the video, voice was "die hard". I pronounced it as clearly as I could but it keeps saying "cannot find command die". Does it not support multiple word voice commands? I changed it to "die" and it worked.

    Also I was trying to find documentation on parameters and failing. Can you direct me? I'm wondering if I can create a command that is generic then pass parameters that I assume I say after the trigger word to launch the appropriate title. I just can't find any docs on how parameters work.

    I setup a trigger "video", with command "p:\utils\scripts\triggercmd.php video", voice "video" allow parameters true. My PHP script looks for parameter "diehard". I said "alexa, ask trigger c m d to run video diehard" and it said "could not find a command with voice word video hard on (pcname)". Am I misinterpreting how to use parameters?

    posted in General Discussion
    S
    Strahan
    Nov 10, 2017, 4:04 PM