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. :rage:

    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.


    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.

Log in to reply