SmartThings Rest API using Tasker

The variable you want to use is %offlinearray this contains all devices that were found to be offline. You can also turn off the progress dialog so it truly runs in the background.

All the offline devices are stored in the %offlinearray so however you’re sending your webhook you will need to add it to the bottom of the task and use the %offlinearray variable.

1 Like

You keep mentioning ‘request limits’. I googled trying to find something, but all I found was information on the old SmartThings API. What are the SmartThings request limits and timeouts if exceeded for the new SmartThings API?

Here’s the Documentation

2 Likes

I take that to mean only 12 Tasker HTML Request per minute maximum then?

Since I really don’t understand this that much, will having SmartThings connections for Alexa, Google Home and other manufacture connections affect the request limit?

Thank you again. What is the variable to show the device in list view instead of comma separation?


How I understand it’s a maximum of 12 call per device per minute. And I don’t think that will affect any other services. I believe the limits are to each token that’s calling on the API. So Alexa should have its own same for Google and so on.

1 Like

To do that we need to convert the array variable to a string, then we will replace the “,” with a Carriage Return.

First thing we will do is add a Variable Set converting the array to a string.

A9: Variable Set [
     Name: %offlinestring
     To: %offlinearray()
     Max Rounding Digits: 3
     Structure Output (JSON, etc): On ]

Next we will add another Variable Set.
(In the To section press the enter key on your keyboard)

A10: Variable Set [
      Name: %ret
      To: 
     
      Max Rounding Digits: 3
      Structure Output (JSON, etc): On ]

Last we will search the string and replace the “,” with the Carriage Return.

A11: Variable Search Replace [
      Variable: %offlinestring
      Search: ,
      Replace Matches: On
      Replace With: %ret ]

Then you will use the %offlinestring in your push notification.

1 Like

Receiving the follow error. Any ideas?

Removed “Max Rounding Digits: 3” and the task worked.

Take a screenshot of the whole task please.

That’s weird do maths shouldn’t have been checked. It isnt on mine. Anyways good to hear that it works.

1 Like

Jake could you set us up another task similar to “device health” that checks for battery levels for all devices… the task checks for battery levels at set points of 20%, 30% 40%, or etc %?

Started receiving this error today…


@swdeason the error on action 8 is because the variable was never assigned. Probably due to the error on action 3. Can you open up the http Request action and screenshot it.


Interesting, can you try running the task manually and let me know if it errors out again. If that’s the case you can try adding a new http Request action. Copy the URL and the body to the new action then, re-run the task and see if that clear things up.

So what is the exact end goal? Get all devices at XX% so you can send a notification? As is I have it to get the battery % of all devices with a battery. I’m just down to the displaying them the way you asked.

Would like to show any devices with 30% or less battery level.

Thanks