SmartThings integration - flip a virtual switch to run a command


  • administrators

    Samsung still hasn't approved my integration, but in the meantime you can install it manually.

    This article tells you have to make virtual SmartThings switches that trigger your commands.

    Here's a video that quickly shows this setup process.
    Also this video shows the new feature that sends an on or off parameter from the virtual switch to your command so you can open or close programs like Kodi.

    The TRIGGERcmd SmartThings integration uses two files that you paste into your SmartThings developer console. You log into the developer console with the same email address and password you used to setup your SmartThings hub.

    These are the steps:
    Log into https://graph.api.smartthings.com with your SmartThings account.

    Click "My Locations," and select your location. (screenshot)

    Login again if it prompts you.

    Click "My SmartApps," then "+ New SmartApp," then "From Code", then paste in this code and click Create.

    Click "Publish," then "For Me" to publish it. (screenshot)

    Click "My Device Handlers," then "+ Create New Device Hander," then "From Code", then paste in this code and click Create.

    Click "Publish," then "For Me" to publish it. (screenshot)

    Open the SmartThings app on your phone.

    Under Automation, select the SmartApps tab.

    Select "+ Add a SmartApp" at the bottom of the list. (screenshot)

    Scroll to the bottom of the list and select "My Apps". (screenshot)

    Select TRIGGERcmd. (screenshot)

    If you log into TRIGGERcmd with an email address and password (as opposed to Facebook, Twitter, or Google account), then you can skip this step. Otherwise, log into your TRIGGERcmd account and click "Welcome [your name]" then Profile, and type in a password. You'll need that for this next step.

    Enter your TRIGGERcmd email address and password, and tap Next. (screenshot)

    Tap "Select Commands," and check the checkboxes next to each command you want to add, then tap Done. (screenshot)

    Now you should see the commands you selected in your "Things" list under "My Home". (screenshot)

    Tap the "OFF" buttons to trigger those commands. The button you tap will turn green and change to ON for a second, and the command will run.

    EDIT 10/11/17: I updated the SmartThings code to send on or off as a parameter when you toggle the virtual switch on and off. If the command doesn't allow parameters, then the command just runs when you toggle the switch off and on.

    Now you can include TRIGGERcmd commands in your Routines and SmartApps as if they're switches! :medal:

    :no_entry: NOTE: If you delete a command from your TRIGGERcmd account before removing it via the TRIGGERcmd Smartthings device handler (under Smartapps), you'll get errors trying to update your list of TRIGGERcmd virtual switches until you delete the virtual switch associated with that command from the Things list.



  • CAN I TELL YOU HOW AWESOME YOU ARE!!! WE HAVE TO GET SOME YOUTUBERS TO KNOW ABOUT THIS!! THIS IS THE MISSING LINK!!


  • administrators

    @Nate-Hales, thank you so much. I thought it was awesome too, so it's good to have someone confirm it.

    I just took a walk with my wife and when we got home I said to Google Assistant my phone, "open sesame" to open the garage. Now that's a geek's dream right there!

    I'd appreciate any help you can give to spread the word about TRIGGERcmd.

    You seem to be a SmartThings enthusiast like me. Have you tried CoRE yet? I've been meaning to try that with some TRIGGERcmd virtual SmartThings switches, but TRIGGERcmd development has kept me from some of these experiments.



  • I am going to steal "open sesame' :) Never heard of Core but Im on it!! I put outdoor speakers in the planters by the front door that will (one day soon) turn on when the bell is rang and announce "Welcome to the Hales automated home, this interaction is being recorded for quality assurance, Please hold while I notify the family of your arrival.. If you are a solicitor please move on to the next house as no soliciting is allowed or wait here while I notify the police. Thank you for your cooperation, We will be with you shortly" Haha also I have monoprice rock speakers throughout the yard that will turn on when motion is activated and play a Wav. file of a dog growling and a police radio, saying random things in the distance. I have played it outside and friends in my yard start thinking cops are on the other side of the fence. haahah .


  • administrators

    Very cool @Nate-Hales, you should do a video when you get it all going. I'd like to see that.



  • i just asked this question under another regarding alexa, but seems appropriate here also.

    For the switches, this seems perfect for launching programs on my htpc. for example Kodi. Now the cmd line to launch kodi is very different than the command to kill it, (sorry im pretty basic at cmd line work). When i create a virtual switch, can i pass the correct different kill line to turn the switch (program) "off"?


  • administrators



  • Hi

    I ran into a bit of trouble installing/configuring the smart app. Following the instructions, the smart app and device handler installed and both are listed as published. However TRIGGERcmd smart app on the mobile side, returns "Error-bad state. Unable to complete page configuration.", after submitting the email address (username) and password created on TRIGGERcmd's website.

    Any ideas on the cause?

    Thanks


  • administrators

    @ou, I think your username or password is bad. I just tried setting mine wrong and I got the same error.

    I wonder if you're using a Facebook or Google account to log into TRIGGERcmd, but you haven't set your password in your profile page yet.

    SmartThings talks directly to TRIGGERcmd, and TRIGGERcmd doesn't know your Google password, so if you use a Google account you have to give TRIGGERcmd a password for SmartThings to login with.


Log in to reply
 

Looks like your connection to TRIGGERcmd Forum was lost, please wait while we try to reconnect.