[Resolved] Multiple Tasker Profiles fail

When I have the below two Profiles enabled, neither execute. If I have only one enabled, it works. And, the Tasks work individually. Seems there’s some type of conflict or maybe due to timing, they both cannot be working at the same time? How may I troubleshoot this?

Mode Profile…

Profile: Mode (246)
	Priority: 39 Notification: no
	Event: Mode Change [ Configuration:Active for ALL Mode Changes
 ]
Enter: Get Mode (236)
	A1: Mode: Get Current [ Configuration:Gets the current mode and available modes. Timeout (Seconds):15 Continue Task After Error:On ] 
	A2: [X] Flash [ Text:%st_mode Long:On ] 
	A3: Variable Set [ Name:%Mode To:%st_mode Recurse Variables:Off Do Maths:Off Append:Off Max Rounding Digits:3 ] 
	A4: If [ %Mode ~ Away ]
	A5: Perform Task [ Name:Lock PC Priority:%priority Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ] 
	A6: End If 

Presence Profile…

Profile: Presence (100)
	Priority: 47 Notification: no
	Event: Thing State [ Configuration:Thing: SNOTE8
Attribute: presence

Triggered when an attribute matching the filters changes.

IMPORTANT: Be sure to manually subscribe to the desired attribute in the main SharpTools app by long-pressing on the desired thing. ]
Enter: Get Presence (85)
	A1: Thing: Get Attribute [ Configuration:Thing: SNOTE8
Attribute: presence Timeout (Seconds):15 Continue Task After Error:On ] 
	A2: [X] Flash [ Text:%st_thing_name, %st_attr_value Long:On ] 
	A3: If [ %st_attr_value ~ present | %par1 ~ home ]
	A4: Perform Task [ Name:Profiles Priority:%priority Parameter 1 (%par1):home Parameter 2 (%par2): Return Value Variable: Stop:Off ] 
	A5: Else 
	A6: Perform Task [ Name:Profiles Priority:%priority Parameter 1 (%par1):away Parameter 2 (%par2): Return Value Variable: Stop:Off ] 
	A7: End If 
	A8: [X] Write File [ File:Tasker/presence_activity.txt Text:%DATE, %TIME - %st_thing_name, %st_attr_value Append:On Add Newline:On Continue Task After Error:On ]

I don’t see anything that would prevent either task from working. Especially not only when they are both enabled.

Have you enabled logging in Tasker and in SharpTools?

You could also try adding an Alert > Flash to the beginning of each profile for debugging. It’s possible that something in that first step is causing an issue (unlikely given the particulars you’ve described so far, but worth ruling out). For example, I’ve seen phones that have throttled SharpTools/Tasker network requests in certain cases. Disabling Data Saver and Power Saving modes is needed on some phones and you’ll want to whitelist SharpTools and Tasker in any battery management or data management features of your phone.

https://help.sharptools.io/portal/kb/articles/does-sharptools-work-with-vpns-task-killers-or-memory-management-tools

I also noticed each profile is event driven, but the first action in each profile is to retrieve the same value. Why not just use the local variables that the event trigger sets?

For example, the the Mode Change event profile is triggered, the %st_mode variable is already set, so Mode: Get Current isn’t needed.

Thank you. I went ahead and completely reset SharpTools, in addition to changing the ST Mode Automation and it seems to be working now. I certainly will report back if not.

Thanks also for the input about not needing the Actions inside the Tasks. My wrong assumption was that the context cited a change, but not what it was changed to.

One additional note in this… Although I reset SharpTools, I think the problem was in ST reporting the presence device. ST has an issue that I reported to ST… ST will automatically rename the phone device back to the original name. In my case, I had renamed the device and ST renamed it back. This created a conflict in the SharpTools Db, as reported in the log.

2 Likes

Occurring again; this time, I switched to Life360 as ST presence was not reliable.

Tasker log does not show either Profiles are executed. However, I can run a manual Task and get appropriate results.

In the SharpTools log (link below), I noticed the following…

“Location DB match failed. Falling back to using the first location in the DB.”

Thanks for the logs.

The fallback to the first item in the database is no concern. For people that have multiple locations, it would just mean that the first location is used rather than an explicitly defined location.

The last event I saw was on 9/1. I’m assuming you expected more events since then?

Have you tried any of the steps from the troubleshooting article?

Yes and yes. Previously, the only solution was to completely reset SharpTools. I’ll do that again and see what results I get.

Ok. If you don’t want to do the complete reset I’m happy to dig through the steps with you and see if we can pinpoint what’s going on.

If you want to do that, I’d request the results of the troubleshooting steps:

  • Is the FCM ID showing up? And does a test message result in a success message coming through?
  • Does the SharpTools Android app show the subscription for your specific thing / attribute?
  • After enabling debug notifications and simulating a departure / arrival, do you see a debug notification for the event?
    • What about for other things (maybe a switch or something that’s easier to control)?
  • If not, do you see the expected events (per the article) in the SmartThings IDE logs?

I’ll go through all again and report back, but push events doesn’t seem to be the problem. If I execute a push event (i.e. Thing State Tasker Task, such as the Get Presence Task cited above) for any subscribed device, it works. It’s only the Profile-based contexts are not working.

I decided to start fresh again… Completely reset SharpTools and uninstalled SharpTools and ST app. So this is a bit of a rant on SmartThings, and home automation in general… In order to conduct proper testing to diagnose this issue, I need something consistent and I’m not getting it from ST. I setup a test Tasker Profile on a light device. Although the profile worked it did not execute until I manually switched the status in the ST Classic app. Without the status getting updated in the Classic app, there’s nothing to pass through SharpTools, so I reinstalled the new ST app which does update the status. However, neither app updates the status if I control my lights via my Harmony Elite remote, which is connected to both apps. The ST Classic app updates the Life360 for Presence, as the new ST app doesn’t work well with Life360, plus it seems I can only connect Life360 to the Classic app. ST Presence doesn’t work consistently on either ST apps because the damn apps do not automatically connect on phone reboot. The SharpTools app needs the Classic app for Routines/Scenes. I cannot get WeMo switches to work well with the new ST app as ST is not officially supported by WeMo. Funny thing, most everything works though IFTTT, however you cannot send messages to IFTTT from ST, so I need Tasker for some actions, not to mention nothing other than EventGhost works well with my PC. I’ve looked into Home Assistant, but the coding is confusing and little integration with mobiles. Wow, how much wasted time have I spent on home automation.

1 Like

The Thing: Get Attribute action queries for the status. eg. SharpTools asks SmartThings for the status when that action is executed.

The Thing State event (profile) waits for a push event to be received in order to trigger. eg. SmartThings tells SharpTools that an event occurred. (Which is why it requires manually subscribing to the attribute)

That’s a really fair point about needing to see the events updating in the SmartThings app itself. If SmartThings isn’t getting the updated state, then SharpTools never will either. To complicate things further, some of the Cloud to Cloud (C2C) integrations in the SmartThings ecosystem don’t support proper event updates. So if the device is controlled outside of SmartThings, sometimes SmartThings doesn’t know about the status. If the device is controlled from SmartThings (or connected SmartApps), then SmartThings records the action as if it was an event so things work as expected - so if it’s controlled somewhere else directly (eg. Harmony, IFTTT, etc) then SmartThings might not know about the state.