Tasker plugin/integration for Android App


(Sim Harbert) #1

Are there any plans to add Tasker integration for the Android mobile app? Or, are there Android Intents for performing actions in the SmartThings app currently? Tasker can arbitrarily call Android Intents if someone can give me the documentation on what they are.

I know that people have created Rube Goldberg methods for triggering things from Tasker using the REST API, but it would be much easier to just be able to call a plugin or at least an Intent.

I myself have created an elaborate system to make my own “presence” sensor using Tasker to to detect when I connect to my condo wifi. When connected Tasker sends a text message to IFTTT, which in turn has SmartThings unlock my door. I suppose I shouldn’t announce that to the world. :slight_smile:

The main problem I am having is that sometimes there is lag between when my phone detects the wifi and when the door is unlocked, making it faster to just manually unlock the door. I am not sure if it is the text message, IFTTT or what that is slow.


(Convinced ST will never be unbroken…) #2

I am not sure just what you’d like to plug in to. SmartThings is an event based system; would you want to send events from Tasker to SmartThings? If so, in what manner?

What you’re doing with your lock can be setup now in Tasker in just a couple of minutes. I am not sure I would consider it RG as that is what endpoints are designed for (and even a plugin would have hoops to jump through with authorization).


(Sim Harbert) #3

I am wanting to be able to send events from Tasker to SmartThings. For example, opening the door lock, as I mentioned. I notice on the forum that people have problems with the SmartThings Android presence sensing so I would prefer to use Tasker to figure out when to unlock the door. And I don’t want to carry yet another key fob with me to do the sensing. Also, doesn’t the SmartThings presence sensing use geofencing? I believe it thinks I am home when I get to my building, but I don’t want the door to unlock till I am on my floor, walking from the elevator. Wifi seems to connect when I get to the right spot.

Making the Android app work as a tasker plugin would be an easy way to add tons more capability to it. Then down the road a bunch of features could be added to the app to do those things for people who don’t like or want to deal with Tasker.

One example is that I can easily add a widget or notification bar button to run a Tasker task to unlock the door. Versus having to open the SmartThings app and navigate to the door lock to do it.

Other Tasker plugins don’t ask for any authorization keys or anything. I would have to investigate that further to figure out if it is possible for another app to spoof Tasker and send commands to a plugin.


(Convinced ST will never be unbroken…) #4

Like I said, this is all doable now with Tasker and oAuth endpoints. You can’t communicate with the SmartThings graph without authorization, so a Tasker plugin would need to establish it as well.


(Kaleb) #5

@noisygecko,

My friend @joshua_lyon has been working on an Android app which provides widgets/shortcuts and a Tasker plugin for controlling SmartThings devices. The app is still in it’s early stages, but I have been testing it with with him. If you are interested in alpha/beta testing the app, follow the instructions below:

https://bitbucket.org/joshua_lyon/smartthings-tools/wiki/Alpha%20Instructions

I would note that while the widgets and Tasker plugin are free during the alpha testing period, he plans on limiting the number of available widgets/Tasker tasks in the free version and having an IAP to unlock unlimited access once the app is released.


(Joshua Lyon (SharpTools.io Dashboard)) #6

Thanks, @Kaleb!

@noisygecko feel free to email me directly if you have any questions or suggestions about the app! For others that are interested, you can check out a list of Features including some screenshots of the Tasker integration and widget creation.


(Sim Harbert) #7

@joshua_lyon I did notice that app after I posted this message. For some reason my search didn’t bring it up earlier, I guess because it was in the midst of a long chain of messages.

@scottinpollock Tasker would talk directly to the SmartThings app on the phone through Android Intents if it were a Tasker plugin, so it wouldn’t need authentication since the app already has it. That is the way the app by @joshua_lyon works. It gets authenticated to the gateway SmartApp, and then Tasker just sends intents to the plugin app when it wants to run an action.

