Tasker and http post


#1

Hi i am trying to use tasker to trigger an action on webcore, i was wondering how to go about it

To be more precise, im trying to get tasker to do a http post to webcore (using the external url link in webcore)

https://graph-na02-useast1.api.smartthings.com/api/token/xxxxe9727dxxx/smartapps/installations/axxxxda-ad47-4xxx-axxx-1c77xxxxx/execute/:59xxx0a8axxx2c00f64xxxx7axx:

and in tasker, where do i put this in?


#2

I had used Tasker before to send json data to webcore using a free plugin called RESTask.


#3

Sorry for the delayed response. I just now saw this post…

Tasker can easily send variables to webCoRE by using the built-in HTTP GET command.
(no need for plugins for this feature)

You only need to fill in the first line (Server:Port). Leave Path and Attributes blank.

Use the link from the piston you want to send it to (like normal)
except you will add to the end of that line something like:
?myColor=blue&myLevel=50

Such as:
https://api.smartthings.com/api/token/abc123/smartapps/installations/def456/execute/:ghi789:?myColor=blue&myLevel=50

Then in webCoRE, you can use a piston like this to do different actions depending on which data is coming in:

temp


At the risk of stating the obvious, you can replace myColor, blue, myLevel & 50 with any variable from Tasker, just be careful because args are case sensitive, so they must be identical in both Tasker and webCoRE.


#4

@WCmore how can I do the opposite of this? I want to trigger a Tasker task FROM a piston.
I’m trying to turn on my phones Bluetooth.
I’d like a piston that runs, IF Front Door closes, followed by within 5 minutes Garden Gate closes, THEN run Tasker task that turns on my Bluetooth.


#5

I use the AutoNotification plugin, and then send a single line like this:
temp

Alternatively, you can use AutoRemote if you only want it going to one device…
(both are plugins for Tasker)


For the record, I use § before any command to run a Task…
and I begin the command with ® if I want the text read back out loud.
(this just lets me streamline my code in Tasker, and simplifies additions in the future)


#6

Sorry for the newbie question, but can you tell me where the IP and port numbers come from?


#7
  • Going from Tasker to webCoRE, no IP is needed. See this post above.
  • Going from webCoRE to Tasker I do not use an IP either. I use a notification as seen here.
  • Going to my Raspberry Pi, I use the static IP and port for my RPi.

#8

@WCmore

Thanks for your quick reply.

I’m I correct that this part is not required if using the link to the piston?

“You only need to fill in the first line (Server:Port). Leave Path and Attributes blank.”


#9

Correct. If you just want to activate a piston, then in Tasker’s HTTP GET, the line “Server:Port” can simply point to the URL found here:

temp


Also, generally speaking, the piston that you want to be activated from an outside source should have no triggers whatsoever. Once your piston is saved, you want to see this up top: