rms62003
(Ra Nae Stanton)
September 9, 2014, 1:58am
1
I’d love to use the Tasker app on my smartphone to control the modes for my Smartthings, not just certain switches. Here’s the scenario. I want to create a shortcut on my home screen for “Night” mode that turns the thermostat down, verifies the front door is locked, and that the lights and Sonos system are off. I can do the Sonos and lights via switches, but not the front door lock and thermostat.
Anyone know of a way to trigger a mode via Tasker?
I haven’t done the thermostat, but i have a task that switches off numerous switches and locks the door all with one action.
NickW
(Nicholas Wilde)
September 9, 2014, 5:23am
3
You can trigger a Hello Home action using a REST Endpoint.
SmartApp endpoints are a powerful way to securely control your SmartThings with familiar REST calls GET,POST,PUT or DELETE. You have the freedom to define your URL schema and can pass query values through the URL path or through JSON.
This tutorial will guide you through the process of setting up this App Endpoint Example . After you authorize the app to see specific devices, it will generate a web page of buttons with URLs to toggle your chosen lights and locks.
You can download the full code for the SmartApp Endpoint Example and PHP code to interact with the endpoint. Additional OAuth documentation can be found here.
Step 1: Enable OAuth in the SmartApp
To begin, add a New SmartApp in the IDE . Make sure to click the button to “Enable Oauth in Smart App.” Note the “OAuth Client I…
Here’s a tutorial on Tasker and ST:
GETTING ACCESS TO SMARTAPP ENDPOINTS
In order to get SmartThings working with Tasker on Android, I will assume you’ve completed Danny’s Endpoint API tutorial here . (old link sorry) You will need to be able to host your own PHP file as per Danny’s instructions, because at the time of this post, Danny’s hosted PHP file is down.
PREPPING TASKER
Once you have finished Danny’s tutorial, the first thing we need to do on our Android smartphone is allow External Access, which will allow apps like NFC Task Launcher (see Part 2: NFC) to initiate Tasker tasks.
Step 1: Open Tasker, tap the Menu button and go to Preferences.
Step 2: Check the “Allow External Access” option and click the X in the top right corner.
[image]
[image]
AUTHORIZING ACCESS TO YOUR DEVICES
Now it’s time to get the End…
As for the endpoint that incorporates the phrases, look at Ubi - prod SmartApp under the My Apps category.
The code you’d need to add is:
...
path("/phrases") {
action: [
GET: "listPhrases"
]
}
path("/phrases/:phraseName") {
action: [
GET: "executePhrase",
POST: "executePhrase",
]
}
...
def listPhrases() {
location.helloHome.getPhrases().label
}
def executePhrase() {
def phraseName = params.phraseName
if (phraseName)
{
location.helloHome.execute(phraseName)
log.debug "executed phrase: $phraseName"
}
else
{
httpError(404, "Phrase not found")
}
}
1 Like
It’s pretty easy to do.
If you follow the instructions found here
Hello ST forum.
First let me start by saying THANK YOU, this forum is priceless for tons of information!
Im trying to configure a way to change hello, home mode using a virtual switch. I’ve looked through the forums but found nothing about changing hello, home modes via a virtual switch. My main goal was to create a switch I could use via endpoint example. Using the http link from the endpoint example I could use the link to create a IOS homescreen icon shortcut to trigger the event.
Once you get to step 7, you can use those URLs and send HTTP get requests using tasker and it will send the corresponding command
rms62003
(Ra Nae Stanton)
September 21, 2014, 11:05pm
5
OK, now I know a little more about what I want, and the Smartthings vocabulary for it. I’d really like to trigger an action, so that the lights, Sonos, lock and thermostat all do what they are supposed to do. Anyone know how to do this? I found the dummy switch to trigger modes, but can’t seem to get the mode to trigger the actions.