SmartThings Rest API using Tasker

Yes, I have tasks for getting Scenes and running them. I will update the 3 post with the code and links to the tasks to get and run a scene.

1 Like

This is great. Thanks.

@rcbjr2 I have added a “Get Scene” task and a “Execute Scene” to the code snippet post. Code Snippet Link
I they work together or you can cannibalize them for your needs. I have also included just the urls for the HTTP Request action for Tasker.

1 Like

By the way, when you add these, do you update your TaskerNet Project? Or do you provide the Code Snippets so we make our own Tasker Tasks? Thanks either way!

1 Like

I will be updating the TaskerNet Project in the future, however for the time being I will be just posting new tasks that will work with the base project. The base project is just a proof of work for anyone to take and build their own tasks.

I’m slowly adding more snippets just for easy of searching for the body code needed.

1 Like

@swdeason I have added a task for checking the device health status. You can find it on Post #3 if you need help building a task that checks at a certain interval feel free to DM me.

1 Like

I think i’ve done everything correctly so far, but how should I create the database?
I’m stopped at this point:


I read a lot of interesting things thanks to tasker, for now as you know, the most important thing for me is sharing the location, as described in the other post, I think this is a necessary thing to do first.

Hi
I am fairly new to tasker, I’m a little stuck, I have installed your tasks, when I set up an event and then use to switch on device, it works, but each time I have to manually enter the device and command, is it possible to store selected on each trigger task set up, thank you

You are on the profiles tab select the task tab. Think of profiles as the “IF” part of a routine. That is where you trigger a task based on, time, event, state, etc.

1 Like

Thanks found! I see a lot of them besides these two, including the “Build Database task” that I saw with a warning sign next to it and invited me to install a correct “autoTools” plugin? I installed it and it asks me whether to use the free version or try it for 30 days. I chose the free version, ok? now the database seems to have been created, but I don’t know how to proceed.

Yes the task for turning on and off a device is just an example. You can create a new task can copy over the HTTP Request action.

Then using the “Get DeviceId” task get the ID of the device you want to control. It should be copied to the clipboard if not it’s stored in the %deviceId variable. Then you will want to edit the HTTP Request action you copied into your new task. You will replace the %deviceId with the one from the clipboard. This will be in the URL part. You will also want to replace the %Command with either on or off depending on use.

1 Like

There are example tasks you can use like “Turn Device On or Off” simply open the task and clip the play button at the bottom left.

Hi Jake, thank you, I didn’t realize it would be that easy, this is fantastic, just want I was looking for

1 Like

I downloaded from Taskernet again. I didn’t realize you had added scenes and location. Neat. I was trying to create my own but then I thought maybe you had added them already. I need to check mode for some Tasker profiles so this will be great. Thanks!

Is it possible to select multiple devices to do a health check on from this screen and check ONLY what is OFFLINE?

Can we also add on the flash pop up the name of the device that is offline?


Modified your task by adding pushbullet to your task so it shows up like a standard push notification.

@Jake_Mohl why do we need to sign for the Beta program??
I use tasker for a long time and I don’t want to be part of the Beta program because at some point it the new beta version might bring some bugs and I don’t want to mess with my automations :grinning:

Is there a way to import your project without sign to the Beta program?

Regarding the tasks, I would like to make one that checks all the devices and send me a notification with the ones that are offline. Is this possible?
I have this in Webcore, but it will stop working soon…

If you’re not in the beta it will cause an error when trying to import the tasks. I will export them and upload them to my Dropbox and post a link once I clean up my project tab again.

Yes it’s possible, I have a task that does that. However if you have a lot of devices it hit the limit of requests per minute and causes an error. I’m currently trying to work out a method of doing only so many request per minute then wait a minute the do more requests.

It would be possible to also build a task that allowed you to select X amount of devices to check that would be under the limit and check those at a set interval.

2 Likes

@swdeason here is a Tasker Profile that will check device health every 1 hour and will display the devices that are offline. You can run the task manually. However if you run it to frequently it will error out because of the request limits of the SmartThings API.

Check every hour this can also be found in the Code Snippet post.

1 Like

Thank you very much. It works as expected. Since I’m using pushbullet to send a notification to my phone when the task runs, I’m trying to figure out how to grab from your task the devices which are offline but the configuration is only grabbing one line. Do you know what I can use to config the pushbullet to grab all offline devices from your task?

Thanks again for your help.



Hi, Jake
This is great, something I’ve been looking for, I am fairly new to tasker could you possibly show a example of how to capture the results so I can use the results to send a webhook, many thanks

1 Like