<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[SmartThings integration - flip a virtual switch to run a command]]></title><description><![CDATA[<p dir="auto">The article below describes the old TRIGGERcmd SmartThings integration.  As of today, 1/13/2023, <strong>please refer to <a href="https://www.triggercmd.com/forum/topic/2494/new-smartthings-integration-2023">this article</a> instead.</strong></p>
<p dir="auto">Samsung still hasn't approved my integration, but in the meantime you can install it manually.</p>
<p dir="auto">This article tells you how to make virtual SmartThings switches that trigger your commands on your computer.</p>
<p dir="auto">Here's a video that quickly <a href="https://www.youtube.com/watch?v=dq-loAiKAgo" rel="nofollow ugc">shows this setup process</a>.<br />
Also <a href="https://youtu.be/qYHbT05UMQc" rel="nofollow ugc">this video</a> shows the new feature that sends an <strong>on</strong> or <strong>off</strong> parameter from the virtual switch to your command so you can open or close programs like Kodi.</p>
<p dir="auto">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.</p>
<p dir="auto">These are the steps:<br />
Log into <a href="https://account.smartthings.com" rel="nofollow ugc">https://account.smartthings.com</a> with your SmartThings account.</p>
<p dir="auto">Click "My Locations," and select your location.  (<a href="https://s3.amazonaws.com/triggercmdagents/SmartThingsCode/MyLocations.JPG" rel="nofollow ugc">screenshot</a>)</p>
<p dir="auto">Login again if it prompts you.</p>
<p dir="auto">Click "My SmartApps," then "+ New SmartApp," then "From Code", then paste in <a href="https://raw.githubusercontent.com/rvmey/SmartThingsPublic/MSA-2199-2/smartapps/vandermeyconsulting/triggercmd.src/triggercmd.groovy" rel="nofollow ugc">this code</a> and click Create.</p>
<p dir="auto">Click "Publish," then "For Me" to publish it.  (<a href="https://s3.amazonaws.com/triggercmdagents/SmartThingsCode/SmartApp.JPG" rel="nofollow ugc">screenshot</a>)</p>
<p dir="auto">Click "My Device Handlers," then "+ Create New Device Hander," then "From Code", then paste in <a href="https://raw.githubusercontent.com/rvmey/SmartThingsPublic/MSA-2199-2/devicetypes/vandermeyconsulting/triggercmd-switch.src/triggercmd-switch.groovy" rel="nofollow ugc">this code</a> and click Create.</p>
<p dir="auto">Click "Publish," then "For Me" to publish it.  (<a href="https://s3.amazonaws.com/triggercmdagents/Pics/DeviceHandler.JPG" rel="nofollow ugc">screenshot</a>)</p>
<p dir="auto">Open the SmartThings app on your phone.</p>
<p dir="auto">Under Automation, select the SmartApps tab.</p>
<p dir="auto">Select "+ Add a SmartApp" at the bottom of the list.  (<a href="https://s3.amazonaws.com/triggercmdagents/SmartThingsCode/AddASmartApp.png" rel="nofollow ugc">screenshot</a>)</p>
<p dir="auto">Scroll to the bottom of the list and select "My Apps". (<a href="https://s3.amazonaws.com/triggercmdagents/SmartThingsCode/SelectMyApps.png" rel="nofollow ugc">screenshot</a>)</p>
<p dir="auto">Select TRIGGERcmd. (<a href="https://s3.amazonaws.com/triggercmdagents/SmartThingsCode/SelectTRIGGERcmd.png" rel="nofollow ugc">screenshot</a>)</p>
<p dir="auto">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.</p>
<p dir="auto">Enter your TRIGGERcmd email address and password, and tap Next.  (<a href="https://s3.amazonaws.com/triggercmdagents/SmartThingsCode/EnterCreds.png" rel="nofollow ugc">screenshot</a>)</p>
<p dir="auto">Tap "Select Commands," and check the checkboxes next to each command you want to add, then tap Done.  (<a href="https://s3.amazonaws.com/triggercmdagents/SmartThingsCode/SelectCommands.png" rel="nofollow ugc">screenshot</a>)</p>
<p dir="auto">Now you should see the commands you selected in your "Things" list under "My Home".  (<a href="https://s3.amazonaws.com/triggercmdagents/SmartThingsCode/VirtualDevices.png" rel="nofollow ugc">screenshot</a>)</p>
<p dir="auto"><s>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.</s></p>
<p dir="auto">EDIT 10/11/17:  I <a href="https://www.triggercmd.com/forum/topic/88/alexa-invocation-and-smartthings-switch-questions/5">updated</a> the SmartThings code to send <strong>on</strong> or <strong>off</strong> 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.</p>
<p dir="auto">Now you can include TRIGGERcmd commands in your Routines and SmartApps as if they're switches!  <img src="https://www.triggercmd.com/forum/assets/plugins/nodebb-plugin-emoji/emoji/android/1f396.png?v=6sa9akdcpc2" class="not-responsive emoji emoji-android emoji--medal" style="height:23px;width:auto;vertical-align:middle" title=":medal:" alt="🎖" /></p>
<p dir="auto"><img src="https://www.triggercmd.com/forum/assets/plugins/nodebb-plugin-emoji/emoji/android/26d4.png?v=6sa9akdcpc2" class="not-responsive emoji emoji-android emoji--no_entry" style="height:23px;width:auto;vertical-align:middle" title=":no_entry:" alt="⛔" /> NOTE: If you delete a command from your TRIGGERcmd account before unselecting it via the TRIGGERcmd SmartApp, 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.  Bubba ( <a class="mention plugin-mentions-user plugin-mentions-a" href="https://www.triggercmd.com/forum/uid/33">@Nate-Hales</a> on this forum) did a detailed video that includes how to delete them here:  <a href="https://youtu.be/R9mZK2U-zkQ?t=864" rel="nofollow ugc">https://youtu.be/R9mZK2U-zkQ?t=864</a>  Just tap the switch, then the gear in the upper-right, then the red <strong>Remove</strong> button.</p>
<p dir="auto">EDIT 10/23/17:  I added logic to the SmartThings code to delete your ST switch automatically if you delete the corresponding TRIGGERcmd command, but the code can't delete the ST switches if they're used by other SmartApps, so you'll still have to delete them manually in some cases.</p>
<p dir="auto">EDIT 5/25/19:  Now the SmartThings switches are tied to the commands via the computer name / command name combo, so you can move your commands to a new computer, name the computer the same as the old computer (in the web gui), and you won't have to re-create your SmartThings switches.  You also won't have to recreate ST switches when you change command properties, as long as the command's name field remains the same.  You can tell if you're using the new code if you see "<strong>TRIGGERcmd V2</strong>" at the top of the SmartApp code.</p>
<p dir="auto">EDIT 7/31/2021:  I updated the <a href="https://github.com/rvmey/SmartThingsPublic/blob/MSA-2199-2/smartapps/vandermeyconsulting/triggercmd.src/triggercmd.groovy" rel="nofollow ugc">SmartApp code to V3</a> today.  I found a bug in the cleanup schedule that was bogging down the server once per hour.  Please update your <a href="https://github.com/rvmey/SmartThingsPublic/blob/MSA-2199-2/smartapps/vandermeyconsulting/triggercmd.src/triggercmd.groovy" rel="nofollow ugc">SmartApp code</a> if doesn't already have <strong>TRIGGERcmd V3</strong> at the top.</p>
]]></description><link>https://www.triggercmd.com/forum/topic/29/smartthings-integration-flip-a-virtual-switch-to-run-a-command</link><generator>RSS for Node</generator><lastBuildDate>Wed, 11 Mar 2026 01:18:05 GMT</lastBuildDate><atom:link href="https://www.triggercmd.com/forum/topic/29.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 21 May 2017 01:48:40 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to SmartThings integration - flip a virtual switch to run a command on Sun, 29 Jan 2023 06:11:21 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://www.triggercmd.com/forum/uid/1">@Russ</a> thanks for coming up with a solution so quickly.  I followed your instructions and I am up and running again! <img src="https://www.triggercmd.com/forum/assets/plugins/nodebb-plugin-emoji/emoji/android/1f44d.png?v=6sa9akdcpc2" class="not-responsive emoji emoji-android emoji--+1" style="height:23px;width:auto;vertical-align:middle" title=":+1:" alt="👍" /></p>
]]></description><link>https://www.triggercmd.com/forum/post/6684</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/6684</guid><dc:creator><![CDATA[JT]]></dc:creator><pubDate>Sun, 29 Jan 2023 06:11:21 GMT</pubDate></item><item><title><![CDATA[Reply to SmartThings integration - flip a virtual switch to run a command on Wed, 18 Jan 2023 02:42:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://www.triggercmd.com/forum/uid/4019">@George-Hatzisymeon</a>, awesome.  Thanks for testing it.</p>
]]></description><link>https://www.triggercmd.com/forum/post/6636</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/6636</guid><dc:creator><![CDATA[Russ]]></dc:creator><pubDate>Wed, 18 Jan 2023 02:42:26 GMT</pubDate></item><item><title><![CDATA[Reply to SmartThings integration - flip a virtual switch to run a command on Tue, 17 Jan 2023 23:41:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://www.triggercmd.com/forum/uid/1">@Russ</a> It works fine what I had to do was to add text to the voice node in the XML configuration file of triggercmd and resync with the app. In previous integration it would show all commands in the smart things app now it picks only those with a voice tag.</p>
<p dir="auto">That is fine! Thanks everything now works as before…</p>
]]></description><link>https://www.triggercmd.com/forum/post/6635</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/6635</guid><dc:creator><![CDATA[George Hatzisymeon]]></dc:creator><pubDate>Tue, 17 Jan 2023 23:41:47 GMT</pubDate></item><item><title><![CDATA[Reply to SmartThings integration - flip a virtual switch to run a command on Mon, 16 Jan 2023 13:28:14 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://www.triggercmd.com/forum/uid/4019">@George-Hatzisymeon</a> thanks for trying it and letting me know it's not working.  Will you please send me a screenshot of the Smart things values on your profile page and on the Smart things cloud integration page?  I might be able to see the problem.</p>
<p dir="auto">Or it's possible it's working but you only have the voice field filled in for your "edit" command.  That's what determines which triggers show up as devices now.  It uses the same logic as the TRIGGERcmd SmartHome Alexa skill and Google Action.  If that's the problem, just fill in the voice field on each command you want to show up as a device in SmartThings.</p>
<p dir="auto">If you send screenshots here that have your secrets, just change them after.  Make sure you re-sync up the profile page info with the info in your SmartThings account too of course.</p>
<p dir="auto">You could also direct message me your screenshots.</p>
<p dir="auto">Thank you for your patience.  I'm sure we can make this work.</p>
]]></description><link>https://www.triggercmd.com/forum/post/6633</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/6633</guid><dc:creator><![CDATA[Russ]]></dc:creator><pubDate>Mon, 16 Jan 2023 13:28:14 GMT</pubDate></item><item><title><![CDATA[Reply to SmartThings integration - flip a virtual switch to run a command on Sun, 15 Jan 2023 19:31:56 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://www.triggercmd.com/forum/uid/1">@Russ</a> I have successfully followed the instructions for the new integrations but at the final step I was not able to see my triggers as virtual switches. Instead I could only see one switch with the name "edit" and nothing else.</p>
<p dir="auto">In the previous integration I was able to select the triggers that I wanted to be mapped as virtual switches, what is the situation now? why dont I see my triggers in the smart things integration?</p>
<p dir="auto">Thanks!</p>
]]></description><link>https://www.triggercmd.com/forum/post/6626</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/6626</guid><dc:creator><![CDATA[George Hatzisymeon]]></dc:creator><pubDate>Sun, 15 Jan 2023 19:31:56 GMT</pubDate></item><item><title><![CDATA[Reply to SmartThings integration - flip a virtual switch to run a command on Sat, 14 Jan 2023 01:20:30 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://www.triggercmd.com/forum/uid/4019">@George-Hatzisymeon</a>, I was worried this day would come.  I actually created an integration while ago in anticipation of the Groovy app cutoff.  It works great but Samsung won't won't approve it because I don't sell any hardware.</p>
<p dir="auto">I considered selling a hardware device, but when I asked them about it, they said my users would only be able to use SmartThings to work with that hardware, so that wouldn't help.</p>
<p dir="auto">I'm working on a new method that won't require SmartThings approval.</p>
<p dir="auto">I'll post here again when I have it working.  I'm hoping by this weekend.</p>
<p dir="auto">EDIT:  I just finished the new <a href="https://www.triggercmd.com/forum/topic/2494/new-smartthings-integration-2023">SmartThings integration</a>.  Please try it and let me know if it works for you.</p>
]]></description><link>https://www.triggercmd.com/forum/post/6613</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/6613</guid><dc:creator><![CDATA[Russ]]></dc:creator><pubDate>Sat, 14 Jan 2023 01:20:30 GMT</pubDate></item><item><title><![CDATA[Reply to SmartThings integration - flip a virtual switch to run a command on Thu, 12 Jan 2023 19:45:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://www.triggercmd.com/forum/uid/1">@Russ</a> It turns out Smartthings has discontinued Groovy apps accrding to this post <a href="https://community.smartthings.com/t/are-all-smartapps-going-away/247375" rel="nofollow ugc">here</a>. I was using TriggerCMD in conjuction with smart things are you willing to support the new integration mechanisms? Do you have a timeline for this?</p>
]]></description><link>https://www.triggercmd.com/forum/post/6612</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/6612</guid><dc:creator><![CDATA[George Hatzisymeon]]></dc:creator><pubDate>Thu, 12 Jan 2023 19:45:47 GMT</pubDate></item><item><title><![CDATA[Reply to SmartThings integration - flip a virtual switch to run a command on Thu, 12 Jan 2023 17:49:53 GMT]]></title><description><![CDATA[<p dir="auto">It is a couple of days now that the Smart Things automation has stopped to function, I have visited my account in the smartthings site and the UI has completely changed, after I open the triggerCMD app I am getting an error saying:</p>
<p dir="auto">ERROR: Something went wrong. Please try to install the SmartApp again.</p>
<p dir="auto">I think something changed in the Samsung site and triggerCMD looks like is uncompatible, is there any way to fix this? I have tried to reinstall the app but there is no way to install a new app using their new UI.</p>
<p dir="auto">Do you have any idea what is going on?</p>
<p dir="auto">Thanks!</p>
]]></description><link>https://www.triggercmd.com/forum/post/6611</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/6611</guid><dc:creator><![CDATA[George Hatzisymeon]]></dc:creator><pubDate>Thu, 12 Jan 2023 17:49:53 GMT</pubDate></item><item><title><![CDATA[Reply to SmartThings integration - flip a virtual switch to run a command on Thu, 25 Feb 2021 14:11:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://www.triggercmd.com/forum/uid/1">@Russ</a> said in <a href="/forum/post/2105">SmartThings integration - flip a virtual switch to run a command</a>:</p>
<blockquote>
<p dir="auto">Handler</p>
</blockquote>
<p dir="auto">It works like a charm!<br />
I have just follow the instructions, and had it immediately working. Still good at 2021</p>
]]></description><link>https://www.triggercmd.com/forum/post/3610</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/3610</guid><dc:creator><![CDATA[ipaivaip]]></dc:creator><pubDate>Thu, 25 Feb 2021 14:11:20 GMT</pubDate></item><item><title><![CDATA[Reply to SmartThings integration - flip a virtual switch to run a command on Thu, 03 Sep 2020 21:12:50 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://www.triggercmd.com/forum/uid/4019">@George-Hatzisymeon</a>, you mentioned you're using an account from Google.  If you do that, then before you can log SmartThings into your TRIGGERcmd account you also need to set your password in your profile in your TRIGGERcmd account.  To get to your profile, click your name in the upper-right.</p>
<p dir="auto">You installed the device handler and SmartApp, correct?</p>
<p dir="auto">Here's a video showing the process:  <a href="https://www.youtube.com/watch?v=dq-loAiKAgo" rel="nofollow ugc">https://www.youtube.com/watch?v=dq-loAiKAgo</a></p>
<p dir="auto">If you still get that error, please post a screenshot.  It might help me understand what's happening.</p>
]]></description><link>https://www.triggercmd.com/forum/post/2787</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/2787</guid><dc:creator><![CDATA[Russ]]></dc:creator><pubDate>Thu, 03 Sep 2020 21:12:50 GMT</pubDate></item><item><title><![CDATA[Reply to SmartThings integration - flip a virtual switch to run a command on Thu, 03 Sep 2020 17:24:47 GMT]]></title><description><![CDATA[<p dir="auto">I am getting an Error saving unnamed page when I click Done on last page.<br />
Also I am using an account from Google, how shall I skip entering the credentials as you propose?</p>
]]></description><link>https://www.triggercmd.com/forum/post/2784</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/2784</guid><dc:creator><![CDATA[George Hatzisymeon]]></dc:creator><pubDate>Thu, 03 Sep 2020 17:24:47 GMT</pubDate></item><item><title><![CDATA[Reply to SmartThings integration - flip a virtual switch to run a command on Sun, 26 Apr 2020 21:16:51 GMT]]></title><description><![CDATA[<p dir="auto">@TigoleBitties, I just tried it and it's working for me.  Can you verify your phone has Internet access?</p>
<p dir="auto">Also, you installed both the SmartApp and the Device Handler, correct?</p>
]]></description><link>https://www.triggercmd.com/forum/post/2105</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/2105</guid><dc:creator><![CDATA[Russ]]></dc:creator><pubDate>Sun, 26 Apr 2020 21:16:51 GMT</pubDate></item><item><title><![CDATA[Reply to SmartThings integration - flip a virtual switch to run a command on Thu, 07 Mar 2019 23:08:32 GMT]]></title><description><![CDATA[<p dir="auto">thanks a lot for a so quick awnser, that did the trick <img src="https://www.triggercmd.com/forum/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=6sa9akdcpc2" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:23px;width:auto;vertical-align:middle" title=":)" alt="🙂" /></p>
]]></description><link>https://www.triggercmd.com/forum/post/1303</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/1303</guid><dc:creator><![CDATA[putefabio]]></dc:creator><pubDate>Thu, 07 Mar 2019 23:08:32 GMT</pubDate></item><item><title><![CDATA[Reply to SmartThings integration - flip a virtual switch to run a command on Fri, 08 Mar 2019 22:49:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://www.triggercmd.com/forum/uid/1801">@putefabio</a>, checkout this post:</p>
<p dir="auto"><a href="https://www.triggercmd.com/forum/topic/86/actiontiles-tile-with-triggercmd-bookmark-url/14">https://www.triggercmd.com/forum/topic/86/actiontiles-tile-with-triggercmd-bookmark-url/14</a></p>
<p dir="auto">It says you can make a small modification to the SmartThings code to make it so the switch goes back off after you flip it on.</p>
]]></description><link>https://www.triggercmd.com/forum/post/1300</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/1300</guid><dc:creator><![CDATA[Russ]]></dc:creator><pubDate>Fri, 08 Mar 2019 22:49:24 GMT</pubDate></item><item><title><![CDATA[Reply to SmartThings integration - flip a virtual switch to run a command on Thu, 07 Mar 2019 21:41:26 GMT]]></title><description><![CDATA[<p dir="auto">hello guys can you please give me some help</p>
<p dir="auto">i have triggercmd installed in my pc so i can open kodi, but i have a 32bit version so thats why (i suppose) i dont have the option to parse a cmd so the smartthings switch knows when its on or off.</p>
<p dir="auto">that beeing said when i press the switch it open kodi but it stays on (green), then if i close but manually it stays green forever, if i flip it again it goes off but it opens kodi, cause im not using the script.</p>
<p dir="auto">well what i want is, can i switch the smartthings switch to a switch that doesnt stay on, it just pushes and goes back to initial state?</p>
<p dir="auto">thanks in advance</p>
]]></description><link>https://www.triggercmd.com/forum/post/1299</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/1299</guid><dc:creator><![CDATA[putefabio]]></dc:creator><pubDate>Thu, 07 Mar 2019 21:41:26 GMT</pubDate></item><item><title><![CDATA[Reply to SmartThings integration - flip a virtual switch to run a command on Sat, 16 Feb 2019 19:32:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://www.triggercmd.com/forum/uid/1862">@mthiel</a>, wow, that's interesting.  I'm glad you found that.  you send me the code snippet you changed?  I want to test it myself, then I'll update the code.  Sorry for the trouble, and thank you for finding a fix.</p>
<p dir="auto">EDIT:<br />
I was able to reproduce the problem.  I tested the change and updated the code.  Thanks <a class="mention plugin-mentions-user plugin-mentions-a" href="https://www.triggercmd.com/forum/uid/1862">@mthiel</a> for the fix!</p>
<pre><code>// deviceList += ["name" : "${roomName} ${devices?.name}", "did" : "${devices?.did}", "type" : "bulb"]  &lt;- this logic doesn't work when there's only 1 command
// Thanks to mthiel for finding this fix. 
deviceList += ["name" : "${roomName} ${devices[0].name}", "did" : "${devices[0].did}", "type" : "bulb"]
</code></pre>
]]></description><link>https://www.triggercmd.com/forum/post/1235</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/1235</guid><dc:creator><![CDATA[Russ]]></dc:creator><pubDate>Sat, 16 Feb 2019 19:32:44 GMT</pubDate></item><item><title><![CDATA[Reply to SmartThings integration - flip a virtual switch to run a command on Fri, 15 Feb 2019 04:57:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://www.triggercmd.com/forum/uid/1">@russ</a> Thanks for checking! Unfortunately, re-creating the device via the SmartApp didn't make a difference. Turns out MY problem is that I only have one trigger I'm testing on...</p>
<p dir="auto">I spent a few hours troubleshooting the SmartApp code and found the root cause around line 249. When a single trigger comes back from the api, the conditional looks like it assumes the type will be a Map, but it actually just returns a List with a single item at index 0.  Changing the "devices?.name" and "devices?did" to "devices[0].name" and "devices[0].did" fixes the issue for me. I only realized the problem because the trigger list kept creating devices with brackets around the name, making me expect a typing problem.</p>
<p dir="auto">It's working great for me now, hope my digging helps!</p>
]]></description><link>https://www.triggercmd.com/forum/post/1234</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/1234</guid><dc:creator><![CDATA[mthiel]]></dc:creator><pubDate>Fri, 15 Feb 2019 04:57:11 GMT</pubDate></item><item><title><![CDATA[Reply to SmartThings integration - flip a virtual switch to run a command on Thu, 14 Feb 2019 02:44:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://www.triggercmd.com/forum/uid/1862">@mthiel</a>, just to make sure, I just tested this in my SmartThings app and it worked for me.</p>
<p dir="auto">I recommend you try this:</p>
<p dir="auto">Go to Marketplace, SmartApps, My Apps, TRIGGERcmd, Next.<br />
Uncheck all of our commands, and click Done, Save.<br />
Go to Home, and if you have any TRIGGERcmd switches left, delete them.<br />
Go to Marketplace, SmartApps, My Apps, TRIGGERcmd, Next again.<br />
Check the commands you and to be switches.<br />
Test your switch again.</p>
<p dir="auto">BTW, I removed your token from the output you pasted.</p>
]]></description><link>https://www.triggercmd.com/forum/post/1233</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/1233</guid><dc:creator><![CDATA[Russ]]></dc:creator><pubDate>Thu, 14 Feb 2019 02:44:46 GMT</pubDate></item><item><title><![CDATA[Reply to SmartThings integration - flip a virtual switch to run a command on Thu, 14 Feb 2019 02:43:54 GMT]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I'm trying to get this setup to put my display to sleep, but the commands don't seem to be reaching SmartThings. If I manually fire the TriggerCMD from my phone browser it works perfectly,  but SmartThings doesn't seem to be communicating correctly despite the lack of any error. TriggerCMD also doesn't report receiving any requests except the ones I performed from the browser. I don't think there's an authentication issue since the SmartApp is reading my commands fine. I'm not sure what else to check. Here's a snip from the SmartThings log:</p>
<pre><code>57bb48b4-bb6a-48d0-8938-e085928b86e6  4:47:54 PM: debug OFF result: [response:done]
57bb48b4-bb6a-48d0-8938-e085928b86e6  4:47:54 PM: debug Return Code = 200 = Command Succeeded.
57bb48b4-bb6a-48d0-8938-e085928b86e6  4:47:54 PM: debug In apiPost with data: [token:(token), uri:/api/run/triggerByID, body:trigger=[5c61df9baa745900163af4dd-5c64b9eb3b309f00167a06eb]&amp;params=off]
57bb48b4-bb6a-48d0-8938-e085928b86e6  4:47:54 PM: debug Off request from child device
57bb48b4-bb6a-48d0-8938-e085928b86e6  4:47:54 PM: debug ON result: [response:done]
57bb48b4-bb6a-48d0-8938-e085928b86e6  4:47:54 PM: debug Return Code = 200 = Command Succeeded.
57bb48b4-bb6a-48d0-8938-e085928b86e6  4:47:54 PM: debug In apiPost with data: [token:(token), uri:/api/run/triggerByID, body:trigger=[5c61df9baa745900163af4dd-5c64b9eb3b309f00167a06eb]&amp;params=on]
57bb48b4-bb6a-48d0-8938-e085928b86e6  4:47:54 PM: debug On request from child device script_dth_cd2efee0eca44de1d6ceeb8c9ede43c0f5239b6c1e6e37c4e674414c2538f18d@574ae66b
</code></pre>
]]></description><link>https://www.triggercmd.com/forum/post/1232</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/1232</guid><dc:creator><![CDATA[mthiel]]></dc:creator><pubDate>Thu, 14 Feb 2019 02:43:54 GMT</pubDate></item><item><title><![CDATA[Reply to SmartThings integration - flip a virtual switch to run a command on Fri, 05 Jan 2018 23:09:27 GMT]]></title><description><![CDATA[<p dir="auto">@dctrbanner, I think I found the problem.</p>
<p dir="auto">This is what I got when I ran it your way:</p>
<pre><code>sudo -u pi  ~/Smartthings/TriggerCMD/Scripts/Myscript.sh
sudo: /root/Smartthings/TriggerCMD/Scripts/Myscript.sh: command not found
</code></pre>
<p dir="auto">Notice it's translating the ~ to /root before the command runs as pi.</p>
<p dir="auto">This works though:</p>
<pre><code>{"trigger":"Test","command":"sudo -u pi -H \/home\/pi\/Smartthings\/TriggerCMD\/Scripts\/Myscript.sh first_arg ","ground":"background","voice":"Test","allowParams": "true"},
</code></pre>
<p dir="auto">This is my test script:</p>
<pre><code>#!/bin/sh
echo $2 $1 &gt;&gt; /tmp/log.txt
</code></pre>
<p dir="auto">This is the output:</p>
<pre><code>$ tail -f /tmp/log.txt
on first_arg
</code></pre>
]]></description><link>https://www.triggercmd.com/forum/post/430</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/430</guid><dc:creator><![CDATA[Russ]]></dc:creator><pubDate>Fri, 05 Jan 2018 23:09:27 GMT</pubDate></item><item><title><![CDATA[Reply to SmartThings integration - flip a virtual switch to run a command on Fri, 05 Jan 2018 17:08:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://www.triggercmd.com/forum/uid/1">@russ</a> I am trying to trigger a command with parameters, but I I'm running into a wall.</p>
<p dir="auto">My script is as follows:</p>
<pre><code>array=( $1 $2 )
some_command ${array[1]} ${array[0]}
</code></pre>
<p dir="auto">I used an array because I needed to reverse the order of the parameters.  Now my commands.json has a trigger configured as such:</p>
<pre><code>  {"trigger":"Test","command":"sudo -u pi -H ~/Smartthings/TriggerCMD/Scripts/Myscript.sh first_arg " ","ground":"background","voice":"Test","allowParams": "true"}
</code></pre>
<p dir="auto">I'm expecting TriggerCMD to pass the "on" or "off" as the second argument, but for some reason, it doesn't seem to be doing so when I test from the website.  Am I doing something wrong?  I even tried to make a script specifically for the first argument so the only argument needed from TriggerCMD is the on / off, but it still doesn't work.</p>
]]></description><link>https://www.triggercmd.com/forum/post/428</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/428</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Fri, 05 Jan 2018 17:08:27 GMT</pubDate></item><item><title><![CDATA[Reply to SmartThings integration - flip a virtual switch to run a command on Fri, 05 Jan 2018 14:35:15 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for the reply - I meant is there any way to parse "on" or "off" in the commands.json in place of where it would be in the command.  For example, I have a heyu command to turn lights on that is formatted as such:</p>
<p dir="auto">Turn lights on: heyu fon Kitchen<br />
Turn lights off: heyu foff Kitchen</p>
<p dir="auto">What I am hoping is that there is something similar to %1, %2, etc in a batch file so that I can write:</p>
<p dir="auto">heyu f%1 Kitchen</p>
<p dir="auto">and pass on or off that way, to make the virtual switch work.  AFAIK it can only be done with a script, but if there is a simpler way I'd love it since I would only need to edit the json (although a script to parse the on/off along with the device name would be more elegant).</p>
<p dir="auto">EDIT: Disregard, I'm going to go with a script after all, my OCD wants the most elegant solution. <img src="https://www.triggercmd.com/forum/assets/plugins/nodebb-plugin-emoji/emoji/android/1f604.png?v=6sa9akdcpc2" class="not-responsive emoji emoji-android emoji--smile" style="height:23px;width:auto;vertical-align:middle" title=":D" alt="😄" /></p>
]]></description><link>https://www.triggercmd.com/forum/post/427</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/427</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Fri, 05 Jan 2018 14:35:15 GMT</pubDate></item><item><title><![CDATA[Reply to SmartThings integration - flip a virtual switch to run a command on Thu, 04 Jan 2018 22:37:14 GMT]]></title><description><![CDATA[<p dir="auto">@dctrbanner, you can include parameters in the commands.json file.  Here's an example that uses two parameters:</p>
<ul>
<li>
<p dir="auto">-y</p>
</li>
<li>
<p dir="auto">update</p>
<pre><code>{"trigger":"apt update","command":"apt-get -y update","ground":"background","voice":"update"},
</code></pre>
</li>
</ul>
<p dir="auto">BTW, if you leave allowParams out, or use "allowParams": "false", then SmartThings won't append <strong>on</strong> or <strong>off</strong> when you flip the switch - it will just run the command without the extra parameter when you flip it on or off.</p>
]]></description><link>https://www.triggercmd.com/forum/post/421</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/421</guid><dc:creator><![CDATA[Russ]]></dc:creator><pubDate>Thu, 04 Jan 2018 22:37:14 GMT</pubDate></item></channel></rss>