Newbie, Execute a Routine or Device action via URL?

Hopefully this is the right place to start. I want to execute a SmartThings Routine or simply flip a device switch off or on via a URL. I know about the “https://graph.api.smarthings.com” site, but betond that I have no idea where to start.

Ultimately, I want to use EventGhost to trigger Routines or device actions in SmartThings. I was doing this in my now dead VeraLite controller, so on the EventGhost side I have everything done, I just want to replace those URL calls in EventGhost with ones for SmartThings. Any help for this newbie would be most appreciated!

This should help:

3 Likes

You could also look at using webCoRE, it has a built-in endpoint that you could use to trigger events or devices without having to program your own REST endpoint.

2 Likes

WebCore is probably The best place to start. :sunglasses: It’s essentially a scripting language for SmartThings, very powerful.

The thread I linked to is still interesting, but was written before webcore existed.

2 Likes

I’m intrigued by this…

Do you have a reference on how to make this work via webCoRE? I see the endpoint link in the help, and I found an action but I need a few examples to work out how to make it…work

1 Like

In webCoRE, create the piston that you want to perform the actions/routines/etc. One you have that worked out, visit the webCoRE dashboard settings, you want the info on the bottom of the page (Executing pistons). It will give you your unique endpoint to call from a URL and append the ID of the piston you created or use the name but you encode the spaces.

https://graph.api.smartthings.com/api/token/secretkey/smartapps/installations/morecodeshere/execute/:pistonId:

or

https://graph.api.smartthings.com/api/token/secretkey/smartapps/installations/morecodeshere/execute/ExecFromURL

Example piston:

5 Likes

Thanks. That was surprisingly easy… Now to do something useful with it.

1 Like

Yes, really easy, @ady624 simplified it for us non-techies (and partial geeks, is there such a thing) :slight_smile:

2 Likes

Boom! An hour so of tinkering, and I have SmartThings/webCoRE and EventGhost doing what VeraLite and EventGhost was doing! Thanks so much. Great wiki to help get started.

3 Likes

I’m creating a dashboard with Tasker and have it working well with push notifications. I decided flooding various devices with refreshes via push was not optimal so looking at calling into webcore from Tasker. I have it working (as stated above super simple) but what I can’t find through hours of research is how to pass data back to Tasker from webcore. Any help will be greatly appreciated!

To be more clear, my piston(s) will query various system and device states and I need to return that data to Tasker. Right now its stored in webcore variables and then Push notification out.