SmartThings Rest API using Tasker

This is what you will want to use to get the value you want in that task.
Do a variable set.

%DeviceInfo.components.main.doorControl.door.value

Thanks for the quick response and tasker syntax lesson :smile:, works great!
I was wondering what Sharptools/Tasker users were going to do after Groovy and this post has been very helpful. Appreciate the effort!

Feel free to hit me up if you need any help with more task.

Hello @Jake_Mohl
For your original Offline status I disabled the List Dialog and replaced it with a Notify. So I can see wich devices are offline (with the list dialog nothing was showed on the screen when the task runs at 12:00)

The problem is that, when the List has more than One, it only shows the first followed by 


The task has the replace , for the “return”, but only the first shows up. Any suggestion?

I think the problem is with MIUI devices. Notifications cannot be extended to read the all text.

I solved it by replacing the array with a string and send the notification on every loop. So i’ll have as many notifications as the number of the offline devices.

That’s fine by me :grin:

You can fix that by using %offlinearray() as the text option for the notification. The () tells it to use the whole array vs using the first entry.

Yes, but still won’t work.
In this case it separates the devices with “comma” and I still can’t see more than one, a comma and the start of the second devices name.
But that’s ok. I’ll use my option of one notification for each device.
Thanks anyway.

I am using pushbullet with this setup with no problems


This is awesome for controlling devices w/in Tasker, though I simply want to send a REST api message to Tasker as a ‘Then’ in a Routine. I’ve created my Personal Token, however, I do not see an option to send it in a Routine. Is there something different I need to do?

What’s an example of this use case? This will help me out on how to beat help you.

I have Home/Away Profiles in Tasker, and would like to use ST as my Tasker presence device. Currently, I’m using Life360 via Home Assistant, sending a REST message to Tasker thru Join.

Edit: Until I figure out how to send a REST message, I’ve found an alternative
 Using Modes & Routines on my Samsung S22, although I cannot directly interact w/ Tasker, I can post a notification for Home/Away which I can Intercept w/ AN.

Edit 2: I actually figured another way, also through Modes & Routines
 Using Tasker App Factory, I created an App that does a Perform Task for Home and one for Away.

Nice thread. I’m sensing a pizza delivery app routine in my future to turn on the porch lights :slight_smile:

2 Likes

Sorry for a newbie question. I want to set up a single widget to control the garage door. How do I create two separate tasks to either open or close the garage door or a single task that would execute either open or close command depending on the device status without requesting the device ID and answering to open/close popup? When I try to create these tasks from the existing “Open Or close Garage Door” task by only leaving HTTP Request enabled and “%deviceId” and “commands” replaced with the fixed ID and “open” or “close” command, I’m getting an error (please see screenshots).
Thanks!


I have a task that will work for this, I will need to modify it. If you can give me a day or so I will PM you with the task.

That would be wonderful. Thank you very much!

With the IDE being Sunset. I am going to start releasing some more tasks to help.

Here’s the first batch.

Managing Location Modes

* Get Current location Mode
* Get All Locations / IDs
* Create Location Mode
* Rename Location Mode
* Delete Location Mode

3 Likes

Hi Jake,

Thank you for making and detailing all this out. I’m yet another person trying to work with the set-up you have here and having trouble, if you could help me out that’d be great.

I’m trying to get a smart plug to turn a light in my living room on and off when my android receives a notification from one specific app. To turn it on when the notification comes in, stay on for about 15-20 seconds, and then turn it off.

I thought I could just incorporate your “Turn Device On or Off” task into a new task, somehow, but it isn’t working!

Here’s the task I’m trying to make:

It seems as if all I need is to create what you have as No. 7 in your “Turn Device On or Off” task: the HTTP Request. However, when I try to make one, after filling in all the information I can’t ever close/create the task!

When I press the back arrow in the upper left of the screen, which is how I close/create every other task, it doesn’t let me! – doesn’t create, doesn’t even close :frowning: it’s like the button isn’t working, but I don’t even get any sort of Error message about why either.

I’ve also noticed that if I go into the HTTP Request you have in the “Turn Device On or Off” task, I also can’t use that back arrow to get out of its request task either. !!

Any help is appreciated. Thanks and thanks again for creating all this for us!

Oh and to add, if it helps, already bought both full version of Tasker and AutoTools as well as signed up for the beta, as you mention in your OP

There is a lot to unpack here.

  1. Your screenshot shouldn’t include the build data Base. That should only be ran 1 time when you first setup this, or when you add or remove devices from SmartThings.

  2. You are correct, you can only use the http request action from the task.

  3. As far as having issues inside tasker with not being able to back out. Your guess is as good as mine.

Now what are you using to intercept the notification you want tasker to react to? AutoNotification?

I can help build you the task that you want but I will need some more details about exactly what you want it to do and how the task is to be launched.

I’m using Tasker to intercept the notification. I already have a task set up to auto-open the app when a notification comes in, which works fine. That task is in the profiles section of Tasker and seems to be a “Notification” task, as such:

I know that I can add a task to that one by long pressing the right side of the green arrow (where it says “Job App Open”), so if I had another task that turned the plug on and off, that should be all I need ???

So, to sum up: I want a light to turn on and off when I receive a notification from a specific app I have (in the image you can see it’s called “Frontline”).

I have a light plugged into a smart plug. When the smart plug is on, it will turn on. So I just need the task to turn the smart plug on and then off after about 15-20 seconds, so I don’t have to turn it off manually after every time the light notifies me of the app’s notification.

I’m not going to pretend to be as good as @Jake_Mohl with Tasker, but I have a task that does exactly what (I think) you’re asking. All you need are three actions in one task:

The first and third actions are almost identical, except for replacing the word “on” with “off”

If it helps, you can copy and paste the text below into the body:

{
  "commands":
    [
      {
        "component": "main",
        "capability": "switch",
        "command": "on",
        "arguments": []
      }
    ]
}

Sounds like you have the profile figured out already, so just add your new task to it and you should be set

Hope that helps!

1 Like