And I get it, there are ways to get this working. I was just wanting to do something that didn’t require a custom SmartApp and yet another smartphone app. Or the SMS/IFTTT system I am using.


(Mike T) #8

[quote=“scottinpollock, post:2, topic:6192”]
I am not sure just what you’d like to plug in to. SmartThings is an event based system; would you want to send events from Tasker to SmartThings? If so, in what manner?
[/quote]Sending from Tasker via endpoints is here, but a plugin would let notifications go the other way too. Tasker could watch for events from SmartThings and then take action. The scripting available from Tasker is broader than that in SmartThings, at least for the casual user like me who is not a skilled programmer.

I’ve seen posts on the forum where people do an end-around to get this working, having SmartThings send a notification which Tasker watches for and then parses. But that’s a lot less clean than having a simple Plugin in which you could set up different actions depending on which sensors are triggered.


(Sim Harbert) #9

I still think a Tasker plugin would be awesome, but I solved my current problem by getting a presence sensor. I did get IFTT to work, but the timing was wrong, and sometimes it never worked. I was having Tasker send a text message to IFTT, which triggered unlocking my door.

With the presence sensor, the door almost always unlocks as I am walking down the hall. The annoying thing is I have to carry yet another stupid thing on my keychain. I was hoping my phone could act as a presence sensor.


(Convinced ST will never be unbroken…) #10

I am not sure just how feasible this would be. Remember, all events (and the apps/actions) they trigger are all sent to/run from the cloud via the hub. I don’t think the app does anything other than receive notifications when not in the foreground. When brought to the foreground it refreshes all states shown within it from the cloud.

So unless your phone is awake and SmartThings is running in the foreground, I don’t think it does a thing.


(Joshua Lyon (SharpTools.io Dashboard)) #11

I have push events through Tasker from SmartThings working in an internal build of my app, SharpTools. I’m not near a computer right now, but I will post some additional details when I get back to a computer. SharpTools currently can control your things through Tasker and I hope to have the push events released soon.


(Mike T) #12

[quote=“scottinpollock, post:10, topic:6192”]
I am not sure just how feasible this would be. Remember, all events (and the apps/actions) they trigger are all sent to/run from the cloud via the hub. I don’t think the app does anything other than receive notifications when not in the foreground. When brought to the foreground it refreshes all states shown within it from the cloud.
[/quote]Right now when the Smartthings app is in the background it can receive a notification and tell the Android OS to put a notification on the home screen. This notification is what the workaround scrapes in order to provide Tasker integration.

I’m not a programmer, but in order to get a Plugin for Tasker to work the Smartthings app would just need to handle the notification in a manner appropriate for a Plugin instead of calling the Android OS to put a notification up.


(Joshua Lyon (SharpTools.io Dashboard)) #13

I said I would follow up with additional details on the Tasker integration, so here I am. :smile: I have push events working with SmartThings and Tasker using a custom Android application I built called SharpTools. I’m still working on building out the user-interface and polishing the workflow, but my internal build of SharpTools has the option to ‘subscribe’ to the events from devices and then react to those in Tasker.

In the Tasker Event plugin, the user can currently choose to trigger on all subscribed events or only if a certain set of parameters are met (eg. matching Thing and/or Attribute name). In my testing if I press a switch on the wall, SharpTools is updated nearly instantaneously, but there is a few second delay if the device is triggered from the SmartThings app.

I still have a few things to work through, but hopefully I can push the update out soon. Are there other things that would be needed in a Tasker Event plugin?

The first 90 seconds of the video show how to authorize SharpTools to access your Things in SharpTools and quickly reviews the Things/Phrases UI and how to subscribe to a Thing. The Tasker specific parts start around 1:30 and show simple example of triggering a Tasker action based on a SmartThings event.


(Sim Harbert) #14

