SmartThings Community

How to trigger Smartthings FROM PC not TO?


(Bill Warwick (Jmrwbilly)) #1

Ok, I know how to setup where a “alert” from my PC will send trigger to my phone to change a virtual switch in smartthings via tasker. I’m trying to figure out how to skip the phone part, and have the PC trigger the virtual switch via a script. Everything i’m finding is sending from ST to PC, I want vise versa… Can someone please point me in the right direction?


(Jean May Jr) #2

You could set up a WebCore piston to change the switch and then fire it by creating a link on your desktop with the URL. (Might have to create a local HTML file to make it more seamless.)


(Bill Warwick (Jmrwbilly)) #3

thank you! I’ve spent hours looking for a solution and everything seemed overly complicated (like incorporating something like eventghost) for something that i feel should be simple… toggle virtual switch via script… really didn’t feel like that should be something that should take much to do…

All I’m looking to do, if cameras detect motion, run script that includes toggling a virtual switch.


#4

If your camera has an ifttt channel, you can also use that to flip an ST switch on/off.


(Bill Warwick (Jmrwbilly)) #5

it does, but i’m looking for more than just this one instance. and with as few moving parts as possible for this and any other similar item. the link firing a piston keeps it pretty simple.

I really wish there was a smartthings desktop app, giving statuses and ability to toggle items, rather than on phone/tablet only.


#6

Give ActionTiles a try if you have not seen it yet, they have a trial version. https://www.actiontiles.com/


(Jean May Jr) #7

WebCore Example using camera motion detector (just change the outlet to a virtual switch):


(Glen King) #8

A curl statement can fire a Webcore piston, so you can omit Tasker from this process.
If the pc sees your camera event as a system event, you can drive this directly from windows’ Task Scheduler. Make sure you run as Administrator, regardless of who is logged on.


(Mavrrick) #9

I would really suggest you look at Action tiles. This is exactly what it is for.


(Bill Warwick (Jmrwbilly)) #10

can you check the status and toggle switches via VB, cmd line or like with actiontiles?


(Ron Talley) #11

My vote is for ActionTiles!


(Mavrrick) #12

I feel like there is some context missing here. It sounds like you want your pc to check Smartthings for some activity, and then have it tell Smartthings to do some action. My assumption was simply about controlling Smartthings from your PC. Not about it actually checking status of items on the smartthings side.

If that is what you want, i would really be interested into why this is needed.

You may be able to talk directly to the Smartthings hub with the new API’s and Smartthings CLI SDK. i believe from what i read that it may be direct control from the computer.


#13

LOL, that’s why we’re throwing everything and seeing what sticks :smiley:


(Bill Warwick (Jmrwbilly)) #14

Actually the piston triggered by a url fits exactly what i’m looking for. Have my PC simply turn on/off a virtual switch via a simple script.

But actiontiles now has my interest… just asking about its capabilities, being i thought it was just a tablet “panel” interface…


(Glen King) #15

I use smarttiles, which is the predecessor to actiontiles. It’s a great tool, and I recommend it highly.

But as you’ve stated, it’s likely unnecessary for what you seek to do. I would do the following:

A. Load eventghost on the pc. It’s a great tool for observing/tracking system events.
B. Simply observe in eventghost the system events that occur when your camera detects motion, and reports it to your PC.
C. Find those corresponding events in Task Scheduler, and send your curl statements when those events occur.


(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #16

Not at this time… But we’re considering it.

I certainly wouldn’t suggest waiting.


(Ron Talley) #17

I have two-way communication between my PC and SmartThings using EventGhost. It’s pretty easy to use. I wrote a complete tutorial on setting it up here. You may skip to the part where you only need to send to ST via the EventGhost Scheduler.

The python script to turn on/off Virtual Switch from the PC is:
import urllib; urllib.urlopen(‘http://some smartthings address’)

Good Luck!