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!