It looks like folks are getting confused on what I am actually wanting when I say Tasker integration. I want Tasker to be able to trigger the SmartThings app to do things that I can do through the app, like switch on a light, or change the temperature. Not the other way around.

This is all very possible, since there are lots of apps like BeyondPod, etc., that do this right now. They provide an Android Intent that other apps on the Android phone can trigger. They can even provide “arguments” to the Intent that might be something like temperature or light level. Apps like BeyondPod make all this very explicit by turning the Intents into ones that are published to Tasker so that all the settings and arguments can be seen in Tasker. But even if they aren’t, Tasker can call intents as long as they are documented.

This is different from calling a URL from Tasker to trigger something in SmartThings. I know that is possible, I guess that is more direct than calling the app. And since the app doesn’t do Intents, that is the only way to do it. When I have a bit of time to look into that I guess I’ll try it. A lot of things about SmartThings seem to involve me spending a bit of time trying to figure out how to get them going.


(Joshua Lyon (SharpTools.io Dashboard)) #15

I agree that it would be great if SmartThings provided the Tasker plugins right out of the box with their Android app or even if they included Intents that could be externally called. That being said, I understand that they have a laundry list of other ‘core’ items that they are working on which is why I created SharpTools so I didn’t have to wait. :smiley:

It sounds like you want to be able to control your Things and execute phrases from Tasker which is one of the main things SharpTools does. Check out the list of features and feel free to let me know if there is something you think should be added as I am constantly improving the app:


And it sounds like you might have already come to this conclusion, but using the Tasker plugins from SharpTools is very similar to calling an Intent if SmartThings had provided one directly in their app. The bottom line is both SharpTools and the SmartThings Android app ultimately have to make a call to the SmartThings cloud to make the change on the devices in your home.


#16

SharpTools looks interesting and probably something I would likely be messing with tonight!


(Sim Harbert) #17

Thanks @joshua_lyon! I am trying the SharpTools beta right now, and it seems to be working pretty well. It is doing what I want, and more. And is much, much easier than creating my own endpoint, etc. I’ll have to test it out a bit more, but it looks like it should work pretty well.

I didn’t see it in the previous info about ShartTools, but it does require two separate in-app purchases for the Tasker plug, and then for widgits. There is a 7 day trial period separately for both of those.

I am using the AlarmPad app that has a Tasker plugin so that I will have things happen when my alarm goes off in the morning. As well as have it shut things down when I enable/disable my alarm at night.


(M203) #18

I am really happy with this plugin so far, the added query feature is nice for example checking the integrity of my apartment when leaving ie are all windows closed is a nice addition! Highly recommended. just ordered a Fibaro motion sensor and hoping that the device config in ST will support setting led color and brightness! then I will set red led when system is armed via sharptools and tasker :smile:

I have noticed that when stuff is executed I get a result:succes flash. Is it possbile to use this in some way? To set an action as done or something? Any ideas? I guess I could intercept it with autonotification maybe?


(Joshua Lyon (SharpTools.io Dashboard)) #19

@m203 I’m glad you are enjoying the plugin!

Let me do some testing related to your question… I am setting Success and Failure codes on the actions that return data so you should be able to react based on those. If I remember correctly the actions that execute events are run asynchronously (eg. they fire and Tasker continues before they complete), so I need to look into those.

You could subscribe to the attribute that you expect to change and setup another Tasker profile that reacts to that. For example, in Profile A you have an action that locks the door (perhaps from a voice command, or when your phone detects it’s connected to your car). Then in Profile B, you would have an event context that reacts when the ‘lock’ attribute of your door changes and could take whatever action you want (eg. change a Hue light to red and speak a confirmation message on your phone). Additionally, you could have a profile that runs at a certain time or based on a geofence (for example, when you get to work), that queries the state of the lock to make sure it is locked and could notify you if the door was not locked.


(Mcvoss) #20

How do you do the 7 day trial, I only see the in app prurchase. I wanted to try before I buy.

Thanks