Tasker Integration Not Working?

I’ll try setting up an app to run SharpTools to see if that helps but when I was testing I was working in SharpTools and then switching to Tasker so not sure how opening the app would help but I’ll try it. Also, my phone reboots every night (using Tasker and another plugin). Thanks.

That’s good info. I agree that automating the opening SharpTools wouldn’t help in that case.

Can you run through some sample Tasker tasks and pull logs from Tasker and SharpTools? For Tasker, you’ll need to enable the logs before running the test. For SharpTools, you’ll need to send the logs relatively soon after running the tests (eg. if you send the logs the next day, they might have been overwritten by then).

For test purposes, you might pick a single device for the test and then run the following steps - a light switch makes a good test:

Preparation:

  1. Start with the light physically turned off
  2. Ensure Tasker logging is enabled
  3. Create a Task for turning the light on
  4. Create a Task for turning the light off
  5. Create a SharpTools widget for turning the light on
  6. Create a SharpTools widget for turning the light off

(PM me if you don’t have the widgets IAP unlocked and I can take care of it for you)

Testing Steps:

  1. Open the main SharpTools app, find your thing in the list, and turn it on
  2. Wait 5 seconds and turn the light back off
  3. Open Tasker and run the task to turn the light on
  4. Wait 5 seconds and run the task to turn the light back off
  5. Run the widget to turn the light on
  6. Run the widget to turn the light off
  7. Send the SharpTools Logs: Support > Send Logs
  8. Send the Tasker logs

I will try this evening. I didn’t have widgets enabled but I just purchased the option. More than happy to help the cause. Will let you know later.

1 Like

I created tasks and widgets. All four worked just fine (although the widgets were a little delayed in updating that the lights were on or off). I sent you the logs by email.

By the way, I did set up a profile/task that runs SharpTools now and then. When I’m at the office during the week, I display my calendar on my phone (because the office blocks google calendar). So I added a line to the task to run SharpTools and then display the calendar. I don’t know if this is a factor or not.

Also, and obviously, I ran SharpTools to test the widgets and tasks, so it had been activated before sending the logs. Maybe if my garage door routine fails I’ll send all logs again (although it worked the last two times I drove home – go figure :slight_smile:).

Thanks.

Thanks! I received the logs and will look through them, but if everything was working then it probably won’t have many clues.

Thanks again and sorry that you’re experiencing the intermittent issues. (If it happens again, I’d love to take a look at the logs!)

I’ll send logs next time it doesn’t work.

1 Like

My garage door open task just failed so I sent you Tasker and SharpTools logs by email.

Thanks. I requested access to the file that was linked in the email. I assume it has both Tasker and SharpTools logs in it?

This is exactly problem I’ve been having and have been in contract with you through email. I thought it was fixed after hard resetting my phone, but it is still intermittent. Tasker just hangs occasionally when using your plugin. Always ends in a timeout. Only thing I saw weird looking through the logs from your app were “location DB match failed. Falling back to using the first location in the DB”

1 Like

Any progress on this? It is getting immensely frustrating. Tell me what I need to do, to give you more info.

I’ve received a couple of log files and I’m trying to track down what’s happening. I still can’t reproduce it on any of my devices. Nothing has changed from the SharpTools side of things, so my suspicion is it’s something blocking or delaying the handoffs with Tasker and SharpTools.

You mentioned that you are on a Pixel 2 XL with the latest software patches (which I am too)… have you tried whitelisting SharpTools and Tasker in any battery management (and VPN, Task Killer) features?

For example, on a vanilla Android install:

  1. Go to Android Settings
  2. Select Battery
  3. Tap the ... overflow and select Battery optimization
  4. Make sure “All Apps” is selected from the drop-down
  5. Find SharpTools, tap it, then select “Don’t optimize”
  6. Find Tasker, tap it, then select “Don’t optimize”

Note: For anyone else sending logs, please be sure to send both Tasker and SharpTools logs both from the same time as the failed event so I can see what’s happening on both sides.

Yes, I have done this already.

Is this a symptom, our something you’re working on? Wasn’t getting this before yesterday.

Emailed more logs to you too.

This is a symptom, but nothing has changed in SharpTools since you posted the issue. This means that Tasker is sending over a non-ordered broadcast.

Unless the developer docs have changed, Tasker should only send ordered broadcasts and plugins should filter out non-ordered broadcasts.

Started working perfectly a few days ago. Nothing changed, just boom, back to working. I did talk to the Tasker developer though, he said non-ordered broadcasts are sent if the command timeout is set to zero. I was trying all different things, so the log I sent you, the timeout was set to zero for that particular fault.

1 Like

I rolled out a beta version of SharpTools (3.9) which includes support for the new service integration model available in the Tasker beta 5.1.5b. The new integration uses a model wherein Tasker calls a service on the SharpTools plugin which should bring SharpTools to the foreground and cause Android to temporarily exempt it from Doze Mode and App Standby.

Note that the recommendation is still to whitelist SharpTools and Tasker in battery optimization features. Even when an app is whitelisted, some battery restrictions are still applied to the application if it is not active / in the foreground. Hence the desire to test this approach and see if it improves the situation.

Also make sure to follow the battery optimization suggestions from the Tasker website which includes whitelisting Tasker as well as enabling the Run in Foreground preference.

You’ll need to make sure you are on SharpTools 3.9b and Tasker 5.1.5b in order to use the new feature.

For more details on the SharpTools beta release, check out the release thread.

Edit: The reliability enhancements that come from the new Tasker service integration are targeted to Android 8.x+ devices. I’m also looking at adding an optional foreground service (eg. fixed notification) that you could choose to enable and would help for Android 6.x-7.x if they are experiencing issues from Doze / App Standby.

I’ve implemented the service integration for all Actions in Tasker and I’ll work on adding this for the Event plugins shortly.

So far, this has resolved the problems I’ve been having as of late! I have not had a single failure or timeout. I’ve had continuous issues for the last month or so, and Josh has been amazing addressing them!

1 Like

Beta 4 of the 3.9 series focused on improved Tasker reliability was released. Check out the following post for more details:

SharpTools 3.9 Beta 4 Release Details

3 posts were merged into an existing topic: Sharptools with Hubitat